isl-0.28/0000775000175000017500000000000015222442312011317 5ustar00skimoskimoisl-0.28/isl_multi_domain_reverse_templ.c0000664000175000017500000000124215072740040017750 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include #include /* Given a multi expression on a domain (A -> B), * interchange A and B in the wrapped domain * to obtain a multi expression on the domain (B -> A). */ __isl_give MULTI(BASE) *FN(MULTI(BASE),domain_reverse)( __isl_take MULTI(BASE) *multi) { S(MULTI(BASE),un_op_control) control = { .fn_space = &isl_space_domain_reverse, .fn_el = &FN(EL,domain_reverse), }; return FN(MULTI(BASE),un_op)(multi, &control); } isl-0.28/isl_ffs.c0000664000175000017500000000123115072740040013107 0ustar00skimoskimo#include #if !HAVE_DECL_FFS && !HAVE_DECL___BUILTIN_FFS && HAVE_DECL__BITSCANFORWARD #include /* Implementation of ffs in terms of _BitScanForward. * * ffs returns the position of the least significant bit set in i, * with the least significant bit is position 1, or 0 if not bits are set. * * _BitScanForward returns 1 if mask is non-zero and sets index * to the position of the least significant bit set in i, * with the least significant bit is position 0. */ int isl_ffs(int i) { unsigned char non_zero; unsigned long index, mask = i; non_zero = _BitScanForward(&index, mask); return non_zero ? 1 + index : 0; } #endif isl-0.28/GIT_HEAD_ID0000664000175000017500000000001115222442312013012 0ustar00skimoskimoisl-0.28 isl-0.28/bound_test.sh.in0000775000175000017500000000132715072740040014436 0ustar00skimoskimo#!/bin/sh EXEEXT=@EXEEXT@ srcdir=@srcdir@ BOUND_TESTS="\ basicLinear2.pwqp \ basicLinear.pwqp \ basicTestParameterPosNeg.pwqp \ basicTest.pwqp \ devos.pwqp \ equality1.pwqp \ equality2.pwqp \ equality3.pwqp \ equality4.pwqp \ equality5.pwqp \ faddeev.pwqp \ linearExample.pwqp \ neg.pwqp \ philippe3vars3pars.pwqp \ philippe3vars.pwqp \ philippeNeg.pwqp \ philippePolynomialCoeff1P.pwqp \ philippePolynomialCoeff.pwqp \ philippe.pwqp \ product.pwqp \ split.pwqp \ test3Deg3Var.pwqp \ toplas.pwqp \ unexpanded.pwqp" for i in $BOUND_TESTS; do echo $i; ./isl_bound$EXEEXT -T --bound=bernstein < $srcdir/test_inputs/$i || exit ./isl_bound$EXEEXT -T --bound=range < $srcdir/test_inputs/$i || exit done isl-0.28/isl_pw_move_dims_templ.c0000664000175000017500000000234615072740040016232 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France */ __isl_give PW *FN(PW,move_dims)(__isl_take PW *pw, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n) { int i; isl_size n_piece; isl_space *space; space = FN(PW,take_space)(pw); space = isl_space_move_dims(space, dst_type, dst_pos, src_type, src_pos, n); pw = FN(PW,restore_space)(pw, space); n_piece = FN(PW,n_piece)(pw); if (n_piece < 0) return FN(PW,free)(pw); for (i = 0; i < n_piece; ++i) { EL *el; el = FN(PW,take_base_at)(pw, i); el = FN(EL,move_dims)(el, dst_type, dst_pos, src_type, src_pos, n); pw = FN(PW,restore_base_at)(pw, i, el); } if (dst_type == isl_dim_in) dst_type = isl_dim_set; if (src_type == isl_dim_in) src_type = isl_dim_set; for (i = 0; i < n_piece; ++i) { isl_set *domain; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_move_dims(domain, dst_type, dst_pos, src_type, src_pos, n); pw = FN(PW,restore_domain_at)(pw, i, domain); } return pw; } isl-0.28/isl_imath.h0000664000175000017500000000070015072740040013440 0ustar00skimoskimo#include #include uint32_t isl_imath_hash(mp_int v, uint32_t hash); int isl_imath_fits_ulong_p(mp_int op); int isl_imath_fits_slong_p(mp_int op); void isl_imath_addmul_ui(mp_int rop, mp_int op1, unsigned long op2); void isl_imath_submul_ui(mp_int rop, mp_int op1, unsigned long op2); void isl_imath_cdiv_q_ui(mp_int rop, mp_int op1, unsigned long op2); void isl_imath_fdiv_q_ui(mp_int rop, mp_int op1, unsigned long op2); isl-0.28/isl_lp_private.h0000664000175000017500000000142415072740040014507 0ustar00skimoskimo#ifndef ISL_LP_PRIVATE_H #define ISL_LP_PRIVATE_H #include #include #include enum isl_lp_result isl_basic_map_solve_lp(__isl_keep isl_basic_map *bmap, int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, __isl_give isl_vec **sol); enum isl_lp_result isl_basic_set_solve_lp(__isl_keep isl_basic_set *bset, int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, __isl_give isl_vec **sol); enum isl_lp_result isl_map_solve_lp(__isl_keep isl_map *map, int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, __isl_give isl_vec **sol); enum isl_lp_result isl_set_solve_lp(__isl_keep isl_set *set, int max, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, __isl_give isl_vec **sol); #endif isl-0.28/isl_aff_lex_templ.c0000664000175000017500000000415015072740040015141 0ustar00skimoskimo/* * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" * where the function value of "mpa1" lexicographically compares as "ORDER" * to that of "mpa2". "space" is the space of the result. * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. * * "mpa1" is in the given lexicographic order compared to "mpa2" * if, for some i, the i-th element of "mpa1" is in that order compared to * the i-th element of "mpa2" while all previous elements are * pairwise equal, where the order needs to be strict (not-equal) * if i corresponds to anything but the last element. * The strict version of "ORDER" is defined by "STRICT_ORDER", * which is the same if "ORDER" itself is strict. */ static __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space)( __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space) { return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, &FN(FN(isl_pw_aff,STRICT_ORDER),map), &FN(FN(isl_pw_aff,ORDER),map), space); } /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" * where the function value of "mpa1" lexicographically compares as "ORDER" * to that of "mpa2". */ __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map)( __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) { return isl_multi_pw_aff_order_map(mpa1, mpa2, &FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space)); } /* Return the subset of "map" where the domain and the range * have "mpa" values that lexicographically compare as "ORDER". */ __isl_give isl_map *FN(FN(isl_map_lex,ORDER),at_multi_pw_aff)( __isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa) { return isl_map_order_at_multi_pw_aff(map, mpa, &FN(FN(isl_multi_pw_aff_lex,ORDER),map)); } isl-0.28/isl_read_from_str_templ.c0000664000175000017500000000123015072740040016357 0ustar00skimoskimo/* * Copyright 2008 Katholieke Universiteit Leuven * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */ #define xCAT(A,B) A ## B #define CAT(A,B) xCAT(A,B) #undef TYPE #define TYPE CAT(isl_,TYPE_BASE) /* Read an object of type TYPE from "str" (using an isl_stream). */ __isl_give TYPE *FN(isl,FN(TYPE_BASE,read_from_str))(isl_ctx *ctx, const char *str) { TYPE *obj; isl_stream *s = isl_stream_new_str(ctx, str); if (!s) return NULL; obj = FN(isl_stream_read,TYPE_BASE)(s); isl_stream_free(s); return obj; } isl-0.28/README0000664000175000017500000000335515072740040012207 0ustar00skimoskimoisl is a thread-safe C library for manipulating sets and relations of integer points bounded by affine constraints. The descriptions of the sets and relations may involve both parameters and existentially quantified variables. All computations are performed in exact integer arithmetic using GMP. isl is released under the MIT license, but depends on the LGPL GMP library. Minimal compilation instructions: ./configure make make install If you are taking the source from the git repository, then you first need to do git clone git://repo.or.cz/isl.git ./autogen.sh For more information, see doc/user.pod or the generated documentation. New releases are announced on http://groups.google.com/group/isl-announce If you use isl, you can let me know by stacking https://www.openhub.net/p/isl on Open Hub. For bug reports, feature requests and questions, contact http://groups.google.com/group/isl-development Whenever you report a bug, please mention the exact version of isl that you are using (output of "./isl_cat --version"). If you are unable to compile isl, then report the git version (output of "git describe") or the version included in the name of the tarball. If you use isl for your research, you are invited do cite the following paper and/or the paper(s) describing the specific operations you use. @incollection{Verdoolaege2010isl, author = {Verdoolaege, Sven}, title = {isl: An Integer Set Library for the Polyhedral Model}, booktitle = {Mathematical Software - ICMS 2010}, series = {Lecture Notes in Computer Science}, editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and Takayama, Nobuki}, publisher = {Springer}, isbn = {978-3-642-15581-9}, pages = {299-302}, volume = {6327}, year = {2010} } isl-0.28/isl_multi_apply_set_no_explicit_domain_templ.c0000664000175000017500000000022215072740040022667 0ustar00skimoskimo#define APPLY_DOMBASE set #define APPLY_DOM isl_set #include #undef APPLY_DOMBASE #undef APPLY_DOM isl-0.28/isl_insert_domain_templ.c0000664000175000017500000000170215072740040016370 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ /* Given a function defined over a parameter domain, * convert it to a function defined over a domain corresponding * to "domain". */ __isl_give TYPE *FN(TYPE,insert_domain)(__isl_take TYPE *obj, __isl_take isl_space *domain) { isl_size dim; isl_space *obj_space; obj_space = FN(TYPE,peek_space)(obj); if (isl_space_check_is_proper_set(domain) < 0 || isl_space_check_is_set(obj_space) < 0) goto error; dim = isl_space_dim(domain, isl_dim_set); if (dim < 0) goto error; domain = isl_space_replace_params(domain, obj_space); obj = FN(TYPE,from_range)(obj); obj = FN(TYPE,add_dims)(obj, isl_dim_in, dim); obj = FN(TYPE,reset_domain_space)(obj, domain); return obj; error: isl_space_free(domain); FN(TYPE,free)(obj); return NULL; } isl-0.28/isl_maybe_aff.h0000664000175000017500000000023215072740040014247 0ustar00skimoskimo#ifndef ISL_MAYBE_AFF_H #define ISL_MAYBE_AFF_H #include #define ISL_TYPE isl_aff #include #undef ISL_TYPE #endif isl-0.28/isl_pw_print_templ.c0000664000175000017500000000353315072740040015403 0ustar00skimoskimo/* * Copyright 2011 Sven Verdoolaege * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege. */ #undef EL #define EL CAT(isl_,BASE) #undef PW #define PW CAT(isl_pw_,BASE) /* Print the empty body of a piecewise expression. * * In particular, print the space with some arbitrary value (zero) * for all dimensions, followed by unsatisfiable constraints (false). */ static __isl_give isl_printer *FN(print_empty_body_pw,BASE)( __isl_take isl_printer *p, __isl_keep PW *pw) { struct isl_print_space_data data = { 0 }; isl_space *space; space = FN(PW,get_space)(pw); data.print_dim = &print_dim_zero; p = isl_print_space(space, p, 0, &data); isl_space_free(space); p = isl_printer_print_str(p, " : false"); return p; } /* Print the body of a piecewise expression, i.e., a semicolon delimited * sequence of expressions, each followed by constraints. */ static __isl_give isl_printer *FN(print_body_pw,BASE)( __isl_take isl_printer *p, __isl_keep PW *pw) { int i; isl_size n; n = FN(PW,n_piece)(pw); if (n < 0) return isl_printer_free(p); if (n == 0) FN(print_empty_body_pw,BASE)(p, pw); for (i = 0; i < n; ++i) { EL *el; isl_space *space; if (i) p = isl_printer_print_str(p, "; "); el = FN(PW,peek_base_at)(pw, i); p = FN(print_body,BASE)(p, el); space = FN(EL,get_domain_space)(el); p = print_disjuncts(set_to_map(pw->p[i].set), space, p, 0); isl_space_free(space); } return p; } /* Print a piecewise expression in isl format. */ static __isl_give isl_printer *FN(FN(print_pw,BASE),isl)( __isl_take isl_printer *p, __isl_keep PW *pw) { struct isl_print_space_data data = { 0 }; if (!pw) return isl_printer_free(p); p = print_param_tuple(p, pw->dim, &data); p = isl_printer_print_str(p, "{ "); p = FN(print_body_pw,BASE)(p, pw); p = isl_printer_print_str(p, " }"); return p; } isl-0.28/isl_test_cpp17-generic.cc0000664000175000017500000000330515072740040016103 0ustar00skimoskimo/* A class that sets a boolean when an object of the class gets destroyed. */ struct S { S(bool *freed) : freed(freed) {} ~S(); bool *freed; }; /* S destructor. * * Set the boolean, a pointer to which was passed to the constructor. */ S::~S() { *freed = true; } /* Construct an isl::id with an S object attached that sets *freed * when it gets destroyed. */ static isl::id construct_id(isl::ctx ctx, bool *freed) { auto s = std::make_shared(freed); isl::id id(ctx, "S", s); return id; } /* Test id::try_user. * * In particular, check that the object attached to an identifier * can be retrieved again, that trying to retrieve an object of the wrong type * or trying to retrieve an object when no object was attached fails. * Furthermore, check that the object attached to an identifier * gets properly freed. */ static void test_try_user(isl::ctx ctx) { isl::id id(ctx, "test", 5); isl::id id2(ctx, "test2"); auto maybe_int = id.try_user(); auto maybe_s = id.try_user>(); auto maybe_int2 = id2.try_user(); if (!maybe_int) die("integer cannot be retrieved from isl::id"); if (*maybe_int != 5) die("wrong integer retrieved from isl::id"); if (maybe_s) die("structure unexpectedly retrieved from isl::id"); if (maybe_int2) die("integer unexpectedly retrieved from isl::id"); bool freed = false; { isl::id id = construct_id(ctx, &freed); if (freed) die("data structure freed prematurely"); auto maybe_s = id.try_user>(); if (!maybe_s) die("structure cannot be retrieved from isl::id"); if ((*maybe_s)->freed != &freed) die("invalid structure retrieved from isl::id"); } if (!freed) die("data structure not freed"); } isl-0.28/isl_int_imath.h0000664000175000017500000000572715072740040014330 0ustar00skimoskimo#ifndef ISL_INT_IMATH_H #define ISL_INT_IMATH_H #include /* isl_int is the basic integer type, implemented with imath's mp_int. */ typedef mp_int isl_int; #define isl_int_init(i) i = mp_int_alloc() #define isl_int_clear(i) mp_int_free(i) #define isl_int_set(r,i) impz_set(r,i) #define isl_int_set_si(r,i) impz_set_si(r,i) #define isl_int_set_ui(r,i) impz_set_ui(r,i) #define isl_int_fits_slong(r) isl_imath_fits_slong_p(r) #define isl_int_get_si(r) impz_get_si(r) #define isl_int_fits_ulong(r) isl_imath_fits_ulong_p(r) #define isl_int_get_ui(r) impz_get_ui(r) #define isl_int_get_d(r) impz_get_si(r) #define isl_int_get_str(r) impz_get_str(0, 10, r) #define isl_int_abs(r,i) impz_abs(r,i) #define isl_int_neg(r,i) impz_neg(r,i) #define isl_int_swap(i,j) impz_swap(i,j) #define isl_int_swap_or_set(i,j) impz_swap(i,j) #define isl_int_add_ui(r,i,j) impz_add_ui(r,i,j) #define isl_int_sub_ui(r,i,j) impz_sub_ui(r,i,j) #define isl_int_add(r,i,j) impz_add(r,i,j) #define isl_int_sub(r,i,j) impz_sub(r,i,j) #define isl_int_mul(r,i,j) impz_mul(r,i,j) #define isl_int_mul_2exp(r,i,j) impz_mul_2exp(r,i,j) #define isl_int_mul_si(r,i,j) mp_int_mul_value(i,j,r) #define isl_int_mul_ui(r,i,j) impz_mul_ui(r,i,j) #define isl_int_pow_ui(r,i,j) impz_pow_ui(r,i,j) #define isl_int_addmul(r,i,j) impz_addmul(r,i,j) #define isl_int_addmul_ui(r,i,j) isl_imath_addmul_ui(r,i,j) #define isl_int_submul(r,i,j) impz_submul(r,i,j) #define isl_int_submul_ui(r,i,j) isl_imath_submul_ui(r,i,j) #define isl_int_gcd(r,i,j) impz_gcd(r,i,j) #define isl_int_lcm(r,i,j) impz_lcm(r,i,j) #define isl_int_divexact(r,i,j) impz_divexact(r,i,j) #define isl_int_divexact_ui(r,i,j) impz_divexact_ui(r,i,j) #define isl_int_tdiv_q(r,i,j) impz_tdiv_q(r,i,j) #define isl_int_cdiv_q(r,i,j) impz_cdiv_q(r,i,j) #define isl_int_cdiv_q_ui(r,i,j) isl_imath_cdiv_q_ui(r,i,j) #define isl_int_fdiv_q(r,i,j) impz_fdiv_q(r,i,j) #define isl_int_fdiv_r(r,i,j) impz_fdiv_r(r,i,j) #define isl_int_fdiv_q_ui(r,i,j) isl_imath_fdiv_q_ui(r,i,j) #define isl_int_read(r,s) impz_set_str(r,s,10) #define isl_int_sgn(i) impz_sgn(i) #define isl_int_cmp(i,j) impz_cmp(i,j) #define isl_int_cmp_si(i,si) impz_cmp_si(i,si) #define isl_int_eq(i,j) (impz_cmp(i,j) == 0) #define isl_int_ne(i,j) (impz_cmp(i,j) != 0) #define isl_int_lt(i,j) (impz_cmp(i,j) < 0) #define isl_int_le(i,j) (impz_cmp(i,j) <= 0) #define isl_int_gt(i,j) (impz_cmp(i,j) > 0) #define isl_int_ge(i,j) (impz_cmp(i,j) >= 0) #define isl_int_abs_cmp(i,j) impz_cmpabs(i,j) #define isl_int_abs_eq(i,j) (impz_cmpabs(i,j) == 0) #define isl_int_abs_ne(i,j) (impz_cmpabs(i,j) != 0) #define isl_int_abs_lt(i,j) (impz_cmpabs(i,j) < 0) #define isl_int_abs_gt(i,j) (impz_cmpabs(i,j) > 0) #define isl_int_abs_ge(i,j) (impz_cmpabs(i,j) >= 0) #define isl_int_is_divisible_by(i,j) impz_divisible_p(i,j) uint32_t isl_imath_hash(mp_int v, uint32_t hash); #define isl_int_hash(v,h) isl_imath_hash(v,h) typedef void (*isl_int_print_mp_free_t)(void *, size_t); #define isl_int_free_str(s) free(s) #endif /* ISL_INT_IMATH_H */ isl-0.28/isl_multi_templ.h0000664000175000017500000000156515072740040014703 0ustar00skimoskimo#include #include /* A multiple expression with base expressions of type EL. * * "space" is the space in which the multiple expression lives. * "n" is the number of base expression and is equal * to the output or set dimension of "space". * "p" is an array of size "n" of base expressions. * The array is only accessible when n > 0. * "dom" is the explicit domain, if present * The explicit domain is only accessible when n == 0. */ struct MULTI(BASE) { int ref; isl_space *space; int n; struct { #ifdef EXPLICIT_DOMAIN DOM *dom; #endif EL *p[1]; } u; }; __isl_give MULTI(BASE) *CAT(MULTI(BASE),_alloc)(__isl_take isl_space *space); __isl_keep isl_space *FN(MULTI(BASE),peek_space)(__isl_keep MULTI(BASE) *multi); #ifdef EXPLICIT_DOMAIN isl_bool CAT(MULTI(BASE),_has_non_trivial_domain)( __isl_keep MULTI(BASE) *multi); #endif isl-0.28/isl_ast_build_private.h0000664000175000017500000003142715215726270016060 0ustar00skimoskimo#ifndef ISL_AST_BUILD_PRIVATE_H #define ISL_AST_BUILD_PRIVATE_H #include #include #include #include #include #include /* An isl_ast_build represents the context in which AST is being * generated. That is, it (mostly) contains information about outer * loops that can be used to simplify inner loops. * * "domain" represents constraints on the internal schedule domain, * corresponding to the context of the AST generation and the constraints * implied by the loops that have already been generated. * When an isl_ast_build is first created, outside any AST generation, * the domain is typically a parameter set. It is only when a AST * generation phase is initiated that the domain of the isl_ast_build * is changed to refer to the internal schedule domain. * The domain then lives in a space of the form * * S * * or * * [O -> S] * * O represents the loops generated in outer AST generations. * S represents the loops (both generated and to be generated) * of the current AST generation. * Both include eliminated loops. * "domain" is expected not to have any unknown divs because * it is used as the context argument in a call to isl_basic_set_gist * in isl_ast_build_compute_gist_basic_set. * * "depth" is equal to the number of loops that have already * been generated (including those in outer AST generations). * "outer_pos" is equal to the number of loops in outer AST generations. * * "generated" is a superset of "domain" corresponding to those * constraints that were either given by the user or that have * effectively been generated (as bounds on a for loop). * * "pending" is a superset of "domain" corresponding to the constraints * that still need to be generated (as guards), but that may end up * not getting generated if they are implied by any constraints * enforced by inner loops. * * "strides" contains the stride of each loop. The number of elements * is equal to the number of dimensions in "domain". * "offsets" contains the offsets of strided loops. If s is the stride * for a given dimension and f is the corresponding offset, then the * dimension takes on values * * f + s a * * with a an integer. For non-strided loops, the offset is zero. * * "iterators" contains the loop iterators of both generated and * to be generated loops. The number of elements is at least as * large as the dimension of the internal schedule domain. The * number may be larger, in which case the additional ids can be * used in a nested AST generation should the schedule be non-injective. * * "values" lives in the space * * [O -> S] -> [O -> S] (or S -> S) * * and expresses (if possible) loop iterators in terms of parameters * and outer loop iterators. If the value of a given loop iterator * cannot be expressed as an affine expression (either because the iterator * attains multiple values or because the single value is a piecewise * affine expression), then it is expressed in "values" as being equal * to itself. * * "value" is the value of the loop iterator at the current depth. * It is NULL if it has not been computed yet or if the value of the * given loop iterator cannot be expressed as a piecewise affine expression * (because the iterator attains multiple values). * * "schedule_map" maps the internal schedule domain to the external schedule * domain. It may be NULL if it hasn't been computed yet. * See isl_ast_build_get_schedule_map_multi_aff. * * "internal2input" maps the internal schedule domain to the original * input schedule domain. In case of a schedule tree input, the original * input schedule domain consist of the flat product of all outer * band node spaces, including the current band node. * It may be NULL if there no longer is such a uniform mapping * (because different iterations have been rescheduled differently). * * "options" contains the AST build options in case we are generating * an AST from a flat schedule map. When creating an AST from a schedule * tree, this field is ignored. * * The "create_leaf" callback is called for every leaf in the generated AST. * The callback is responsible for creating the node to be placed at those * leaves. If this callback is not set, then isl will generated user * nodes with call expressions corresponding to an element of the domain. * * The "at_each_domain" callback is called on every node created to represent * an element of the domain. Each of these nodes is a user node * with as expression a call expression. * * The "before_each_for" callback is called on each for node before * its children have been created. * * The "after_each_for" callback is called on each for node after * its children have been created. * * The "before_each_mark" callback is called before we handle the subtree * of an isl_schedule_node_mark node. * * The "after_each_mark" callback is called after we have handled the subtree * of an isl_schedule_node_mark node. * * "executed" contains the inverse schedule at this point * of the AST generation. * It is currently only used in isl_ast_build_get_schedule, which is * in turn only used by user code from within a callback. * The value is set right before we may be calling such a callback. * * "node" points to the current band node in case we are generating * an AST from a schedule tree. It may be NULL if we are not generating * an AST from a schedule tree or if we are not inside a band node. * * "loop_type" originally contains loop AST generation types for * the "n" members of "node" and it is updated (along with "n") when * a schedule dimension is inserted. * It is NULL if "node" is NULL. * * "isolated" is the piece of the schedule domain isolated by the isolate * option on the current band. This set may be NULL if we have not checked * for the isolate option yet. */ struct isl_ast_build { int ref; int outer_pos; int depth; isl_id_list *iterators; isl_set *domain; isl_set *generated; isl_set *pending; isl_multi_aff *values; isl_pw_aff *value; isl_vec *strides; isl_multi_aff *offsets; isl_multi_aff *schedule_map; isl_multi_aff *internal2input; isl_union_map *options; __isl_give isl_ast_node *(*at_each_domain)( __isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user); void *at_each_domain_user; __isl_give isl_id *(*before_each_for)( __isl_keep isl_ast_build *context, void *user); void *before_each_for_user; __isl_give isl_ast_node *(*after_each_for)( __isl_take isl_ast_node *node, __isl_keep isl_ast_build *context, void *user); void *after_each_for_user; isl_stat (*before_each_mark)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, void *user); void *before_each_mark_user; __isl_give isl_ast_node *(*after_each_mark)( __isl_take isl_ast_node *node, __isl_keep isl_ast_build *context, void *user); void *after_each_mark_user; __isl_give isl_ast_node *(*create_leaf)( __isl_take isl_ast_build *build, void *user); void *create_leaf_user; isl_union_map *executed; isl_schedule_node *node; int n; enum isl_ast_loop_type *loop_type; isl_set *isolated; }; __isl_give isl_ast_build *isl_ast_build_clear_local_info( __isl_take isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_increase_depth( __isl_take isl_ast_build *build); isl_size isl_ast_build_get_depth(__isl_keep isl_ast_build *build); isl_size isl_ast_build_dim(__isl_keep isl_ast_build *build, enum isl_dim_type type); __isl_give isl_space *isl_ast_build_get_space( __isl_keep isl_ast_build *build, int internal); __isl_give isl_ast_build *isl_ast_build_align_params( __isl_take isl_ast_build *build, __isl_take isl_space *model); __isl_give isl_ast_build *isl_ast_build_cow( __isl_take isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_insert_dim( __isl_take isl_ast_build *build, int pos); __isl_give isl_ast_build *isl_ast_build_scale_down( __isl_take isl_ast_build *build, __isl_take isl_val *m, __isl_take isl_union_map *umap); __isl_give isl_ast_build *isl_ast_build_product( __isl_take isl_ast_build *build, __isl_take isl_space *embedding); __isl_give isl_ast_build *isl_ast_build_set_loop_bounds( __isl_take isl_ast_build *build, __isl_take isl_basic_set *bounds); __isl_give isl_ast_build *isl_ast_build_set_pending_generated( __isl_take isl_ast_build *build, __isl_take isl_basic_set *bounds); __isl_give isl_ast_build *isl_ast_build_detect_strides( __isl_take isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_ast_build *isl_ast_build_include_stride( __isl_take isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_set_executed( __isl_take isl_ast_build *build, __isl_take isl_union_map *executed); __isl_give isl_multi_aff *isl_ast_build_get_internal2input( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_domain( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_pending( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_generated( __isl_keep isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_restrict_generated( __isl_take isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_ast_build *isl_ast_build_replace_pending_by_guard( __isl_take isl_ast_build *build, __isl_take isl_set *guard); isl_bool isl_ast_build_need_schedule_map(__isl_keep isl_ast_build *build); __isl_give isl_multi_aff *isl_ast_build_get_schedule_map_multi_aff( __isl_keep isl_ast_build *build); __isl_give isl_map *isl_ast_build_get_schedule_map( __isl_keep isl_ast_build *build); isl_bool isl_ast_build_has_affine_value(__isl_keep isl_ast_build *build, int pos); int isl_ast_build_has_value(__isl_keep isl_ast_build *build); __isl_give isl_id *isl_ast_build_get_iterator_id( __isl_keep isl_ast_build *build, int pos); int isl_ast_build_has_schedule_node(__isl_keep isl_ast_build *build); __isl_give isl_schedule_node *isl_ast_build_get_schedule_node( __isl_keep isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_set_schedule_node( __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node); __isl_give isl_ast_build *isl_ast_build_reset_schedule_node( __isl_take isl_ast_build *build); __isl_give isl_ast_build *isl_ast_build_extract_isolated( __isl_take isl_ast_build *build); int isl_ast_build_has_isolated(__isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_isolated( __isl_keep isl_ast_build *build); __isl_give isl_basic_set *isl_ast_build_specialize_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset); __isl_give isl_basic_set *isl_ast_build_compute_gist_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset); __isl_give isl_set *isl_ast_build_specialize(__isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_set *isl_ast_build_compute_gist( __isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_map *isl_ast_build_compute_gist_map_domain( __isl_keep isl_ast_build *build, __isl_take isl_map *map); __isl_give isl_aff *isl_ast_build_compute_gist_aff( __isl_keep isl_ast_build *build, __isl_take isl_aff *aff); __isl_give isl_pw_aff *isl_ast_build_compute_gist_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa); __isl_give isl_pw_multi_aff *isl_ast_build_compute_gist_pw_multi_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma); __isl_give isl_union_map *isl_ast_build_substitute_values_union_map_domain( __isl_keep isl_ast_build *build, __isl_take isl_union_map *umap); isl_bool isl_ast_build_aff_is_nonneg(__isl_keep isl_ast_build *build, __isl_keep isl_aff *aff); isl_bool isl_ast_build_has_stride(__isl_keep isl_ast_build *build); __isl_give isl_aff *isl_ast_build_get_offset(__isl_keep isl_ast_build *build, int pos); __isl_give isl_val *isl_ast_build_get_stride(__isl_keep isl_ast_build *build, int pos); __isl_give isl_set *isl_ast_build_get_stride_constraint( __isl_keep isl_ast_build *build); __isl_give isl_multi_aff *isl_ast_build_get_stride_expansion( __isl_keep isl_ast_build *build); void isl_ast_build_dump(__isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_option_domain( __isl_keep isl_ast_build *build, enum isl_ast_loop_type type); __isl_give isl_map *isl_ast_build_get_separation_class( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_eliminate( __isl_keep isl_ast_build *build, __isl_take isl_set *domain); __isl_give isl_set *isl_ast_build_eliminate_inner( __isl_keep isl_ast_build *build, __isl_take isl_set *set); __isl_give isl_set *isl_ast_build_eliminate_divs( __isl_keep isl_ast_build *build, __isl_take isl_set *set); enum isl_ast_loop_type isl_ast_build_get_loop_type( __isl_keep isl_ast_build *build, int isolated); __isl_give isl_map *isl_ast_build_map_to_iterator( __isl_keep isl_ast_build *build, __isl_take isl_set *set); int isl_ast_build_options_involve_depth(__isl_keep isl_ast_build *build); #endif isl-0.28/isl_ast_graft.c0000664000175000017500000012455215072740040014317 0ustar00skimoskimo/* * Copyright 2012 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France * and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include #include #include #include #include #include #include #include "isl_set_to_ast_graft_list.h" static __isl_give isl_ast_graft *isl_ast_graft_copy( __isl_keep isl_ast_graft *graft); static __isl_give isl_ast_graft *isl_stream_read_ast_graft( __isl_keep isl_stream *s); #undef EL_BASE #define EL_BASE ast_graft #include #include #undef BASE #define BASE ast_graft #include isl_ctx *isl_ast_graft_get_ctx(__isl_keep isl_ast_graft *graft) { if (!graft) return NULL; return isl_basic_set_get_ctx(graft->enforced); } __isl_give isl_ast_node *isl_ast_graft_get_node( __isl_keep isl_ast_graft *graft) { return graft ? isl_ast_node_copy(graft->node) : NULL; } /* Create a graft for "node" with guards "guard" and * enforced conditions "enforced". */ static isl_ast_graft *graft_alloc(__isl_take isl_ast_node *node, __isl_take isl_set *guard, __isl_take isl_basic_set *enforced) { isl_ctx *ctx; isl_ast_graft *graft; if (!node || !guard || !enforced) goto error; ctx = isl_ast_node_get_ctx(node); graft = isl_calloc_type(ctx, isl_ast_graft); if (!graft) goto error; graft->ref = 1; graft->node = node; graft->guard = guard; graft->enforced = enforced; return graft; error: isl_ast_node_free(node); isl_set_free(guard); isl_basic_set_free(enforced); return NULL; } /* Create a graft for "node" with no guards and no enforced conditions. */ __isl_give isl_ast_graft *isl_ast_graft_alloc( __isl_take isl_ast_node *node, __isl_keep isl_ast_build *build) { isl_space *space; isl_set *guard; isl_basic_set *enforced; if (!node) return NULL; space = isl_ast_build_get_space(build, 1); guard = isl_set_universe(isl_space_copy(space)); enforced = isl_basic_set_universe(space); return graft_alloc(node, guard, enforced); } /* Create a graft with no guards and no enforced conditions * encapsulating a call to the domain element specified by "executed". * "executed" is assumed to be single-valued. */ __isl_give isl_ast_graft *isl_ast_graft_alloc_domain( __isl_take isl_map *executed, __isl_keep isl_ast_build *build) { isl_ast_node *node; node = isl_ast_build_call_from_executed(build, executed); return isl_ast_graft_alloc(node, build); } static __isl_give isl_ast_graft *isl_ast_graft_copy( __isl_keep isl_ast_graft *graft) { if (!graft) return NULL; graft->ref++; return graft; } /* Do all the grafts in "list" have the same guard and is this guard * independent of the current depth? */ static isl_bool equal_independent_guards(__isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_size depth; isl_size dim; isl_ast_graft *graft_0; isl_bool equal = isl_bool_true; isl_bool skip; n = isl_ast_graft_list_n_ast_graft(list); depth = isl_ast_build_get_depth(build); if (n < 0 || depth < 0) return isl_bool_error; graft_0 = isl_ast_graft_list_get_ast_graft(list, 0); if (!graft_0) return isl_bool_error; dim = isl_set_dim(graft_0->guard, isl_dim_set); if (dim < 0) skip = isl_bool_error; else if (dim <= depth) skip = isl_bool_false; else skip = isl_set_involves_dims(graft_0->guard, isl_dim_set, depth, 1); if (skip < 0 || skip) { isl_ast_graft_free(graft_0); return isl_bool_not(skip); } for (i = 1; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); if (!graft) equal = isl_bool_error; else equal = isl_set_is_equal(graft_0->guard, graft->guard); isl_ast_graft_free(graft); if (equal < 0 || !equal) break; } isl_ast_graft_free(graft_0); return equal; } /* Hoist "guard" out of the current level (given by "build"). * * In particular, eliminate the dimension corresponding to the current depth. */ static __isl_give isl_set *hoist_guard(__isl_take isl_set *guard, __isl_keep isl_ast_build *build) { isl_size depth; isl_size dim; depth = isl_ast_build_get_depth(build); dim = isl_set_dim(guard, isl_dim_set); if (depth < 0 || dim < 0) return isl_set_free(guard); if (depth < dim) { guard = isl_set_remove_divs_involving_dims(guard, isl_dim_set, depth, 1); guard = isl_set_eliminate(guard, isl_dim_set, depth, 1); guard = isl_set_compute_divs(guard); } return guard; } /* Extract a common guard from the grafts in "list" that can be hoisted * out of the current level. If no such guard can be found, then return * a universal set. * * If all the grafts in the list have the same guard and if this guard * is independent of the current level, then it can be hoisted out. * If there is only one graft in the list and if its guard * depends on the current level, then we eliminate this level and * return the result. * * Otherwise, we return the unshifted simple hull of the guards. * In order to be able to hoist as many constraints as possible, * but at the same time avoid hoisting constraints that did not * appear in the guards in the first place, we intersect the guards * with all the information that is available (i.e., the domain * from the build and the enforced constraints of the graft) and * compute the unshifted hull of the result using only constraints * from the original guards. * In particular, intersecting the guards with other known information * allows us to hoist guards that are only explicit is some of * the grafts and implicit in the others. * * The special case for equal guards is needed in case those guards * are non-convex. Taking the simple hull would remove information * and would not allow for these guards to be hoisted completely. */ __isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard( __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_bool equal; isl_ctx *ctx; isl_set *guard; isl_set_list *set_list; isl_basic_set *hull; if (!list || !build) return NULL; n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) return NULL; if (n == 0) return isl_set_universe(isl_ast_build_get_space(build, 1)); equal = equal_independent_guards(list, build); if (equal < 0) return NULL; if (equal || n == 1) { isl_ast_graft *graft_0; graft_0 = isl_ast_graft_list_get_ast_graft(list, 0); if (!graft_0) return NULL; guard = isl_set_copy(graft_0->guard); if (!equal) guard = hoist_guard(guard, build); isl_ast_graft_free(graft_0); return guard; } ctx = isl_ast_build_get_ctx(build); set_list = isl_set_list_alloc(ctx, n); guard = isl_set_empty(isl_ast_build_get_space(build, 1)); for (i = 0; i < n; ++i) { isl_ast_graft *graft; isl_basic_set *enforced; isl_set *guard_i; graft = isl_ast_graft_list_get_ast_graft(list, i); enforced = isl_ast_graft_get_enforced(graft); guard_i = isl_set_copy(graft->guard); isl_ast_graft_free(graft); set_list = isl_set_list_add(set_list, isl_set_copy(guard_i)); guard_i = isl_set_intersect(guard_i, isl_set_from_basic_set(enforced)); guard_i = isl_set_intersect(guard_i, isl_ast_build_get_domain(build)); guard = isl_set_union(guard, guard_i); } hull = isl_set_unshifted_simple_hull_from_set_list(guard, set_list); guard = isl_set_from_basic_set(hull); return hoist_guard(guard, build); } /* Internal data structure used inside insert_if. * * list is the list of guarded nodes created by each call to insert_if. * node is the original node that is guarded by insert_if. * build is the build in which the AST is constructed. */ struct isl_insert_if_data { isl_ast_node_list *list; isl_ast_node *node; isl_ast_build *build; }; static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user); /* Insert an if node around "node" testing the condition encoded * in guard "guard". * * If the user does not want any disjunctions in the if conditions * and if "guard" does involve a disjunction, then we make the different * disjuncts disjoint and insert an if node corresponding to each disjunct * around a copy of "node". The result is then a block node containing * this sequence of guarded copies of "node". */ static __isl_give isl_ast_node *ast_node_insert_if( __isl_take isl_ast_node *node, __isl_take isl_set *guard, __isl_keep isl_ast_build *build) { struct isl_insert_if_data data; isl_ctx *ctx; isl_size n; n = isl_set_n_basic_set(guard); if (n < 0) goto error; ctx = isl_ast_build_get_ctx(build); if (isl_options_get_ast_build_allow_or(ctx) || n <= 1) { isl_ast_node *if_node; isl_ast_expr *expr; expr = isl_ast_build_expr_from_set_internal(build, guard); if_node = isl_ast_node_alloc_if(expr); return isl_ast_node_if_set_then(if_node, node); } guard = isl_set_make_disjoint(guard); data.list = isl_ast_node_list_alloc(ctx, 0); data.node = node; data.build = build; if (isl_set_foreach_basic_set(guard, &insert_if, &data) < 0) data.list = isl_ast_node_list_free(data.list); isl_set_free(guard); isl_ast_node_free(data.node); return isl_ast_node_alloc_block(data.list); error: isl_set_free(guard); isl_ast_node_free(node); return NULL; } /* Insert an if node around a copy of "data->node" testing the condition * encoded in guard "bset" and add the result to data->list. */ static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user) { struct isl_insert_if_data *data = user; isl_ast_node *node; isl_set *set; set = isl_set_from_basic_set(bset); node = isl_ast_node_copy(data->node); node = ast_node_insert_if(node, set, data->build); data->list = isl_ast_node_list_add(data->list, node); return isl_stat_ok; } /* Insert an if node around graft->node testing the condition encoded * in guard "guard", assuming guard involves any conditions. */ static __isl_give isl_ast_graft *insert_if_node( __isl_take isl_ast_graft *graft, __isl_take isl_set *guard, __isl_keep isl_ast_build *build) { int univ; if (!graft) goto error; univ = isl_set_plain_is_universe(guard); if (univ < 0) goto error; if (univ) { isl_set_free(guard); return graft; } graft->node = ast_node_insert_if(graft->node, guard, build); if (!graft->node) return isl_ast_graft_free(graft); return graft; error: isl_set_free(guard); return isl_ast_graft_free(graft); } /* Insert an if node around graft->node testing the condition encoded * in graft->guard, assuming graft->guard involves any conditions. */ static __isl_give isl_ast_graft *insert_pending_guard_node( __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) { if (!graft) return NULL; return insert_if_node(graft, isl_set_copy(graft->guard), build); } /* Replace graft->enforced by "enforced". */ __isl_give isl_ast_graft *isl_ast_graft_set_enforced( __isl_take isl_ast_graft *graft, __isl_take isl_basic_set *enforced) { if (!graft || !enforced) goto error; isl_basic_set_free(graft->enforced); graft->enforced = enforced; return graft; error: isl_basic_set_free(enforced); return isl_ast_graft_free(graft); } /* Update "enforced" such that it only involves constraints that are * also enforced by "graft". */ static __isl_give isl_basic_set *update_enforced( __isl_take isl_basic_set *enforced, __isl_keep isl_ast_graft *graft, int depth) { isl_size dim; isl_basic_set *enforced_g; enforced_g = isl_ast_graft_get_enforced(graft); dim = isl_basic_set_dim(enforced_g, isl_dim_set); if (dim < 0) enforced_g = isl_basic_set_free(enforced_g); if (depth < dim) enforced_g = isl_basic_set_eliminate(enforced_g, isl_dim_set, depth, 1); enforced_g = isl_basic_set_remove_unknown_divs(enforced_g); enforced_g = isl_basic_set_align_params(enforced_g, isl_basic_set_get_space(enforced)); enforced = isl_basic_set_align_params(enforced, isl_basic_set_get_space(enforced_g)); enforced = isl_set_simple_hull(isl_basic_set_union(enforced, enforced_g)); return enforced; } /* Extend the node at *body with node. * * If body points to the else branch, then *body may still be NULL. * If so, we simply attach node to this else branch. * Otherwise, we attach a list containing the statements already * attached at *body followed by node. */ static void extend_body(__isl_keep isl_ast_node **body, __isl_take isl_ast_node *node) { isl_ast_node_list *list; if (!*body) { *body = node; return; } if ((*body)->type == isl_ast_node_block) { list = isl_ast_node_block_get_children(*body); isl_ast_node_free(*body); } else list = isl_ast_node_list_from_ast_node(*body); list = isl_ast_node_list_add(list, node); *body = isl_ast_node_alloc_block(list); } /* Merge "graft" into the last graft of "list". * body points to the then or else branch of an if node in that last graft. * * We attach graft->node to this branch and update the enforced * set of the last graft of "list" to take into account the enforced * set of "graft". */ static __isl_give isl_ast_graft_list *graft_extend_body( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_node **body, __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) { isl_size n; isl_size depth; isl_ast_graft *last; isl_space *space; isl_basic_set *enforced; n = isl_ast_graft_list_n_ast_graft(list); depth = isl_ast_build_get_depth(build); if (n < 0 || depth < 0 || !graft) goto error; extend_body(body, isl_ast_node_copy(graft->node)); if (!*body) goto error; last = isl_ast_graft_list_get_ast_graft(list, n - 1); space = isl_ast_build_get_space(build, 1); enforced = isl_basic_set_empty(space); enforced = update_enforced(enforced, last, depth); enforced = update_enforced(enforced, graft, depth); last = isl_ast_graft_set_enforced(last, enforced); list = isl_ast_graft_list_set_ast_graft(list, n - 1, last); isl_ast_graft_free(graft); return list; error: isl_ast_graft_free(graft); return isl_ast_graft_list_free(list); } /* Merge "graft" into the last graft of "list", attaching graft->node * to the then branch of "last_if". */ static __isl_give isl_ast_graft_list *extend_then( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_node *last_if, __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) { return graft_extend_body(list, &last_if->u.i.then, graft, build); } /* Merge "graft" into the last graft of "list", attaching graft->node * to the else branch of "last_if". */ static __isl_give isl_ast_graft_list *extend_else( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_node *last_if, __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) { return graft_extend_body(list, &last_if->u.i.else_node, graft, build); } /* This data structure keeps track of an if node. * * "node" is the actual if-node * "guard" is the original, non-simplified guard of the node * "complement" is the complement of "guard" in the context of outer if nodes */ struct isl_if_node { isl_ast_node *node; isl_set *guard; isl_set *complement; }; /* Given a list of "n" if nodes, clear those starting at "first" * and return "first" (i.e., the updated size of the array). */ static int clear_if_nodes(struct isl_if_node *if_node, int first, int n) { int i; for (i = first; i < n; ++i) { isl_set_free(if_node[i].guard); isl_set_free(if_node[i].complement); } return first; } /* For each graft in "list", * insert an if node around graft->node testing the condition encoded * in graft->guard, assuming graft->guard involves any conditions. * * We keep track of a list of generated if nodes that can be extended * without changing the order of the elements in "list". * If the guard of a graft is a subset of either the guard or its complement * of one of those if nodes, then the node * of the new graft is inserted into the then or else branch of the last graft * and the current graft is discarded. * The guard of the node is then simplified based on the conditions * enforced at that then or else branch. * Otherwise, the current graft is appended to the list. * * We only construct else branches if allowed by the user. */ static __isl_give isl_ast_graft_list *insert_pending_guard_nodes( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i, j, n_if; isl_size n; int allow_else; isl_ctx *ctx; isl_ast_graft_list *res; struct isl_if_node *if_node = NULL; n = isl_ast_graft_list_n_ast_graft(list); if (!build || n < 0) return isl_ast_graft_list_free(list); ctx = isl_ast_build_get_ctx(build); allow_else = isl_options_get_ast_build_allow_else(ctx); n_if = 0; if (n > 1) { if_node = isl_alloc_array(ctx, struct isl_if_node, n - 1); if (!if_node) return isl_ast_graft_list_free(list); } res = isl_ast_graft_list_alloc(ctx, n); for (i = 0; i < n; ++i) { isl_set *guard; isl_ast_graft *graft; int subset, found_then, found_else; isl_ast_node *node; graft = isl_ast_graft_list_get_ast_graft(list, i); if (!graft) break; subset = 0; found_then = found_else = -1; if (n_if > 0) { isl_set *test; test = isl_set_copy(graft->guard); test = isl_set_intersect(test, isl_set_copy(build->domain)); for (j = n_if - 1; j >= 0; --j) { subset = isl_set_is_subset(test, if_node[j].guard); if (subset < 0 || subset) { found_then = j; break; } if (!allow_else) continue; subset = isl_set_is_subset(test, if_node[j].complement); if (subset < 0 || subset) { found_else = j; break; } } n_if = clear_if_nodes(if_node, j + 1, n_if); isl_set_free(test); } if (subset < 0) { graft = isl_ast_graft_free(graft); break; } guard = isl_set_copy(graft->guard); if (found_then >= 0) graft->guard = isl_set_gist(graft->guard, isl_set_copy(if_node[found_then].guard)); else if (found_else >= 0) graft->guard = isl_set_gist(graft->guard, isl_set_copy(if_node[found_else].complement)); node = graft->node; if (!graft->guard) graft = isl_ast_graft_free(graft); graft = insert_pending_guard_node(graft, build); if (graft && graft->node != node && i != n - 1) { isl_set *set; if_node[n_if].node = graft->node; if_node[n_if].guard = guard; if (found_then >= 0) set = if_node[found_then].guard; else if (found_else >= 0) set = if_node[found_else].complement; else set = build->domain; set = isl_set_copy(set); set = isl_set_subtract(set, isl_set_copy(guard)); if_node[n_if].complement = set; n_if++; } else isl_set_free(guard); if (!graft) break; if (found_then >= 0) res = extend_then(res, if_node[found_then].node, graft, build); else if (found_else >= 0) res = extend_else(res, if_node[found_else].node, graft, build); else res = isl_ast_graft_list_add(res, graft); } if (i < n) res = isl_ast_graft_list_free(res); isl_ast_graft_list_free(list); clear_if_nodes(if_node, 0, n_if); free(if_node); return res; } /* For each graft in "list", * insert an if node around graft->node testing the condition encoded * in graft->guard, assuming graft->guard involves any conditions. * Subsequently remove the guards from the grafts. */ __isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_set *universe; list = insert_pending_guard_nodes(list, build); n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) return isl_ast_graft_list_free(list); universe = isl_set_universe(isl_ast_build_get_space(build, 1)); for (i = 0; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); if (!graft) break; isl_set_free(graft->guard); graft->guard = isl_set_copy(universe); if (!graft->guard) graft = isl_ast_graft_free(graft); list = isl_ast_graft_list_set_ast_graft(list, i, graft); } isl_set_free(universe); if (i < n) return isl_ast_graft_list_free(list); return list; } /* Collect the nodes contained in the grafts in "list" in a node list. */ static __isl_give isl_ast_node_list *extract_node_list( __isl_keep isl_ast_graft_list *list) { int i; isl_size n; isl_ctx *ctx; isl_ast_node_list *node_list; n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) return NULL; ctx = isl_ast_graft_list_get_ctx(list); node_list = isl_ast_node_list_alloc(ctx, n); for (i = 0; i < n; ++i) { isl_ast_node *node; isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); node = isl_ast_graft_get_node(graft); node_list = isl_ast_node_list_add(node_list, node); isl_ast_graft_free(graft); } return node_list; } /* Look for shared enforced constraints by all the elements in "list" * on outer loops (with respect to the current depth) and return the result. * * If there are no elements in "list", then return the empty set. */ __isl_give isl_basic_set *isl_ast_graft_list_extract_shared_enforced( __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_size depth; isl_space *space; isl_basic_set *enforced; n = isl_ast_graft_list_n_ast_graft(list); depth = isl_ast_build_get_depth(build); if (n < 0 || depth < 0) return NULL; space = isl_ast_build_get_space(build, 1); enforced = isl_basic_set_empty(space); for (i = 0; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); enforced = update_enforced(enforced, graft, depth); isl_ast_graft_free(graft); } return enforced; } /* Record "guard" in "graft" so that it will be enforced somewhere * up the tree. If the graft already has a guard, then it may be partially * redundant in combination with the new guard and in the context * the generated constraints of "build". In fact, the new guard * may in itself have some redundant constraints. * We therefore (re)compute the gist of the intersection * and coalesce the result. */ static __isl_give isl_ast_graft *store_guard(__isl_take isl_ast_graft *graft, __isl_take isl_set *guard, __isl_keep isl_ast_build *build) { int is_universe; if (!graft) goto error; is_universe = isl_set_plain_is_universe(guard); if (is_universe < 0) goto error; if (is_universe) { isl_set_free(guard); return graft; } graft->guard = isl_set_intersect(graft->guard, guard); graft->guard = isl_set_gist(graft->guard, isl_ast_build_get_generated(build)); graft->guard = isl_set_coalesce(graft->guard); if (!graft->guard) return isl_ast_graft_free(graft); return graft; error: isl_set_free(guard); return isl_ast_graft_free(graft); } /* For each graft in "list", replace its guard with the gist with * respect to "context". */ static __isl_give isl_ast_graft_list *gist_guards( __isl_take isl_ast_graft_list *list, __isl_keep isl_set *context) { int i; isl_size n; n = isl_ast_graft_list_n_ast_graft(list); if (!list) return isl_ast_graft_list_free(list); for (i = 0; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); if (!graft) break; graft->guard = isl_set_gist(graft->guard, isl_set_copy(context)); if (!graft->guard) graft = isl_ast_graft_free(graft); list = isl_ast_graft_list_set_ast_graft(list, i, graft); } if (i < n) return isl_ast_graft_list_free(list); return list; } /* For each graft in "list", replace its guard with the gist with * respect to "context". */ __isl_give isl_ast_graft_list *isl_ast_graft_list_gist_guards( __isl_take isl_ast_graft_list *list, __isl_take isl_set *context) { list = gist_guards(list, context); isl_set_free(context); return list; } /* Allocate a graft in "build" based on the list of grafts in "sub_build". * "guard" and "enforced" are the guard and enforced constraints * of the allocated graft. The guard is used to simplify the guards * of the elements in "list". * * The node is initialized to either a block containing the nodes of "children" * or, if there is only a single child, the node of that child. * If the current level requires a for node, it should be inserted by * a subsequent call to isl_ast_graft_insert_for. */ __isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard, __isl_take isl_basic_set *enforced, __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build) { isl_ast_build *guard_build; isl_ast_node *node; isl_ast_node_list *node_list; isl_ast_graft *graft; guard_build = isl_ast_build_copy(sub_build); guard_build = isl_ast_build_replace_pending_by_guard(guard_build, isl_set_copy(guard)); list = gist_guards(list, guard); list = insert_pending_guard_nodes(list, guard_build); isl_ast_build_free(guard_build); node_list = extract_node_list(list); node = isl_ast_node_from_ast_node_list(node_list); isl_ast_graft_list_free(list); graft = isl_ast_graft_alloc(node, build); graft = store_guard(graft, guard, build); graft = isl_ast_graft_enforce(graft, enforced); return graft; } /* Combine the grafts in the list into a single graft. * * The guard is initialized to the shared guard of the list elements (if any), * provided it does not depend on the current dimension. * The guards in the elements are then simplified with respect to the * hoisted guard and materialized as if nodes around the contained AST nodes * in the context of "sub_build". * * The enforced set is initialized to the simple hull of the enforced sets * of the elements, provided the ast_build_exploit_nested_bounds option is set * or the new graft will be used at the same level. * * The node is initialized to either a block containing the nodes of "list" * or, if there is only a single element, the node of that element. */ static __isl_give isl_ast_graft *ast_graft_list_fuse( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { isl_ast_graft *graft; isl_basic_set *enforced; isl_set *guard; if (!list) return NULL; enforced = isl_ast_graft_list_extract_shared_enforced(list, build); guard = isl_ast_graft_list_extract_hoistable_guard(list, build); graft = isl_ast_graft_alloc_from_children(list, guard, enforced, build, build); return graft; } /* Combine the grafts in the list into a single graft. * Return a list containing this single graft. * If the original list is empty, then return an empty list. */ __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { isl_size n; isl_ast_graft *graft; n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) return isl_ast_graft_list_free(list); if (n <= 1) return list; graft = ast_graft_list_fuse(list, build); return isl_ast_graft_list_from_ast_graft(graft); } /* Combine the two grafts into a single graft. * Return a list containing this single graft. */ static __isl_give isl_ast_graft *isl_ast_graft_fuse( __isl_take isl_ast_graft *graft1, __isl_take isl_ast_graft *graft2, __isl_keep isl_ast_build *build) { isl_ctx *ctx; isl_ast_graft_list *list; ctx = isl_ast_build_get_ctx(build); list = isl_ast_graft_list_alloc(ctx, 2); list = isl_ast_graft_list_add(list, graft1); list = isl_ast_graft_list_add(list, graft2); return ast_graft_list_fuse(list, build); } /* Insert a for node enclosing the current graft->node. */ __isl_give isl_ast_graft *isl_ast_graft_insert_for( __isl_take isl_ast_graft *graft, __isl_take isl_ast_node *node) { if (!graft) goto error; graft->node = isl_ast_node_for_set_body(node, graft->node); if (!graft->node) return isl_ast_graft_free(graft); return graft; error: isl_ast_node_free(node); isl_ast_graft_free(graft); return NULL; } /* Insert a mark governing the current graft->node. */ __isl_give isl_ast_graft *isl_ast_graft_insert_mark( __isl_take isl_ast_graft *graft, __isl_take isl_id *mark) { if (!graft) goto error; graft->node = isl_ast_node_alloc_mark(mark, graft->node); if (!graft->node) return isl_ast_graft_free(graft); return graft; error: isl_id_free(mark); isl_ast_graft_free(graft); return NULL; } /* Represent the graft list as an AST node. * This operation drops the information about guards in the grafts, so * if there are any pending guards, then they are materialized as if nodes. */ __isl_give isl_ast_node *isl_ast_node_from_graft_list( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { isl_ast_node_list *node_list; list = insert_pending_guard_nodes(list, build); node_list = extract_node_list(list); isl_ast_graft_list_free(list); return isl_ast_node_from_ast_node_list(node_list); } __isl_null isl_ast_graft *isl_ast_graft_free(__isl_take isl_ast_graft *graft) { if (!graft) return NULL; if (--graft->ref > 0) return NULL; isl_ast_node_free(graft->node); isl_set_free(graft->guard); isl_basic_set_free(graft->enforced); free(graft); return NULL; } /* Record that the grafted tree enforces * "enforced" by intersecting graft->enforced with "enforced". */ __isl_give isl_ast_graft *isl_ast_graft_enforce( __isl_take isl_ast_graft *graft, __isl_take isl_basic_set *enforced) { if (!graft || !enforced) goto error; enforced = isl_basic_set_align_params(enforced, isl_basic_set_get_space(graft->enforced)); graft->enforced = isl_basic_set_align_params(graft->enforced, isl_basic_set_get_space(enforced)); graft->enforced = isl_basic_set_intersect(graft->enforced, enforced); if (!graft->enforced) return isl_ast_graft_free(graft); return graft; error: isl_basic_set_free(enforced); return isl_ast_graft_free(graft); } __isl_give isl_basic_set *isl_ast_graft_get_enforced( __isl_keep isl_ast_graft *graft) { return graft ? isl_basic_set_copy(graft->enforced) : NULL; } __isl_give isl_set *isl_ast_graft_get_guard(__isl_keep isl_ast_graft *graft) { return graft ? isl_set_copy(graft->guard) : NULL; } /* Record that "guard" needs to be inserted in "graft". */ __isl_give isl_ast_graft *isl_ast_graft_add_guard( __isl_take isl_ast_graft *graft, __isl_take isl_set *guard, __isl_keep isl_ast_build *build) { return store_guard(graft, guard, build); } /* Reformulate the "graft", which was generated in the context * of an inner code generation, in terms of the outer code generation * AST build. * * If "product" is set, then the domain of the inner code generation build is * * [O -> S] * * with O the domain of the outer code generation build. * We essentially need to project out S. * * If "product" is not set, then we need to project the domains onto * their parameter spaces. */ __isl_give isl_ast_graft *isl_ast_graft_unembed(__isl_take isl_ast_graft *graft, int product) { isl_basic_set *enforced; if (!graft) return NULL; if (product) { enforced = graft->enforced; enforced = isl_basic_map_domain(isl_basic_set_unwrap(enforced)); graft->enforced = enforced; graft->guard = isl_map_domain(isl_set_unwrap(graft->guard)); } else { graft->enforced = isl_basic_set_params(graft->enforced); graft->guard = isl_set_params(graft->guard); } graft->guard = isl_set_compute_divs(graft->guard); if (!graft->enforced || !graft->guard) return isl_ast_graft_free(graft); return graft; } /* Reformulate the grafts in "list", which were generated in the context * of an inner code generation, in terms of the outer code generation * AST build. */ __isl_give isl_ast_graft_list *isl_ast_graft_list_unembed( __isl_take isl_ast_graft_list *list, int product) { int i; isl_size n; n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) return isl_ast_graft_list_free(list); for (i = 0; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); graft = isl_ast_graft_unembed(graft, product); list = isl_ast_graft_list_set_ast_graft(list, i, graft); } return list; } /* Compute the preimage of "graft" under the function represented by "ma". * In other words, plug in "ma" in "enforced" and "guard" fields of "graft". */ __isl_give isl_ast_graft *isl_ast_graft_preimage_multi_aff( __isl_take isl_ast_graft *graft, __isl_take isl_multi_aff *ma) { isl_basic_set *enforced; if (!graft) return NULL; enforced = graft->enforced; graft->enforced = isl_basic_set_preimage_multi_aff(enforced, isl_multi_aff_copy(ma)); graft->guard = isl_set_preimage_multi_aff(graft->guard, ma); if (!graft->enforced || !graft->guard) return isl_ast_graft_free(graft); return graft; } /* Compute the preimage of all the grafts in "list" under * the function represented by "ma". */ __isl_give isl_ast_graft_list *isl_ast_graft_list_preimage_multi_aff( __isl_take isl_ast_graft_list *list, __isl_take isl_multi_aff *ma) { int i; isl_size n; n = isl_ast_graft_list_n_ast_graft(list); if (n < 0) list = isl_ast_graft_list_free(list); for (i = 0; i < n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list, i); graft = isl_ast_graft_preimage_multi_aff(graft, isl_multi_aff_copy(ma)); list = isl_ast_graft_list_set_ast_graft(list, i, graft); } isl_multi_aff_free(ma); return list; } /* Compare two grafts based on their guards. */ static int cmp_graft(__isl_keep isl_ast_graft *a, __isl_keep isl_ast_graft *b, void *user) { return isl_set_plain_cmp(a->guard, b->guard); } /* Order the elements in "list" based on their guards. */ __isl_give isl_ast_graft_list *isl_ast_graft_list_sort_guard( __isl_take isl_ast_graft_list *list) { return isl_ast_graft_list_sort(list, &cmp_graft, NULL); } /* Merge the given two lists into a single list of grafts, * merging grafts with the same guard into a single graft. * * "list2" has been sorted using isl_ast_graft_list_sort. * "list1" may be the result of a previous call to isl_ast_graft_list_merge * and may therefore not be completely sorted. * * The elements in "list2" need to be executed after those in "list1", * but if the guard of a graft in "list2" is disjoint from the guards * of some final elements in "list1", then it can be moved up to before * those final elements. * * In particular, we look at each element g of "list2" in turn * and move it up beyond elements of "list1" that would be sorted * after g as long as each of these elements has a guard that is disjoint * from that of g. * * We do not allow the second or any later element of "list2" to be moved * before a previous elements of "list2" even if the reason that * that element didn't move up further was that its guard was not disjoint * from that of the previous element in "list1". */ __isl_give isl_ast_graft_list *isl_ast_graft_list_merge( __isl_take isl_ast_graft_list *list1, __isl_take isl_ast_graft_list *list2, __isl_keep isl_ast_build *build) { int i, j, first; if (!list1 || !list2 || !build) goto error; if (list2->n == 0) { isl_ast_graft_list_free(list2); return list1; } if (list1->n == 0) { isl_ast_graft_list_free(list1); return list2; } first = 0; for (i = 0; i < list2->n; ++i) { isl_ast_graft *graft; graft = isl_ast_graft_list_get_ast_graft(list2, i); if (!graft) break; for (j = list1->n; j >= 0; --j) { int cmp, disjoint; isl_ast_graft *graft_j; if (j == first) cmp = -1; else cmp = isl_set_plain_cmp(list1->p[j - 1]->guard, graft->guard); if (cmp > 0) { disjoint = isl_set_is_disjoint(graft->guard, list1->p[j - 1]->guard); if (disjoint < 0) { isl_ast_graft_free(graft); list1 = isl_ast_graft_list_free(list1); break; } if (!disjoint) cmp = -1; } if (cmp > 0) continue; if (cmp < 0) { list1 = isl_ast_graft_list_insert(list1, j, graft); break; } --j; graft_j = isl_ast_graft_list_get_ast_graft(list1, j); graft_j = isl_ast_graft_fuse(graft_j, graft, build); list1 = isl_ast_graft_list_set_ast_graft(list1, j, graft_j); break; } if (j < 0) { isl_ast_graft_free(graft); isl_die(isl_ast_build_get_ctx(build), isl_error_internal, "element failed to get inserted", break); } first = j + 1; if (!list1) break; } if (i < list2->n) list1 = isl_ast_graft_list_free(list1); isl_ast_graft_list_free(list2); return list1; error: isl_ast_graft_list_free(list1); isl_ast_graft_list_free(list2); return NULL; } /* Internal data structure for split_on_guard. * * "guard2list" is the constructed associative array. * "any_match" gets set if any guard was seen more than once. */ struct isl_split_on_guard_data { isl_set_to_ast_graft_list *guard2list; int *any_match; }; /* Add "graft" to the list associated to its guard in data->guard2list. * If some other graft was already associated to this guard, * then set data->any_match. */ static isl_stat add_to_guard_list(__isl_take isl_ast_graft *graft, void *user) { struct isl_split_on_guard_data *data = user; isl_set *guard; isl_maybe_isl_ast_graft_list m; if (!graft) return isl_stat_error; m = isl_set_to_ast_graft_list_try_get(data->guard2list, graft->guard); if (m.valid < 0) return isl_stat_non_null(isl_ast_graft_free(graft)); if (m.valid) { *data->any_match = 1; m.value = isl_ast_graft_list_add(m.value, graft); } else { m.value = isl_ast_graft_list_from_ast_graft(graft); } guard = isl_set_copy(graft->guard); data->guard2list = isl_set_to_ast_graft_list_set(data->guard2list, guard, m.value); return isl_stat_non_null(data->guard2list); } /* Construct an associative array that groups the elements * of "list" based on their guards. * If any guard appears more than once, then set "any_match". */ static __isl_give isl_set_to_ast_graft_list *split_on_guard( __isl_keep isl_ast_graft_list *list, int *any_match) { struct isl_split_on_guard_data data = { NULL, any_match }; isl_size n; isl_ctx *ctx; n = isl_ast_graft_list_size(list); if (n < 0) return NULL; ctx = isl_ast_graft_list_get_ctx(list); data.guard2list = isl_set_to_ast_graft_list_alloc(ctx, n); if (isl_ast_graft_list_foreach(list, &add_to_guard_list, &data) < 0) return isl_set_to_ast_graft_list_free(data.guard2list); return data.guard2list; } /* Add the elements of "guard_list" to "list". */ static isl_stat add_same_guard(__isl_take isl_set *guard, __isl_take isl_ast_graft_list *guard_list, void *user) { isl_ast_graft_list **list = user; isl_set_free(guard); *list = isl_ast_graft_list_concat(*list, guard_list); return isl_stat_non_null(*list); } /* Given an associative array "guard2list" containing the elements * of "list" grouped on common guards, reconstruct "list" * by placing elements with the same guard consecutively. */ static __isl_give isl_ast_graft_list *reconstruct( __isl_take isl_ast_graft_list *list, __isl_keep isl_set_to_ast_graft_list *guard2list, __isl_keep isl_ast_build *build) { list = isl_ast_graft_list_clear(list); if (isl_set_to_ast_graft_list_foreach(guard2list, &add_same_guard, &list) < 0) list = isl_ast_graft_list_free(list); return list; } /* Group the grafts in "list" based on identical guards. * * Note that there need to be a least three elements in the list * for the elements not to be grouped already. * * Group the elements in an associative array based on their guards. * If any guard was seen more than once, then reconstruct the list * from the associative array. Otherwise, simply return the original list. */ __isl_give isl_ast_graft_list *isl_ast_graft_list_group_on_guard( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { int any_match = 0; isl_size n; isl_set_to_ast_graft_list *guard2list; n = isl_ast_graft_list_size(list); if (n < 0) return isl_ast_graft_list_free(list); if (n <= 2) return list; guard2list = split_on_guard(list, &any_match); if (any_match) list = reconstruct(list, guard2list, build); isl_set_to_ast_graft_list_free(guard2list); return list; } /* An enumeration of the keys that appear in the textual representation * of an isl_sat_graft object. */ enum isl_graft_key { isl_graft_key_error = -1, isl_graft_key_guard, isl_graft_key_enforced, isl_graft_key_node, isl_graft_key_end }; /* Textual representations of the keys for an isl_sat_graft object. */ static char *key_str[] = { [isl_graft_key_guard] = "guard", [isl_graft_key_enforced] = "enforced", [isl_graft_key_node] = "node", }; __isl_give isl_printer *isl_printer_print_ast_graft(__isl_take isl_printer *p, __isl_keep isl_ast_graft *graft) { if (!p) return NULL; if (!graft) return isl_printer_free(p); p = isl_printer_print_str(p, "("); p = isl_printer_print_str(p, key_str[isl_graft_key_guard]); p = isl_printer_print_str(p, ": "); p = isl_printer_print_set(p, graft->guard); p = isl_printer_print_str(p, ", "); p = isl_printer_print_str(p, key_str[isl_graft_key_enforced]); p = isl_printer_print_str(p, ": "); p = isl_printer_print_basic_set(p, graft->enforced); p = isl_printer_print_str(p, ", "); p = isl_printer_print_str(p, key_str[isl_graft_key_node]); p = isl_printer_print_str(p, ": "); p = isl_printer_print_ast_node(p, graft->node); p = isl_printer_print_str(p, ")"); return p; } #undef KEY #define KEY enum isl_graft_key #undef KEY_ERROR #define KEY_ERROR isl_graft_key_error #undef KEY_END #define KEY_END isl_graft_key_end #undef KEY_STR #define KEY_STR key_str #undef KEY_EXTRACT #define KEY_EXTRACT extract_key #undef KEY_GET #define KEY_GET get_key #include "extract_key.c" /* Read the key "key" from "s", along with the subsequent colon. */ static isl_stat read_key(__isl_keep isl_stream *s, enum isl_graft_key key) { enum isl_graft_key extracted; extracted = get_key(s); if (extracted < 0) return isl_stat_error; if (extracted != key) isl_die(isl_stream_get_ctx(s), isl_error_invalid, "expecting different field", return isl_stat_error); if (isl_stream_eat(s, ':') < 0) return isl_stat_error; return isl_stat_ok; } /* Read an isl_ast_graft object from "s". * * Read the pieces in the way they are printed in isl_printer_print_ast_graft. */ static __isl_give isl_ast_graft *isl_stream_read_ast_graft( __isl_keep isl_stream *s) { isl_set *guard; isl_basic_set *enforced = NULL; isl_ast_node *node = NULL; if (isl_stream_eat(s, '(') < 0) return NULL; if (read_key(s, isl_graft_key_guard) < 0) return NULL; guard = isl_stream_read_set(s); if (!guard) goto error; if (isl_stream_eat(s, ',') < 0) goto error; if (read_key(s, isl_graft_key_enforced) < 0) goto error; enforced = isl_stream_read_basic_set(s); if (!enforced) goto error; if (isl_stream_eat(s, ',') < 0) goto error; if (read_key(s, isl_graft_key_node) < 0) goto error; node = isl_stream_read_ast_node(s); if (!node) goto error; if (isl_stream_eat(s, ')') < 0) goto error; return graft_alloc(node, guard, enforced); error: isl_set_free(guard); isl_basic_set_free(enforced); isl_ast_node_free(node); return NULL; } isl-0.28/isl_tab_pip.c0000664000175000017500000052233215215726270013771 0ustar00skimoskimo/* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2016-2017 Sven Verdoolaege * Copyright 2023 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include #include "isl_map_private.h" #include #include "isl_tab.h" #include "isl_sample.h" #include #include #include #include #include #include #include /* * The implementation of parametric integer linear programming in this file * was inspired by the paper "Parametric Integer Programming" and the * report "Solving systems of affine (in)equalities" by Paul Feautrier * (and others). * * The strategy used for obtaining a feasible solution is different * from the one used in isl_tab.c. In particular, in isl_tab.c, * upon finding a constraint that is not yet satisfied, we pivot * in a row that increases the constant term of the row holding the * constraint, making sure the sample solution remains feasible * for all the constraints it already satisfied. * Here, we always pivot in the row holding the constraint, * choosing a column that induces the lexicographically smallest * increment to the sample solution. * * By starting out from a sample value that is lexicographically * smaller than any integer point in the problem space, the first * feasible integer sample point we find will also be the lexicographically * smallest. If all variables can be assumed to be non-negative, * then the initial sample value may be chosen equal to zero. * However, we will not make this assumption. Instead, we apply * the "big parameter" trick. Any variable x is then not directly * used in the tableau, but instead it is represented by another * variable x' = M + x, where M is an arbitrarily large (positive) * value. x' is therefore always non-negative, whatever the value of x. * Taking as initial sample value x' = 0 corresponds to x = -M, * which is always smaller than any possible value of x. * * The big parameter trick is used in the main tableau and * also in the context tableau if isl_context_lex is used. * In this case, each tableaus has its own big parameter. * Before doing any real work, we check if all the parameters * happen to be non-negative. If so, we drop the column corresponding * to M from the initial context tableau. * If isl_context_gbr is used, then the big parameter trick is only * used in the main tableau. */ struct isl_context; struct isl_context_op { /* detect nonnegative parameters in context and mark them in tab */ struct isl_tab *(*detect_nonnegative_parameters)( struct isl_context *context, struct isl_tab *tab); /* return temporary reference to basic set representation of context */ struct isl_basic_set *(*peek_basic_set)(struct isl_context *context); /* return temporary reference to tableau representation of context */ struct isl_tab *(*peek_tab)(struct isl_context *context); /* add equality; check is 1 if eq may not be valid; * update is 1 if we may want to call ineq_sign on context later. */ void (*add_eq)(struct isl_context *context, isl_int *eq, int check, int update); /* add inequality; check is 1 if ineq may not be valid; * update is 1 if we may want to call ineq_sign on context later. */ void (*add_ineq)(struct isl_context *context, isl_int *ineq, int check, int update); /* check sign of ineq based on previous information. * strict is 1 if saturation should be treated as a positive sign. */ enum isl_tab_row_sign (*ineq_sign)(struct isl_context *context, isl_int *ineq, int strict); /* check if inequality maintains feasibility */ int (*test_ineq)(struct isl_context *context, isl_int *ineq); /* return index of a div that corresponds to "div" */ int (*get_div)(struct isl_context *context, struct isl_tab *tab, struct isl_vec *div); /* insert div "div" to context at "pos" and return non-negativity */ isl_bool (*insert_div)(struct isl_context *context, int pos, __isl_keep isl_vec *div); int (*detect_equalities)(struct isl_context *context, struct isl_tab *tab); /* return row index of "best" split */ int (*best_split)(struct isl_context *context, struct isl_tab *tab); /* check if context has already been determined to be empty */ int (*is_empty)(struct isl_context *context); /* check if context is still usable */ int (*is_ok)(struct isl_context *context); /* save a copy/snapshot of context */ void *(*save)(struct isl_context *context); /* restore saved context */ void (*restore)(struct isl_context *context, void *); /* discard saved context */ void (*discard)(void *); /* invalidate context */ void (*invalidate)(struct isl_context *context); /* free context */ __isl_null struct isl_context *(*free)(struct isl_context *context); }; /* Shared parts of context representation. * * "n_unknown" is the number of final unknown integer divisions * in the input domain. */ struct isl_context { struct isl_context_op *op; int n_unknown; }; struct isl_context_lex { struct isl_context context; struct isl_tab *tab; }; /* A stack (linked list) of solutions of subtrees of the search space. * * "ma" describes the solution as a function of "dom". * In particular, the domain space of "ma" is equal to the space of "dom". * * If "ma" is NULL, then there is no solution on "dom". */ struct isl_partial_sol { int level; struct isl_basic_set *dom; isl_multi_aff *ma; struct isl_partial_sol *next; }; struct isl_sol; struct isl_sol_callback { struct isl_tab_callback callback; struct isl_sol *sol; }; /* isl_sol is an interface for constructing a solution to * a parametric integer linear programming problem. * Every time the algorithm reaches a state where a solution * can be read off from the tableau, the function "add" is called * on the isl_sol passed to find_solutions_main. In a state where * the tableau is empty, "add_empty" is called instead. * "free" is called to free the implementation specific fields, if any. * * "error" is set if some error has occurred. This flag invalidates * the remainder of the data structure. * If "rational" is set, then a rational optimization is being performed. * "level" is the current level in the tree with nodes for each * split in the context. * If "max" is set, then a maximization problem is being solved, rather than * a minimization problem, which means that the variables in the * tableau have value "M - x" rather than "M + x". * "n_out" is the number of output dimensions in the input. * "space" is the space in which the solution (and also the input) lives. * * The context tableau is owned by isl_sol and is updated incrementally. * * There are currently two implementations of this interface, * isl_sol_map, which simply collects the solutions in an isl_map * and (optionally) the parts of the context where there is no solution * in an isl_set, and * isl_sol_pma, which collects an isl_pw_multi_aff instead. */ struct isl_sol { int error; int rational; int level; int max; isl_size n_out; isl_space *space; struct isl_context *context; struct isl_partial_sol *partial; void (*add)(struct isl_sol *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *ma); void (*add_empty)(struct isl_sol *sol, struct isl_basic_set *bset); void (*free)(struct isl_sol *sol); struct isl_sol_callback dec_level; }; static void sol_free(struct isl_sol *sol) { struct isl_partial_sol *partial, *next; if (!sol) return; for (partial = sol->partial; partial; partial = next) { next = partial->next; isl_basic_set_free(partial->dom); isl_multi_aff_free(partial->ma); free(partial); } isl_space_free(sol->space); if (sol->context) sol->context->op->free(sol->context); sol->free(sol); free(sol); } /* Add equality constraint "eq" to the context of "sol". * "check" is set if "eq" is not known to be a valid constraint. * "update" is set if ineq_sign() may still get called on the context. */ static void sol_context_add_eq(struct isl_sol *sol, isl_int *eq, int check, int update) { if (sol->error) return; sol->context->op->add_eq(sol->context, eq, check, update); if (!sol->context->op->is_ok(sol->context)) sol->error = 1; } /* Add inequality constraint "ineq" to the context of "sol". * "check" is set if "ineq" is not known to be a valid constraint. * "update" is set if ineq_sign() may still get called on the context. */ static void sol_context_add_ineq(struct isl_sol *sol, isl_int *ineq, int check, int update) { if (sol->error) return; sol->context->op->add_ineq(sol->context, ineq, check, update); if (!sol->context->op->is_ok(sol->context)) sol->error = 1; } /* Push a partial solution represented by a domain and function "ma" * onto the stack of partial solutions. * If "ma" is NULL, then "dom" represents a part of the domain * with no solution. */ static void sol_push_sol(struct isl_sol *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *ma) { struct isl_partial_sol *partial; if (sol->error || !dom) goto error; partial = isl_alloc_type(dom->ctx, struct isl_partial_sol); if (!partial) goto error; partial->level = sol->level; partial->dom = dom; partial->ma = ma; partial->next = sol->partial; sol->partial = partial; return; error: isl_basic_set_free(dom); isl_multi_aff_free(ma); sol->error = 1; } /* Check that the final columns of "M", starting at "first", are zero. */ static isl_stat check_final_columns_are_zero(__isl_keep isl_mat *M, unsigned first) { int i; isl_size rows, cols; unsigned n; rows = isl_mat_rows(M); cols = isl_mat_cols(M); if (rows < 0 || cols < 0) return isl_stat_error; n = cols - first; for (i = 0; i < rows; ++i) if (isl_seq_any_non_zero(M->row[i] + first, n)) isl_die(isl_mat_get_ctx(M), isl_error_internal, "final columns should be zero", return isl_stat_error); return isl_stat_ok; } /* Set the affine expressions in "ma" according to the rows in "M", which * are defined over the local space "ls". * The matrix "M" may have extra (zero) columns beyond the number * of variables in "ls". */ static __isl_give isl_multi_aff *set_from_affine_matrix( __isl_take isl_multi_aff *ma, __isl_take isl_local_space *ls, __isl_take isl_mat *M) { int i; isl_size dim; isl_aff *aff; dim = isl_local_space_dim(ls, isl_dim_all); if (!ma || dim < 0 || !M) goto error; if (check_final_columns_are_zero(M, 1 + dim) < 0) goto error; for (i = 1; i < M->n_row; ++i) { aff = isl_aff_alloc(isl_local_space_copy(ls)); if (aff) { isl_int_set(aff->v->el[0], M->row[0][0]); isl_seq_cpy(aff->v->el + 1, M->row[i], 1 + dim); } aff = isl_aff_normalize(aff); ma = isl_multi_aff_set_aff(ma, i - 1, aff); } isl_local_space_free(ls); isl_mat_free(M); return ma; error: isl_local_space_free(ls); isl_mat_free(M); isl_multi_aff_free(ma); return NULL; } /* Push a partial solution represented by a domain and mapping M * onto the stack of partial solutions. * * The affine matrix "M" maps the dimensions of the context * to the output variables. Convert it into an isl_multi_aff and * then call sol_push_sol. * * Note that the description of the initial context may have involved * existentially quantified variables, in which case they also appear * in "dom". These need to be removed before creating the affine * expression because an affine expression cannot be defined in terms * of existentially quantified variables without a known representation. * Since newly added integer divisions are inserted before these * existentially quantified variables, they are still in the final * positions and the corresponding final columns of "M" are zero * because align_context_divs adds the existentially quantified * variables of the context to the main tableau without any constraints and * any equality constraints that are added later on can only serve * to eliminate these existentially quantified variables. */ static void sol_push_sol_mat(struct isl_sol *sol, __isl_take isl_basic_set *dom, __isl_take isl_mat *M) { isl_local_space *ls; isl_multi_aff *ma; isl_size n_div; int n_known; n_div = isl_basic_set_dim(dom, isl_dim_div); if (n_div < 0) goto error; n_known = n_div - sol->context->n_unknown; ma = isl_multi_aff_alloc(isl_space_copy(sol->space)); ls = isl_basic_set_get_local_space(dom); ls = isl_local_space_drop_dims(ls, isl_dim_div, n_known, n_div - n_known); ma = set_from_affine_matrix(ma, ls, M); if (!ma) dom = isl_basic_set_free(dom); sol_push_sol(sol, dom, ma); return; error: isl_basic_set_free(dom); isl_mat_free(M); sol_push_sol(sol, NULL, NULL); } /* Pop one partial solution from the partial solution stack and * pass it on to sol->add or sol->add_empty. */ static void sol_pop_one(struct isl_sol *sol) { struct isl_partial_sol *partial; partial = sol->partial; sol->partial = partial->next; if (partial->ma) sol->add(sol, partial->dom, partial->ma); else sol->add_empty(sol, partial->dom); free(partial); } /* Return a fresh copy of the domain represented by the context tableau. */ static struct isl_basic_set *sol_domain(struct isl_sol *sol) { struct isl_basic_set *bset; if (sol->error) return NULL; bset = isl_basic_set_dup(sol->context->op->peek_basic_set(sol->context)); bset = isl_basic_set_update_from_tab(bset, sol->context->op->peek_tab(sol->context)); return bset; } /* Check whether two partial solutions have the same affine expressions. */ static isl_bool same_solution(struct isl_partial_sol *s1, struct isl_partial_sol *s2) { if (!s1->ma != !s2->ma) return isl_bool_false; if (!s1->ma) return isl_bool_true; return isl_multi_aff_plain_is_equal(s1->ma, s2->ma); } /* Swap the initial two partial solutions in "sol". * * That is, go from * * sol->partial = p1; p1->next = p2; p2->next = p3 * * to * * sol->partial = p2; p2->next = p1; p1->next = p3 */ static void swap_initial(struct isl_sol *sol) { struct isl_partial_sol *partial; partial = sol->partial; sol->partial = partial->next; partial->next = partial->next->next; sol->partial->next = partial; } /* Combine the initial two partial solution of "sol" into * a partial solution with the current context domain of "sol" and * the function description of the second partial solution in the list. * The level of the new partial solution is set to the current level. * * That is, the first two partial solutions (D1,M1) and (D2,M2) are * replaced by (D,M2), where D is the domain of "sol", which is assumed * to be the union of D1 and D2, while M1 is assumed to be equal to M2 * (at least on D1). */ static isl_stat combine_initial_into_second(struct isl_sol *sol) { struct isl_partial_sol *partial; isl_basic_set *bset; partial = sol->partial; bset = sol_domain(sol); isl_basic_set_free(partial->next->dom); partial->next->dom = bset; partial->next->level = sol->level; if (!bset) return isl_stat_error; sol->partial = partial->next; isl_basic_set_free(partial->dom); isl_multi_aff_free(partial->ma); free(partial); return isl_stat_ok; } /* Are "ma1" and "ma2" equal to each other on "dom"? * * Combine "ma1" and "ma2" with "dom" and check if the results are the same. * "dom" may have existentially quantified variables. Eliminate them first * as otherwise they would have to be eliminated twice, in a more complicated * context. */ static isl_bool equal_on_domain(__isl_keep isl_multi_aff *ma1, __isl_keep isl_multi_aff *ma2, __isl_keep isl_basic_set *dom) { isl_set *set; isl_pw_multi_aff *pma1, *pma2; isl_bool equal; set = isl_basic_set_compute_divs(isl_basic_set_copy(dom)); pma1 = isl_pw_multi_aff_alloc(isl_set_copy(set), isl_multi_aff_copy(ma1)); pma2 = isl_pw_multi_aff_alloc(set, isl_multi_aff_copy(ma2)); equal = isl_pw_multi_aff_is_equal(pma1, pma2); isl_pw_multi_aff_free(pma1); isl_pw_multi_aff_free(pma2); return equal; } /* The initial two partial solutions of "sol" are known to be at * the same level. * If they represent the same solution (on different parts of the domain), * then combine them into a single solution at the current level. * Otherwise, pop them both. * * Even if the two partial solution are not obviously the same, * one may still be a simplification of the other over its own domain. * Also check if the two sets of affine functions are equal when * restricted to one of the domains. If so, combine the two * using the set of affine functions on the other domain. * That is, for two partial solutions (D1,M1) and (D2,M2), * if M1 = M2 on D1, then the pair of partial solutions can * be replaced by (D1+D2,M2) and similarly when M1 = M2 on D2. */ static isl_stat combine_initial_if_equal(struct isl_sol *sol) { struct isl_partial_sol *partial; isl_bool same; partial = sol->partial; same = same_solution(partial, partial->next); if (same < 0) return isl_stat_error; if (same) return combine_initial_into_second(sol); if (partial->ma && partial->next->ma) { same = equal_on_domain(partial->ma, partial->next->ma, partial->dom); if (same < 0) return isl_stat_error; if (same) return combine_initial_into_second(sol); same = equal_on_domain(partial->ma, partial->next->ma, partial->next->dom); if (same) { swap_initial(sol); return combine_initial_into_second(sol); } } sol_pop_one(sol); sol_pop_one(sol); return isl_stat_ok; } /* Pop all solutions from the partial solution stack that were pushed onto * the stack at levels that are deeper than the current level. * If the two topmost elements on the stack have the same level * and represent the same solution, then their domains are combined. * This combined domain is the same as the current context domain * as sol_pop is called each time we move back to a higher level. * If the outer level (0) has been reached, then all partial solutions * at the current level are also popped off. */ static void sol_pop(struct isl_sol *sol) { struct isl_partial_sol *partial; if (sol->error) return; partial = sol->partial; if (!partial) return; if (partial->level == 0 && sol->level == 0) { for (partial = sol->partial; partial; partial = sol->partial) sol_pop_one(sol); return; } if (partial->level <= sol->level) return; if (partial->next && partial->next->level == partial->level) { if (combine_initial_if_equal(sol) < 0) goto error; } else sol_pop_one(sol); if (sol->level == 0) { for (partial = sol->partial; partial; partial = sol->partial) sol_pop_one(sol); return; } if (0) error: sol->error = 1; } static void sol_dec_level(struct isl_sol *sol) { if (sol->error) return; sol->level--; sol_pop(sol); } static isl_stat sol_dec_level_wrap(struct isl_tab_callback *cb) { struct isl_sol_callback *callback = (struct isl_sol_callback *)cb; sol_dec_level(callback->sol); return callback->sol->error ? isl_stat_error : isl_stat_ok; } /* Move down to next level and push callback onto context tableau * to decrease the level again when it gets rolled back across * the current state. That is, dec_level will be called with * the context tableau in the same state as it is when inc_level * is called. */ static void sol_inc_level(struct isl_sol *sol) { struct isl_tab *tab; if (sol->error) return; sol->level++; tab = sol->context->op->peek_tab(sol->context); if (isl_tab_push_callback(tab, &sol->dec_level.callback) < 0) sol->error = 1; } static void scale_rows(struct isl_mat *mat, isl_int m, int n_row) { int i; if (isl_int_is_one(m)) return; for (i = 0; i < n_row; ++i) isl_seq_scale(mat->row[i], mat->row[i], m, mat->n_col); } /* Add the solution identified by the tableau and the context tableau. * * The layout of the variables is as follows. * tab->n_var is equal to the total number of variables in the input * map (including divs that were copied from the context) * + the number of extra divs constructed * Of these, the first tab->n_param and the last tab->n_div variables * correspond to the variables in the context, i.e., * tab->n_param + tab->n_div = context_tab->n_var * tab->n_param is equal to the number of parameters and input * dimensions in the input map * tab->n_div is equal to the number of divs in the context * * If there is no solution, then call add_empty with a basic set * that corresponds to the context tableau. (If add_empty is NULL, * then do nothing). * * If there is a solution, then first construct a matrix that maps * all dimensions of the context to the output variables, i.e., * the output dimensions in the input map. * The divs in the input map (if any) that do not correspond to any * div in the context do not appear in the solution. * The algorithm will make sure that they have an integer value, * but these values themselves are of no interest. * We have to be careful not to drop or rearrange any divs in the * context because that would change the meaning of the matrix. * * To extract the value of the output variables, it should be noted * that we always use a big parameter M in the main tableau and so * the variable stored in this tableau is not an output variable x itself, but * x' = M + x (in case of minimization) * or * x' = M - x (in case of maximization) * If x' appears in a column, then its optimal value is zero, * which means that the optimal value of x is an unbounded number * (-M for minimization and M for maximization). * We currently assume that the output dimensions in the original map * are bounded, so this cannot occur. * Similarly, when x' appears in a row, then the coefficient of M in that * row is necessarily 1. * If the row in the tableau represents * d x' = c + d M + e(y) * then, in case of minimization, the corresponding row in the matrix * will be * a c + a e(y) * with a d = m, the (updated) common denominator of the matrix. * In case of maximization, the row will be * -a c - a e(y) */ static void sol_add(struct isl_sol *sol, struct isl_tab *tab) { struct isl_basic_set *bset = NULL; struct isl_mat *mat = NULL; unsigned off; int row; isl_int m; if (sol->error || !tab) goto error; if (tab->empty && !sol->add_empty) return; if (sol->context->op->is_empty(sol->context)) return; bset = sol_domain(sol); if (tab->empty) { sol_push_sol(sol, bset, NULL); return; } off = 2 + tab->M; mat = isl_mat_alloc(tab->mat->ctx, 1 + sol->n_out, 1 + tab->n_param + tab->n_div); if (!mat) goto error; isl_int_init(m); isl_seq_clr(mat->row[0] + 1, mat->n_col - 1); isl_int_set_si(mat->row[0][0], 1); for (row = 0; row < sol->n_out; ++row) { int i = tab->n_param + row; int r, j; isl_seq_clr(mat->row[1 + row], mat->n_col); if (!tab->var[i].is_row) { if (tab->M) isl_die(mat->ctx, isl_error_invalid, "unbounded optimum", goto error2); continue; } r = tab->var[i].index; if (tab->M && isl_int_ne(tab->mat->row[r][2], tab->mat->row[r][0])) isl_die(mat->ctx, isl_error_invalid, "unbounded optimum", goto error2); isl_int_gcd(m, mat->row[0][0], tab->mat->row[r][0]); isl_int_divexact(m, tab->mat->row[r][0], m); scale_rows(mat, m, 1 + row); isl_int_divexact(m, mat->row[0][0], tab->mat->row[r][0]); isl_int_mul(mat->row[1 + row][0], m, tab->mat->row[r][1]); for (j = 0; j < tab->n_param; ++j) { int col; if (tab->var[j].is_row) continue; col = tab->var[j].index; isl_int_mul(mat->row[1 + row][1 + j], m, tab->mat->row[r][off + col]); } for (j = 0; j < tab->n_div; ++j) { int col; if (tab->var[tab->n_var - tab->n_div+j].is_row) continue; col = tab->var[tab->n_var - tab->n_div+j].index; isl_int_mul(mat->row[1 + row][1 + tab->n_param + j], m, tab->mat->row[r][off + col]); } if (sol->max) isl_seq_neg(mat->row[1 + row], mat->row[1 + row], mat->n_col); } isl_int_clear(m); sol_push_sol_mat(sol, bset, mat); return; error2: isl_int_clear(m); error: isl_basic_set_free(bset); isl_mat_free(mat); sol->error = 1; } struct isl_sol_map { struct isl_sol sol; struct isl_map *map; struct isl_set *empty; }; static void sol_map_free(struct isl_sol *sol) { struct isl_sol_map *sol_map = (struct isl_sol_map *) sol; isl_map_free(sol_map->map); isl_set_free(sol_map->empty); } /* This function is called for parts of the context where there is * no solution, with "bset" corresponding to the context tableau. * Simply add the basic set to the set "empty". */ static void sol_map_add_empty(struct isl_sol_map *sol, struct isl_basic_set *bset) { if (!bset || !sol->empty) goto error; sol->empty = isl_set_grow(sol->empty, 1); bset = isl_basic_set_simplify(bset); bset = isl_basic_set_finalize(bset); sol->empty = isl_set_add_basic_set(sol->empty, isl_basic_set_copy(bset)); if (!sol->empty) goto error; isl_basic_set_free(bset); return; error: isl_basic_set_free(bset); sol->sol.error = 1; } static void sol_map_add_empty_wrap(struct isl_sol *sol, struct isl_basic_set *bset) { sol_map_add_empty((struct isl_sol_map *)sol, bset); } /* Given a basic set "dom" that represents the context and a tuple of * affine expressions "ma" defined over this domain, construct a basic map * that expresses this function on the domain. */ static void sol_map_add(struct isl_sol_map *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *ma) { isl_basic_map *bmap; if (sol->sol.error || !dom || !ma) goto error; bmap = isl_basic_map_from_multi_aff2(ma, sol->sol.rational); bmap = isl_basic_map_intersect_domain(bmap, dom); sol->map = isl_map_grow(sol->map, 1); sol->map = isl_map_add_basic_map(sol->map, bmap); if (!sol->map) sol->sol.error = 1; return; error: isl_basic_set_free(dom); isl_multi_aff_free(ma); sol->sol.error = 1; } static void sol_map_add_wrap(struct isl_sol *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *ma) { sol_map_add((struct isl_sol_map *)sol, dom, ma); } /* Store the "parametric constant" of row "row" of tableau "tab" in "line", * i.e., the constant term and the coefficients of all variables that * appear in the context tableau. * Note that the coefficient of the big parameter M is NOT copied. * The context tableau may not have a big parameter and even when it * does, it is a different big parameter. */ static void get_row_parameter_line(struct isl_tab *tab, int row, isl_int *line) { int i; unsigned off = 2 + tab->M; isl_int_set(line[0], tab->mat->row[row][1]); for (i = 0; i < tab->n_param; ++i) { if (tab->var[i].is_row) isl_int_set_si(line[1 + i], 0); else { int col = tab->var[i].index; isl_int_set(line[1 + i], tab->mat->row[row][off + col]); } } for (i = 0; i < tab->n_div; ++i) { if (tab->var[tab->n_var - tab->n_div + i].is_row) isl_int_set_si(line[1 + tab->n_param + i], 0); else { int col = tab->var[tab->n_var - tab->n_div + i].index; isl_int_set(line[1 + tab->n_param + i], tab->mat->row[row][off + col]); } } } /* Check if rows "row1" and "row2" have identical "parametric constants", * as explained above. * In this case, we also insist that the coefficients of the big parameter * be the same as the values of the constants will only be the same * if these coefficients are also the same. */ static int identical_parameter_line(struct isl_tab *tab, int row1, int row2) { int i; unsigned off = 2 + tab->M; if (isl_int_ne(tab->mat->row[row1][1], tab->mat->row[row2][1])) return 0; if (tab->M && isl_int_ne(tab->mat->row[row1][2], tab->mat->row[row2][2])) return 0; for (i = 0; i < tab->n_param + tab->n_div; ++i) { int pos = i < tab->n_param ? i : tab->n_var - tab->n_div + i - tab->n_param; int col; if (tab->var[pos].is_row) continue; col = tab->var[pos].index; if (isl_int_ne(tab->mat->row[row1][off + col], tab->mat->row[row2][off + col])) return 0; } return 1; } /* Return an inequality that expresses that the "parametric constant" * should be non-negative. * This function is only called when the coefficient of the big parameter * is equal to zero. */ static struct isl_vec *get_row_parameter_ineq(struct isl_tab *tab, int row) { struct isl_vec *ineq; ineq = isl_vec_alloc(tab->mat->ctx, 1 + tab->n_param + tab->n_div); if (!ineq) return NULL; get_row_parameter_line(tab, row, ineq->el); if (ineq) ineq = isl_vec_normalize(ineq); return ineq; } /* Normalize a div expression of the form * * [(g*f(x) + c)/(g * m)] * * with c the constant term and f(x) the remaining coefficients, to * * [(f(x) + [c/g])/m] */ static void normalize_div(__isl_keep isl_vec *div) { isl_ctx *ctx = isl_vec_get_ctx(div); int len = div->size - 2; isl_seq_gcd(div->el + 2, len, &ctx->normalize_gcd); isl_int_gcd(ctx->normalize_gcd, ctx->normalize_gcd, div->el[0]); if (isl_int_is_one(ctx->normalize_gcd)) return; isl_int_divexact(div->el[0], div->el[0], ctx->normalize_gcd); isl_int_fdiv_q(div->el[1], div->el[1], ctx->normalize_gcd); isl_seq_scale_down(div->el + 2, div->el + 2, ctx->normalize_gcd, len); } /* Return an integer division for use in a parametric cut based * on the given row. * In particular, let the parametric constant of the row be * * \sum_i a_i y_i * * where y_0 = 1, but none of the y_i corresponds to the big parameter M. * The div returned is equal to * * floor(\sum_i {-a_i} y_i) = floor((\sum_i (-a_i mod d) y_i)/d) */ static struct isl_vec *get_row_parameter_div(struct isl_tab *tab, int row) { struct isl_vec *div; div = isl_vec_alloc(tab->mat->ctx, 1 + 1 + tab->n_param + tab->n_div); if (!div) return NULL; isl_int_set(div->el[0], tab->mat->row[row][0]); get_row_parameter_line(tab, row, div->el + 1); isl_seq_neg(div->el + 1, div->el + 1, div->size - 1); normalize_div(div); isl_seq_fdiv_r(div->el + 1, div->el + 1, div->el[0], div->size - 1); return div; } /* Return an integer division for use in transferring an integrality constraint * to the context. * In particular, let the parametric constant of the row be * * \sum_i a_i y_i * * where y_0 = 1, but none of the y_i corresponds to the big parameter M. * The the returned div is equal to * * floor(\sum_i {a_i} y_i) = floor((\sum_i (a_i mod d) y_i)/d) */ static struct isl_vec *get_row_split_div(struct isl_tab *tab, int row) { struct isl_vec *div; div = isl_vec_alloc(tab->mat->ctx, 1 + 1 + tab->n_param + tab->n_div); if (!div) return NULL; isl_int_set(div->el[0], tab->mat->row[row][0]); get_row_parameter_line(tab, row, div->el + 1); normalize_div(div); isl_seq_fdiv_r(div->el + 1, div->el + 1, div->el[0], div->size - 1); return div; } /* Construct and return an inequality that expresses an upper bound * on the given div. * In particular, if the div is given by * * d = floor(e/m) * * then the inequality expresses * * m d <= e */ static __isl_give isl_vec *ineq_for_div(__isl_keep isl_basic_set *bset, unsigned div) { isl_size total; unsigned div_pos; struct isl_vec *ineq; total = isl_basic_set_dim(bset, isl_dim_all); if (total < 0) return NULL; div_pos = 1 + total - bset->n_div + div; ineq = isl_vec_alloc(bset->ctx, 1 + total); if (!ineq) return NULL; isl_seq_cpy(ineq->el, bset->div[div] + 1, 1 + total); isl_int_neg(ineq->el[div_pos], bset->div[div][0]); return ineq; } /* Given a row in the tableau and a div that was created * using get_row_split_div and that has been constrained to equality, i.e., * * d = floor(\sum_i {a_i} y_i) = \sum_i {a_i} y_i * * replace the expression "\sum_i {a_i} y_i" in the row by d, * i.e., we subtract "\sum_i {a_i} y_i" and add 1 d. * The coefficients of the non-parameters in the tableau have been * verified to be integral. We can therefore simply replace coefficient b * by floor(b). For the coefficients of the parameters we have * floor(a_i) = a_i - {a_i}, while for the other coefficients, we have * floor(b) = b. */ static struct isl_tab *set_row_cst_to_div(struct isl_tab *tab, int row, int div) { isl_seq_fdiv_q(tab->mat->row[row] + 1, tab->mat->row[row] + 1, tab->mat->row[row][0], 1 + tab->M + tab->n_col); isl_int_set_si(tab->mat->row[row][0], 1); if (tab->var[tab->n_var - tab->n_div + div].is_row) { int drow = tab->var[tab->n_var - tab->n_div + div].index; isl_assert(tab->mat->ctx, isl_int_is_one(tab->mat->row[drow][0]), goto error); isl_seq_combine(tab->mat->row[row] + 1, tab->mat->ctx->one, tab->mat->row[row] + 1, tab->mat->ctx->one, tab->mat->row[drow] + 1, 1 + tab->M + tab->n_col); } else { int dcol = tab->var[tab->n_var - tab->n_div + div].index; isl_int_add_ui(tab->mat->row[row][2 + tab->M + dcol], tab->mat->row[row][2 + tab->M + dcol], 1); } return tab; error: isl_tab_free(tab); return NULL; } /* Check if the (parametric) constant of the given row is obviously * negative, meaning that we don't need to consult the context tableau. * If there is a big parameter and its coefficient is non-zero, * then this coefficient determines the outcome. * Otherwise, we check whether the constant is negative and * all non-zero coefficients of parameters are negative and * belong to non-negative parameters. */ static int is_obviously_neg(struct isl_tab *tab, int row) { int i; int col; unsigned off = 2 + tab->M; if (tab->M) { if (isl_int_is_pos(tab->mat->row[row][2])) return 0; if (isl_int_is_neg(tab->mat->row[row][2])) return 1; } if (isl_int_is_nonneg(tab->mat->row[row][1])) return 0; for (i = 0; i < tab->n_param; ++i) { /* Eliminated parameter */ if (tab->var[i].is_row) continue; col = tab->var[i].index; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; if (!tab->var[i].is_nonneg) return 0; if (isl_int_is_pos(tab->mat->row[row][off + col])) return 0; } for (i = 0; i < tab->n_div; ++i) { if (tab->var[tab->n_var - tab->n_div + i].is_row) continue; col = tab->var[tab->n_var - tab->n_div + i].index; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; if (!tab->var[tab->n_var - tab->n_div + i].is_nonneg) return 0; if (isl_int_is_pos(tab->mat->row[row][off + col])) return 0; } return 1; } /* Check if the (parametric) constant of the given row is obviously * non-negative, meaning that we don't need to consult the context tableau. * If there is a big parameter and its coefficient is non-zero, * then this coefficient determines the outcome. * Otherwise, we check whether the constant is non-negative and * all non-zero coefficients of parameters are positive and * belong to non-negative parameters. */ static int is_obviously_nonneg(struct isl_tab *tab, int row) { int i; int col; unsigned off = 2 + tab->M; if (tab->M) { if (isl_int_is_pos(tab->mat->row[row][2])) return 1; if (isl_int_is_neg(tab->mat->row[row][2])) return 0; } if (isl_int_is_neg(tab->mat->row[row][1])) return 0; for (i = 0; i < tab->n_param; ++i) { /* Eliminated parameter */ if (tab->var[i].is_row) continue; col = tab->var[i].index; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; if (!tab->var[i].is_nonneg) return 0; if (isl_int_is_neg(tab->mat->row[row][off + col])) return 0; } for (i = 0; i < tab->n_div; ++i) { if (tab->var[tab->n_var - tab->n_div + i].is_row) continue; col = tab->var[tab->n_var - tab->n_div + i].index; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; if (!tab->var[tab->n_var - tab->n_div + i].is_nonneg) return 0; if (isl_int_is_neg(tab->mat->row[row][off + col])) return 0; } return 1; } /* Given a row r and two columns, return the column that would * lead to the lexicographically smallest increment in the sample * solution when leaving the basis in favor of the row. * Pivoting with column c will increment the sample value by a non-negative * constant times a_{V,c}/a_{r,c}, with a_{V,c} the elements of column c * corresponding to the non-parametric variables. * If variable v appears in a column c_v, then a_{v,c} = 1 iff c = c_v, * with all other entries in this virtual row equal to zero. * If variable v appears in a row, then a_{v,c} is the element in column c * of that row. * * Let v be the first variable with a_{v,c1}/a_{r,c1} != a_{v,c2}/a_{r,c2}. * Then if a_{v,c1}/a_{r,c1} < a_{v,c2}/a_{r,c2}, i.e., * a_{v,c2} a_{r,c1} - a_{v,c1} a_{r,c2} > 0, c1 results in the minimal * increment. Otherwise, it's c2. */ static int lexmin_col_pair(struct isl_tab *tab, int row, int col1, int col2, isl_int tmp) { int i; isl_int *tr; tr = tab->mat->row[row] + 2 + tab->M; for (i = tab->n_param; i < tab->n_var - tab->n_div; ++i) { int s1, s2; isl_int *r; if (!tab->var[i].is_row) { if (tab->var[i].index == col1) return col2; if (tab->var[i].index == col2) return col1; continue; } if (tab->var[i].index == row) continue; r = tab->mat->row[tab->var[i].index] + 2 + tab->M; s1 = isl_int_sgn(r[col1]); s2 = isl_int_sgn(r[col2]); if (s1 == 0 && s2 == 0) continue; if (s1 < s2) return col1; if (s2 < s1) return col2; isl_int_mul(tmp, r[col2], tr[col1]); isl_int_submul(tmp, r[col1], tr[col2]); if (isl_int_is_pos(tmp)) return col1; if (isl_int_is_neg(tmp)) return col2; } return -1; } /* Does the index into the tab->var or tab->con array "index" * correspond to a variable in the context tableau? * In particular, it needs to be an index into the tab->var array and * it needs to refer to either one of the first tab->n_param variables or * one of the last tab->n_div variables. */ static int is_parameter_var(struct isl_tab *tab, int index) { if (index < 0) return 0; if (index < tab->n_param) return 1; if (index >= tab->n_var - tab->n_div) return 1; return 0; } /* Does column "col" of "tab" refer to a variable in the context tableau? */ static int col_is_parameter_var(struct isl_tab *tab, int col) { return is_parameter_var(tab, tab->col_var[col]); } /* Does row "row" of "tab" refer to a variable in the context tableau? */ static int row_is_parameter_var(struct isl_tab *tab, int row) { return is_parameter_var(tab, tab->row_var[row]); } /* Given a row in the tableau, find and return the column that would * result in the lexicographically smallest, but positive, increment * in the sample point. * If there is no such column, then return tab->n_col. * If anything goes wrong, return -1. */ static int lexmin_pivot_col(struct isl_tab *tab, int row) { int j; int col = tab->n_col; isl_int *tr; isl_int tmp; tr = tab->mat->row[row] + 2 + tab->M; isl_int_init(tmp); for (j = tab->n_dead; j < tab->n_col; ++j) { if (col_is_parameter_var(tab, j)) continue; if (!isl_int_is_pos(tr[j])) continue; if (col == tab->n_col) col = j; else col = lexmin_col_pair(tab, row, col, j, tmp); isl_assert(tab->mat->ctx, col >= 0, goto error); } isl_int_clear(tmp); return col; error: isl_int_clear(tmp); return -1; } /* Return the first known violated constraint, i.e., a non-negative * constraint that currently has an either obviously negative value * or a previously determined to be negative value. * * If any constraint has a negative coefficient for the big parameter, * if any, then we return one of these first. */ static int first_neg(struct isl_tab *tab) { int row; if (tab->M) for (row = tab->n_redundant; row < tab->n_row; ++row) { if (!isl_tab_var_from_row(tab, row)->is_nonneg) continue; if (!isl_int_is_neg(tab->mat->row[row][2])) continue; if (tab->row_sign) tab->row_sign[row] = isl_tab_row_neg; return row; } for (row = tab->n_redundant; row < tab->n_row; ++row) { if (!isl_tab_var_from_row(tab, row)->is_nonneg) continue; if (tab->row_sign) { if (tab->row_sign[row] == 0 && is_obviously_neg(tab, row)) tab->row_sign[row] = isl_tab_row_neg; if (tab->row_sign[row] != isl_tab_row_neg) continue; } else if (!is_obviously_neg(tab, row)) continue; return row; } return -1; } /* Check whether the invariant that all columns are lexico-positive * is satisfied. This function is not called from the current code * but is useful during debugging. */ static void check_lexpos(struct isl_tab *tab) __attribute__ ((unused)); static void check_lexpos(struct isl_tab *tab) { unsigned off = 2 + tab->M; int col; int var; int row; for (col = tab->n_dead; col < tab->n_col; ++col) { if (col_is_parameter_var(tab, col)) continue; for (var = tab->n_param; var < tab->n_var - tab->n_div; ++var) { if (!tab->var[var].is_row) { if (tab->var[var].index == col) break; else continue; } row = tab->var[var].index; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; if (isl_int_is_pos(tab->mat->row[row][off + col])) break; fprintf(stderr, "lexneg column %d (row %d)\n", col, row); } if (var >= tab->n_var - tab->n_div) fprintf(stderr, "zero column %d\n", col); } } /* Report to the caller that the given constraint is part of an encountered * conflict. */ static int report_conflicting_constraint(struct isl_tab *tab, int con) { return tab->conflict(con, tab->conflict_user); } /* Given a conflicting row in the tableau, report all constraints * involved in the row to the caller. That is, the row itself * (if it represents a constraint) and all constraint columns with * non-zero (and therefore negative) coefficients. */ static int report_conflict(struct isl_tab *tab, int row) { int j; isl_int *tr; if (!tab->conflict) return 0; if (tab->row_var[row] < 0 && report_conflicting_constraint(tab, ~tab->row_var[row]) < 0) return -1; tr = tab->mat->row[row] + 2 + tab->M; for (j = tab->n_dead; j < tab->n_col; ++j) { if (col_is_parameter_var(tab, j)) continue; if (!isl_int_is_neg(tr[j])) continue; if (tab->col_var[j] < 0 && report_conflicting_constraint(tab, ~tab->col_var[j]) < 0) return -1; } return 0; } /* Resolve all known or obviously violated constraints through pivoting. * In particular, as long as we can find any violated constraint, we * look for a pivoting column that would result in the lexicographically * smallest increment in the sample point. If there is no such column * then the tableau is infeasible. */ static int restore_lexmin(struct isl_tab *tab) WARN_UNUSED; static int restore_lexmin(struct isl_tab *tab) { int row, col; if (!tab) return -1; if (tab->empty) return 0; while ((row = first_neg(tab)) != -1) { col = lexmin_pivot_col(tab, row); if (col >= tab->n_col) { if (report_conflict(tab, row) < 0) return -1; if (isl_tab_mark_empty(tab) < 0) return -1; return 0; } if (col < 0) return -1; if (isl_tab_pivot(tab, row, col) < 0) return -1; } return 0; } /* Given a row that represents an equality, look for an appropriate * pivoting column. * In particular, if there are any non-zero coefficients among * the non-parameter variables, then we take the last of these * variables. Eliminating this variable in terms of the other * variables and/or parameters does not influence the property * that all column in the initial tableau are lexicographically * positive. The row corresponding to the eliminated variable * will only have non-zero entries below the diagonal of the * initial tableau. That is, we transform * * I I * 1 into a * I I * * If there is no such non-parameter variable, then we are dealing with * pure parameter equality and we pick any parameter with coefficient 1 or -1 * for elimination. This will ensure that the eliminated parameter * always has an integer value whenever all the other parameters are integral. * If there is no such parameter then we return -1. */ static int last_var_col_or_int_par_col(struct isl_tab *tab, int row) { unsigned off = 2 + tab->M; int i; for (i = tab->n_var - tab->n_div - 1; i >= 0 && i >= tab->n_param; --i) { int col; if (tab->var[i].is_row) continue; col = tab->var[i].index; if (col <= tab->n_dead) continue; if (!isl_int_is_zero(tab->mat->row[row][off + col])) return col; } for (i = tab->n_dead; i < tab->n_col; ++i) { if (isl_int_is_one(tab->mat->row[row][off + i])) return i; if (isl_int_is_negone(tab->mat->row[row][off + i])) return i; } return -1; } /* Add an equality that is known to be valid to the tableau. * We first check if we can eliminate a variable or a parameter. * If not, we add the equality as two inequalities. * In this case, the equality was a pure parameter equality and there * is no need to resolve any constraint violations. * * This function assumes that at least two more rows and at least * two more elements in the constraint array are available in the tableau. */ static struct isl_tab *add_lexmin_valid_eq(struct isl_tab *tab, isl_int *eq) { int i; int r; if (!tab) return NULL; r = isl_tab_add_row(tab, eq); if (r < 0) goto error; r = tab->con[r].index; i = last_var_col_or_int_par_col(tab, r); if (i < 0) { tab->con[r].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r]) < 0) goto error; isl_seq_neg(eq, eq, 1 + tab->n_var); r = isl_tab_add_row(tab, eq); if (r < 0) goto error; tab->con[r].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r]) < 0) goto error; } else { if (isl_tab_pivot(tab, r, i) < 0) goto error; if (isl_tab_kill_col(tab, i) < 0) goto error; tab->n_eq++; } return tab; error: isl_tab_free(tab); return NULL; } /* Check if the given row is a pure constant. */ static int is_constant(struct isl_tab *tab, int row) { unsigned off = 2 + tab->M; return !isl_seq_any_non_zero(tab->mat->row[row] + off + tab->n_dead, tab->n_col - tab->n_dead); } /* Is the given row a parametric constant? * That is, does it only involve variables that also appear in the context? */ static int is_parametric_constant(struct isl_tab *tab, int row) { unsigned off = 2 + tab->M; int col; for (col = tab->n_dead; col < tab->n_col; ++col) { if (col_is_parameter_var(tab, col)) continue; if (isl_int_is_zero(tab->mat->row[row][off + col])) continue; return 0; } return 1; } /* Add an equality that may or may not be valid to the tableau. * If the resulting row is a pure constant, then it must be zero. * Otherwise, the resulting tableau is empty. * * If the row is not a pure constant, then we add two inequalities, * each time checking that they can be satisfied. * In the end we try to use one of the two constraints to eliminate * a column. * * This function assumes that at least two more rows and at least * two more elements in the constraint array are available in the tableau. */ static int add_lexmin_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED; static int add_lexmin_eq(struct isl_tab *tab, isl_int *eq) { int r1, r2; int row; struct isl_tab_undo *snap; if (!tab) return -1; snap = isl_tab_snap(tab); r1 = isl_tab_add_row(tab, eq); if (r1 < 0) return -1; tab->con[r1].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r1]) < 0) return -1; row = tab->con[r1].index; if (is_constant(tab, row)) { if (!isl_int_is_zero(tab->mat->row[row][1]) || (tab->M && !isl_int_is_zero(tab->mat->row[row][2]))) { if (isl_tab_mark_empty(tab) < 0) return -1; return 0; } if (isl_tab_rollback(tab, snap) < 0) return -1; return 0; } if (restore_lexmin(tab) < 0) return -1; if (tab->empty) return 0; isl_seq_neg(eq, eq, 1 + tab->n_var); r2 = isl_tab_add_row(tab, eq); if (r2 < 0) return -1; tab->con[r2].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r2]) < 0) return -1; if (restore_lexmin(tab) < 0) return -1; if (tab->empty) return 0; if (!tab->con[r1].is_row) { if (isl_tab_kill_col(tab, tab->con[r1].index) < 0) return -1; } else if (!tab->con[r2].is_row) { if (isl_tab_kill_col(tab, tab->con[r2].index) < 0) return -1; } if (tab->bmap) { tab->bmap = isl_basic_map_add_ineq(tab->bmap, eq); if (isl_tab_push(tab, isl_tab_undo_bmap_ineq) < 0) return -1; isl_seq_neg(eq, eq, 1 + tab->n_var); tab->bmap = isl_basic_map_add_ineq(tab->bmap, eq); isl_seq_neg(eq, eq, 1 + tab->n_var); if (isl_tab_push(tab, isl_tab_undo_bmap_ineq) < 0) return -1; if (!tab->bmap) return -1; } return 0; } /* Add an inequality to the tableau, resolving violations using * restore_lexmin. * * This function assumes that at least one more row and at least * one more element in the constraint array are available in the tableau. */ static struct isl_tab *add_lexmin_ineq(struct isl_tab *tab, isl_int *ineq) { int r; if (!tab) return NULL; if (tab->bmap) { tab->bmap = isl_basic_map_add_ineq(tab->bmap, ineq); if (isl_tab_push(tab, isl_tab_undo_bmap_ineq) < 0) goto error; if (!tab->bmap) goto error; } r = isl_tab_add_row(tab, ineq); if (r < 0) goto error; tab->con[r].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r]) < 0) goto error; if (isl_tab_row_is_redundant(tab, tab->con[r].index)) { if (isl_tab_mark_redundant(tab, tab->con[r].index) < 0) goto error; return tab; } if (restore_lexmin(tab) < 0) goto error; if (!tab->empty && tab->con[r].is_row && isl_tab_row_is_redundant(tab, tab->con[r].index)) if (isl_tab_mark_redundant(tab, tab->con[r].index) < 0) goto error; return tab; error: isl_tab_free(tab); return NULL; } /* Check if the coefficients of the parameters are all integral. */ static int integer_parameter(struct isl_tab *tab, int row) { int i; int col; unsigned off = 2 + tab->M; for (i = 0; i < tab->n_param; ++i) { /* Eliminated parameter */ if (tab->var[i].is_row) continue; col = tab->var[i].index; if (!isl_int_is_divisible_by(tab->mat->row[row][off + col], tab->mat->row[row][0])) return 0; } for (i = 0; i < tab->n_div; ++i) { if (tab->var[tab->n_var - tab->n_div + i].is_row) continue; col = tab->var[tab->n_var - tab->n_div + i].index; if (!isl_int_is_divisible_by(tab->mat->row[row][off + col], tab->mat->row[row][0])) return 0; } return 1; } /* Check if the coefficients of the non-parameter variables are all integral. */ static int integer_variable(struct isl_tab *tab, int row) { int i; unsigned off = 2 + tab->M; for (i = tab->n_dead; i < tab->n_col; ++i) { if (col_is_parameter_var(tab, i)) continue; if (!isl_int_is_divisible_by(tab->mat->row[row][off + i], tab->mat->row[row][0])) return 0; } return 1; } /* Check if the constant term is integral. */ static int integer_constant(struct isl_tab *tab, int row) { return isl_int_is_divisible_by(tab->mat->row[row][1], tab->mat->row[row][0]); } #define I_CST 1 << 0 #define I_PAR 1 << 1 #define I_VAR 1 << 2 /* Check for next (non-parameter) variable after "var" (first if var == -1) * that is non-integer and therefore requires a cut and return * the index of the variable. * For parametric tableaus, there are three parts in a row, * the constant, the coefficients of the parameters and the rest. * For each part, we check whether the coefficients in that part * are all integral and if so, set the corresponding flag in *f. * If the constant and the parameter part are integral, then the * current sample value is integral and no cut is required * (irrespective of whether the variable part is integral). */ static int next_non_integer_var(struct isl_tab *tab, int var, int *f) { var = var < 0 ? tab->n_param : var + 1; for (; var < tab->n_var - tab->n_div; ++var) { int flags = 0; int row; if (!tab->var[var].is_row) continue; row = tab->var[var].index; if (integer_constant(tab, row)) ISL_FL_SET(flags, I_CST); if (integer_parameter(tab, row)) ISL_FL_SET(flags, I_PAR); if (ISL_FL_ISSET(flags, I_CST) && ISL_FL_ISSET(flags, I_PAR)) continue; if (integer_variable(tab, row)) ISL_FL_SET(flags, I_VAR); *f = flags; return var; } return -1; } /* Check for first (non-parameter) variable that is non-integer and * therefore requires a cut and return the corresponding row. * For parametric tableaus, there are three parts in a row, * the constant, the coefficients of the parameters and the rest. * For each part, we check whether the coefficients in that part * are all integral and if so, set the corresponding flag in *f. * If the constant and the parameter part are integral, then the * current sample value is integral and no cut is required * (irrespective of whether the variable part is integral). */ static int first_non_integer_row(struct isl_tab *tab, int *f) { int var = next_non_integer_var(tab, -1, f); return var < 0 ? -1 : tab->var[var].index; } /* Add a (non-parametric) cut to cut away the non-integral sample * value of the given row. * * If the row is given by * * m r = f + \sum_i a_i y_i * * then the cut is * * c = - {-f/m} + \sum_i {a_i/m} y_i >= 0 * * The big parameter, if any, is ignored, since it is assumed to be big * enough to be divisible by any integer. * If the tableau is actually a parametric tableau, then this function * is only called when all coefficients of the parameters are integral. * The cut therefore has zero coefficients for the parameters. * * The current value is known to be negative, so row_sign, if it * exists, is set accordingly. * * Return the row of the cut or -1. */ static int add_cut(struct isl_tab *tab, int row) { int i; int r; isl_int *r_row; unsigned off = 2 + tab->M; if (isl_tab_extend_cons(tab, 1) < 0) return -1; r = isl_tab_allocate_con(tab); if (r < 0) return -1; r_row = tab->mat->row[tab->con[r].index]; isl_int_set(r_row[0], tab->mat->row[row][0]); isl_int_neg(r_row[1], tab->mat->row[row][1]); isl_int_fdiv_r(r_row[1], r_row[1], tab->mat->row[row][0]); isl_int_neg(r_row[1], r_row[1]); if (tab->M) isl_int_set_si(r_row[2], 0); for (i = 0; i < tab->n_col; ++i) isl_int_fdiv_r(r_row[off + i], tab->mat->row[row][off + i], tab->mat->row[row][0]); tab->con[r].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r]) < 0) return -1; if (tab->row_sign) tab->row_sign[tab->con[r].index] = isl_tab_row_neg; return tab->con[r].index; } #define CUT_ALL 1 #define CUT_ONE 0 /* Given a non-parametric tableau, add cuts until an integer * sample point is obtained or until the tableau is determined * to be integer infeasible. * As long as there is any non-integer value in the sample point, * we add appropriate cuts, if possible, for each of these * non-integer values and then resolve the violated * cut constraints using restore_lexmin. * If one of the corresponding rows is equal to an integral * combination of variables/constraints plus a non-integral constant, * then there is no way to obtain an integer point and we return * a tableau that is marked empty. * The parameter cutting_strategy controls the strategy used when adding cuts * to remove non-integer points. CUT_ALL adds all possible cuts * before continuing the search. CUT_ONE adds only one cut at a time. */ static struct isl_tab *cut_to_integer_lexmin(struct isl_tab *tab, int cutting_strategy) { int var; int row; int flags; if (!tab) return NULL; if (tab->empty) return tab; while ((var = next_non_integer_var(tab, -1, &flags)) != -1) { do { if (ISL_FL_ISSET(flags, I_VAR)) { if (isl_tab_mark_empty(tab) < 0) goto error; return tab; } row = tab->var[var].index; row = add_cut(tab, row); if (row < 0) goto error; if (cutting_strategy == CUT_ONE) break; } while ((var = next_non_integer_var(tab, var, &flags)) != -1); if (restore_lexmin(tab) < 0) goto error; if (tab->empty) break; } return tab; error: isl_tab_free(tab); return NULL; } /* Check whether all the currently active samples also satisfy the inequality * "ineq" (treated as an equality if eq is set). * Remove those samples that do not. */ static struct isl_tab *check_samples(struct isl_tab *tab, isl_int *ineq, int eq) { int i; isl_int v; if (!tab) return NULL; isl_assert(tab->mat->ctx, tab->bmap, goto error); isl_assert(tab->mat->ctx, tab->samples, goto error); isl_assert(tab->mat->ctx, tab->samples->n_col == 1 + tab->n_var, goto error); isl_int_init(v); for (i = tab->n_outside; i < tab->n_sample; ++i) { int sgn; isl_seq_inner_product(ineq, tab->samples->row[i], 1 + tab->n_var, &v); sgn = isl_int_sgn(v); if (eq ? (sgn == 0) : (sgn >= 0)) continue; tab = isl_tab_drop_sample(tab, i); if (!tab) break; } isl_int_clear(v); return tab; error: isl_tab_free(tab); return NULL; } /* Check whether the sample value of the tableau is finite, * i.e., either the tableau does not use a big parameter, or * all values of the variables are equal to the big parameter plus * some constant. This constant is the actual sample value. */ static int sample_is_finite(struct isl_tab *tab) { int i; if (!tab->M) return 1; for (i = 0; i < tab->n_var; ++i) { int row; if (!tab->var[i].is_row) return 0; row = tab->var[i].index; if (isl_int_ne(tab->mat->row[row][0], tab->mat->row[row][2])) return 0; } return 1; } /* Check if the context tableau of sol has any integer points. * Leave tab in empty state if no integer point can be found. * If an integer point can be found and if moreover it is finite, * then it is added to the list of sample values. * * This function is only called when none of the currently active sample * values satisfies the most recently added constraint. */ static struct isl_tab *check_integer_feasible(struct isl_tab *tab) { struct isl_tab_undo *snap; if (!tab) return NULL; snap = isl_tab_snap(tab); if (isl_tab_push_basis(tab) < 0) goto error; tab = cut_to_integer_lexmin(tab, CUT_ALL); if (!tab) goto error; if (!tab->empty && sample_is_finite(tab)) { struct isl_vec *sample; sample = isl_tab_get_sample_value(tab); if (isl_tab_add_sample(tab, sample) < 0) goto error; } if (!tab->empty && isl_tab_rollback(tab, snap) < 0) goto error; return tab; error: isl_tab_free(tab); return NULL; } /* Check if any of the currently active sample values satisfies * the inequality "ineq" (an equality if eq is set). */ static int tab_has_valid_sample(struct isl_tab *tab, isl_int *ineq, int eq) { int i; isl_int v; if (!tab) return -1; isl_assert(tab->mat->ctx, tab->bmap, return -1); isl_assert(tab->mat->ctx, tab->samples, return -1); isl_assert(tab->mat->ctx, tab->samples->n_col == 1 + tab->n_var, return -1); isl_int_init(v); for (i = tab->n_outside; i < tab->n_sample; ++i) { int sgn; isl_seq_inner_product(ineq, tab->samples->row[i], 1 + tab->n_var, &v); sgn = isl_int_sgn(v); if (eq ? (sgn == 0) : (sgn >= 0)) break; } isl_int_clear(v); return i < tab->n_sample; } /* Insert a div specified by "div" to the tableau "tab" at position "pos" and * return isl_bool_true if the div is obviously non-negative. */ static isl_bool context_tab_insert_div(struct isl_tab *tab, int pos, __isl_keep isl_vec *div, isl_stat (*add_ineq)(void *user, isl_int *), void *user) { int i; int r; struct isl_mat *samples; int nonneg; r = isl_tab_insert_div(tab, pos, div, add_ineq, user); if (r < 0) return isl_bool_error; nonneg = tab->var[r].is_nonneg; tab->var[r].frozen = 1; samples = isl_mat_extend(tab->samples, tab->n_sample, 1 + tab->n_var); tab->samples = samples; if (!samples) return isl_bool_error; for (i = tab->n_outside; i < samples->n_row; ++i) { isl_seq_inner_product(div->el + 1, samples->row[i], div->size - 1, &samples->row[i][samples->n_col - 1]); isl_int_fdiv_q(samples->row[i][samples->n_col - 1], samples->row[i][samples->n_col - 1], div->el[0]); } tab->samples = isl_mat_move_cols(tab->samples, 1 + pos, 1 + tab->n_var - 1, 1); if (!tab->samples) return isl_bool_error; return isl_bool_ok(nonneg); } /* Add a div specified by "div" to both the main tableau and * the context tableau. In case of the main tableau, we only * need to add an extra div. In the context tableau, we also * need to express the meaning of the div. * Return the index of the div or -1 if anything went wrong. * * The new integer division is added before any unknown integer * divisions in the context to ensure that it does not get * equated to some linear combination involving unknown integer * divisions. */ static int add_div(struct isl_tab *tab, struct isl_context *context, __isl_keep isl_vec *div) { int r; int pos; isl_bool nonneg; struct isl_tab *context_tab = context->op->peek_tab(context); if (!tab || !context_tab) goto error; pos = context_tab->n_var - context->n_unknown; if ((nonneg = context->op->insert_div(context, pos, div)) < 0) goto error; if (!context->op->is_ok(context)) goto error; pos = tab->n_var - context->n_unknown; if (isl_tab_extend_vars(tab, 1) < 0) goto error; r = isl_tab_insert_var(tab, pos); if (r < 0) goto error; if (nonneg) tab->var[r].is_nonneg = 1; tab->var[r].frozen = 1; tab->n_div++; return tab->n_div - 1 - context->n_unknown; error: context->op->invalidate(context); return -1; } /* Return the position of the integer division that is equal to div/denom * if there is one. Otherwise, return a position beyond the integer divisions. */ static int find_div(struct isl_tab *tab, isl_int *div, isl_int denom) { int i; isl_size total = isl_basic_map_dim(tab->bmap, isl_dim_all); isl_size n_div; n_div = isl_basic_map_dim(tab->bmap, isl_dim_div); if (total < 0 || n_div < 0) return -1; for (i = 0; i < n_div; ++i) { if (isl_int_ne(tab->bmap->div[i][0], denom)) continue; if (!isl_seq_eq(tab->bmap->div[i] + 1, div, 1 + total)) continue; return i; } return n_div; } /* Return the index of a div that corresponds to "div". * We first check if we already have such a div and if not, we create one. */ static int get_div(struct isl_tab *tab, struct isl_context *context, struct isl_vec *div) { int d; struct isl_tab *context_tab = context->op->peek_tab(context); unsigned n_div; if (!context_tab) return -1; n_div = isl_basic_map_dim(context_tab->bmap, isl_dim_div); d = find_div(context_tab, div->el + 1, div->el[0]); if (d < 0) return -1; if (d < n_div) return d; return add_div(tab, context, div); } /* Add a parametric cut to cut away the non-integral sample value * of the given row. * Let a_i be the coefficients of the constant term and the parameters * and let b_i be the coefficients of the variables or constraints * in basis of the tableau. * Let q be the div q = floor(\sum_i {-a_i} y_i). * * The cut is expressed as * * c = \sum_i -{-a_i} y_i + \sum_i {b_i} x_i + q >= 0 * * If q did not already exist in the context tableau, then it is added first. * If q is in a column of the main tableau then the "+ q" can be accomplished * by setting the corresponding entry to the denominator of the constraint. * If q happens to be in a row of the main tableau, then the corresponding * row needs to be added instead (taking care of the denominators). * Note that this is very unlikely, but perhaps not entirely impossible. * * The current value of the cut is known to be negative (or at least * non-positive), so row_sign is set accordingly. * * Return the row of the cut or -1. */ static int add_parametric_cut(struct isl_tab *tab, int row, struct isl_context *context) { struct isl_vec *div; int d; int i; int r; isl_int *r_row; int col; int n; unsigned off = 2 + tab->M; if (!context) return -1; div = get_row_parameter_div(tab, row); if (!div) return -1; n = tab->n_div - context->n_unknown; d = context->op->get_div(context, tab, div); isl_vec_free(div); if (d < 0) return -1; if (isl_tab_extend_cons(tab, 1) < 0) return -1; r = isl_tab_allocate_con(tab); if (r < 0) return -1; r_row = tab->mat->row[tab->con[r].index]; isl_int_set(r_row[0], tab->mat->row[row][0]); isl_int_neg(r_row[1], tab->mat->row[row][1]); isl_int_fdiv_r(r_row[1], r_row[1], tab->mat->row[row][0]); isl_int_neg(r_row[1], r_row[1]); if (tab->M) isl_int_set_si(r_row[2], 0); for (i = 0; i < tab->n_param; ++i) { if (tab->var[i].is_row) continue; col = tab->var[i].index; isl_int_neg(r_row[off + col], tab->mat->row[row][off + col]); isl_int_fdiv_r(r_row[off + col], r_row[off + col], tab->mat->row[row][0]); isl_int_neg(r_row[off + col], r_row[off + col]); } for (i = 0; i < tab->n_div; ++i) { if (tab->var[tab->n_var - tab->n_div + i].is_row) continue; col = tab->var[tab->n_var - tab->n_div + i].index; isl_int_neg(r_row[off + col], tab->mat->row[row][off + col]); isl_int_fdiv_r(r_row[off + col], r_row[off + col], tab->mat->row[row][0]); isl_int_neg(r_row[off + col], r_row[off + col]); } for (i = 0; i < tab->n_col; ++i) { if (tab->col_var[i] >= 0 && (tab->col_var[i] < tab->n_param || tab->col_var[i] >= tab->n_var - tab->n_div)) continue; isl_int_fdiv_r(r_row[off + i], tab->mat->row[row][off + i], tab->mat->row[row][0]); } if (tab->var[tab->n_var - tab->n_div + d].is_row) { isl_int gcd; int d_row = tab->var[tab->n_var - tab->n_div + d].index; isl_int_init(gcd); isl_int_gcd(gcd, tab->mat->row[d_row][0], r_row[0]); isl_int_divexact(r_row[0], r_row[0], gcd); isl_int_divexact(gcd, tab->mat->row[d_row][0], gcd); isl_seq_combine(r_row + 1, gcd, r_row + 1, r_row[0], tab->mat->row[d_row] + 1, off - 1 + tab->n_col); isl_int_mul(r_row[0], r_row[0], tab->mat->row[d_row][0]); isl_int_clear(gcd); } else { col = tab->var[tab->n_var - tab->n_div + d].index; isl_int_set(r_row[off + col], tab->mat->row[row][0]); } tab->con[r].is_nonneg = 1; if (isl_tab_push_var(tab, isl_tab_undo_nonneg, &tab->con[r]) < 0) return -1; if (tab->row_sign) tab->row_sign[tab->con[r].index] = isl_tab_row_neg; row = tab->con[r].index; if (d >= n && context->op->detect_equalities(context, tab) < 0) return -1; return row; } /* Construct a tableau for bmap that can be used for computing * the lexicographic minimum (or maximum) of bmap. * If not NULL, then dom is the domain where the minimum * should be computed. In this case, we set up a parametric * tableau with row signs (initialized to "unknown"). * If M is set, then the tableau will use a big parameter. * If max is set, then a maximum should be computed instead of a minimum. * This means that for each variable x, the tableau will contain the variable * x' = M - x, rather than x' = M + x. This in turn means that the coefficient * of the variables in all constraints are negated prior to adding them * to the tableau. */ static __isl_give struct isl_tab *tab_for_lexmin(__isl_keep isl_basic_map *bmap, __isl_keep isl_basic_set *dom, unsigned M, int max) { int i; struct isl_tab *tab; unsigned n_var; unsigned o_var; isl_size total; total = isl_basic_map_dim(bmap, isl_dim_all); if (total < 0) return NULL; tab = isl_tab_alloc(bmap->ctx, 2 * bmap->n_eq + bmap->n_ineq + 1, total, M); if (!tab) return NULL; tab->rational = ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL); if (dom) { isl_size dom_total; dom_total = isl_basic_set_dim(dom, isl_dim_all); if (dom_total < 0) goto error; tab->n_param = dom_total - dom->n_div; tab->n_div = dom->n_div; tab->row_sign = isl_calloc_array(bmap->ctx, enum isl_tab_row_sign, tab->mat->n_row); if (tab->mat->n_row && !tab->row_sign) goto error; } if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) { if (isl_tab_mark_empty(tab) < 0) goto error; return tab; } for (i = tab->n_param; i < tab->n_var - tab->n_div; ++i) { tab->var[i].is_nonneg = 1; tab->var[i].frozen = 1; } o_var = 1 + tab->n_param; n_var = tab->n_var - tab->n_param - tab->n_div; for (i = 0; i < bmap->n_eq; ++i) { if (max) isl_seq_neg(bmap->eq[i] + o_var, bmap->eq[i] + o_var, n_var); tab = add_lexmin_valid_eq(tab, bmap->eq[i]); if (max) isl_seq_neg(bmap->eq[i] + o_var, bmap->eq[i] + o_var, n_var); if (!tab || tab->empty) return tab; } if (bmap->n_eq && restore_lexmin(tab) < 0) goto error; for (i = 0; i < bmap->n_ineq; ++i) { if (max) isl_seq_neg(bmap->ineq[i] + o_var, bmap->ineq[i] + o_var, n_var); tab = add_lexmin_ineq(tab, bmap->ineq[i]); if (max) isl_seq_neg(bmap->ineq[i] + o_var, bmap->ineq[i] + o_var, n_var); if (!tab || tab->empty) return tab; } return tab; error: isl_tab_free(tab); return NULL; } /* Given a main tableau where more than one row requires a split, * determine and return the "best" row to split on. * * If any of the rows requiring a split only involves * variables that also appear in the context tableau, * then the negative part is guaranteed not to have a solution. * It is therefore best to split on any of these rows first. * * Otherwise, * given two rows in the main tableau, if the inequality corresponding * to the first row is redundant with respect to that of the second row * in the current tableau, then it is better to split on the second row, * since in the positive part, both rows will be positive. * (In the negative part a pivot will have to be performed and just about * anything can happen to the sign of the other row.) * * As a simple heuristic, we therefore select the row that makes the most * of the other rows redundant. * * Perhaps it would also be useful to look at the number of constraints * that conflict with any given constraint. * * best is the best row so far (-1 when we have not found any row yet). * best_r is the number of other rows made redundant by row best. * When best is still -1, bset_r is meaningless, but it is initialized * to some arbitrary value (0) anyway. Without this redundant initialization * valgrind may warn about uninitialized memory accesses when isl * is compiled with some versions of gcc. */ static int best_split(struct isl_tab *tab, struct isl_tab *context_tab) { struct isl_tab_undo *snap; int split; int row; int best = -1; int best_r = 0; if (isl_tab_extend_cons(context_tab, 2) < 0) return -1; snap = isl_tab_snap(context_tab); for (split = tab->n_redundant; split < tab->n_row; ++split) { struct isl_tab_undo *snap2; struct isl_vec *ineq = NULL; int r = 0; int ok; if (!isl_tab_var_from_row(tab, split)->is_nonneg) continue; if (tab->row_sign[split] != isl_tab_row_any) continue; if (is_parametric_constant(tab, split)) return split; ineq = get_row_parameter_ineq(tab, split); if (!ineq) return -1; ok = isl_tab_add_ineq(context_tab, ineq->el) >= 0; isl_vec_free(ineq); if (!ok) return -1; snap2 = isl_tab_snap(context_tab); for (row = tab->n_redundant; row < tab->n_row; ++row) { struct isl_tab_var *var; if (row == split) continue; if (!isl_tab_var_from_row(tab, row)->is_nonneg) continue; if (tab->row_sign[row] != isl_tab_row_any) continue; ineq = get_row_parameter_ineq(tab, row); if (!ineq) return -1; ok = isl_tab_add_ineq(context_tab, ineq->el) >= 0; isl_vec_free(ineq); if (!ok) return -1; var = &context_tab->con[context_tab->n_con - 1]; if (!context_tab->empty && !isl_tab_min_at_most_neg_one(context_tab, var)) r++; if (isl_tab_rollback(context_tab, snap2) < 0) return -1; } if (best == -1 || r > best_r) { best = split; best_r = r; } if (isl_tab_rollback(context_tab, snap) < 0) return -1; } return best; } static struct isl_basic_set *context_lex_peek_basic_set( struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (!clex->tab) return NULL; return isl_tab_peek_bset(clex->tab); } static struct isl_tab *context_lex_peek_tab(struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; return clex->tab; } static void context_lex_add_eq(struct isl_context *context, isl_int *eq, int check, int update) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (isl_tab_extend_cons(clex->tab, 2) < 0) goto error; if (add_lexmin_eq(clex->tab, eq) < 0) goto error; if (check) { int v = tab_has_valid_sample(clex->tab, eq, 1); if (v < 0) goto error; if (!v) clex->tab = check_integer_feasible(clex->tab); } if (update) clex->tab = check_samples(clex->tab, eq, 1); return; error: isl_tab_free(clex->tab); clex->tab = NULL; } static void context_lex_add_ineq(struct isl_context *context, isl_int *ineq, int check, int update) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (isl_tab_extend_cons(clex->tab, 1) < 0) goto error; clex->tab = add_lexmin_ineq(clex->tab, ineq); if (check) { int v = tab_has_valid_sample(clex->tab, ineq, 0); if (v < 0) goto error; if (!v) clex->tab = check_integer_feasible(clex->tab); } if (update) clex->tab = check_samples(clex->tab, ineq, 0); return; error: isl_tab_free(clex->tab); clex->tab = NULL; } static isl_stat context_lex_add_ineq_wrap(void *user, isl_int *ineq) { struct isl_context *context = (struct isl_context *)user; context_lex_add_ineq(context, ineq, 0, 0); return context->op->is_ok(context) ? isl_stat_ok : isl_stat_error; } /* Check which signs can be obtained by "ineq" on all the currently * active sample values. See row_sign for more information. */ static enum isl_tab_row_sign tab_ineq_sign(struct isl_tab *tab, isl_int *ineq, int strict) { int i; int sgn; isl_int tmp; enum isl_tab_row_sign res = isl_tab_row_unknown; isl_assert(tab->mat->ctx, tab->samples, return isl_tab_row_unknown); isl_assert(tab->mat->ctx, tab->samples->n_col == 1 + tab->n_var, return isl_tab_row_unknown); isl_int_init(tmp); for (i = tab->n_outside; i < tab->n_sample; ++i) { isl_seq_inner_product(tab->samples->row[i], ineq, 1 + tab->n_var, &tmp); sgn = isl_int_sgn(tmp); if (sgn > 0 || (sgn == 0 && strict)) { if (res == isl_tab_row_unknown) res = isl_tab_row_pos; if (res == isl_tab_row_neg) res = isl_tab_row_any; } if (sgn < 0) { if (res == isl_tab_row_unknown) res = isl_tab_row_neg; if (res == isl_tab_row_pos) res = isl_tab_row_any; } if (res == isl_tab_row_any) break; } isl_int_clear(tmp); return res; } static enum isl_tab_row_sign context_lex_ineq_sign(struct isl_context *context, isl_int *ineq, int strict) { struct isl_context_lex *clex = (struct isl_context_lex *)context; return tab_ineq_sign(clex->tab, ineq, strict); } /* Check whether "ineq" can be added to the tableau without rendering * it infeasible. */ static int context_lex_test_ineq(struct isl_context *context, isl_int *ineq) { struct isl_context_lex *clex = (struct isl_context_lex *)context; struct isl_tab_undo *snap; int feasible; if (!clex->tab) return -1; if (isl_tab_extend_cons(clex->tab, 1) < 0) return -1; snap = isl_tab_snap(clex->tab); if (isl_tab_push_basis(clex->tab) < 0) return -1; clex->tab = add_lexmin_ineq(clex->tab, ineq); clex->tab = check_integer_feasible(clex->tab); if (!clex->tab) return -1; feasible = !clex->tab->empty; if (isl_tab_rollback(clex->tab, snap) < 0) return -1; return feasible; } static int context_lex_get_div(struct isl_context *context, struct isl_tab *tab, struct isl_vec *div) { return get_div(tab, context, div); } /* Insert a div specified by "div" to the context tableau at position "pos" and * return isl_bool_true if the div is obviously non-negative. * context_tab_add_div will always return isl_bool_true, because all variables * in a isl_context_lex tableau are non-negative. * However, if we are using a big parameter in the context, then this only * reflects the non-negativity of the variable used to _encode_ the * div, i.e., div' = M + div, so we can't draw any conclusions. */ static isl_bool context_lex_insert_div(struct isl_context *context, int pos, __isl_keep isl_vec *div) { struct isl_context_lex *clex = (struct isl_context_lex *)context; isl_bool nonneg; nonneg = context_tab_insert_div(clex->tab, pos, div, context_lex_add_ineq_wrap, context); if (nonneg < 0) return isl_bool_error; if (clex->tab->M) return isl_bool_false; return nonneg; } static int context_lex_detect_equalities(struct isl_context *context, struct isl_tab *tab) { return 0; } static int context_lex_best_split(struct isl_context *context, struct isl_tab *tab) { struct isl_context_lex *clex = (struct isl_context_lex *)context; struct isl_tab_undo *snap; int r; snap = isl_tab_snap(clex->tab); if (isl_tab_push_basis(clex->tab) < 0) return -1; r = best_split(tab, clex->tab); if (r >= 0 && isl_tab_rollback(clex->tab, snap) < 0) return -1; return r; } static int context_lex_is_empty(struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (!clex->tab) return -1; return clex->tab->empty; } static void *context_lex_save(struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; struct isl_tab_undo *snap; snap = isl_tab_snap(clex->tab); if (isl_tab_push_basis(clex->tab) < 0) return NULL; if (isl_tab_save_samples(clex->tab) < 0) return NULL; return snap; } static void context_lex_restore(struct isl_context *context, void *save) { struct isl_context_lex *clex = (struct isl_context_lex *)context; if (isl_tab_rollback(clex->tab, (struct isl_tab_undo *)save) < 0) { isl_tab_free(clex->tab); clex->tab = NULL; } } static void context_lex_discard(void *save) { } static int context_lex_is_ok(struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; return !!clex->tab; } /* For each variable in the context tableau, check if the variable can * only attain non-negative values. If so, mark the parameter as non-negative * in the main tableau. This allows for a more direct identification of some * cases of violated constraints. */ static struct isl_tab *tab_detect_nonnegative_parameters(struct isl_tab *tab, struct isl_tab *context_tab) { int i; struct isl_tab_undo *snap; struct isl_vec *ineq = NULL; struct isl_tab_var *var; int n; if (context_tab->n_var == 0) return tab; ineq = isl_vec_alloc(tab->mat->ctx, 1 + context_tab->n_var); if (!ineq) goto error; if (isl_tab_extend_cons(context_tab, 1) < 0) goto error; snap = isl_tab_snap(context_tab); n = 0; isl_seq_clr(ineq->el, ineq->size); for (i = 0; i < context_tab->n_var; ++i) { isl_int_set_si(ineq->el[1 + i], 1); if (isl_tab_add_ineq(context_tab, ineq->el) < 0) goto error; var = &context_tab->con[context_tab->n_con - 1]; if (!context_tab->empty && !isl_tab_min_at_most_neg_one(context_tab, var)) { int j = i; if (i >= tab->n_param) j = i - tab->n_param + tab->n_var - tab->n_div; tab->var[j].is_nonneg = 1; n++; } isl_int_set_si(ineq->el[1 + i], 0); if (isl_tab_rollback(context_tab, snap) < 0) goto error; } if (context_tab->M && n == context_tab->n_var) { context_tab->mat = isl_mat_drop_cols(context_tab->mat, 2, 1); context_tab->M = 0; } isl_vec_free(ineq); return tab; error: isl_vec_free(ineq); isl_tab_free(tab); return NULL; } static struct isl_tab *context_lex_detect_nonnegative_parameters( struct isl_context *context, struct isl_tab *tab) { struct isl_context_lex *clex = (struct isl_context_lex *)context; struct isl_tab_undo *snap; if (!tab) return NULL; snap = isl_tab_snap(clex->tab); if (isl_tab_push_basis(clex->tab) < 0) goto error; tab = tab_detect_nonnegative_parameters(tab, clex->tab); if (isl_tab_rollback(clex->tab, snap) < 0) goto error; return tab; error: isl_tab_free(tab); return NULL; } static void context_lex_invalidate(struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; isl_tab_free(clex->tab); clex->tab = NULL; } static __isl_null struct isl_context *context_lex_free( struct isl_context *context) { struct isl_context_lex *clex = (struct isl_context_lex *)context; isl_tab_free(clex->tab); free(clex); return NULL; } struct isl_context_op isl_context_lex_op = { context_lex_detect_nonnegative_parameters, context_lex_peek_basic_set, context_lex_peek_tab, context_lex_add_eq, context_lex_add_ineq, context_lex_ineq_sign, context_lex_test_ineq, context_lex_get_div, context_lex_insert_div, context_lex_detect_equalities, context_lex_best_split, context_lex_is_empty, context_lex_is_ok, context_lex_save, context_lex_restore, context_lex_discard, context_lex_invalidate, context_lex_free, }; static struct isl_tab *context_tab_for_lexmin(__isl_take isl_basic_set *bset) { struct isl_tab *tab; if (!bset) return NULL; tab = tab_for_lexmin(bset_to_bmap(bset), NULL, 1, 0); if (isl_tab_track_bset(tab, bset) < 0) goto error; tab = isl_tab_init_samples(tab); return tab; error: isl_tab_free(tab); return NULL; } static struct isl_context *isl_context_lex_alloc(struct isl_basic_set *dom) { struct isl_context_lex *clex; if (!dom) return NULL; clex = isl_alloc_type(dom->ctx, struct isl_context_lex); if (!clex) return NULL; clex->context.op = &isl_context_lex_op; clex->tab = context_tab_for_lexmin(isl_basic_set_copy(dom)); if (restore_lexmin(clex->tab) < 0) goto error; clex->tab = check_integer_feasible(clex->tab); if (!clex->tab) goto error; return &clex->context; error: clex->context.op->free(&clex->context); return NULL; } /* Representation of the context when using generalized basis reduction. * * "shifted" contains the offsets of the unit hypercubes that lie inside the * context. Any rational point in "shifted" can therefore be rounded * up to an integer point in the context. * If the context is constrained by any equality, then "shifted" is not used * as it would be empty. */ struct isl_context_gbr { struct isl_context context; struct isl_tab *tab; struct isl_tab *shifted; struct isl_tab *cone; }; static struct isl_tab *context_gbr_detect_nonnegative_parameters( struct isl_context *context, struct isl_tab *tab) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; if (!tab) return NULL; return tab_detect_nonnegative_parameters(tab, cgbr->tab); } static struct isl_basic_set *context_gbr_peek_basic_set( struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; if (!cgbr->tab) return NULL; return isl_tab_peek_bset(cgbr->tab); } static struct isl_tab *context_gbr_peek_tab(struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; return cgbr->tab; } /* Initialize the "shifted" tableau of the context, which * contains the constraints of the original tableau shifted * by the sum of all negative coefficients. This ensures * that any rational point in the shifted tableau can * be rounded up to yield an integer point in the original tableau. */ static void gbr_init_shifted(struct isl_context_gbr *cgbr) { int i, j; struct isl_vec *cst; struct isl_basic_set *bset = isl_tab_peek_bset(cgbr->tab); isl_size dim = isl_basic_set_dim(bset, isl_dim_all); if (dim < 0) return; cst = isl_vec_alloc(cgbr->tab->mat->ctx, bset->n_ineq); if (!cst) return; for (i = 0; i < bset->n_ineq; ++i) { isl_int_set(cst->el[i], bset->ineq[i][0]); for (j = 0; j < dim; ++j) { if (!isl_int_is_neg(bset->ineq[i][1 + j])) continue; isl_int_add(bset->ineq[i][0], bset->ineq[i][0], bset->ineq[i][1 + j]); } } cgbr->shifted = isl_tab_from_basic_set(bset, 0); for (i = 0; i < bset->n_ineq; ++i) isl_int_set(bset->ineq[i][0], cst->el[i]); isl_vec_free(cst); } /* Check if the shifted tableau is non-empty, and if so * use the sample point to construct an integer point * of the context tableau. */ static struct isl_vec *gbr_get_shifted_sample(struct isl_context_gbr *cgbr) { struct isl_vec *sample; if (!cgbr->shifted) gbr_init_shifted(cgbr); if (!cgbr->shifted) return NULL; if (cgbr->shifted->empty) return isl_vec_alloc(cgbr->tab->mat->ctx, 0); sample = isl_tab_get_sample_value(cgbr->shifted); sample = isl_vec_ceil(sample); return sample; } static __isl_give isl_basic_set *drop_constant_terms( __isl_take isl_basic_set *bset) { int i; if (!bset) return NULL; for (i = 0; i < bset->n_eq; ++i) isl_int_set_si(bset->eq[i][0], 0); for (i = 0; i < bset->n_ineq; ++i) isl_int_set_si(bset->ineq[i][0], 0); return bset; } static int use_shifted(struct isl_context_gbr *cgbr) { if (!cgbr->tab) return 0; return cgbr->tab->bmap->n_eq == 0 && cgbr->tab->bmap->n_div == 0; } static struct isl_vec *gbr_get_sample(struct isl_context_gbr *cgbr) { struct isl_basic_set *bset; struct isl_basic_set *cone; if (isl_tab_sample_is_integer(cgbr->tab)) return isl_tab_get_sample_value(cgbr->tab); if (use_shifted(cgbr)) { struct isl_vec *sample; sample = gbr_get_shifted_sample(cgbr); if (!sample || sample->size > 0) return sample; isl_vec_free(sample); } if (!cgbr->cone) { bset = isl_tab_peek_bset(cgbr->tab); cgbr->cone = isl_tab_from_recession_cone(bset, 0); if (!cgbr->cone) return NULL; if (isl_tab_track_bset(cgbr->cone, isl_basic_set_copy(bset)) < 0) return NULL; } if (isl_tab_detect_implicit_equalities(cgbr->cone) < 0) return NULL; if (cgbr->cone->n_dead == cgbr->cone->n_col) { struct isl_vec *sample; struct isl_tab_undo *snap; if (cgbr->tab->basis) { if (cgbr->tab->basis->n_col != 1 + cgbr->tab->n_var) { isl_mat_free(cgbr->tab->basis); cgbr->tab->basis = NULL; } cgbr->tab->n_zero = 0; cgbr->tab->n_unbounded = 0; } snap = isl_tab_snap(cgbr->tab); sample = isl_tab_sample(cgbr->tab); if (!sample || isl_tab_rollback(cgbr->tab, snap) < 0) { isl_vec_free(sample); return NULL; } return sample; } cone = isl_basic_set_dup(isl_tab_peek_bset(cgbr->cone)); cone = drop_constant_terms(cone); cone = isl_basic_set_update_from_tab(cone, cgbr->cone); cone = isl_basic_set_underlying_set(cone); cone = isl_basic_set_gauss(cone, NULL); bset = isl_basic_set_dup(isl_tab_peek_bset(cgbr->tab)); bset = isl_basic_set_update_from_tab(bset, cgbr->tab); bset = isl_basic_set_underlying_set(bset); bset = isl_basic_set_gauss(bset, NULL); return isl_basic_set_sample_with_cone(bset, cone); } static void check_gbr_integer_feasible(struct isl_context_gbr *cgbr) { struct isl_vec *sample; if (!cgbr->tab) return; if (cgbr->tab->empty) return; sample = gbr_get_sample(cgbr); if (!sample) goto error; if (sample->size == 0) { isl_vec_free(sample); if (isl_tab_mark_empty(cgbr->tab) < 0) goto error; return; } if (isl_tab_add_sample(cgbr->tab, sample) < 0) goto error; return; error: isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static struct isl_tab *add_gbr_eq(struct isl_tab *tab, isl_int *eq) { if (!tab) return NULL; if (isl_tab_extend_cons(tab, 2) < 0) goto error; if (isl_tab_add_eq(tab, eq) < 0) goto error; return tab; error: isl_tab_free(tab); return NULL; } /* Add the equality described by "eq" to the context. * If "check" is set, then we check if the context is empty after * adding the equality. * If "update" is set, then we check if the samples are still valid. * * We do not explicitly add shifted copies of the equality to * cgbr->shifted since they would conflict with each other. * Instead, we directly mark cgbr->shifted empty. */ static void context_gbr_add_eq(struct isl_context *context, isl_int *eq, int check, int update) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; cgbr->tab = add_gbr_eq(cgbr->tab, eq); if (cgbr->shifted && !cgbr->shifted->empty && use_shifted(cgbr)) { if (isl_tab_mark_empty(cgbr->shifted) < 0) goto error; } if (cgbr->cone && cgbr->cone->n_col != cgbr->cone->n_dead) { if (isl_tab_extend_cons(cgbr->cone, 2) < 0) goto error; if (isl_tab_add_eq(cgbr->cone, eq) < 0) goto error; } if (check) { int v = tab_has_valid_sample(cgbr->tab, eq, 1); if (v < 0) goto error; if (!v) check_gbr_integer_feasible(cgbr); } if (update) cgbr->tab = check_samples(cgbr->tab, eq, 1); return; error: isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static void add_gbr_ineq(struct isl_context_gbr *cgbr, isl_int *ineq) { if (!cgbr->tab) return; if (isl_tab_extend_cons(cgbr->tab, 1) < 0) goto error; if (isl_tab_add_ineq(cgbr->tab, ineq) < 0) goto error; if (cgbr->shifted && !cgbr->shifted->empty && use_shifted(cgbr)) { int i; isl_size dim; dim = isl_basic_map_dim(cgbr->tab->bmap, isl_dim_all); if (dim < 0) goto error; if (isl_tab_extend_cons(cgbr->shifted, 1) < 0) goto error; for (i = 0; i < dim; ++i) { if (!isl_int_is_neg(ineq[1 + i])) continue; isl_int_add(ineq[0], ineq[0], ineq[1 + i]); } if (isl_tab_add_ineq(cgbr->shifted, ineq) < 0) goto error; for (i = 0; i < dim; ++i) { if (!isl_int_is_neg(ineq[1 + i])) continue; isl_int_sub(ineq[0], ineq[0], ineq[1 + i]); } } if (cgbr->cone && cgbr->cone->n_col != cgbr->cone->n_dead) { if (isl_tab_extend_cons(cgbr->cone, 1) < 0) goto error; if (isl_tab_add_ineq(cgbr->cone, ineq) < 0) goto error; } return; error: isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static void context_gbr_add_ineq(struct isl_context *context, isl_int *ineq, int check, int update) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; add_gbr_ineq(cgbr, ineq); if (!cgbr->tab) return; if (check) { int v = tab_has_valid_sample(cgbr->tab, ineq, 0); if (v < 0) goto error; if (!v) check_gbr_integer_feasible(cgbr); } if (update) cgbr->tab = check_samples(cgbr->tab, ineq, 0); return; error: isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static isl_stat context_gbr_add_ineq_wrap(void *user, isl_int *ineq) { struct isl_context *context = (struct isl_context *)user; context_gbr_add_ineq(context, ineq, 0, 0); return context->op->is_ok(context) ? isl_stat_ok : isl_stat_error; } static enum isl_tab_row_sign context_gbr_ineq_sign(struct isl_context *context, isl_int *ineq, int strict) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; return tab_ineq_sign(cgbr->tab, ineq, strict); } /* Check whether "ineq" can be added to the tableau without rendering * it infeasible. */ static int context_gbr_test_ineq(struct isl_context *context, isl_int *ineq) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; struct isl_tab_undo *snap; struct isl_tab_undo *shifted_snap = NULL; struct isl_tab_undo *cone_snap = NULL; int feasible; if (!cgbr->tab) return -1; if (isl_tab_extend_cons(cgbr->tab, 1) < 0) return -1; snap = isl_tab_snap(cgbr->tab); if (cgbr->shifted) shifted_snap = isl_tab_snap(cgbr->shifted); if (cgbr->cone) cone_snap = isl_tab_snap(cgbr->cone); add_gbr_ineq(cgbr, ineq); check_gbr_integer_feasible(cgbr); if (!cgbr->tab) return -1; feasible = !cgbr->tab->empty; if (isl_tab_rollback(cgbr->tab, snap) < 0) return -1; if (shifted_snap) { if (isl_tab_rollback(cgbr->shifted, shifted_snap)) return -1; } else if (cgbr->shifted) { isl_tab_free(cgbr->shifted); cgbr->shifted = NULL; } if (cone_snap) { if (isl_tab_rollback(cgbr->cone, cone_snap)) return -1; } else if (cgbr->cone) { isl_tab_free(cgbr->cone); cgbr->cone = NULL; } return feasible; } /* Return the column of the last of the variables associated to * a column that has a non-zero coefficient. * This function is called in a context where only coefficients * of parameters or divs can be non-zero. */ static int last_non_zero_var_col(struct isl_tab *tab, isl_int *p) { int i; int col; if (tab->n_var == 0) return -1; for (i = tab->n_var - 1; i >= 0; --i) { if (i >= tab->n_param && i < tab->n_var - tab->n_div) continue; if (tab->var[i].is_row) continue; col = tab->var[i].index; if (!isl_int_is_zero(p[col])) return col; } return -1; } /* Look through all the recently added equalities in the context * to see if we can propagate any of them to the main tableau. * * The newly added equalities in the context are encoded as pairs * of inequalities starting at inequality "first". * * We tentatively add each of these equalities to the main tableau * and if this happens to result in a row with a final coefficient * that is one or negative one, we use it to kill a column * in the main tableau. Otherwise, we discard the tentatively * added row. * This tentative addition of equality constraints turns * on the undo facility of the tableau. Turn it off again * at the end, assuming it was turned off to begin with. * * Return 0 on success and -1 on failure. */ static int propagate_equalities(struct isl_context_gbr *cgbr, struct isl_tab *tab, unsigned first) { int i; struct isl_vec *eq = NULL; isl_bool needs_undo; needs_undo = isl_tab_need_undo(tab); if (needs_undo < 0) goto error; eq = isl_vec_alloc(tab->mat->ctx, 1 + tab->n_var); if (!eq) goto error; if (isl_tab_extend_cons(tab, (cgbr->tab->bmap->n_ineq - first)/2) < 0) goto error; isl_seq_clr(eq->el + 1 + tab->n_param, tab->n_var - tab->n_param - tab->n_div); for (i = first; i < cgbr->tab->bmap->n_ineq; i += 2) { int j; int r; struct isl_tab_undo *snap; snap = isl_tab_snap(tab); isl_seq_cpy(eq->el, cgbr->tab->bmap->ineq[i], 1 + tab->n_param); isl_seq_cpy(eq->el + 1 + tab->n_var - tab->n_div, cgbr->tab->bmap->ineq[i] + 1 + tab->n_param, tab->n_div); r = isl_tab_add_row(tab, eq->el); if (r < 0) goto error; r = tab->con[r].index; j = last_non_zero_var_col(tab, tab->mat->row[r] + 2 + tab->M); if (j < 0 || j < tab->n_dead || !isl_int_is_one(tab->mat->row[r][0]) || (!isl_int_is_one(tab->mat->row[r][2 + tab->M + j]) && !isl_int_is_negone(tab->mat->row[r][2 + tab->M + j]))) { if (isl_tab_rollback(tab, snap) < 0) goto error; continue; } if (isl_tab_pivot(tab, r, j) < 0) goto error; if (isl_tab_kill_col(tab, j) < 0) goto error; if (restore_lexmin(tab) < 0) goto error; } if (!needs_undo) isl_tab_clear_undo(tab); isl_vec_free(eq); return 0; error: isl_vec_free(eq); isl_tab_free(cgbr->tab); cgbr->tab = NULL; return -1; } static int context_gbr_detect_equalities(struct isl_context *context, struct isl_tab *tab) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; unsigned n_ineq; if (!cgbr->cone) { struct isl_basic_set *bset = isl_tab_peek_bset(cgbr->tab); cgbr->cone = isl_tab_from_recession_cone(bset, 0); if (!cgbr->cone) goto error; if (isl_tab_track_bset(cgbr->cone, isl_basic_set_copy(bset)) < 0) goto error; } if (isl_tab_detect_implicit_equalities(cgbr->cone) < 0) goto error; n_ineq = cgbr->tab->bmap->n_ineq; cgbr->tab = isl_tab_detect_equalities(cgbr->tab, cgbr->cone); if (!cgbr->tab) return -1; if (cgbr->tab->bmap->n_ineq > n_ineq && propagate_equalities(cgbr, tab, n_ineq) < 0) return -1; return 0; error: isl_tab_free(cgbr->tab); cgbr->tab = NULL; return -1; } static int context_gbr_get_div(struct isl_context *context, struct isl_tab *tab, struct isl_vec *div) { return get_div(tab, context, div); } static isl_bool context_gbr_insert_div(struct isl_context *context, int pos, __isl_keep isl_vec *div) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; if (cgbr->cone) { int r, o_div; isl_size n_div; n_div = isl_basic_map_dim(cgbr->cone->bmap, isl_dim_div); if (n_div < 0) return isl_bool_error; o_div = cgbr->cone->n_var - n_div; if (isl_tab_extend_cons(cgbr->cone, 3) < 0) return isl_bool_error; if (isl_tab_extend_vars(cgbr->cone, 1) < 0) return isl_bool_error; if ((r = isl_tab_insert_var(cgbr->cone, pos)) <0) return isl_bool_error; cgbr->cone->bmap = isl_basic_map_insert_div(cgbr->cone->bmap, r - o_div, div); if (!cgbr->cone->bmap) return isl_bool_error; if (isl_tab_push_var(cgbr->cone, isl_tab_undo_bmap_div, &cgbr->cone->var[r]) < 0) return isl_bool_error; } return context_tab_insert_div(cgbr->tab, pos, div, context_gbr_add_ineq_wrap, context); } static int context_gbr_best_split(struct isl_context *context, struct isl_tab *tab) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; struct isl_tab_undo *snap; int r; snap = isl_tab_snap(cgbr->tab); r = best_split(tab, cgbr->tab); if (r >= 0 && isl_tab_rollback(cgbr->tab, snap) < 0) return -1; return r; } static int context_gbr_is_empty(struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; if (!cgbr->tab) return -1; return cgbr->tab->empty; } struct isl_gbr_tab_undo { struct isl_tab_undo *tab_snap; struct isl_tab_undo *shifted_snap; struct isl_tab_undo *cone_snap; }; static void *context_gbr_save(struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; struct isl_gbr_tab_undo *snap; if (!cgbr->tab) return NULL; snap = isl_alloc_type(cgbr->tab->mat->ctx, struct isl_gbr_tab_undo); if (!snap) return NULL; snap->tab_snap = isl_tab_snap(cgbr->tab); if (isl_tab_save_samples(cgbr->tab) < 0) goto error; if (cgbr->shifted) snap->shifted_snap = isl_tab_snap(cgbr->shifted); else snap->shifted_snap = NULL; if (cgbr->cone) snap->cone_snap = isl_tab_snap(cgbr->cone); else snap->cone_snap = NULL; return snap; error: free(snap); return NULL; } static void context_gbr_restore(struct isl_context *context, void *save) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; struct isl_gbr_tab_undo *snap = (struct isl_gbr_tab_undo *)save; if (!snap) goto error; if (isl_tab_rollback(cgbr->tab, snap->tab_snap) < 0) goto error; if (snap->shifted_snap) { if (isl_tab_rollback(cgbr->shifted, snap->shifted_snap) < 0) goto error; } else if (cgbr->shifted) { isl_tab_free(cgbr->shifted); cgbr->shifted = NULL; } if (snap->cone_snap) { if (isl_tab_rollback(cgbr->cone, snap->cone_snap) < 0) goto error; } else if (cgbr->cone) { isl_tab_free(cgbr->cone); cgbr->cone = NULL; } free(snap); return; error: free(snap); isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static void context_gbr_discard(void *save) { struct isl_gbr_tab_undo *snap = (struct isl_gbr_tab_undo *)save; free(snap); } static int context_gbr_is_ok(struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; return !!cgbr->tab; } static void context_gbr_invalidate(struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; isl_tab_free(cgbr->tab); cgbr->tab = NULL; } static __isl_null struct isl_context *context_gbr_free( struct isl_context *context) { struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context; isl_tab_free(cgbr->tab); isl_tab_free(cgbr->shifted); isl_tab_free(cgbr->cone); free(cgbr); return NULL; } struct isl_context_op isl_context_gbr_op = { context_gbr_detect_nonnegative_parameters, context_gbr_peek_basic_set, context_gbr_peek_tab, context_gbr_add_eq, context_gbr_add_ineq, context_gbr_ineq_sign, context_gbr_test_ineq, context_gbr_get_div, context_gbr_insert_div, context_gbr_detect_equalities, context_gbr_best_split, context_gbr_is_empty, context_gbr_is_ok, context_gbr_save, context_gbr_restore, context_gbr_discard, context_gbr_invalidate, context_gbr_free, }; static struct isl_context *isl_context_gbr_alloc(__isl_keep isl_basic_set *dom) { struct isl_context_gbr *cgbr; if (!dom) return NULL; cgbr = isl_calloc_type(dom->ctx, struct isl_context_gbr); if (!cgbr) return NULL; cgbr->context.op = &isl_context_gbr_op; cgbr->shifted = NULL; cgbr->cone = NULL; cgbr->tab = isl_tab_from_basic_set(dom, 1); cgbr->tab = isl_tab_init_samples(cgbr->tab); if (!cgbr->tab) goto error; check_gbr_integer_feasible(cgbr); return &cgbr->context; error: cgbr->context.op->free(&cgbr->context); return NULL; } /* Allocate a context corresponding to "dom". * The representation specific fields are initialized by * isl_context_lex_alloc or isl_context_gbr_alloc. * The shared "n_unknown" field is initialized to the number * of final unknown integer divisions in "dom". */ static struct isl_context *isl_context_alloc(__isl_keep isl_basic_set *dom) { struct isl_context *context; int first; isl_size n_div; if (!dom) return NULL; if (dom->ctx->opt->context == ISL_CONTEXT_LEXMIN) context = isl_context_lex_alloc(dom); else context = isl_context_gbr_alloc(dom); if (!context) return NULL; first = isl_basic_set_first_unknown_div(dom); n_div = isl_basic_set_dim(dom, isl_dim_div); if (first < 0 || n_div < 0) return context->op->free(context); context->n_unknown = n_div - first; return context; } /* Initialize some common fields of "sol", which keeps track * of the solution of an optimization problem on "bmap" over * the domain "dom". * If "max" is set, then a maximization problem is being solved, rather than * a minimization problem, which means that the variables in the * tableau have value "M - x" rather than "M + x". */ static isl_stat sol_init(struct isl_sol *sol, __isl_keep isl_basic_map *bmap, __isl_keep isl_basic_set *dom, int max) { sol->rational = ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL); sol->dec_level.callback.run = &sol_dec_level_wrap; sol->dec_level.sol = sol; sol->max = max; sol->n_out = isl_basic_map_dim(bmap, isl_dim_out); sol->space = isl_basic_map_get_space(bmap); sol->context = isl_context_alloc(dom); if (sol->n_out < 0 || !sol->space || !sol->context) return isl_stat_error; return isl_stat_ok; } /* Construct an isl_sol_map structure for accumulating the solution. * If track_empty is set, then we also keep track of the parts * of the context where there is no solution. * If max is set, then we are solving a maximization, rather than * a minimization problem, which means that the variables in the * tableau have value "M - x" rather than "M + x". */ static struct isl_sol *sol_map_init(__isl_keep isl_basic_map *bmap, __isl_take isl_basic_set *dom, int track_empty, int max) { struct isl_sol_map *sol_map = NULL; isl_space *space; if (!bmap) goto error; sol_map = isl_calloc_type(bmap->ctx, struct isl_sol_map); if (!sol_map) goto error; sol_map->sol.free = &sol_map_free; if (sol_init(&sol_map->sol, bmap, dom, max) < 0) goto error; sol_map->sol.add = &sol_map_add_wrap; sol_map->sol.add_empty = track_empty ? &sol_map_add_empty_wrap : NULL; space = isl_space_copy(sol_map->sol.space); sol_map->map = isl_map_alloc_space(space, 1, ISL_MAP_DISJOINT); if (!sol_map->map) goto error; if (track_empty) { sol_map->empty = isl_set_alloc_space(isl_basic_set_get_space(dom), 1, ISL_SET_DISJOINT); if (!sol_map->empty) goto error; } isl_basic_set_free(dom); return &sol_map->sol; error: isl_basic_set_free(dom); sol_free(&sol_map->sol); return NULL; } /* Check whether all coefficients of (non-parameter) variables * are non-positive, meaning that no pivots can be performed on the row. */ static int is_critical(struct isl_tab *tab, int row) { int j; unsigned off = 2 + tab->M; for (j = tab->n_dead; j < tab->n_col; ++j) { if (col_is_parameter_var(tab, j)) continue; if (isl_int_is_pos(tab->mat->row[row][off + j])) return 0; } return 1; } /* Check whether the inequality represented by vec is strict over the integers, * i.e., there are no integer values satisfying the constraint with * equality. This happens if the gcd of the coefficients is not a divisor * of the constant term. If so, scale the constraint down by the gcd * of the coefficients. */ static int is_strict(struct isl_vec *vec) { isl_int gcd; int strict = 0; isl_int_init(gcd); isl_seq_gcd(vec->el + 1, vec->size - 1, &gcd); if (!isl_int_is_one(gcd)) { strict = !isl_int_is_divisible_by(vec->el[0], gcd); isl_int_fdiv_q(vec->el[0], vec->el[0], gcd); isl_seq_scale_down(vec->el + 1, vec->el + 1, gcd, vec->size-1); } isl_int_clear(gcd); return strict; } /* Determine the sign of the given row of the main tableau. * The result is one of * isl_tab_row_pos: always non-negative; no pivot needed * isl_tab_row_neg: always non-positive; pivot * isl_tab_row_any: can be both positive and negative; split * * We first handle some simple cases * - the row sign may be known already * - the row may be obviously non-negative * - the parametric constant may be equal to that of another row * for which we know the sign. This sign will be either "pos" or * "any". If it had been "neg" then we would have pivoted before. * * If none of these cases hold, we check the value of the row for each * of the currently active samples. Based on the signs of these values * we make an initial determination of the sign of the row. * * all zero -> unk(nown) * all non-negative -> pos * all non-positive -> neg * both negative and positive -> all * * If we end up with "all", we are done. * Otherwise, we perform a check for positive and/or negative * values as follows. * * samples neg unk pos * <0 ? Y N Y N * pos any pos * >0 ? Y N Y N * any neg any neg * * There is no special sign for "zero", because we can usually treat zero * as either non-negative or non-positive, whatever works out best. * However, if the row is "critical", meaning that pivoting is impossible * then we don't want to limp zero with the non-positive case, because * then we we would lose the solution for those values of the parameters * where the value of the row is zero. Instead, we treat 0 as non-negative * ensuring a split if the row can attain both zero and negative values. * The same happens when the original constraint was one that could not * be satisfied with equality by any integer values of the parameters. * In this case, we normalize the constraint, but then a value of zero * for the normalized constraint is actually a positive value for the * original constraint, so again we need to treat zero as non-negative. * In both these cases, we have the following decision tree instead: * * all non-negative -> pos * all negative -> neg * both negative and non-negative -> all * * samples neg pos * <0 ? Y N * any pos * >=0 ? Y N * any neg */ static enum isl_tab_row_sign row_sign(struct isl_tab *tab, struct isl_sol *sol, int row) { struct isl_vec *ineq = NULL; enum isl_tab_row_sign res = isl_tab_row_unknown; int critical; int strict; int row2; if (tab->row_sign[row] != isl_tab_row_unknown) return tab->row_sign[row]; if (is_obviously_nonneg(tab, row)) return isl_tab_row_pos; for (row2 = tab->n_redundant; row2 < tab->n_row; ++row2) { if (tab->row_sign[row2] == isl_tab_row_unknown) continue; if (identical_parameter_line(tab, row, row2)) return tab->row_sign[row2]; } critical = is_critical(tab, row); ineq = get_row_parameter_ineq(tab, row); if (!ineq) goto error; strict = is_strict(ineq); res = sol->context->op->ineq_sign(sol->context, ineq->el, critical || strict); if (res == isl_tab_row_unknown || res == isl_tab_row_pos) { /* test for negative values */ int feasible; isl_seq_neg(ineq->el, ineq->el, ineq->size); isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); feasible = sol->context->op->test_ineq(sol->context, ineq->el); if (feasible < 0) goto error; if (!feasible) res = isl_tab_row_pos; else res = (res == isl_tab_row_unknown) ? isl_tab_row_neg : isl_tab_row_any; if (res == isl_tab_row_neg) { isl_seq_neg(ineq->el, ineq->el, ineq->size); isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); } } if (res == isl_tab_row_neg) { /* test for positive values */ int feasible; if (!critical && !strict) isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); feasible = sol->context->op->test_ineq(sol->context, ineq->el); if (feasible < 0) goto error; if (feasible) res = isl_tab_row_any; } isl_vec_free(ineq); return res; error: isl_vec_free(ineq); return isl_tab_row_unknown; } static void find_solutions(struct isl_sol *sol, struct isl_tab *tab); /* Find solutions for values of the parameters that satisfy the given * inequality. * * We currently take a snapshot of the context tableau that is reset * when we return from this function, while we make a copy of the main * tableau, leaving the original main tableau untouched. * These are fairly arbitrary choices. Making a copy also of the context * tableau would obviate the need to undo any changes made to it later, * while taking a snapshot of the main tableau could reduce memory usage. * If we were to switch to taking a snapshot of the main tableau, * we would have to keep in mind that we need to save the row signs * and that we need to do this before saving the current basis * such that the basis has been restore before we restore the row signs. */ static void find_in_pos(struct isl_sol *sol, struct isl_tab *tab, isl_int *ineq) { void *saved; if (!sol->context) goto error; tab = isl_tab_dup(tab); if (!tab) goto error; saved = sol->context->op->save(sol->context); sol_context_add_ineq(sol, ineq, 0, 1); find_solutions(sol, tab); if (!sol->error) sol->context->op->restore(sol->context, saved); else sol->context->op->discard(saved); return; error: sol->error = 1; } /* Record the absence of solutions for those values of the parameters * that do not satisfy the given inequality with equality. */ static void no_sol_in_strict(struct isl_sol *sol, struct isl_tab *tab, struct isl_vec *ineq) { int empty; void *saved; if (!sol->context || sol->error) goto error; saved = sol->context->op->save(sol->context); isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); sol_context_add_ineq(sol, ineq->el, 1, 0); empty = tab->empty; tab->empty = 1; sol_add(sol, tab); tab->empty = empty; isl_int_add_ui(ineq->el[0], ineq->el[0], 1); sol->context->op->restore(sol->context, saved); if (!sol->context->op->is_ok(sol->context)) goto error; return; error: sol->error = 1; } /* Reset all row variables that are marked to have a sign that may * be both positive and negative to have an unknown sign. */ static void reset_any_to_unknown(struct isl_tab *tab) { int row; for (row = tab->n_redundant; row < tab->n_row; ++row) { if (!isl_tab_var_from_row(tab, row)->is_nonneg) continue; if (tab->row_sign[row] == isl_tab_row_any) tab->row_sign[row] = isl_tab_row_unknown; } } /* Compute the lexicographic minimum of the set represented by the main * tableau "tab" within the context "sol->context_tab". * On entry the sample value of the main tableau is lexicographically * less than or equal to this lexicographic minimum. * Pivots are performed until a feasible point is found, which is then * necessarily equal to the minimum, or until the tableau is found to * be infeasible. Some pivots may need to be performed for only some * feasible values of the context tableau. If so, the context tableau * is split into a part where the pivot is needed and a part where it is not. * * Whenever we enter the main loop, the main tableau is such that no * "obvious" pivots need to be performed on it, where "obvious" means * that the given row can be seen to be negative without looking at * the context tableau. In particular, for non-parametric problems, * no pivots need to be performed on the main tableau. * The caller of find_solutions is responsible for making this property * hold prior to the first iteration of the loop, while restore_lexmin * is called before every other iteration. * * Inside the main loop, we first examine the signs of the rows of * the main tableau within the context of the context tableau. * If we find a row that is always non-positive for all values of * the parameters satisfying the context tableau and negative for at * least one value of the parameters, we perform the appropriate pivot * and start over. An exception is the case where no pivot can be * performed on the row. In this case, we require that the sign of * the row is negative for all values of the parameters (rather than just * non-positive). This special case is handled inside row_sign, which * will say that the row can have any sign if it determines that it can * attain both negative and zero values. * * If we can't find a row that always requires a pivot, but we can find * one or more rows that require a pivot for some values of the parameters * (i.e., the row can attain both positive and negative signs), then we split * the context tableau into two parts, one where we force the sign to be * non-negative and one where we force is to be negative. * The non-negative part is handled by a recursive call (through find_in_pos). * Upon returning from this call, we continue with the negative part and * perform the required pivot. * * If no such rows can be found, all rows are non-negative and we have * found a (rational) feasible point. If we only wanted a rational point * then we are done. * Otherwise, we check if all values of the sample point of the tableau * are integral for the variables. If so, we have found the minimal * integral point and we are done. * If the sample point is not integral, then we need to make a distinction * based on whether the constant term is non-integral or the coefficients * of the parameters. Furthermore, in order to decide how to handle * the non-integrality, we also need to know whether the coefficients * of the other columns in the tableau are integral. This leads * to the following table. The first two rows do not correspond * to a non-integral sample point and are only mentioned for completeness. * * constant parameters other * * int int int | * int int rat | -> no problem * * rat int int -> fail * * rat int rat -> cut * * int rat rat | * rat rat rat | -> parametric cut * * int rat int | * rat rat int | -> split context * * If the parametric constant is completely integral, then there is nothing * to be done. If the constant term is non-integral, but all the other * coefficient are integral, then there is nothing that can be done * and the tableau has no integral solution. * If, on the other hand, one or more of the other columns have rational * coefficients, but the parameter coefficients are all integral, then * we can perform a regular (non-parametric) cut. * Finally, if there is any parameter coefficient that is non-integral, * then we need to involve the context tableau. There are two cases here. * If at least one other column has a rational coefficient, then we * can perform a parametric cut in the main tableau by adding a new * integer division in the context tableau. * If all other columns have integral coefficients, then we need to * enforce that the rational combination of parameters (c + \sum a_i y_i)/m * is always integral. We do this by introducing an integer division * q = floor((c + \sum a_i y_i)/m) and stipulating that its argument should * always be integral in the context tableau, i.e., m q = c + \sum a_i y_i. * Since q is expressed in the tableau as * c + \sum a_i y_i - m q >= 0 * -c - \sum a_i y_i + m q + m - 1 >= 0 * it is sufficient to add the inequality * -c - \sum a_i y_i + m q >= 0 * In the part of the context where this inequality does not hold, the * main tableau is marked as being empty. */ static void find_solutions(struct isl_sol *sol, struct isl_tab *tab) { struct isl_context *context; int r; if (!tab || sol->error) goto error; context = sol->context; if (tab->empty) goto done; if (context->op->is_empty(context)) goto done; for (r = 0; r >= 0 && tab && !tab->empty; r = restore_lexmin(tab)) { int flags; int row; enum isl_tab_row_sign sgn; int split = -1; int n_split = 0; for (row = tab->n_redundant; row < tab->n_row; ++row) { if (!isl_tab_var_from_row(tab, row)->is_nonneg) continue; sgn = row_sign(tab, sol, row); if (!sgn) goto error; tab->row_sign[row] = sgn; if (sgn == isl_tab_row_any) n_split++; if (sgn == isl_tab_row_any && split == -1) split = row; if (sgn == isl_tab_row_neg) break; } if (row < tab->n_row) continue; if (split != -1) { struct isl_vec *ineq; if (n_split != 1) split = context->op->best_split(context, tab); if (split < 0) goto error; ineq = get_row_parameter_ineq(tab, split); if (!ineq) goto error; is_strict(ineq); reset_any_to_unknown(tab); tab->row_sign[split] = isl_tab_row_pos; sol_inc_level(sol); find_in_pos(sol, tab, ineq->el); tab->row_sign[split] = isl_tab_row_neg; isl_seq_neg(ineq->el, ineq->el, ineq->size); isl_int_sub_ui(ineq->el[0], ineq->el[0], 1); sol_context_add_ineq(sol, ineq->el, 0, 1); isl_vec_free(ineq); if (sol->error) goto error; continue; } if (tab->rational) break; row = first_non_integer_row(tab, &flags); if (row < 0) break; if (ISL_FL_ISSET(flags, I_PAR)) { if (ISL_FL_ISSET(flags, I_VAR)) { if (isl_tab_mark_empty(tab) < 0) goto error; break; } row = add_cut(tab, row); } else if (ISL_FL_ISSET(flags, I_VAR)) { struct isl_vec *div; struct isl_vec *ineq; int d; div = get_row_split_div(tab, row); if (!div) goto error; d = context->op->get_div(context, tab, div); isl_vec_free(div); if (d < 0) goto error; ineq = ineq_for_div(context->op->peek_basic_set(context), d); if (!ineq) goto error; sol_inc_level(sol); no_sol_in_strict(sol, tab, ineq); isl_seq_neg(ineq->el, ineq->el, ineq->size); sol_context_add_ineq(sol, ineq->el, 1, 1); isl_vec_free(ineq); if (sol->error || !context->op->is_ok(context)) goto error; tab = set_row_cst_to_div(tab, row, d); if (context->op->is_empty(context)) break; } else row = add_parametric_cut(tab, row, context); if (row < 0) goto error; } if (r < 0) goto error; done: sol_add(sol, tab); isl_tab_free(tab); return; error: isl_tab_free(tab); sol->error = 1; } /* Does "sol" contain a pair of partial solutions that could potentially * be merged? * * We currently only check that "sol" is not in an error state * and that there are at least two partial solutions of which the final two * are defined at the same level. */ static int sol_has_mergeable_solutions(struct isl_sol *sol) { if (sol->error) return 0; if (!sol->partial) return 0; if (!sol->partial->next) return 0; return sol->partial->level == sol->partial->next->level; } /* Compute the lexicographic minimum of the set represented by the main * tableau "tab" within the context "sol->context_tab". * * As a preprocessing step, we first transfer all the purely parametric * equalities from the main tableau to the context tableau, i.e., * parameters that have been pivoted to a row. * These equalities are ignored by the main algorithm, because the * corresponding rows may not be marked as being non-negative. * In parts of the context where the added equality does not hold, * the main tableau is marked as being empty. * * Before we embark on the actual computation, we save a copy * of the context. When we return, we check if there are any * partial solutions that can potentially be merged. If so, * we perform a rollback to the initial state of the context. * The merging of partial solutions happens inside calls to * sol_dec_level that are pushed onto the undo stack of the context. * If there are no partial solutions that can potentially be merged * then the rollback is skipped as it would just be wasted effort. */ static void find_solutions_main(struct isl_sol *sol, struct isl_tab *tab) { int row; void *saved; if (!tab) goto error; sol->level = 0; for (row = tab->n_redundant; row < tab->n_row; ++row) { int p; struct isl_vec *eq; if (!row_is_parameter_var(tab, row)) continue; if (tab->row_var[row] < tab->n_param) p = tab->row_var[row]; else p = tab->row_var[row] + tab->n_param - (tab->n_var - tab->n_div); eq = isl_vec_alloc(tab->mat->ctx, 1+tab->n_param+tab->n_div); if (!eq) goto error; get_row_parameter_line(tab, row, eq->el); isl_int_neg(eq->el[1 + p], tab->mat->row[row][0]); eq = isl_vec_normalize(eq); sol_inc_level(sol); no_sol_in_strict(sol, tab, eq); isl_seq_neg(eq->el, eq->el, eq->size); sol_inc_level(sol); no_sol_in_strict(sol, tab, eq); isl_seq_neg(eq->el, eq->el, eq->size); sol_context_add_eq(sol, eq->el, 1, 1); isl_vec_free(eq); if (isl_tab_mark_redundant(tab, row) < 0) goto error; if (sol->context->op->is_empty(sol->context)) break; row = tab->n_redundant - 1; } saved = sol->context->op->save(sol->context); find_solutions(sol, tab); if (sol_has_mergeable_solutions(sol)) sol->context->op->restore(sol->context, saved); else sol->context->op->discard(saved); sol->level = 0; sol_pop(sol); return; error: isl_tab_free(tab); sol->error = 1; } /* Is the local variable "div" of "bmap" an integer division * with a known expression that does not involve the "n" variables * starting at "first"? */ static isl_bool is_known_div_not_involving(__isl_keep isl_basic_map *bmap, unsigned div, unsigned first, unsigned n) { isl_bool unknown, involves; unknown = isl_basic_map_div_is_marked_unknown(bmap, div); if (unknown < 0 || unknown) return isl_bool_not(unknown); involves = isl_basic_map_div_expr_involves_vars(bmap, div, first, n); return isl_bool_not(involves); } /* Check if integer division "div" of "src" also occurs in "dst", * where the integer division "div" is known to involve * only the first "n_shared" variables. * If so, return its position within the local variables. * Otherwise, return a position beyond the local variables. */ static isl_size find_div_involving_only(__isl_keep isl_basic_map *dst, __isl_keep isl_basic_map *src, unsigned div, unsigned n_shared) { int i; isl_size total; isl_size n_div; total = isl_basic_map_dim(dst, isl_dim_all); n_div = isl_basic_map_dim(dst, isl_dim_div); if (total < 0 || n_div < 0) return isl_size_error; for (i = 0; i < n_div; ++i) { isl_bool ok; ok = is_known_div_not_involving(dst, i, n_shared, total - n_shared); if (ok < 0) return isl_size_error; if (!ok) continue; if (isl_seq_eq(dst->div[i], src->div[div], 2 + n_shared)) return i; } return n_div; } /* Check if integer division "div" of "dom" also occurs in "bmap". * If so, return its position within the divs. * Otherwise, return a position beyond the integer divisions. */ static isl_size find_context_div(__isl_keep isl_basic_map *bmap, __isl_keep isl_basic_set *dom, unsigned div) { isl_size d_v_div; isl_size n_div, d_n_div; isl_bool ok; d_v_div = isl_basic_set_var_offset(dom, isl_dim_div); n_div = isl_basic_map_dim(bmap, isl_dim_div); d_n_div = isl_basic_set_dim(dom, isl_dim_div); if (d_v_div < 0 || n_div < 0 || d_n_div < 0) return isl_size_error; ok = is_known_div_not_involving(bset_to_bmap(dom), div, d_v_div, d_n_div); if (ok < 0) return isl_size_error; if (!ok) return n_div; return find_div_involving_only(bmap, bset_to_bmap(dom), div, d_v_div); } /* Copy integer division "div" of "bmap", which is known to only involve * the first "n_shared" variables, to "dom" at position "dom_div". */ static __isl_give isl_basic_set *copy_div(__isl_take isl_basic_set *dom, __isl_keep isl_basic_map *bmap, unsigned div, unsigned n_shared, unsigned dom_div) { isl_vec *v; isl_size total; total = isl_basic_set_dim(dom, isl_dim_all); if (total < 0) return isl_basic_set_free(dom); v = isl_vec_alloc(isl_basic_set_get_ctx(dom), 1 + 1 + total); if (!v) return isl_basic_set_free(dom); isl_seq_cpy(v->el, bmap->div[div], 1 + 1 + n_shared); isl_seq_clr(v->el + 1 + 1 + n_shared, total - n_shared); dom = isl_basic_set_insert_div(dom, dom_div, v); dom = isl_basic_set_add_div_constraints(dom, dom_div); isl_vec_free(v); return dom; } /* Copy the integer divisions of "bmap" that only involve variables in "dom" and * that do not already appear in "dom" to "dom". */ static __isl_give isl_basic_set *copy_divs(__isl_take isl_basic_set *dom, __isl_keep isl_basic_map *bmap) { int i; isl_size dom_n_div, bmap_n_div, total; isl_size v_out; dom_n_div = isl_basic_set_dim(dom, isl_dim_div); bmap_n_div = isl_basic_map_dim(bmap, isl_dim_div); total = isl_basic_map_dim(bmap, isl_dim_all); v_out = isl_basic_map_var_offset(bmap, isl_dim_out); if (dom_n_div < 0 || bmap_n_div < 0 || total < 0 || v_out < 0) return isl_basic_set_free(dom); for (i = 0; i < bmap_n_div; ++i) { isl_bool ok; isl_size pos; ok = is_known_div_not_involving(bmap, i, v_out, total - v_out); if (ok < 0) return isl_basic_set_free(dom); if (!ok) continue; pos = find_div_involving_only(bset_to_bmap(dom), bmap, i, v_out); if (pos < 0) return isl_basic_set_free(dom); if (pos < dom_n_div) continue; dom = copy_div(dom, bmap, i, v_out, dom_n_div++); } return dom; } /* The correspondence between the variables in the main tableau, * the context tableau, and the input map and domain is as follows. * The first n_param and the last n_div variables of the main tableau * form the variables of the context tableau. * In the basic map, these n_param variables correspond to the * parameters and the input dimensions. In the domain, they correspond * to the parameters and the set dimensions. * The n_div variables correspond to the integer divisions in the domain. * To ensure that everything lines up, we may need to copy some of the * integer divisions of the domain to the map. These have to be placed * in the same order as those in the context and they have to be placed * after any other integer divisions that the map may have. * This function performs the required reordering. */ static __isl_give isl_basic_map *align_context_divs( __isl_take isl_basic_map *bmap, __isl_keep isl_basic_set *dom) { int i; int common = 0; int other; isl_size bmap_n_div, dom_n_div; bmap_n_div = isl_basic_map_dim(bmap, isl_dim_div); dom_n_div = isl_basic_set_dim(dom, isl_dim_div); if (bmap_n_div < 0 || dom_n_div < 0) return isl_basic_map_free(bmap); for (i = 0; i < dom_n_div; ++i) { isl_size pos; pos = find_context_div(bmap, dom, i); if (pos < 0) return isl_basic_map_free(bmap); if (pos < bmap_n_div) common++; } other = bmap_n_div - common; if (dom_n_div - common > 0) { bmap = isl_basic_map_cow(bmap); bmap = isl_basic_map_extend(bmap, dom_n_div - common, 0, 0); if (!bmap) return NULL; } for (i = 0; i < dom_n_div; ++i) { isl_size pos = find_context_div(bmap, dom, i); if (pos < 0) bmap = isl_basic_map_free(bmap); if (pos >= bmap_n_div) { pos = isl_basic_map_alloc_div(bmap); if (pos < 0) goto error; isl_int_set_si(bmap->div[pos][0], 0); bmap_n_div++; } if (pos != other + i) bmap = isl_basic_map_swap_div(bmap, pos, other + i); } return bmap; error: isl_basic_map_free(bmap); return NULL; } /* Base case of isl_tab_basic_map_partial_lexopt, after removing * some obvious symmetries. * * We make sure the divs in the domain are properly ordered, * because they will be added one by one in the given order * during the construction of the solution map. * Furthermore, make sure that the known integer divisions * appear before any unknown integer division because the solution * may depend on the known integer divisions, while anything that * depends on any variable starting from the first unknown integer * division is ignored in sol_pma_add. * First copy over any integer divisions from "bmap" that do not * already appear in "dom". This ensures that the tableau * will not be split on the corresponding integer division constraints * since they will be known to hold in "dom". */ static struct isl_sol *basic_map_partial_lexopt_base_sol( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max, struct isl_sol *(*init)(__isl_keep isl_basic_map *bmap, __isl_take isl_basic_set *dom, int track_empty, int max)) { struct isl_tab *tab; struct isl_sol *sol = NULL; struct isl_context *context; dom = copy_divs(dom, bmap); dom = isl_basic_set_sort_divs(dom); bmap = align_context_divs(bmap, dom); sol = init(bmap, dom, !!empty, max); if (!sol) goto error; context = sol->context; if (isl_basic_set_plain_is_empty(context->op->peek_basic_set(context))) /* nothing */; else if (isl_basic_map_plain_is_empty(bmap)) { if (sol->add_empty) sol->add_empty(sol, isl_basic_set_copy(context->op->peek_basic_set(context))); } else { tab = tab_for_lexmin(bmap, context->op->peek_basic_set(context), 1, max); tab = context->op->detect_nonnegative_parameters(context, tab); find_solutions_main(sol, tab); } if (sol->error) goto error; isl_basic_map_free(bmap); return sol; error: sol_free(sol); isl_basic_map_free(bmap); return NULL; } /* Base case of isl_tab_basic_map_partial_lexopt, after removing * some obvious symmetries. * * We call basic_map_partial_lexopt_base_sol and extract the results. */ static __isl_give isl_map *basic_map_partial_lexopt_base( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max) { isl_map *result = NULL; struct isl_sol *sol; struct isl_sol_map *sol_map; sol = basic_map_partial_lexopt_base_sol(bmap, dom, empty, max, &sol_map_init); if (!sol) return NULL; sol_map = (struct isl_sol_map *) sol; result = isl_map_copy(sol_map->map); if (empty) *empty = isl_set_copy(sol_map->empty); sol_free(&sol_map->sol); return result; } /* Return a count of the number of occurrences of the "n" first * variables in the inequality constraints of "bmap". */ static __isl_give int *count_occurrences(__isl_keep isl_basic_map *bmap, int n) { int i, j; isl_ctx *ctx; int *occurrences; if (!bmap) return NULL; ctx = isl_basic_map_get_ctx(bmap); occurrences = isl_calloc_array(ctx, int, n); if (!occurrences) return NULL; for (i = 0; i < bmap->n_ineq; ++i) { for (j = 0; j < n; ++j) { if (!isl_int_is_zero(bmap->ineq[i][1 + j])) occurrences[j]++; } } return occurrences; } /* Do all of the "n" variables with non-zero coefficients in "c" * occur in exactly a single constraint. * "occurrences" is an array of length "n" containing the number * of occurrences of each of the variables in the inequality constraints. */ static int single_occurrence(int n, isl_int *c, int *occurrences) { int i; for (i = 0; i < n; ++i) { if (isl_int_is_zero(c[i])) continue; if (occurrences[i] != 1) return 0; } return 1; } /* Do all of the "n" initial variables that occur in inequality constraint * "ineq" of "bmap" only occur in that constraint? */ static int all_single_occurrence(__isl_keep isl_basic_map *bmap, int ineq, int n) { int i, j; for (i = 0; i < n; ++i) { if (isl_int_is_zero(bmap->ineq[ineq][1 + i])) continue; for (j = 0; j < bmap->n_ineq; ++j) { if (j == ineq) continue; if (!isl_int_is_zero(bmap->ineq[j][1 + i])) return 0; } } return 1; } /* Structure used during detection of parallel constraints. * n_in: number of "input" variables: isl_dim_param + isl_dim_in * n_out: number of "output" variables: isl_dim_out + isl_dim_div * val: the coefficients of the output variables */ struct isl_constraint_equal_info { unsigned n_in; unsigned n_out; isl_int *val; }; /* Check whether the coefficients of the output variables * of the constraint in "entry" are equal to info->val. */ static isl_bool constraint_equal(const void *entry, const void *val) { isl_int **row = (isl_int **)entry; const struct isl_constraint_equal_info *info = val; int eq; eq = isl_seq_eq((*row) + 1 + info->n_in, info->val, info->n_out); return isl_bool_ok(eq); } /* Check whether "bmap" has a pair of constraints that have * the same coefficients for the output variables. * Note that the coefficients of the existentially quantified * variables need to be zero since the existentially quantified * of the result are usually not the same as those of the input. * Furthermore, check that each of the input variables that occur * in those constraints does not occur in any other constraint. * If so, return true and return the row indices of the two constraints * in *first and *second. */ static isl_bool parallel_constraints(__isl_keep isl_basic_map *bmap, int *first, int *second) { int i; isl_ctx *ctx; int *occurrences = NULL; struct isl_hash_table *table = NULL; struct isl_hash_table_entry *entry; struct isl_constraint_equal_info info; isl_size nparam, n_in, n_out, n_div; ctx = isl_basic_map_get_ctx(bmap); table = isl_hash_table_alloc(ctx, bmap->n_ineq); if (!table) goto error; nparam = isl_basic_map_dim(bmap, isl_dim_param); n_in = isl_basic_map_dim(bmap, isl_dim_in); n_out = isl_basic_map_dim(bmap, isl_dim_out); n_div = isl_basic_map_dim(bmap, isl_dim_div); if (nparam < 0 || n_in < 0 || n_out < 0 || n_div < 0) goto error; info.n_in = nparam + n_in; occurrences = count_occurrences(bmap, info.n_in); if (info.n_in && !occurrences) goto error; info.n_out = n_out + n_div; for (i = 0; i < bmap->n_ineq; ++i) { uint32_t hash; info.val = bmap->ineq[i] + 1 + info.n_in; if (!isl_seq_any_non_zero(info.val, n_out)) continue; if (isl_seq_any_non_zero(info.val + n_out, n_div)) continue; if (!single_occurrence(info.n_in, bmap->ineq[i] + 1, occurrences)) continue; hash = isl_seq_get_hash(info.val, info.n_out); entry = isl_hash_table_find(ctx, table, hash, constraint_equal, &info, 1); if (!entry) goto error; if (entry->data) break; entry->data = &bmap->ineq[i]; } if (i < bmap->n_ineq) { *first = ((isl_int **)entry->data) - bmap->ineq; *second = i; } isl_hash_table_free(ctx, table); free(occurrences); return isl_bool_ok(i < bmap->n_ineq); error: isl_hash_table_free(ctx, table); free(occurrences); return isl_bool_error; } /* Given a set of upper bounds in "var", add constraints to "bset" * that make the i-th bound smallest. * * In particular, if there are n bounds b_i, then add the constraints * * b_i <= b_j for j > i * b_i < b_j for j < i */ static __isl_give isl_basic_set *select_minimum(__isl_take isl_basic_set *bset, __isl_keep isl_mat *var, int i) { isl_ctx *ctx; int j, k; ctx = isl_mat_get_ctx(var); for (j = 0; j < var->n_row; ++j) { if (j == i) continue; k = isl_basic_set_alloc_inequality(bset); if (k < 0) goto error; isl_seq_combine(bset->ineq[k], ctx->one, var->row[j], ctx->negone, var->row[i], var->n_col); isl_int_set_si(bset->ineq[k][var->n_col], 0); if (j < i) isl_int_sub_ui(bset->ineq[k][0], bset->ineq[k][0], 1); } bset = isl_basic_set_finalize(bset); return bset; error: isl_basic_set_free(bset); return NULL; } /* Given a set of upper bounds on the last "input" variable m, * construct a set that assigns the minimal upper bound to m, i.e., * construct a set that divides the space into cells where one * of the upper bounds is smaller than all the others and assign * this upper bound to m. * * In particular, if there are n bounds b_i, then the result * consists of n basic sets, each one of the form * * m = b_i * b_i <= b_j for j > i * b_i < b_j for j < i */ static __isl_give isl_set *set_minimum(__isl_take isl_space *space, __isl_take isl_mat *var) { int i, k; isl_basic_set *bset = NULL; isl_set *set = NULL; if (!space || !var) goto error; set = isl_set_alloc_space(isl_space_copy(space), var->n_row, ISL_SET_DISJOINT); for (i = 0; i < var->n_row; ++i) { bset = isl_basic_set_alloc_space(isl_space_copy(space), 0, 1, var->n_row - 1); k = isl_basic_set_alloc_equality(bset); if (k < 0) goto error; isl_seq_cpy(bset->eq[k], var->row[i], var->n_col); isl_int_set_si(bset->eq[k][var->n_col], -1); bset = select_minimum(bset, var, i); set = isl_set_add_basic_set(set, bset); } isl_space_free(space); isl_mat_free(var); return set; error: isl_basic_set_free(bset); isl_set_free(set); isl_space_free(space); isl_mat_free(var); return NULL; } /* Given that the last input variable of "bmap" represents the minimum * of the bounds in "cst", check whether we need to split the domain * based on which bound attains the minimum. * * A split is needed when the minimum appears in an integer division * or in an equality. Otherwise, it is only needed if it appears in * an upper bound that is different from the upper bounds on which it * is defined. */ static isl_bool need_split_basic_map(__isl_keep isl_basic_map *bmap, __isl_keep isl_mat *cst) { int i, j; isl_bool involves; isl_size total; unsigned pos; pos = cst->n_col - 1; total = isl_basic_map_dim(bmap, isl_dim_all); if (total < 0) return isl_bool_error; involves = isl_basic_map_any_div_involves_vars(bmap, pos, 1); if (involves < 0 || involves) return involves; for (i = 0; i < bmap->n_eq; ++i) if (!isl_int_is_zero(bmap->eq[i][1 + pos])) return isl_bool_true; for (i = 0; i < bmap->n_ineq; ++i) { if (isl_int_is_nonneg(bmap->ineq[i][1 + pos])) continue; if (!isl_int_is_negone(bmap->ineq[i][1 + pos])) return isl_bool_true; if (isl_seq_any_non_zero(bmap->ineq[i] + 1 + pos + 1, total - pos - 1)) return isl_bool_true; for (j = 0; j < cst->n_row; ++j) if (isl_seq_eq(bmap->ineq[i], cst->row[j], cst->n_col)) break; if (j >= cst->n_row) return isl_bool_true; } return isl_bool_false; } /* Given that the last set variable of "bset" represents the minimum * of the bounds in "cst", check whether we need to split the domain * based on which bound attains the minimum. * * We simply call need_split_basic_map here. This is safe because * the position of the minimum is computed from "cst" and not * from "bmap". */ static isl_bool need_split_basic_set(__isl_keep isl_basic_set *bset, __isl_keep isl_mat *cst) { return need_split_basic_map(bset_to_bmap(bset), cst); } /* Given that the last set variable of "set" represents the minimum * of the bounds in "cst", check whether we need to split the domain * based on which bound attains the minimum. */ static isl_bool need_split_set(__isl_keep isl_set *set, __isl_keep isl_mat *cst) { int i; for (i = 0; i < set->n; ++i) { isl_bool split; split = need_split_basic_set(set->p[i], cst); if (split < 0 || split) return split; } return isl_bool_false; } /* Given a map of which the last input variable is the minimum * of the bounds in "cst", split each basic set in the set * in pieces where one of the bounds is (strictly) smaller than the others. * This subdivision is given in "min_expr". * The variable is subsequently projected out. * * We only do the split when it is needed. * For example if the last input variable m = min(a,b) and the only * constraints in the given basic set are lower bounds on m, * i.e., l <= m = min(a,b), then we can simply project out m * to obtain l <= a and l <= b, without having to split on whether * m is equal to a or b. */ static __isl_give isl_map *split_domain(__isl_take isl_map *opt, __isl_take isl_set *min_expr, __isl_take isl_mat *cst) { isl_size n_in; int i; isl_space *space; isl_map *res; n_in = isl_map_dim(opt, isl_dim_in); if (n_in < 0 || !min_expr || !cst) goto error; space = isl_map_get_space(opt); space = isl_space_drop_dims(space, isl_dim_in, n_in - 1, 1); res = isl_map_empty(space); for (i = 0; i < opt->n; ++i) { isl_map *map; isl_bool split; map = isl_map_from_basic_map(isl_basic_map_copy(opt->p[i])); split = need_split_basic_map(opt->p[i], cst); if (split < 0) map = isl_map_free(map); else if (split) map = isl_map_intersect_domain(map, isl_set_copy(min_expr)); map = isl_map_remove_dims(map, isl_dim_in, n_in - 1, 1); res = isl_map_union_disjoint(res, map); } isl_map_free(opt); isl_set_free(min_expr); isl_mat_free(cst); return res; error: isl_map_free(opt); isl_set_free(min_expr); isl_mat_free(cst); return NULL; } /* Given a set of which the last set variable is the minimum * of the bounds in "cst", split each basic set in the set * in pieces where one of the bounds is (strictly) smaller than the others. * This subdivision is given in "min_expr". * The variable is subsequently projected out. */ static __isl_give isl_set *split(__isl_take isl_set *empty, __isl_take isl_set *min_expr, __isl_take isl_mat *cst) { isl_map *map; map = isl_map_from_domain(empty); map = split_domain(map, min_expr, cst); empty = isl_map_domain(map); return empty; } static __isl_give isl_map *basic_map_partial_lexopt( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max); /* This function is called from basic_map_partial_lexopt_symm. * The last variable of "bmap" and "dom" corresponds to the minimum * of the bounds in "cst". "map_space" is the space of the original * input relation (of basic_map_partial_lexopt_symm) and "set_space" * is the space of the original domain. * * We recursively call basic_map_partial_lexopt and then plug in * the definition of the minimum in the result. */ static __isl_give isl_map *basic_map_partial_lexopt_symm_core( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max, __isl_take isl_mat *cst, __isl_take isl_space *map_space, __isl_take isl_space *set_space) { isl_map *opt; isl_set *min_expr; min_expr = set_minimum(isl_basic_set_get_space(dom), isl_mat_copy(cst)); opt = basic_map_partial_lexopt(bmap, dom, empty, max); if (empty) { *empty = split(*empty, isl_set_copy(min_expr), isl_mat_copy(cst)); *empty = isl_set_reset_space(*empty, set_space); } opt = split_domain(opt, min_expr, cst); opt = isl_map_reset_space(opt, map_space); return opt; } /* Extract a domain from "bmap" for the purpose of computing * a lexicographic optimum. * * This function is only called when the caller wants to compute a full * lexicographic optimum, i.e., without specifying a domain. In this case, * the caller is not interested in the part of the domain space where * there is no solution and the domain can be initialized to those constraints * of "bmap" that only involve the parameters and the input dimensions. * This relieves the parametric programming engine from detecting those * inequalities and transferring them to the context. More importantly, * it ensures that those inequalities are transferred first and not * intermixed with inequalities that actually split the domain. * * If the caller does not require the absence of existentially quantified * variables in the result (i.e., if ISL_OPT_QE is not set in "flags"), * then the actual domain of "bmap" can be used. This ensures that * the domain does not need to be split at all just to separate out * pieces of the domain that do not have a solution from piece that do. * This domain cannot be used in general because it may involve * (unknown) existentially quantified variables which will then also * appear in the solution. */ static __isl_give isl_basic_set *extract_domain(__isl_keep isl_basic_map *bmap, unsigned flags) { isl_size n_div; isl_size n_out; n_div = isl_basic_map_dim(bmap, isl_dim_div); n_out = isl_basic_map_dim(bmap, isl_dim_out); if (n_div < 0 || n_out < 0) return NULL; bmap = isl_basic_map_copy(bmap); if (ISL_FL_ISSET(flags, ISL_OPT_QE)) { bmap = isl_basic_map_drop_constraints_involving_dims(bmap, isl_dim_div, 0, n_div); bmap = isl_basic_map_drop_constraints_involving_dims(bmap, isl_dim_out, 0, n_out); } return isl_basic_map_domain(bmap); } #undef TYPE #define TYPE isl_map #undef SUFFIX #define SUFFIX #define isl_map_pullback_multi_aff isl_map_preimage_domain_multi_aff #include "isl_tab_lexopt_templ.c" /* Extract the subsequence of the sample value of "tab" * starting at "pos" and of length "len". */ static __isl_give isl_vec *extract_sample_sequence(struct isl_tab *tab, int pos, int len) { int i; isl_ctx *ctx; isl_vec *v; ctx = isl_tab_get_ctx(tab); v = isl_vec_alloc(ctx, len); if (!v) return NULL; for (i = 0; i < len; ++i) { if (!tab->var[pos + i].is_row) { isl_int_set_si(v->el[i], 0); } else { int row; row = tab->var[pos + i].index; isl_int_divexact(v->el[i], tab->mat->row[row][1], tab->mat->row[row][0]); } } return v; } /* Check if the sequence of variables starting at "pos" * represents a trivial solution according to "trivial". * That is, is the result of applying "trivial" to this sequence * equal to the zero vector? */ static isl_bool region_is_trivial(struct isl_tab *tab, int pos, __isl_keep isl_mat *trivial) { isl_size n, len; isl_vec *v; isl_bool is_trivial; n = isl_mat_rows(trivial); if (n < 0) return isl_bool_error; if (n == 0) return isl_bool_false; len = isl_mat_cols(trivial); if (len < 0) return isl_bool_error; v = extract_sample_sequence(tab, pos, len); v = isl_mat_vec_product(isl_mat_copy(trivial), v); is_trivial = isl_vec_is_zero(v); isl_vec_free(v); return is_trivial; } /* Global internal data for isl_tab_basic_set_non_trivial_lexmin. * * "n_op" is the number of initial coordinates to optimize, * as passed to isl_tab_basic_set_non_trivial_lexmin. * "region" is the "n_region"-sized array of regions passed * to isl_tab_basic_set_non_trivial_lexmin. * * "tab" is the tableau that corresponds to the ILP problem. * "local" is an array of local data structure, one for each * (potential) level of the backtracking procedure of * isl_tab_basic_set_non_trivial_lexmin. * "v" is a pre-allocated vector that can be used for adding * constraints to the tableau. * * "sol" contains the best solution found so far. * It is initialized to a vector of size zero. */ struct isl_lexmin_data { int n_op; int n_region; struct isl_trivial_region *region; struct isl_tab *tab; struct isl_local_region *local; isl_vec *v; isl_vec *sol; }; /* Return the index of the first trivial region, "n_region" if all regions * are non-trivial or -1 in case of error. */ static int first_trivial_region(struct isl_lexmin_data *data) { int i; for (i = 0; i < data->n_region; ++i) { isl_bool trivial; trivial = region_is_trivial(data->tab, data->region[i].pos, data->region[i].trivial); if (trivial < 0) return -1; if (trivial) return i; } return data->n_region; } /* Check if the solution is optimal, i.e., whether the first * n_op entries are zero. */ static int is_optimal(__isl_keep isl_vec *sol, int n_op) { int i; for (i = 0; i < n_op; ++i) if (!isl_int_is_zero(sol->el[1 + i])) return 0; return 1; } /* Add constraints to "tab" that ensure that any solution is significantly * better than that represented by "sol". That is, find the first * relevant (within first n_op) non-zero coefficient and force it (along * with all previous coefficients) to be zero. * If the solution is already optimal (all relevant coefficients are zero), * then just mark the table as empty. * "n_zero" is the number of coefficients that have been forced zero * by previous calls to this function at the same level. * Return the updated number of forced zero coefficients or -1 on error. * * This function assumes that at least 2 * (n_op - n_zero) more rows and * at least 2 * (n_op - n_zero) more elements in the constraint array * are available in the tableau. */ static int force_better_solution(struct isl_tab *tab, __isl_keep isl_vec *sol, int n_op, int n_zero) { int i, n; isl_ctx *ctx; isl_vec *v = NULL; if (!sol) return -1; for (i = n_zero; i < n_op; ++i) if (!isl_int_is_zero(sol->el[1 + i])) break; if (i == n_op) { if (isl_tab_mark_empty(tab) < 0) return -1; return n_op; } ctx = isl_vec_get_ctx(sol); v = isl_vec_alloc(ctx, 1 + tab->n_var); if (!v) return -1; n = i + 1; for (; i >= n_zero; --i) { v = isl_vec_clr(v); isl_int_set_si(v->el[1 + i], -1); if (add_lexmin_eq(tab, v->el) < 0) goto error; } isl_vec_free(v); return n; error: isl_vec_free(v); return -1; } /* Fix triviality direction "dir" of the given region to zero. * * This function assumes that at least two more rows and at least * two more elements in the constraint array are available in the tableau. */ static isl_stat fix_zero(struct isl_tab *tab, struct isl_trivial_region *region, int dir, struct isl_lexmin_data *data) { isl_size len; data->v = isl_vec_clr(data->v); if (!data->v) return isl_stat_error; len = isl_mat_cols(region->trivial); if (len < 0) return isl_stat_error; isl_seq_cpy(data->v->el + 1 + region->pos, region->trivial->row[dir], len); if (add_lexmin_eq(tab, data->v->el) < 0) return isl_stat_error; return isl_stat_ok; } /* This function selects case "side" for non-triviality region "region", * assuming all the equality constraints have been imposed already. * In particular, the triviality direction side/2 is made positive * if side is even and made negative if side is odd. * * This function assumes that at least one more row and at least * one more element in the constraint array are available in the tableau. */ static struct isl_tab *pos_neg(struct isl_tab *tab, struct isl_trivial_region *region, int side, struct isl_lexmin_data *data) { isl_size len; data->v = isl_vec_clr(data->v); if (!data->v) goto error; isl_int_set_si(data->v->el[0], -1); len = isl_mat_cols(region->trivial); if (len < 0) goto error; if (side % 2 == 0) isl_seq_cpy(data->v->el + 1 + region->pos, region->trivial->row[side / 2], len); else isl_seq_neg(data->v->el + 1 + region->pos, region->trivial->row[side / 2], len); return add_lexmin_ineq(tab, data->v->el); error: isl_tab_free(tab); return NULL; } /* Local data at each level of the backtracking procedure of * isl_tab_basic_set_non_trivial_lexmin. * * "update" is set if a solution has been found in the current case * of this level, such that a better solution needs to be enforced * in the next case. * "n_zero" is the number of initial coordinates that have already * been forced to be zero at this level. * "region" is the non-triviality region considered at this level. * "side" is the index of the current case at this level. * "n" is the number of triviality directions. * "snap" is a snapshot of the tableau holding a state that needs * to be satisfied by all subsequent cases. */ struct isl_local_region { int update; int n_zero; int region; int side; int n; struct isl_tab_undo *snap; }; /* Initialize the global data structure "data" used while solving * the ILP problem "bset". */ static isl_stat init_lexmin_data(struct isl_lexmin_data *data, __isl_keep isl_basic_set *bset) { isl_ctx *ctx; ctx = isl_basic_set_get_ctx(bset); data->tab = tab_for_lexmin(bset, NULL, 0, 0); if (!data->tab) return isl_stat_error; data->v = isl_vec_alloc(ctx, 1 + data->tab->n_var); if (!data->v) return isl_stat_error; data->local = isl_calloc_array(ctx, struct isl_local_region, data->n_region); if (data->n_region && !data->local) return isl_stat_error; data->sol = isl_vec_alloc(ctx, 0); return isl_stat_ok; } /* Mark all outer levels as requiring a better solution * in the next cases. */ static void update_outer_levels(struct isl_lexmin_data *data, int level) { int i; for (i = 0; i < level; ++i) data->local[i].update = 1; } /* Initialize "local" to refer to region "region" and * to initiate processing at this level. */ static isl_stat init_local_region(struct isl_local_region *local, int region, struct isl_lexmin_data *data) { isl_size n = isl_mat_rows(data->region[region].trivial); if (n < 0) return isl_stat_error; local->n = n; local->region = region; local->side = 0; local->update = 0; local->n_zero = 0; return isl_stat_ok; } /* What to do next after entering a level of the backtracking procedure. * * error: some error has occurred; abort * done: an optimal solution has been found; stop search * backtrack: backtrack to the previous level * handle: add the constraints for the current level and * move to the next level */ enum isl_next { isl_next_error = -1, isl_next_done, isl_next_backtrack, isl_next_handle, }; /* Have all cases of the current region been considered? * If there are n directions, then there are 2n cases. * * The constraints in the current tableau are imposed * in all subsequent cases. This means that if the current * tableau is empty, then none of those cases should be considered * anymore and all cases have effectively been considered. */ static int finished_all_cases(struct isl_local_region *local, struct isl_lexmin_data *data) { if (data->tab->empty) return 1; return local->side >= 2 * local->n; } /* Enter level "level" of the backtracking search and figure out * what to do next. "init" is set if the level was entered * from a higher level and needs to be initialized. * Otherwise, the level is entered as a result of backtracking and * the tableau needs to be restored to a position that can * be used for the next case at this level. * The snapshot is assumed to have been saved in the previous case, * before the constraints specific to that case were added. * * In the initialization case, the local region is initialized * to point to the first violated region. * If the constraints of all regions are satisfied by the current * sample of the tableau, then tell the caller to continue looking * for a better solution or to stop searching if an optimal solution * has been found. * * If the tableau is empty or if all cases at the current level * have been considered, then the caller needs to backtrack as well. */ static enum isl_next enter_level(int level, int init, struct isl_lexmin_data *data) { struct isl_local_region *local = &data->local[level]; if (init) { int r; data->tab = cut_to_integer_lexmin(data->tab, CUT_ONE); if (!data->tab) return isl_next_error; if (data->tab->empty) return isl_next_backtrack; r = first_trivial_region(data); if (r < 0) return isl_next_error; if (r == data->n_region) { update_outer_levels(data, level); isl_vec_free(data->sol); data->sol = isl_tab_get_sample_value(data->tab); if (!data->sol) return isl_next_error; if (is_optimal(data->sol, data->n_op)) return isl_next_done; return isl_next_backtrack; } if (level >= data->n_region) isl_die(isl_vec_get_ctx(data->v), isl_error_internal, "nesting level too deep", return isl_next_error); if (init_local_region(local, r, data) < 0) return isl_next_error; if (isl_tab_extend_cons(data->tab, 2 * local->n + 2 * data->n_op) < 0) return isl_next_error; } else { if (isl_tab_rollback(data->tab, local->snap) < 0) return isl_next_error; } if (finished_all_cases(local, data)) return isl_next_backtrack; return isl_next_handle; } /* If a solution has been found in the previous case at this level * (marked by local->update being set), then add constraints * that enforce a better solution in the present and all following cases. * The constraints only need to be imposed once because they are * included in the snapshot (taken in pick_side) that will be used in * subsequent cases. */ static isl_stat better_next_side(struct isl_local_region *local, struct isl_lexmin_data *data) { if (!local->update) return isl_stat_ok; local->n_zero = force_better_solution(data->tab, data->sol, data->n_op, local->n_zero); if (local->n_zero < 0) return isl_stat_error; local->update = 0; return isl_stat_ok; } /* Add constraints to data->tab that select the current case (local->side) * at the current level. * * If the linear combinations v should not be zero, then the cases are * v_0 >= 1 * v_0 <= -1 * v_0 = 0 and v_1 >= 1 * v_0 = 0 and v_1 <= -1 * v_0 = 0 and v_1 = 0 and v_2 >= 1 * v_0 = 0 and v_1 = 0 and v_2 <= -1 * ... * in this order. * * A snapshot is taken after the equality constraint (if any) has been added * such that the next case can start off from this position. * The rollback to this position is performed in enter_level. */ static isl_stat pick_side(struct isl_local_region *local, struct isl_lexmin_data *data) { struct isl_trivial_region *region; int side, base; region = &data->region[local->region]; side = local->side; base = 2 * (side/2); if (side == base && base >= 2 && fix_zero(data->tab, region, base / 2 - 1, data) < 0) return isl_stat_error; local->snap = isl_tab_snap(data->tab); if (isl_tab_push_basis(data->tab) < 0) return isl_stat_error; data->tab = pos_neg(data->tab, region, side, data); if (!data->tab) return isl_stat_error; return isl_stat_ok; } /* Free the memory associated to "data". */ static void clear_lexmin_data(struct isl_lexmin_data *data) { free(data->local); isl_vec_free(data->v); isl_tab_free(data->tab); } /* Return the lexicographically smallest non-trivial solution of the * given ILP problem. * * All variables are assumed to be non-negative. * * n_op is the number of initial coordinates to optimize. * That is, once a solution has been found, we will only continue looking * for solutions that result in significantly better values for those * initial coordinates. That is, we only continue looking for solutions * that increase the number of initial zeros in this sequence. * * A solution is non-trivial, if it is non-trivial on each of the * specified regions. Each region represents a sequence of * triviality directions on a sequence of variables that starts * at a given position. A solution is non-trivial on such a region if * at least one of the triviality directions is non-zero * on that sequence of variables. * * Whenever a conflict is encountered, all constraints involved are * reported to the caller through a call to "conflict". * * We perform a simple branch-and-bound backtracking search. * Each level in the search represents an initially trivial region * that is forced to be non-trivial. * At each level we consider 2 * n cases, where n * is the number of triviality directions. * In terms of those n directions v_i, we consider the cases * v_0 >= 1 * v_0 <= -1 * v_0 = 0 and v_1 >= 1 * v_0 = 0 and v_1 <= -1 * v_0 = 0 and v_1 = 0 and v_2 >= 1 * v_0 = 0 and v_1 = 0 and v_2 <= -1 * ... * in this order. */ __isl_give isl_vec *isl_tab_basic_set_non_trivial_lexmin( __isl_take isl_basic_set *bset, int n_op, int n_region, struct isl_trivial_region *region, int (*conflict)(int con, void *user), void *user) { struct isl_lexmin_data data = { n_op, n_region, region }; int level, init; if (!bset) return NULL; if (init_lexmin_data(&data, bset) < 0) goto error; data.tab->conflict = conflict; data.tab->conflict_user = user; level = 0; init = 1; while (level >= 0) { enum isl_next next; struct isl_local_region *local = &data.local[level]; next = enter_level(level, init, &data); if (next < 0) goto error; if (next == isl_next_done) break; if (next == isl_next_backtrack) { level--; init = 0; continue; } if (better_next_side(local, &data) < 0) goto error; if (pick_side(local, &data) < 0) goto error; local->side++; level++; init = 1; } clear_lexmin_data(&data); isl_basic_set_free(bset); return data.sol; error: clear_lexmin_data(&data); isl_basic_set_free(bset); isl_vec_free(data.sol); return NULL; } /* Wrapper for a tableau that is used for computing * the lexicographically smallest rational point of a non-negative set. * This point is represented by the sample value of "tab", * unless "tab" is empty. */ struct isl_tab_lexmin { isl_ctx *ctx; struct isl_tab *tab; }; /* Free "tl" and return NULL. */ __isl_null isl_tab_lexmin *isl_tab_lexmin_free(__isl_take isl_tab_lexmin *tl) { if (!tl) return NULL; isl_ctx_deref(tl->ctx); isl_tab_free(tl->tab); free(tl); return NULL; } /* Construct an isl_tab_lexmin for computing * the lexicographically smallest rational point in "bset", * assuming that all variables are non-negative. */ __isl_give isl_tab_lexmin *isl_tab_lexmin_from_basic_set( __isl_take isl_basic_set *bset) { isl_ctx *ctx; isl_tab_lexmin *tl; if (!bset) return NULL; ctx = isl_basic_set_get_ctx(bset); tl = isl_calloc_type(ctx, struct isl_tab_lexmin); if (!tl) goto error; tl->ctx = ctx; isl_ctx_ref(ctx); tl->tab = tab_for_lexmin(bset, NULL, 0, 0); isl_basic_set_free(bset); if (!tl->tab) return isl_tab_lexmin_free(tl); return tl; error: isl_basic_set_free(bset); isl_tab_lexmin_free(tl); return NULL; } /* Return the dimension of the set represented by "tl". */ int isl_tab_lexmin_dim(__isl_keep isl_tab_lexmin *tl) { return tl ? tl->tab->n_var : -1; } /* Add the equality with coefficients "eq" to "tl", updating the optimal * solution if needed. * The equality is added as two opposite inequality constraints. */ __isl_give isl_tab_lexmin *isl_tab_lexmin_add_eq(__isl_take isl_tab_lexmin *tl, isl_int *eq) { unsigned n_var; if (!tl || !eq) return isl_tab_lexmin_free(tl); if (isl_tab_extend_cons(tl->tab, 2) < 0) return isl_tab_lexmin_free(tl); n_var = tl->tab->n_var; isl_seq_neg(eq, eq, 1 + n_var); tl->tab = add_lexmin_ineq(tl->tab, eq); isl_seq_neg(eq, eq, 1 + n_var); tl->tab = add_lexmin_ineq(tl->tab, eq); if (!tl->tab) return isl_tab_lexmin_free(tl); return tl; } /* Add cuts to "tl" until the sample value reaches an integer value or * until the result becomes empty. */ __isl_give isl_tab_lexmin *isl_tab_lexmin_cut_to_integer( __isl_take isl_tab_lexmin *tl) { if (!tl) return NULL; tl->tab = cut_to_integer_lexmin(tl->tab, CUT_ONE); if (!tl->tab) return isl_tab_lexmin_free(tl); return tl; } /* Return the lexicographically smallest rational point in the basic set * from which "tl" was constructed. * If the original input was empty, then return a zero-length vector. */ __isl_give isl_vec *isl_tab_lexmin_get_solution(__isl_keep isl_tab_lexmin *tl) { if (!tl) return NULL; if (tl->tab->empty) return isl_vec_alloc(tl->ctx, 0); else return isl_tab_get_sample_value(tl->tab); } struct isl_sol_pma { struct isl_sol sol; isl_pw_multi_aff *pma; isl_set *empty; }; static void sol_pma_free(struct isl_sol *sol) { struct isl_sol_pma *sol_pma = (struct isl_sol_pma *) sol; isl_pw_multi_aff_free(sol_pma->pma); isl_set_free(sol_pma->empty); } /* This function is called for parts of the context where there is * no solution, with "bset" corresponding to the context tableau. * Simply add the basic set to the set "empty". */ static void sol_pma_add_empty(struct isl_sol_pma *sol, __isl_take isl_basic_set *bset) { if (!bset || !sol->empty) goto error; sol->empty = isl_set_grow(sol->empty, 1); bset = isl_basic_set_simplify(bset); bset = isl_basic_set_finalize(bset); sol->empty = isl_set_add_basic_set(sol->empty, bset); if (!sol->empty) sol->sol.error = 1; return; error: isl_basic_set_free(bset); sol->sol.error = 1; } /* Given a basic set "dom" that represents the context and a tuple of * affine expressions "maff" defined over this domain, construct * an isl_pw_multi_aff with a single cell corresponding to "dom" and * the affine expressions in "maff". */ static void sol_pma_add(struct isl_sol_pma *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *maff) { isl_pw_multi_aff *pma; dom = isl_basic_set_simplify(dom); dom = isl_basic_set_finalize(dom); pma = isl_pw_multi_aff_alloc(isl_set_from_basic_set(dom), maff); sol->pma = isl_pw_multi_aff_add_disjoint(sol->pma, pma); if (!sol->pma) sol->sol.error = 1; } static void sol_pma_add_empty_wrap(struct isl_sol *sol, __isl_take isl_basic_set *bset) { sol_pma_add_empty((struct isl_sol_pma *)sol, bset); } static void sol_pma_add_wrap(struct isl_sol *sol, __isl_take isl_basic_set *dom, __isl_take isl_multi_aff *ma) { sol_pma_add((struct isl_sol_pma *)sol, dom, ma); } /* Construct an isl_sol_pma structure for accumulating the solution. * If track_empty is set, then we also keep track of the parts * of the context where there is no solution. * If max is set, then we are solving a maximization, rather than * a minimization problem, which means that the variables in the * tableau have value "M - x" rather than "M + x". */ static struct isl_sol *sol_pma_init(__isl_keep isl_basic_map *bmap, __isl_take isl_basic_set *dom, int track_empty, int max) { struct isl_sol_pma *sol_pma = NULL; isl_space *space; if (!bmap) goto error; sol_pma = isl_calloc_type(bmap->ctx, struct isl_sol_pma); if (!sol_pma) goto error; sol_pma->sol.free = &sol_pma_free; if (sol_init(&sol_pma->sol, bmap, dom, max) < 0) goto error; sol_pma->sol.add = &sol_pma_add_wrap; sol_pma->sol.add_empty = track_empty ? &sol_pma_add_empty_wrap : NULL; space = isl_space_copy(sol_pma->sol.space); sol_pma->pma = isl_pw_multi_aff_empty(space); if (!sol_pma->pma) goto error; if (track_empty) { sol_pma->empty = isl_set_alloc_space(isl_basic_set_get_space(dom), 1, ISL_SET_DISJOINT); if (!sol_pma->empty) goto error; } isl_basic_set_free(dom); return &sol_pma->sol; error: isl_basic_set_free(dom); sol_free(&sol_pma->sol); return NULL; } /* Base case of isl_tab_basic_map_partial_lexopt, after removing * some obvious symmetries. * * We call basic_map_partial_lexopt_base_sol and extract the results. */ static __isl_give isl_pw_multi_aff *basic_map_partial_lexopt_base_pw_multi_aff( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max) { isl_pw_multi_aff *result = NULL; struct isl_sol *sol; struct isl_sol_pma *sol_pma; sol = basic_map_partial_lexopt_base_sol(bmap, dom, empty, max, &sol_pma_init); if (!sol) return NULL; sol_pma = (struct isl_sol_pma *) sol; result = isl_pw_multi_aff_copy(sol_pma->pma); if (empty) *empty = isl_set_copy(sol_pma->empty); sol_free(&sol_pma->sol); return result; } /* Given that the last input variable of "maff" represents the minimum * of some bounds, check whether we need to plug in the expression * of the minimum. * * In particular, check if the last input variable appears in any * of the expressions in "maff". */ static isl_bool need_substitution(__isl_keep isl_multi_aff *maff) { int i; isl_size n_in; unsigned pos; n_in = isl_multi_aff_dim(maff, isl_dim_in); if (n_in < 0) return isl_bool_error; pos = n_in - 1; for (i = 0; i < maff->n; ++i) { isl_bool involves; involves = isl_aff_involves_dims(maff->u.p[i], isl_dim_in, pos, 1); if (involves < 0 || involves) return involves; } return isl_bool_false; } /* Given a set of upper bounds on the last "input" variable m, * construct a piecewise affine expression that selects * the minimal upper bound to m, i.e., * divide the space into cells where one * of the upper bounds is smaller than all the others and select * this upper bound on that cell. * * In particular, if there are n bounds b_i, then the result * consists of n cell, each one of the form * * b_i <= b_j for j > i * b_i < b_j for j < i * * The affine expression on this cell is * * b_i */ static __isl_give isl_pw_aff *set_minimum_pa(__isl_take isl_space *space, __isl_take isl_mat *var) { int i; isl_aff *aff = NULL; isl_basic_set *bset = NULL; isl_pw_aff *paff = NULL; isl_space *pw_space; isl_local_space *ls = NULL; if (!space || !var) goto error; ls = isl_local_space_from_space(isl_space_copy(space)); pw_space = isl_space_copy(space); pw_space = isl_space_from_domain(pw_space); pw_space = isl_space_add_dims(pw_space, isl_dim_out, 1); paff = isl_pw_aff_alloc_size(pw_space, var->n_row); for (i = 0; i < var->n_row; ++i) { isl_pw_aff *paff_i; aff = isl_aff_alloc(isl_local_space_copy(ls)); bset = isl_basic_set_alloc_space(isl_space_copy(space), 0, 0, var->n_row - 1); if (!aff || !bset) goto error; isl_int_set_si(aff->v->el[0], 1); isl_seq_cpy(aff->v->el + 1, var->row[i], var->n_col); isl_int_set_si(aff->v->el[1 + var->n_col], 0); bset = select_minimum(bset, var, i); paff_i = isl_pw_aff_alloc(isl_set_from_basic_set(bset), aff); paff = isl_pw_aff_add_disjoint(paff, paff_i); } isl_local_space_free(ls); isl_space_free(space); isl_mat_free(var); return paff; error: isl_aff_free(aff); isl_basic_set_free(bset); isl_pw_aff_free(paff); isl_local_space_free(ls); isl_space_free(space); isl_mat_free(var); return NULL; } /* Given a piecewise multi-affine expression of which the last input variable * is the minimum of the bounds in "cst", plug in the value of the minimum. * This minimum expression is given in "min_expr_pa". * The set "min_expr" contains the same information, but in the form of a set. * The variable is subsequently projected out. * * The implementation is similar to those of "split" and "split_domain". * If the variable appears in a given expression, then minimum expression * is plugged in. Otherwise, if the variable appears in the constraints * and a split is required, then the domain is split. Otherwise, no split * is performed. */ static __isl_give isl_pw_multi_aff *split_domain_pma( __isl_take isl_pw_multi_aff *opt, __isl_take isl_pw_aff *min_expr_pa, __isl_take isl_set *min_expr, __isl_take isl_mat *cst) { isl_size n_in; int i; isl_space *space; isl_pw_multi_aff *res; if (!opt || !min_expr || !cst) goto error; n_in = isl_pw_multi_aff_dim(opt, isl_dim_in); if (n_in < 0) goto error; space = isl_pw_multi_aff_get_space(opt); space = isl_space_drop_dims(space, isl_dim_in, n_in - 1, 1); res = isl_pw_multi_aff_empty(space); for (i = 0; i < opt->n; ++i) { isl_bool subs; isl_pw_multi_aff *pma; pma = isl_pw_multi_aff_alloc(isl_set_copy(opt->p[i].set), isl_multi_aff_copy(opt->p[i].maff)); subs = need_substitution(opt->p[i].maff); if (subs < 0) { pma = isl_pw_multi_aff_free(pma); } else if (subs) { pma = isl_pw_multi_aff_substitute(pma, n_in - 1, min_expr_pa); } else { isl_bool split; split = need_split_set(opt->p[i].set, cst); if (split < 0) pma = isl_pw_multi_aff_free(pma); else if (split) pma = isl_pw_multi_aff_intersect_domain(pma, isl_set_copy(min_expr)); } pma = isl_pw_multi_aff_project_out(pma, isl_dim_in, n_in - 1, 1); res = isl_pw_multi_aff_add_disjoint(res, pma); } isl_pw_multi_aff_free(opt); isl_pw_aff_free(min_expr_pa); isl_set_free(min_expr); isl_mat_free(cst); return res; error: isl_pw_multi_aff_free(opt); isl_pw_aff_free(min_expr_pa); isl_set_free(min_expr); isl_mat_free(cst); return NULL; } static __isl_give isl_pw_multi_aff *basic_map_partial_lexopt_pw_multi_aff( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max); /* This function is called from basic_map_partial_lexopt_symm. * The last variable of "bmap" and "dom" corresponds to the minimum * of the bounds in "cst". "map_space" is the space of the original * input relation (of basic_map_partial_lexopt_symm) and "set_space" * is the space of the original domain. * * We recursively call basic_map_partial_lexopt and then plug in * the definition of the minimum in the result. */ static __isl_give isl_pw_multi_aff * basic_map_partial_lexopt_symm_core_pw_multi_aff( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max, __isl_take isl_mat *cst, __isl_take isl_space *map_space, __isl_take isl_space *set_space) { isl_pw_multi_aff *opt; isl_pw_aff *min_expr_pa; isl_set *min_expr; min_expr = set_minimum(isl_basic_set_get_space(dom), isl_mat_copy(cst)); min_expr_pa = set_minimum_pa(isl_basic_set_get_space(dom), isl_mat_copy(cst)); opt = basic_map_partial_lexopt_pw_multi_aff(bmap, dom, empty, max); if (empty) { *empty = split(*empty, isl_set_copy(min_expr), isl_mat_copy(cst)); *empty = isl_set_reset_space(*empty, set_space); } opt = split_domain_pma(opt, min_expr_pa, min_expr, cst); opt = isl_pw_multi_aff_reset_space(opt, map_space); return opt; } #undef TYPE #define TYPE isl_pw_multi_aff #undef SUFFIX #define SUFFIX _pw_multi_aff #include "isl_tab_lexopt_templ.c" isl-0.28/isl_ctx_private.h0000664000175000017500000000206615072740040014675 0ustar00skimoskimo#include #include /* "error" stores the last error that has occurred. * It is reset to isl_error_none by isl_ctx_reset_error. * "error_msg" stores the error message of the last error, * while "error_file" and "error_line" specify where the last error occurred. * "error_msg" and "error_file" always point to statically allocated * strings (if not NULL). */ struct isl_ctx { int ref; struct isl_stats *stats; int opt_allocated; struct isl_options *opt; void *user_opt; struct isl_args *user_args; isl_int zero; isl_int one; isl_int two; isl_int negone; isl_int normalize_gcd; int n_cached; int n_miss; struct isl_blk cache[ISL_BLK_CACHE_SIZE]; struct isl_hash_table id_table; enum isl_error error; const char *error_msg; const char *error_file; int error_line; int abort; unsigned long operations; unsigned long max_operations; }; int isl_ctx_next_operation(isl_ctx *ctx); void isl_ctx_set_full_error(isl_ctx *ctx, enum isl_error error, const char *msg, const char *file, int line); isl-0.28/opt_type.h0000664000175000017500000000100115072740040013325 0ustar00skimoskimo#define NO_LOC #ifdef HAS_TYPE #define OPT_TYPE_PARAM , enum isl_fold type #define OPT_TYPE_PARAM_FIRST enum isl_fold type, #define OPT_TYPE_ARG(loc) , loc type #define OPT_TYPE_ARG_FIRST(loc) loc type, #define OPT_SET_TYPE(loc,val) loc type = (val); #define OPT_EQUAL_TYPES(loc1, loc2) ((loc1 type) == (loc2 type)) #else #define OPT_TYPE_PARAM #define OPT_TYPE_PARAM_FIRST #define OPT_TYPE_ARG(loc) #define OPT_TYPE_ARG_FIRST(loc) #define OPT_SET_TYPE(loc,val) #define OPT_EQUAL_TYPES(loc1, loc2) 1 #endif isl-0.28/mp_get_memory_functions.c0000664000175000017500000000056515072740040016426 0ustar00skimoskimo#include void mp_get_memory_functions( void *(**alloc_func_ptr) (size_t), void *(**realloc_func_ptr) (void *, size_t, size_t), void (**free_func_ptr) (void *, size_t)) { if (alloc_func_ptr) *alloc_func_ptr = __gmp_allocate_func; if (realloc_func_ptr) *realloc_func_ptr = __gmp_reallocate_func; if (free_func_ptr) *free_func_ptr = __gmp_free_func; } isl-0.28/isl_list_read_yaml_templ.c0000664000175000017500000000153315072740040016527 0ustar00skimoskimo/* * Copyright 2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include /* Read a sequence of EL objects and return them as a list. */ static __isl_give LIST(EL) *FN(isl_stream_yaml_read,LIST(EL_BASE))( isl_stream *s) { isl_ctx *ctx; LIST(EL) *list; isl_bool more; ctx = isl_stream_get_ctx(s); if (isl_stream_yaml_read_start_sequence(s) < 0) return NULL; list = FN(LIST(EL),alloc)(ctx, 0); while ((more = isl_stream_yaml_next(s)) == isl_bool_true) { EL *el; el = FN(isl_stream_read,EL_BASE)(s); list = FN(LIST(EL),add)(list, el); } if (more < 0 || isl_stream_yaml_read_end_sequence(s) < 0) return FN(LIST(EL),free)(list); return list; } isl-0.28/isl_multi_un_op_templ.c0000664000175000017500000000232415072740040016070 0ustar00skimoskimo/* * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include /* Data structure that specifies how isl_multi_*_un_op should * modify its input. * * If "fn_space" is set, then it is applied to the space. * * "fn_el" is applied to each base expression. */ S(MULTI(BASE),un_op_control) { __isl_give isl_space *(*fn_space)(__isl_take isl_space *space); __isl_give EL *(*fn_el)(__isl_take EL *el); }; /* Modify "multi" based on "control". */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),un_op)( __isl_take MULTI(BASE) *multi, S(MULTI(BASE),un_op_control) *control) { int i; isl_size n; isl_space *space; n = FN(MULTI(BASE),size)(multi); if (n < 0) return FN(MULTI(BASE),free)(multi); for (i = 0; i < n; ++i) { EL *el; el = FN(MULTI(BASE),take_at)(multi, i); el = control->fn_el(el); multi = FN(MULTI(BASE),restore_at)(multi, i, el); } if (!control->fn_space) return multi; space = FN(MULTI(BASE),take_space)(multi); space = control->fn_space(space); multi = FN(MULTI(BASE),restore_space)(multi, space); return multi; } isl-0.28/isl_pw_add_constant_templ.c0000664000175000017500000000160315072740040016704 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include #undef VAL #define VAL CAT(isl_,VAL_BASE) /* Add "v" to the constant term of "pw" over its entire definition domain. */ __isl_give PW *FN(FN(PW,add_constant),VAL_BASE)(__isl_take PW *pw, __isl_take VAL *v) { isl_bool zero; isl_size n; int i; zero = FN(VAL,is_zero)(v); n = FN(PW,n_piece)(pw); if (zero < 0 || n < 0) goto error; if (zero || n == 0) { FN(VAL,free)(v); return pw; } for (i = 0; i < n; ++i) { EL *el; el = FN(PW,take_base_at)(pw, i); el = FN(FN(EL,add_constant),VAL_BASE)(el, FN(VAL,copy)(v)); pw = FN(PW,restore_base_at)(pw, i, el); } FN(VAL,free)(v); return pw; error: FN(PW,free)(pw); FN(VAL,free)(v); return NULL; } isl-0.28/polyhedron_detect_equalities.c0000664000175000017500000000131415072740040017424 0ustar00skimoskimo/* * Copyright 2008-2009 Katholieke Universiteit Leuven * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */ #include int main(int argc, char **argv) { struct isl_ctx *ctx = isl_ctx_alloc(); struct isl_basic_set *bset; isl_printer *p; bset = isl_basic_set_read_from_file(ctx, stdin); bset = isl_basic_set_detect_equalities(bset); p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, ISL_FORMAT_POLYLIB); p = isl_printer_print_basic_set(p, bset); isl_printer_free(p); isl_basic_set_free(bset); isl_ctx_free(ctx); return 0; } isl-0.28/check_reparse_templ.c0000664000175000017500000000134115072740040015463 0ustar00skimoskimo#define xCAT(A,B) A ## B #define CAT(A,B) xCAT(A,B) #undef TYPE #define TYPE CAT(isl_,BASE) #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) /* Check that printing "obj" and parsing the output results * in the same expression. */ static isl_stat FN(check_reparse,BASE)(isl_ctx *ctx, __isl_take TYPE *obj) { char *str; isl_bool equal; TYPE *obj2; str = FN(TYPE,to_str)(obj); obj2 = FN(TYPE,read_from_str)(ctx, str); free(str); equal = FN(TYPE,plain_is_equal)(obj, obj2); FN(TYPE,free)(obj); FN(TYPE,free)(obj2); if (equal < 0) return isl_stat_error; if (!equal) isl_die(ctx, isl_error_unknown, "parsed function not equal to original", return isl_stat_error); return isl_stat_ok; } isl-0.28/print_templ_yaml.c0000664000175000017500000000151215072740040015043 0ustar00skimoskimo#define xCAT(A,B) A ## B #define CAT(A,B) xCAT(A,B) #undef TYPE #define TYPE CAT(isl_,BASE) #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) void FN(TYPE,dump)(__isl_keep TYPE *obj) { isl_printer *p; if (!obj) return; p = isl_printer_to_file(FN(TYPE,get_ctx)(obj), stderr); p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_BLOCK); p = FN(isl_printer_print,BASE)(p, obj); isl_printer_free(p); } /* Return a string representation of "obj". * Print the object in flow format. */ __isl_give char *FN(TYPE,to_str)(__isl_keep TYPE *obj) { isl_printer *p; char *s; if (!obj) return NULL; p = isl_printer_to_str(FN(TYPE,get_ctx)(obj)); p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_FLOW); p = FN(isl_printer_print,BASE)(p, obj); s = isl_printer_get_str(p); isl_printer_free(p); return s; } isl-0.28/isl_multi_nan_templ.c0000664000175000017500000000063315072740040015525 0ustar00skimoskimo/* * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include /* Does "multi" involve any NaNs? */ isl_bool FN(MULTI(BASE),involves_nan)(__isl_keep MULTI(BASE) *multi) { return FN(MULTI(BASE),any)(multi, &FN(EL,involves_nan)); } isl-0.28/check_parse_fail_test_templ.c0000664000175000017500000000176715072740040017202 0ustar00skimoskimo/* * Copyright 2021 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #define xCAT(A,B) A ## B #define CAT(A,B) xCAT(A,B) #undef TYPE #define TYPE CAT(isl_,BASE) #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) #undef TESTS #define TESTS CAT(parse_,CAT(BASE,_fail_tests)) /* Test parsing of objects of type TYPE * that are expected to fail. */ static isl_stat FN(check,TESTS)(isl_ctx *ctx) { int i, n; int on_error; on_error = isl_options_get_on_error(ctx); isl_options_set_on_error(ctx, ISL_ON_ERROR_CONTINUE); n = ARRAY_SIZE(TESTS); for (i = 0; i < n; ++i) { TYPE *obj; obj = FN(TYPE,read_from_str)(ctx, TESTS[i]); FN(TYPE,free)(obj); if (obj) break; } isl_options_set_on_error(ctx, on_error); if (i < n) isl_die(ctx, isl_error_unknown, "parsing not expected to succeed", return isl_stat_error); return isl_stat_ok; } isl-0.28/isl_unbind_params_templ.c0000664000175000017500000000200315072740040016352 0ustar00skimoskimo/* * Copyright 2018 Sven Verdoolaege * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege. */ /* Given a function "obj" defined over a parameter domain, * convert it to a function defined over a domain corresponding * to "domain". * Any parameters with identifiers in "domain" are reinterpreted * as the corresponding domain dimensions. */ __isl_give TYPE *FN(TYPE,unbind_params_insert_domain)( __isl_take TYPE *obj, __isl_take isl_multi_id *domain) { isl_bool is_params; isl_space *space; isl_reordering *r; space = FN(TYPE,get_domain_space)(obj); is_params = isl_space_is_params(space); if (is_params < 0) domain = isl_multi_id_free(domain); else if (!is_params) isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid, "expecting function with parameter domain", domain = isl_multi_id_free(domain)); r = isl_reordering_unbind_params_insert_domain(space, domain); isl_space_free(space); isl_multi_id_free(domain); return FN(TYPE,realign_domain)(obj, r); } isl-0.28/closure.c0000664000175000017500000000162115072740040013141 0ustar00skimoskimo#include #include #include int main(int argc, char **argv) { struct isl_ctx *ctx; struct isl_map *map; struct isl_options *options; isl_printer *p; isl_bool exact; options = isl_options_new_with_defaults(); assert(options); argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL); ctx = isl_ctx_alloc_with_options(&isl_options_args, options); p = isl_printer_to_file(ctx, stdout); map = isl_map_read_from_file(ctx, stdin); map = isl_map_transitive_closure(map, &exact); if (!exact) p = isl_printer_print_str(p, "# NOT exact\n"); p = isl_printer_print_map(p, map); p = isl_printer_end_line(p); map = isl_map_compute_divs(map); map = isl_map_coalesce(map); p = isl_printer_print_str(p, "# coalesced\n"); p = isl_printer_print_map(p, map); p = isl_printer_end_line(p); isl_map_free(map); isl_printer_free(p); isl_ctx_free(ctx); return 0; } isl-0.28/isl_multi_templ.c0000664000175000017500000005740015215726270014705 0ustar00skimoskimo/* * Copyright 2011 Sven Verdoolaege * Copyright 2012-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ #include #include #include #include #include #define MULTI_NAME(BASE) "isl_multi_" #BASE isl_ctx *FN(MULTI(BASE),get_ctx)(__isl_keep MULTI(BASE) *multi) { return multi ? isl_space_get_ctx(multi->space) : NULL; } __isl_give isl_space *FN(MULTI(BASE),get_domain_space)( __isl_keep MULTI(BASE) *multi) { return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL; } /* Allocate a multi expression living in "space". * * If the number of base expressions is zero, then make sure * there is enough room in the structure for the explicit domain, * in case the type supports such an explicit domain. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space) { isl_ctx *ctx; isl_size n; MULTI(BASE) *multi; n = isl_space_dim(space, isl_dim_out); if (n < 0) goto error; ctx = isl_space_get_ctx(space); if (n > 0) multi = isl_calloc(ctx, MULTI(BASE), sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *)); else multi = isl_calloc(ctx, MULTI(BASE), sizeof(MULTI(BASE))); if (!multi) goto error; multi->space = space; multi->n = n; multi->ref = 1; if (FN(MULTI(BASE),has_explicit_domain)(multi)) multi = FN(MULTI(BASE),init_explicit_domain)(multi); return multi; error: isl_space_free(space); return NULL; } __isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi) { int i; MULTI(BASE) *dup; if (!multi) return NULL; dup = FN(MULTI(BASE),alloc)(isl_space_copy(multi->space)); if (!dup) return NULL; for (i = 0; i < multi->n; ++i) dup = FN(FN(MULTI(BASE),set),BASE)(dup, i, FN(EL,copy)(multi->u.p[i])); if (FN(MULTI(BASE),has_explicit_domain)(multi)) dup = FN(MULTI(BASE),copy_explicit_domain)(dup, multi); return dup; } __isl_give MULTI(BASE) *FN(MULTI(BASE),cow)(__isl_take MULTI(BASE) *multi) { if (!multi) return NULL; if (multi->ref == 1) return multi; multi->ref--; return FN(MULTI(BASE),dup)(multi); } __isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi) { if (!multi) return NULL; multi->ref++; return multi; } __isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi) { int i; if (!multi) return NULL; if (--multi->ref > 0) return NULL; isl_space_free(multi->space); for (i = 0; i < multi->n; ++i) FN(EL,free)(multi->u.p[i]); if (FN(MULTI(BASE),has_explicit_domain)(multi)) FN(MULTI(BASE),free_explicit_domain)(multi); free(multi); return NULL; } #undef TYPE #define TYPE MULTI(BASE) #undef FIELD_TYPE #define FIELD_TYPE isl_space #undef FIELD_NAME #define FIELD_NAME space #undef PROPERTY #define PROPERTY space #include "isl_peek_templ.c" #include "isl_get_templ.c" #include "isl_take_templ.c" #include "isl_restore_templ.c" isl_size FN(MULTI(BASE),dim)(__isl_keep MULTI(BASE) *multi, enum isl_dim_type type) { return isl_space_dim(FN(MULTI(BASE),peek_space)(multi), type); } /* Return the number of base expressions in "multi". */ isl_size FN(MULTI(BASE),size)(__isl_keep MULTI(BASE) *multi) { return multi ? multi->n : isl_size_error; } #undef TYPE #define TYPE MULTI(BASE) static #include "check_type_range_templ.c" /* Return the base expression at position "pos" in "multi". */ static __isl_give EL *FN(MULTI(BASE),peek_at)(__isl_keep MULTI(BASE) *multi, int pos) { if (FN(MULTI(BASE),check_range)(multi, isl_dim_out, pos, 1) < 0) return NULL; return multi->u.p[pos]; } /* Return a copy of the base expression at position "pos" in "multi". */ __isl_give EL *FN(MULTI(BASE),get_at)(__isl_keep MULTI(BASE) *multi, int pos) { return FN(EL,copy)(FN(MULTI(BASE),peek_at)(multi, pos)); } /* This is an alternative name for the function above. */ __isl_give EL *FN(FN(MULTI(BASE),get),BASE)(__isl_keep MULTI(BASE) *multi, int pos) { return FN(MULTI(BASE),get_at)(multi, pos); } /* Return the base expression at position "pos" in "multi". * This may be either a copy or the base expression itself * if there is only one reference to "multi". * This allows the base expression to be modified inplace * if both the multi expression and this base expression * have only a single reference. * The caller is not allowed to modify "multi" between this call and * the subsequent call to isl_multi_*_restore_at_*. * The only exception is that isl_multi_*_free can be called instead. */ static __isl_give EL *FN(MULTI(BASE),take_at)(__isl_keep MULTI(BASE) *multi, int pos) { EL *el; if (!multi) return NULL; if (multi->ref != 1) return FN(MULTI(BASE),get_at)(multi, pos); if (FN(MULTI(BASE),check_range)(multi, isl_dim_out, pos, 1) < 0) return NULL; el = multi->u.p[pos]; multi->u.p[pos] = NULL; return el; } /* Set the element at position "pos" of "multi" to "el", * where the position may be empty if "multi" has only a single reference. */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),restore_at)( __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) { if (FN(MULTI(BASE),check_range)(multi, isl_dim_out, pos, 1) < 0 || !el) goto error; if (multi->u.p[pos] == el) { FN(EL,free)(el); return multi; } multi = FN(MULTI(BASE),cow)(multi); if (!multi) goto error; FN(EL,free)(multi->u.p[pos]); multi->u.p[pos] = el; return multi; error: FN(MULTI(BASE),free)(multi); FN(EL,free)(el); return NULL; } /* Set the element at position "pos" of "multi" to "el", * where the position may be empty if "multi" has only a single reference. * However, the space of "multi" is available and is checked * for compatibility with "el". */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),restore_check_space)( __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) { isl_space *space; space = FN(MULTI(BASE),peek_space)(multi); if (FN(EL,check_match_domain_space)(el, space) < 0) multi = FN(MULTI(BASE),free)(multi); return FN(MULTI(BASE),restore_at)(multi, pos, el); } /* Replace the base expression at position "pos" in "multi" with "el". */ __isl_give MULTI(BASE) *FN(MULTI(BASE),set_at)( __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) { isl_space *multi_space = NULL; isl_space *el_space = NULL; isl_bool match; multi_space = FN(MULTI(BASE),get_space)(multi); match = FN(EL,matching_params)(el, multi_space); if (match < 0) goto error; if (!match) { multi = FN(MULTI(BASE),align_params)(multi, FN(EL,get_space)(el)); isl_space_free(multi_space); multi_space = FN(MULTI(BASE),get_space)(multi); el = FN(EL,align_params)(el, isl_space_copy(multi_space)); } multi = FN(MULTI(BASE),restore_check_space)(multi, pos, el); isl_space_free(multi_space); isl_space_free(el_space); return multi; error: FN(MULTI(BASE),free)(multi); FN(EL,free)(el); isl_space_free(multi_space); isl_space_free(el_space); return NULL; } /* This is an alternative name for the function above. */ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),set),BASE)( __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) { return FN(MULTI(BASE),set_at)(multi, pos, el); } /* Return the base expressions of "multi" as a list. */ __isl_give LIST(EL) *FN(MULTI(BASE),get_list)( __isl_keep MULTI(BASE) *multi) { isl_size n; int i; LIST(EL) *list; n = FN(MULTI(BASE),size)(multi); if (n < 0) return NULL; list = FN(LIST(EL),alloc)(FN(MULTI(BASE),get_ctx(multi)), n); for (i = 0; i < n; ++i) { EL *el = FN(MULTI(BASE),get_at)(multi, i); list = FN(LIST(EL),add)(list, el); } return list; } /* Reset the space of "multi". This function is called from isl_pw_templ.c * and doesn't know if the space of an element object is represented * directly or through its domain. It therefore passes along both, * which we pass along to the element function since we don't know how * that is represented either. * * If "multi" has an explicit domain, then the caller is expected * to make sure that any modification that would change the dimensions * of the explicit domain has bee applied before this function is called. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space_and_domain)( __isl_take MULTI(BASE) *multi, __isl_take isl_space *space, __isl_take isl_space *domain) { isl_size n; int i; n = FN(MULTI(BASE),size)(multi); if (n < 0 || !space || !domain) goto error; for (i = 0; i < n; ++i) { EL *el; el = FN(MULTI(BASE),take_at)(multi, i); el = FN(EL,reset_domain_space)(el, isl_space_copy(domain)); multi = FN(MULTI(BASE),restore_at)(multi, i, el); } if (FN(MULTI(BASE),has_explicit_domain)(multi)) multi = FN(MULTI(BASE),reset_explicit_domain_space)(multi, isl_space_copy(domain)); isl_space_free(domain); multi = FN(MULTI(BASE),restore_space)(multi, space); return multi; error: isl_space_free(domain); isl_space_free(space); FN(MULTI(BASE),free)(multi); return NULL; } __isl_give MULTI(BASE) *FN(MULTI(BASE),reset_domain_space)( __isl_take MULTI(BASE) *multi, __isl_take isl_space *domain) { isl_space *space, *multi_space; multi_space = FN(MULTI(BASE),get_space)(multi); space = isl_space_extend_domain_with_range(isl_space_copy(domain), multi_space); return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain); } __isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space)( __isl_take MULTI(BASE) *multi, __isl_take isl_space *space) { isl_space *domain; domain = isl_space_domain(isl_space_copy(space)); return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain); } /* Reset the user pointer on all identifiers of parameters and tuples * of the space of "multi". */ __isl_give MULTI(BASE) *FN(MULTI(BASE),reset_user)( __isl_take MULTI(BASE) *multi) { isl_space *space; space = FN(MULTI(BASE),get_space)(multi); space = isl_space_reset_user(space); return FN(MULTI(BASE),reset_space)(multi, space); } __isl_give MULTI(BASE) *FN(MULTI(BASE),realign_domain)( __isl_take MULTI(BASE) *multi, __isl_take isl_reordering *exp) { int i; isl_size n; isl_space *space; n = FN(MULTI(BASE),size)(multi); if (n < 0 || !exp) goto error; for (i = 0; i < n; ++i) { EL *el; el = FN(MULTI(BASE),take_at)(multi, i); el = FN(EL,realign_domain)(el, isl_reordering_copy(exp)); multi = FN(MULTI(BASE),restore_at)(multi, i, el); } space = isl_reordering_get_space(exp); multi = FN(MULTI(BASE),reset_domain_space)(multi, space); isl_reordering_free(exp); return multi; error: isl_reordering_free(exp); FN(MULTI(BASE),free)(multi); return NULL; } /* Align the parameters of "multi" to those of "model". * * If "multi" has an explicit domain, then align the parameters * of the domain first. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params)( __isl_take MULTI(BASE) *multi, __isl_take isl_space *model) { isl_ctx *ctx; isl_bool equal_params; isl_space *domain_space; isl_reordering *exp; if (!multi || !model) goto error; equal_params = isl_space_has_equal_params(multi->space, model); if (equal_params < 0) goto error; if (equal_params) { isl_space_free(model); return multi; } ctx = isl_space_get_ctx(model); if (!isl_space_has_named_params(model)) isl_die(ctx, isl_error_invalid, "model has unnamed parameters", goto error); if (!isl_space_has_named_params(multi->space)) isl_die(ctx, isl_error_invalid, "input has unnamed parameters", goto error); if (FN(MULTI(BASE),has_explicit_domain)(multi)) { multi = FN(MULTI(BASE),align_explicit_domain_params)(multi, isl_space_copy(model)); if (!multi) goto error; } domain_space = FN(MULTI(BASE),get_domain_space)(multi); exp = isl_parameter_alignment_reordering(domain_space, model); isl_space_free(domain_space); multi = FN(MULTI(BASE),realign_domain)(multi, exp); isl_space_free(model); return multi; error: isl_space_free(model); FN(MULTI(BASE),free)(multi); return NULL; } /* Create a multi expression in the given space with the elements of "list" * as base expressions. * * Since isl_multi_*_restore_* assumes that the element and * the multi expression have matching spaces, the alignment * (if any) needs to be performed beforehand. */ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))( __isl_take isl_space *space, __isl_take LIST(EL) *list) { int i; isl_size n, dim; isl_ctx *ctx; MULTI(BASE) *multi; dim = isl_space_dim(space, isl_dim_out); n = FN(FN(LIST(EL),n),BASE)(list); if (dim < 0 || n < 0) goto error; ctx = isl_space_get_ctx(space); if (n != dim) isl_die(ctx, isl_error_invalid, "invalid number of elements in list", goto error); for (i = 0; i < n; ++i) { EL *el = FN(LIST(EL),peek)(list, i); space = isl_space_align_params(space, FN(EL,get_space)(el)); } multi = FN(MULTI(BASE),alloc)(isl_space_copy(space)); for (i = 0; i < n; ++i) { EL *el = FN(FN(LIST(EL),get),BASE)(list, i); el = FN(EL,align_params)(el, isl_space_copy(space)); multi = FN(MULTI(BASE),restore_check_space)(multi, i, el); } isl_space_free(space); FN(LIST(EL),free)(list); return multi; error: isl_space_free(space); FN(LIST(EL),free)(list); return NULL; } /* This function performs the same operation as isl_multi_*_from_*_list, * but is considered as a function on an isl_space when exported. */ __isl_give MULTI(BASE) *FN(isl_space_multi,BASE)(__isl_take isl_space *space, __isl_take LIST(EL) *list) { return FN(FN(MULTI(BASE),from),LIST(BASE))(space, list); } /* Drop the "n" output dimensions of "multi" starting at "first", * where the space is assumed to have been adjusted already. */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),drop_output_dims)( __isl_take MULTI(BASE) *multi, unsigned first, unsigned n) { int i; multi = FN(MULTI(BASE),cow)(multi); if (!multi) return NULL; for (i = 0; i < n; ++i) FN(EL,free)(multi->u.p[first + i]); for (i = first; i + n < multi->n; ++i) multi->u.p[i] = multi->u.p[i + n]; multi->n -= n; if (n > 0 && FN(MULTI(BASE),has_explicit_domain)(multi)) multi = FN(MULTI(BASE),init_explicit_domain)(multi); return multi; } __isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)( __isl_take MULTI(BASE) *multi, enum isl_dim_type type, unsigned first, unsigned n) { isl_space *space; isl_size size; int i; if (FN(MULTI(BASE),check_range)(multi, type, first, n) < 0) return FN(MULTI(BASE),free)(multi); space = FN(MULTI(BASE),take_space)(multi); space = isl_space_drop_dims(space, type, first, n); multi = FN(MULTI(BASE),restore_space)(multi, space); if (type == isl_dim_out) return FN(MULTI(BASE),drop_output_dims)(multi, first, n); if (FN(MULTI(BASE),has_explicit_domain)(multi)) multi = FN(MULTI(BASE),drop_explicit_domain_dims)(multi, type, first, n); size = FN(MULTI(BASE),size)(multi); if (size < 0) return FN(MULTI(BASE),free)(multi); for (i = 0; i < size; ++i) { EL *el; el = FN(MULTI(BASE),take_at)(multi, i); el = FN(EL,drop_dims)(el, type, first, n); multi = FN(MULTI(BASE),restore_at)(multi, i, el); } return multi; } #undef TYPE #define TYPE MULTI(BASE) #include "isl_check_named_params_templ.c" static #include "isl_align_params_bin_templ.c" /* Given two MULTI(BASE)s A -> B and C -> D, * construct a MULTI(BASE) (A * C) -> [B -> D]. * * If "multi1" and/or "multi2" has an explicit domain, then * intersect the domain of the result with these explicit domains. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) { int i; isl_size n1, n2; EL *el; isl_space *space; MULTI(BASE) *res; FN(MULTI(BASE),align_params_bin)(&multi1, &multi2); n1 = FN(MULTI(BASE),size)(multi1); n2 = FN(MULTI(BASE),size)(multi2); if (n1 < 0 || n2 < 0) goto error; space = isl_space_range_product(FN(MULTI(BASE),get_space)(multi1), FN(MULTI(BASE),get_space)(multi2)); res = FN(MULTI(BASE),alloc)(space); for (i = 0; i < n1; ++i) { el = FN(FN(MULTI(BASE),get),BASE)(multi1, i); res = FN(FN(MULTI(BASE),set),BASE)(res, i, el); } for (i = 0; i < n2; ++i) { el = FN(FN(MULTI(BASE),get),BASE)(multi2, i); res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el); } if (FN(MULTI(BASE),has_explicit_domain)(multi1)) res = FN(MULTI(BASE),intersect_explicit_domain)(res, multi1); if (FN(MULTI(BASE),has_explicit_domain)(multi2)) res = FN(MULTI(BASE),intersect_explicit_domain)(res, multi2); FN(MULTI(BASE),free)(multi1); FN(MULTI(BASE),free)(multi2); return res; error: FN(MULTI(BASE),free)(multi1); FN(MULTI(BASE),free)(multi2); return NULL; } /* Is the range of "multi" a wrapped relation? */ isl_bool FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi) { if (!multi) return isl_bool_error; return isl_space_range_is_wrapping(multi->space); } /* Given a function A -> [B -> C], extract the function A -> B. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_domain)( __isl_take MULTI(BASE) *multi) { isl_space *space; isl_size total, keep; total = FN(MULTI(BASE),dim)(multi, isl_dim_out); if (total < 0) return FN(MULTI(BASE),free)(multi); if (!isl_space_range_is_wrapping(multi->space)) isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, "range is not a product", return FN(MULTI(BASE),free)(multi)); space = FN(MULTI(BASE),get_space)(multi); space = isl_space_range_factor_domain(space); keep = isl_space_dim(space, isl_dim_out); if (keep < 0) multi = FN(MULTI(BASE),free)(multi); multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_out, keep, total - keep); multi = FN(MULTI(BASE),reset_space)(multi, space); return multi; } /* Given a function A -> [B -> C], extract the function A -> C. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_range)( __isl_take MULTI(BASE) *multi) { isl_space *space; isl_size total, keep; total = FN(MULTI(BASE),dim)(multi, isl_dim_out); if (total < 0) return FN(MULTI(BASE),free)(multi); if (!isl_space_range_is_wrapping(multi->space)) isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, "range is not a product", return FN(MULTI(BASE),free)(multi)); space = FN(MULTI(BASE),get_space)(multi); space = isl_space_range_factor_range(space); keep = isl_space_dim(space, isl_dim_out); if (keep < 0) multi = FN(MULTI(BASE),free)(multi); multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_out, 0, total - keep); multi = FN(MULTI(BASE),reset_space)(multi, space); return multi; } /* Given a function [B -> C], extract the function C. */ __isl_give MULTI(BASE) *FN(MULTI(BASE),factor_range)( __isl_take MULTI(BASE) *multi) { isl_space *space; isl_size total, keep; total = FN(MULTI(BASE),dim)(multi, isl_dim_set); if (total < 0) return FN(MULTI(BASE),free)(multi); if (!isl_space_is_wrapping(multi->space)) isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid, "not a product", return FN(MULTI(BASE),free)(multi)); space = FN(MULTI(BASE),get_space)(multi); space = isl_space_factor_range(space); keep = isl_space_dim(space, isl_dim_set); if (keep < 0) multi = FN(MULTI(BASE),free)(multi); multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_set, 0, total - keep); multi = FN(MULTI(BASE),reset_space)(multi, space); return multi; } __isl_give MULTI(BASE) *FN(MULTI(BASE),flatten_range)( __isl_take MULTI(BASE) *multi) { isl_space *space; space = FN(MULTI(BASE),take_space)(multi); space = isl_space_flatten_range(space); multi = FN(MULTI(BASE),restore_space)(multi, space); return multi; } /* Given two MULTI(BASE)s A -> B and C -> D, * construct a MULTI(BASE) (A * C) -> (B, D). */ __isl_give MULTI(BASE) *FN(MULTI(BASE),flat_range_product)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) { MULTI(BASE) *multi; multi = FN(MULTI(BASE),range_product)(multi1, multi2); multi = FN(MULTI(BASE),flatten_range)(multi); return multi; } /* Given two multi expressions, "multi1" * * [A] -> [B1 B2] * * where B2 starts at position "pos", and "multi2" * * [A] -> [D] * * return the multi expression * * [A] -> [B1 D B2] */ __isl_give MULTI(BASE) *FN(MULTI(BASE),range_splice)( __isl_take MULTI(BASE) *multi1, unsigned pos, __isl_take MULTI(BASE) *multi2) { MULTI(BASE) *res; isl_size dim; dim = FN(MULTI(BASE),size)(multi1); if (dim < 0 || !multi2) goto error; if (FN(MULTI(BASE),check_range)(multi1, isl_dim_out, pos, 0) < 0) goto error; res = FN(MULTI(BASE),copy)(multi1); res = FN(MULTI(BASE),drop_dims)(res, isl_dim_out, pos, dim - pos); multi1 = FN(MULTI(BASE),drop_dims)(multi1, isl_dim_out, 0, pos); res = FN(MULTI(BASE),flat_range_product)(res, multi2); res = FN(MULTI(BASE),flat_range_product)(res, multi1); return res; error: FN(MULTI(BASE),free)(multi1); FN(MULTI(BASE),free)(multi2); return NULL; } #undef TYPE #define TYPE MULTI(BASE) static #include "isl_type_has_equal_space_bin_templ.c" static #include "isl_type_check_equal_space_templ.c" /* This function is currently only used from isl_aff.c */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),bin_op)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2, __isl_give EL *(*fn)(__isl_take EL *, __isl_take EL *)) __attribute__ ((unused)); /* Pairwise perform "fn" to the elements of "multi1" and "multi2" and * return the result. * * If "multi2" has an explicit domain, then * intersect the domain of the result with this explicit domain. */ static __isl_give MULTI(BASE) *FN(MULTI(BASE),bin_op)( __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2, __isl_give EL *(*fn)(__isl_take EL *, __isl_take EL *)) { isl_size n; int i; FN(MULTI(BASE),align_params_bin)(&multi1, &multi2); n = FN(MULTI(BASE),size)(multi1); if (n < 0 || FN(MULTI(BASE),check_equal_space)(multi1, multi2) < 0) goto error; for (i = 0; i < n; ++i) { EL *el1, *el2; el2 = FN(MULTI(BASE),get_at)(multi2, i); el1 = FN(MULTI(BASE),take_at)(multi1, i); el1 = fn(el1, el2); multi1 = FN(MULTI(BASE),restore_at)(multi1, i, el1); } if (FN(MULTI(BASE),has_explicit_domain)(multi2)) multi1 = FN(MULTI(BASE),intersect_explicit_domain)(multi1, multi2); FN(MULTI(BASE),free)(multi2); return multi1; error: FN(MULTI(BASE),free)(multi1); FN(MULTI(BASE),free)(multi2); return NULL; } /* Only used on some multi-expressions. */ static isl_bool FN(MULTI(BASE),any)(__isl_keep MULTI(BASE) *multi, isl_bool (*test)(__isl_keep EL *)) __attribute__ ((unused)); /* Does "test" succeed on any base expression of "multi"? */ static isl_bool FN(MULTI(BASE),any)(__isl_keep MULTI(BASE) *multi, isl_bool (*test)(__isl_keep EL *)) { isl_size n; int i; n = FN(MULTI(BASE),size)(multi); if (n < 0) return isl_bool_error; for (i = 0; i < n; ++i) { isl_bool any = test(multi->u.p[i]); if (any < 0 || any) return any; } return isl_bool_false; } /* Only used on some multi-expressions. */ static isl_bool FN(MULTI(BASE),every)(__isl_keep MULTI(BASE) *multi, isl_bool (*test)(__isl_keep EL *)) __attribute__ ((unused)); /* Does "test" succeed on every base expression of "multi"? */ static isl_bool FN(MULTI(BASE),every)(__isl_keep MULTI(BASE) *multi, isl_bool (*test)(__isl_keep EL *)) { isl_size n; int i; n = FN(MULTI(BASE),size)(multi); if (n < 0) return isl_bool_error; for (i = 0; i < n; ++i) { isl_bool every = test(multi->u.p[i]); if (every < 0 || !every) return every; } return isl_bool_true; } #undef TYPE #define TYPE MULTI(BASE) #include "isl_from_range_templ.c" /* Are "multi1" and "multi2" obviously equal? */ isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1, __isl_keep MULTI(BASE) *multi2) { int i; isl_bool equal; if (!multi1 || !multi2) return isl_bool_error; if (multi1->n != multi2->n) return isl_bool_false; equal = isl_space_is_equal(multi1->space, multi2->space); if (equal < 0 || !equal) return equal; for (i = 0; i < multi1->n; ++i) { equal = FN(EL,plain_is_equal)(multi1->u.p[i], multi2->u.p[i]); if (equal < 0 || !equal) return equal; } if (FN(MULTI(BASE),has_explicit_domain)(multi1) || FN(MULTI(BASE),has_explicit_domain)(multi2)) { equal = FN(MULTI(BASE),equal_explicit_domain)(multi1, multi2); if (equal < 0 || !equal) return equal; } return isl_bool_true; } isl-0.28/isl_align_params_templ.c0000664000175000017500000000204215072740040016170 0ustar00skimoskimo/* * Copyright 2011 Sven Verdoolaege * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) /* Align the parameters of the two arguments of type ARG1 and ARG2 * (if needed). */ isl_stat FN(FN(ARG1,align_params),SUFFIX)(__isl_keep ARG1 **obj1, __isl_keep ARG2 **obj2) { isl_space *space1, *space2; isl_bool equal_params; space1 = FN(ARG1,peek_space)(*obj1); space2 = FN(ARG2,peek_space)(*obj2); equal_params = isl_space_has_equal_params(space1, space2); if (equal_params < 0) goto error; if (equal_params) return isl_stat_ok; if (FN(ARG1,check_named_params)(*obj1) < 0 || FN(ARG2,check_named_params)(*obj2) < 0) goto error; *obj1 = FN(ARG1,align_params)(*obj1, FN(ARG2,get_space)(*obj2)); *obj2 = FN(ARG2,align_params)(*obj2, FN(ARG1,get_space)(*obj1)); if (!*obj1 || !*obj2) goto error; return isl_stat_ok; error: *obj1 = FN(ARG1,free)(*obj1); *obj2 = FN(ARG2,free)(*obj2); return isl_stat_error; } isl-0.28/isl_polynomial.c0000664000175000017500000035225015215726270014536 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef EL_BASE #define EL_BASE qpolynomial #include #undef EL_BASE #define EL_BASE pw_qpolynomial #include static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type) { switch (type) { case isl_dim_param: return 0; case isl_dim_in: return space->nparam; case isl_dim_out: return space->nparam + space->n_in; default: return 0; } } isl_bool isl_poly_is_cst(__isl_keep isl_poly *poly) { if (!poly) return isl_bool_error; return isl_bool_ok(poly->var < 0); } __isl_keep isl_poly_cst *isl_poly_as_cst(__isl_keep isl_poly *poly) { if (!poly) return NULL; isl_assert(poly->ctx, poly->var < 0, return NULL); return (isl_poly_cst *) poly; } __isl_keep isl_poly_rec *isl_poly_as_rec(__isl_keep isl_poly *poly) { if (!poly) return NULL; isl_assert(poly->ctx, poly->var >= 0, return NULL); return (isl_poly_rec *) poly; } /* Compare two polynomials. * * Return -1 if "poly1" is "smaller" than "poly2", 1 if "poly1" is "greater" * than "poly2" and 0 if they are equal. */ static int isl_poly_plain_cmp(__isl_keep isl_poly *poly1, __isl_keep isl_poly *poly2) { int i; isl_bool is_cst1; isl_poly_rec *rec1, *rec2; if (poly1 == poly2) return 0; is_cst1 = isl_poly_is_cst(poly1); if (is_cst1 < 0) return -1; if (!poly2) return 1; if (poly1->var != poly2->var) return poly1->var - poly2->var; if (is_cst1) { isl_poly_cst *cst1, *cst2; int cmp; cst1 = isl_poly_as_cst(poly1); cst2 = isl_poly_as_cst(poly2); if (!cst1 || !cst2) return 0; cmp = isl_int_cmp(cst1->n, cst2->n); if (cmp != 0) return cmp; return isl_int_cmp(cst1->d, cst2->d); } rec1 = isl_poly_as_rec(poly1); rec2 = isl_poly_as_rec(poly2); if (!rec1 || !rec2) return 0; if (rec1->n != rec2->n) return rec1->n - rec2->n; for (i = 0; i < rec1->n; ++i) { int cmp = isl_poly_plain_cmp(rec1->p[i], rec2->p[i]); if (cmp != 0) return cmp; } return 0; } isl_bool isl_poly_is_equal(__isl_keep isl_poly *poly1, __isl_keep isl_poly *poly2) { int i; isl_bool is_cst1; isl_poly_rec *rec1, *rec2; is_cst1 = isl_poly_is_cst(poly1); if (is_cst1 < 0 || !poly2) return isl_bool_error; if (poly1 == poly2) return isl_bool_true; if (poly1->var != poly2->var) return isl_bool_false; if (is_cst1) { isl_poly_cst *cst1, *cst2; int r; cst1 = isl_poly_as_cst(poly1); cst2 = isl_poly_as_cst(poly2); if (!cst1 || !cst2) return isl_bool_error; r = isl_int_eq(cst1->n, cst2->n) && isl_int_eq(cst1->d, cst2->d); return isl_bool_ok(r); } rec1 = isl_poly_as_rec(poly1); rec2 = isl_poly_as_rec(poly2); if (!rec1 || !rec2) return isl_bool_error; if (rec1->n != rec2->n) return isl_bool_false; for (i = 0; i < rec1->n; ++i) { isl_bool eq = isl_poly_is_equal(rec1->p[i], rec2->p[i]); if (eq < 0 || !eq) return eq; } return isl_bool_true; } isl_bool isl_poly_is_zero(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; return isl_bool_ok(isl_int_is_zero(cst->n) && isl_int_is_pos(cst->d)); } int isl_poly_sgn(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return 0; cst = isl_poly_as_cst(poly); if (!cst) return 0; return isl_int_sgn(cst->n); } isl_bool isl_poly_is_nan(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; return isl_bool_ok(isl_int_is_zero(cst->n) && isl_int_is_zero(cst->d)); } isl_bool isl_poly_is_infty(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; return isl_bool_ok(isl_int_is_pos(cst->n) && isl_int_is_zero(cst->d)); } isl_bool isl_poly_is_neginfty(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; return isl_bool_ok(isl_int_is_neg(cst->n) && isl_int_is_zero(cst->d)); } isl_bool isl_poly_is_one(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; int r; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; r = isl_int_eq(cst->n, cst->d) && isl_int_is_pos(cst->d); return isl_bool_ok(r); } isl_bool isl_poly_is_negone(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; return isl_bool_ok(isl_int_is_negone(cst->n) && isl_int_is_one(cst->d)); } __isl_give isl_poly_cst *isl_poly_cst_alloc(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_alloc_type(ctx, struct isl_poly_cst); if (!cst) return NULL; cst->poly.ref = 1; cst->poly.ctx = ctx; isl_ctx_ref(ctx); cst->poly.var = -1; isl_int_init(cst->n); isl_int_init(cst->d); return cst; } __isl_give isl_poly *isl_poly_zero(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set_si(cst->n, 0); isl_int_set_si(cst->d, 1); return &cst->poly; } __isl_give isl_poly *isl_poly_one(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set_si(cst->n, 1); isl_int_set_si(cst->d, 1); return &cst->poly; } __isl_give isl_poly *isl_poly_infty(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set_si(cst->n, 1); isl_int_set_si(cst->d, 0); return &cst->poly; } __isl_give isl_poly *isl_poly_neginfty(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set_si(cst->n, -1); isl_int_set_si(cst->d, 0); return &cst->poly; } __isl_give isl_poly *isl_poly_nan(isl_ctx *ctx) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set_si(cst->n, 0); isl_int_set_si(cst->d, 0); return &cst->poly; } __isl_give isl_poly *isl_poly_rat_cst(isl_ctx *ctx, isl_int n, isl_int d) { isl_poly_cst *cst; cst = isl_poly_cst_alloc(ctx); if (!cst) return NULL; isl_int_set(cst->n, n); isl_int_set(cst->d, d); return &cst->poly; } __isl_give isl_poly_rec *isl_poly_alloc_rec(isl_ctx *ctx, int var, int size) { isl_poly_rec *rec; isl_assert(ctx, var >= 0, return NULL); isl_assert(ctx, size >= 0, return NULL); rec = isl_calloc(ctx, struct isl_poly_rec, sizeof(struct isl_poly_rec) + size * sizeof(struct isl_poly *)); if (!rec) return NULL; rec->poly.ref = 1; rec->poly.ctx = ctx; isl_ctx_ref(ctx); rec->poly.var = var; rec->n = 0; rec->size = size; return rec; } #undef TYPE #define TYPE isl_qpolynomial #undef FIELD_TYPE #define FIELD_TYPE isl_space #undef FIELD_NAME #define FIELD_NAME dim #undef PROPERTY #define PROPERTY domain_space static #include "isl_peek_templ.c" #include "isl_get_templ.c" static #include "isl_take_templ.c" static #include "isl_restore_templ.c" __isl_give isl_qpolynomial *isl_qpolynomial_reset_domain_space( __isl_take isl_qpolynomial *qp, __isl_take isl_space *space) { return isl_qpolynomial_restore_domain_space(qp, space); } /* Reset the space of "qp". This function is called from isl_pw_templ.c * and doesn't know if the space of an element object is represented * directly or through its domain. It therefore passes along both. */ __isl_give isl_qpolynomial *isl_qpolynomial_reset_space_and_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_space *space, __isl_take isl_space *domain) { isl_space_free(space); return isl_qpolynomial_reset_domain_space(qp, domain); } isl_ctx *isl_qpolynomial_get_ctx(__isl_keep isl_qpolynomial *qp) { return qp ? qp->dim->ctx : NULL; } #undef TYPE #define TYPE isl_qpolynomial #undef PEEK_SPACE #define PEEK_SPACE peek_domain_space static #include "isl_type_has_equal_space_bin_templ.c" static #include "isl_type_check_equal_space_templ.c" #undef PEEK_SPACE /* Return a copy of the local variables of "qp". */ __isl_keep isl_local *isl_qpolynomial_get_local( __isl_keep isl_qpolynomial *qp) { return qp ? isl_local_copy(qp->div) : NULL; } #undef TYPE #define TYPE isl_qpolynomial #undef FIELD_TYPE #define FIELD_TYPE isl_local #undef FIELD_NAME #define FIELD_NAME div #undef PROPERTY #define PROPERTY local static #include "isl_take_templ.c" static #include "isl_restore_templ.c" /* Return a copy of the local space on which "qp" is defined. */ static __isl_give isl_local_space *isl_qpolynomial_get_domain_local_space( __isl_keep isl_qpolynomial *qp) { isl_space *space; isl_local *local; if (!qp) return NULL; space = isl_qpolynomial_get_domain_space(qp); local = isl_qpolynomial_get_local(qp); return isl_local_space_alloc_div(space, local); } __isl_give isl_space *isl_qpolynomial_get_space(__isl_keep isl_qpolynomial *qp) { isl_space *space; if (!qp) return NULL; space = isl_space_copy(qp->dim); space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, 1); return space; } /* Return the number of variables of the given type in the domain of "qp". */ isl_size isl_qpolynomial_domain_dim(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type) { isl_space *space; isl_size dim; space = isl_qpolynomial_peek_domain_space(qp); if (!space) return isl_size_error; if (type == isl_dim_div) return qp->div->n_row; dim = isl_space_dim(space, type); if (dim < 0) return isl_size_error; if (type == isl_dim_all) { isl_size n_div; n_div = isl_qpolynomial_domain_dim(qp, isl_dim_div); if (n_div < 0) return isl_size_error; dim += n_div; } return dim; } /* Given the type of a dimension of an isl_qpolynomial, * return the type of the corresponding dimension in its domain. * This function is only called for "type" equal to isl_dim_in or * isl_dim_param. */ static enum isl_dim_type domain_type(enum isl_dim_type type) { return type == isl_dim_in ? isl_dim_set : type; } /* Externally, an isl_qpolynomial has a map space, but internally, the * ls field corresponds to the domain of that space. */ isl_size isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type) { if (!qp) return isl_size_error; if (type == isl_dim_out) return 1; type = domain_type(type); return isl_qpolynomial_domain_dim(qp, type); } /* Return the offset of the first variable of type "type" within * the variables of the domain of "qp". */ static isl_size isl_qpolynomial_domain_var_offset( __isl_keep isl_qpolynomial *qp, enum isl_dim_type type) { isl_space *space; space = isl_qpolynomial_peek_domain_space(qp); switch (type) { case isl_dim_param: case isl_dim_set: return isl_space_offset(space, type); case isl_dim_div: return isl_space_dim(space, isl_dim_all); case isl_dim_cst: default: isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, "invalid dimension type", return isl_size_error); } } /* Return the offset of the first coefficient of type "type" in * the domain of "qp". */ unsigned isl_qpolynomial_domain_offset(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type) { switch (type) { case isl_dim_cst: return 0; case isl_dim_param: case isl_dim_set: case isl_dim_div: return 1 + isl_qpolynomial_domain_var_offset(qp, type); default: return 0; } } #undef TYPE #define TYPE isl_qpolynomial #undef FIELD_TYPE #define FIELD_TYPE isl_poly #undef FIELD_NAME #define FIELD_NAME poly #undef PROPERTY #define PROPERTY poly static #include "isl_peek_templ.c" #include "isl_get_templ.c" isl_bool isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_zero(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_one(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_nan(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_infty(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_neginfty(isl_qpolynomial_peek_poly(qp)); } int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp) { return isl_poly_sgn(isl_qpolynomial_peek_poly(qp)); } static void poly_free_cst(__isl_take isl_poly_cst *cst) { isl_int_clear(cst->n); isl_int_clear(cst->d); } static void poly_free_rec(__isl_take isl_poly_rec *rec) { int i; for (i = 0; i < rec->n; ++i) isl_poly_free(rec->p[i]); } __isl_give isl_poly *isl_poly_copy(__isl_keep isl_poly *poly) { if (!poly) return NULL; poly->ref++; return poly; } __isl_give isl_poly *isl_poly_dup_cst(__isl_keep isl_poly *poly) { isl_poly_cst *cst; isl_poly_cst *dup; cst = isl_poly_as_cst(poly); if (!cst) return NULL; dup = isl_poly_as_cst(isl_poly_zero(poly->ctx)); if (!dup) return NULL; isl_int_set(dup->n, cst->n); isl_int_set(dup->d, cst->d); return &dup->poly; } __isl_give isl_poly *isl_poly_dup_rec(__isl_keep isl_poly *poly) { int i; isl_poly_rec *rec; isl_poly_rec *dup; rec = isl_poly_as_rec(poly); if (!rec) return NULL; dup = isl_poly_alloc_rec(poly->ctx, poly->var, rec->n); if (!dup) return NULL; for (i = 0; i < rec->n; ++i) { dup->p[i] = isl_poly_copy(rec->p[i]); if (!dup->p[i]) goto error; dup->n++; } return &dup->poly; error: isl_poly_free(&dup->poly); return NULL; } __isl_give isl_poly *isl_poly_dup(__isl_keep isl_poly *poly) { isl_bool is_cst; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return NULL; if (is_cst) return isl_poly_dup_cst(poly); else return isl_poly_dup_rec(poly); } __isl_give isl_poly *isl_poly_cow(__isl_take isl_poly *poly) { if (!poly) return NULL; if (poly->ref == 1) return poly; poly->ref--; return isl_poly_dup(poly); } __isl_null isl_poly *isl_poly_free(__isl_take isl_poly *poly) { if (!poly) return NULL; if (--poly->ref > 0) return NULL; if (poly->var < 0) poly_free_cst((isl_poly_cst *) poly); else poly_free_rec((isl_poly_rec *) poly); isl_ctx_deref(poly->ctx); free(poly); return NULL; } static void isl_poly_cst_reduce(__isl_keep isl_poly_cst *cst) { isl_int gcd; isl_int_init(gcd); isl_int_gcd(gcd, cst->n, cst->d); if (!isl_int_is_zero(gcd) && !isl_int_is_one(gcd)) { isl_int_divexact(cst->n, cst->n, gcd); isl_int_divexact(cst->d, cst->d, gcd); } isl_int_clear(gcd); } __isl_give isl_poly *isl_poly_sum_cst(__isl_take isl_poly *poly1, __isl_take isl_poly *poly2) { isl_poly_cst *cst1; isl_poly_cst *cst2; poly1 = isl_poly_cow(poly1); if (!poly1 || !poly2) goto error; cst1 = isl_poly_as_cst(poly1); cst2 = isl_poly_as_cst(poly2); if (isl_int_eq(cst1->d, cst2->d)) isl_int_add(cst1->n, cst1->n, cst2->n); else { isl_int_mul(cst1->n, cst1->n, cst2->d); isl_int_addmul(cst1->n, cst2->n, cst1->d); isl_int_mul(cst1->d, cst1->d, cst2->d); } isl_poly_cst_reduce(cst1); isl_poly_free(poly2); return poly1; error: isl_poly_free(poly1); isl_poly_free(poly2); return NULL; } static __isl_give isl_poly *replace_by_zero(__isl_take isl_poly *poly) { struct isl_ctx *ctx; if (!poly) return NULL; ctx = poly->ctx; isl_poly_free(poly); return isl_poly_zero(ctx); } static __isl_give isl_poly *replace_by_constant_term(__isl_take isl_poly *poly) { isl_poly_rec *rec; isl_poly *cst; if (!poly) return NULL; rec = isl_poly_as_rec(poly); if (!rec) goto error; cst = isl_poly_copy(rec->p[0]); isl_poly_free(poly); return cst; error: isl_poly_free(poly); return NULL; } __isl_give isl_poly *isl_poly_sum(__isl_take isl_poly *poly1, __isl_take isl_poly *poly2) { int i; isl_bool is_zero, is_nan, is_cst; isl_poly_rec *rec1, *rec2; if (!poly1 || !poly2) goto error; is_nan = isl_poly_is_nan(poly1); if (is_nan < 0) goto error; if (is_nan) { isl_poly_free(poly2); return poly1; } is_nan = isl_poly_is_nan(poly2); if (is_nan < 0) goto error; if (is_nan) { isl_poly_free(poly1); return poly2; } is_zero = isl_poly_is_zero(poly1); if (is_zero < 0) goto error; if (is_zero) { isl_poly_free(poly1); return poly2; } is_zero = isl_poly_is_zero(poly2); if (is_zero < 0) goto error; if (is_zero) { isl_poly_free(poly2); return poly1; } if (poly1->var < poly2->var) return isl_poly_sum(poly2, poly1); if (poly2->var < poly1->var) { isl_poly_rec *rec; isl_bool is_infty; is_infty = isl_poly_is_infty(poly2); if (is_infty >= 0 && !is_infty) is_infty = isl_poly_is_neginfty(poly2); if (is_infty < 0) goto error; if (is_infty) { isl_poly_free(poly1); return poly2; } poly1 = isl_poly_cow(poly1); rec = isl_poly_as_rec(poly1); if (!rec) goto error; rec->p[0] = isl_poly_sum(rec->p[0], poly2); if (rec->n == 1) poly1 = replace_by_constant_term(poly1); return poly1; } is_cst = isl_poly_is_cst(poly1); if (is_cst < 0) goto error; if (is_cst) return isl_poly_sum_cst(poly1, poly2); rec1 = isl_poly_as_rec(poly1); rec2 = isl_poly_as_rec(poly2); if (!rec1 || !rec2) goto error; if (rec1->n < rec2->n) return isl_poly_sum(poly2, poly1); poly1 = isl_poly_cow(poly1); rec1 = isl_poly_as_rec(poly1); if (!rec1) goto error; for (i = rec2->n - 1; i >= 0; --i) { isl_bool is_zero; rec1->p[i] = isl_poly_sum(rec1->p[i], isl_poly_copy(rec2->p[i])); if (!rec1->p[i]) goto error; if (i != rec1->n - 1) continue; is_zero = isl_poly_is_zero(rec1->p[i]); if (is_zero < 0) goto error; if (is_zero) { isl_poly_free(rec1->p[i]); rec1->n--; } } if (rec1->n == 0) poly1 = replace_by_zero(poly1); else if (rec1->n == 1) poly1 = replace_by_constant_term(poly1); isl_poly_free(poly2); return poly1; error: isl_poly_free(poly1); isl_poly_free(poly2); return NULL; } __isl_give isl_poly *isl_poly_cst_add_isl_int(__isl_take isl_poly *poly, isl_int v) { isl_poly_cst *cst; poly = isl_poly_cow(poly); if (!poly) return NULL; cst = isl_poly_as_cst(poly); isl_int_addmul(cst->n, cst->d, v); return poly; } __isl_give isl_poly *isl_poly_add_isl_int(__isl_take isl_poly *poly, isl_int v) { isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return isl_poly_cst_add_isl_int(poly, v); poly = isl_poly_cow(poly); rec = isl_poly_as_rec(poly); if (!rec) goto error; rec->p[0] = isl_poly_add_isl_int(rec->p[0], v); if (!rec->p[0]) goto error; return poly; error: isl_poly_free(poly); return NULL; } __isl_give isl_poly *isl_poly_cst_mul_isl_int(__isl_take isl_poly *poly, isl_int v) { isl_bool is_zero; isl_poly_cst *cst; is_zero = isl_poly_is_zero(poly); if (is_zero < 0) return isl_poly_free(poly); if (is_zero) return poly; poly = isl_poly_cow(poly); if (!poly) return NULL; cst = isl_poly_as_cst(poly); isl_int_mul(cst->n, cst->n, v); return poly; } __isl_give isl_poly *isl_poly_mul_isl_int(__isl_take isl_poly *poly, isl_int v) { int i; isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return isl_poly_cst_mul_isl_int(poly, v); poly = isl_poly_cow(poly); rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { rec->p[i] = isl_poly_mul_isl_int(rec->p[i], v); if (!rec->p[i]) goto error; } return poly; error: isl_poly_free(poly); return NULL; } /* Multiply the constant polynomial "poly" by "v". */ static __isl_give isl_poly *isl_poly_cst_scale_val(__isl_take isl_poly *poly, __isl_keep isl_val *v) { isl_bool is_zero; isl_poly_cst *cst; is_zero = isl_poly_is_zero(poly); if (is_zero < 0) return isl_poly_free(poly); if (is_zero) return poly; poly = isl_poly_cow(poly); if (!poly) return NULL; cst = isl_poly_as_cst(poly); isl_int_mul(cst->n, cst->n, v->n); isl_int_mul(cst->d, cst->d, v->d); isl_poly_cst_reduce(cst); return poly; } /* Multiply the polynomial "poly" by "v". */ static __isl_give isl_poly *isl_poly_scale_val(__isl_take isl_poly *poly, __isl_keep isl_val *v) { int i; isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return isl_poly_cst_scale_val(poly, v); poly = isl_poly_cow(poly); rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { rec->p[i] = isl_poly_scale_val(rec->p[i], v); if (!rec->p[i]) goto error; } return poly; error: isl_poly_free(poly); return NULL; } __isl_give isl_poly *isl_poly_mul_cst(__isl_take isl_poly *poly1, __isl_take isl_poly *poly2) { isl_poly_cst *cst1; isl_poly_cst *cst2; poly1 = isl_poly_cow(poly1); if (!poly1 || !poly2) goto error; cst1 = isl_poly_as_cst(poly1); cst2 = isl_poly_as_cst(poly2); isl_int_mul(cst1->n, cst1->n, cst2->n); isl_int_mul(cst1->d, cst1->d, cst2->d); isl_poly_cst_reduce(cst1); isl_poly_free(poly2); return poly1; error: isl_poly_free(poly1); isl_poly_free(poly2); return NULL; } __isl_give isl_poly *isl_poly_mul_rec(__isl_take isl_poly *poly1, __isl_take isl_poly *poly2) { isl_poly_rec *rec1; isl_poly_rec *rec2; isl_poly_rec *res = NULL; int i, j; int size; rec1 = isl_poly_as_rec(poly1); rec2 = isl_poly_as_rec(poly2); if (!rec1 || !rec2) goto error; size = rec1->n + rec2->n - 1; res = isl_poly_alloc_rec(poly1->ctx, poly1->var, size); if (!res) goto error; for (i = 0; i < rec1->n; ++i) { res->p[i] = isl_poly_mul(isl_poly_copy(rec2->p[0]), isl_poly_copy(rec1->p[i])); if (!res->p[i]) goto error; res->n++; } for (; i < size; ++i) { res->p[i] = isl_poly_zero(poly1->ctx); if (!res->p[i]) goto error; res->n++; } for (i = 0; i < rec1->n; ++i) { for (j = 1; j < rec2->n; ++j) { isl_poly *poly; poly = isl_poly_mul(isl_poly_copy(rec2->p[j]), isl_poly_copy(rec1->p[i])); res->p[i + j] = isl_poly_sum(res->p[i + j], poly); if (!res->p[i + j]) goto error; } } isl_poly_free(poly1); isl_poly_free(poly2); return &res->poly; error: isl_poly_free(poly1); isl_poly_free(poly2); isl_poly_free(&res->poly); return NULL; } __isl_give isl_poly *isl_poly_mul(__isl_take isl_poly *poly1, __isl_take isl_poly *poly2) { isl_bool is_zero, is_nan, is_one, is_cst; if (!poly1 || !poly2) goto error; is_nan = isl_poly_is_nan(poly1); if (is_nan < 0) goto error; if (is_nan) { isl_poly_free(poly2); return poly1; } is_nan = isl_poly_is_nan(poly2); if (is_nan < 0) goto error; if (is_nan) { isl_poly_free(poly1); return poly2; } is_zero = isl_poly_is_zero(poly1); if (is_zero < 0) goto error; if (is_zero) { isl_poly_free(poly2); return poly1; } is_zero = isl_poly_is_zero(poly2); if (is_zero < 0) goto error; if (is_zero) { isl_poly_free(poly1); return poly2; } is_one = isl_poly_is_one(poly1); if (is_one < 0) goto error; if (is_one) { isl_poly_free(poly1); return poly2; } is_one = isl_poly_is_one(poly2); if (is_one < 0) goto error; if (is_one) { isl_poly_free(poly2); return poly1; } if (poly1->var < poly2->var) return isl_poly_mul(poly2, poly1); if (poly2->var < poly1->var) { int i; isl_poly_rec *rec; isl_bool is_infty; is_infty = isl_poly_is_infty(poly2); if (is_infty >= 0 && !is_infty) is_infty = isl_poly_is_neginfty(poly2); if (is_infty < 0) goto error; if (is_infty) { isl_ctx *ctx = poly1->ctx; isl_poly_free(poly1); isl_poly_free(poly2); return isl_poly_nan(ctx); } poly1 = isl_poly_cow(poly1); rec = isl_poly_as_rec(poly1); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { rec->p[i] = isl_poly_mul(rec->p[i], isl_poly_copy(poly2)); if (!rec->p[i]) goto error; } isl_poly_free(poly2); return poly1; } is_cst = isl_poly_is_cst(poly1); if (is_cst < 0) goto error; if (is_cst) return isl_poly_mul_cst(poly1, poly2); return isl_poly_mul_rec(poly1, poly2); error: isl_poly_free(poly1); isl_poly_free(poly2); return NULL; } __isl_give isl_poly *isl_poly_pow(__isl_take isl_poly *poly, unsigned power) { isl_poly *res; if (!poly) return NULL; if (power == 1) return poly; if (power % 2) res = isl_poly_copy(poly); else res = isl_poly_one(poly->ctx); while (power >>= 1) { poly = isl_poly_mul(poly, isl_poly_copy(poly)); if (power % 2) res = isl_poly_mul(res, isl_poly_copy(poly)); } isl_poly_free(poly); return res; } __isl_give isl_qpolynomial *isl_qpolynomial_alloc(__isl_take isl_space *space, unsigned n_div, __isl_take isl_poly *poly) { struct isl_qpolynomial *qp = NULL; isl_size total; total = isl_space_dim(space, isl_dim_all); if (total < 0 || !poly) goto error; if (!isl_space_is_set(space)) isl_die(isl_space_get_ctx(space), isl_error_invalid, "domain of polynomial should be a set", goto error); qp = isl_calloc_type(space->ctx, struct isl_qpolynomial); if (!qp) goto error; qp->ref = 1; qp->div = isl_mat_alloc(space->ctx, n_div, 1 + 1 + total + n_div); if (!qp->div) goto error; qp->dim = space; qp->poly = poly; return qp; error: isl_space_free(space); isl_poly_free(poly); isl_qpolynomial_free(qp); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp) { if (!qp) return NULL; qp->ref++; return qp; } #undef TYPE #define TYPE isl_qpolynomial #undef FIELD_TYPE #define FIELD_TYPE isl_poly #undef FIELD_NAME #define FIELD_NAME poly #undef PROPERTY #define PROPERTY poly static #include "isl_take_templ.c" static #include "isl_restore_templ.c" __isl_give isl_qpolynomial *isl_qpolynomial_dup(__isl_keep isl_qpolynomial *qp) { isl_poly *poly; struct isl_qpolynomial *dup; if (!qp) return NULL; poly = isl_qpolynomial_get_poly(qp); dup = isl_qpolynomial_alloc(isl_space_copy(qp->dim), qp->div->n_row, poly); if (!dup) return NULL; isl_mat_free(dup->div); dup->div = isl_qpolynomial_get_local(qp); if (!dup->div) goto error; return dup; error: isl_qpolynomial_free(dup); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_cow(__isl_take isl_qpolynomial *qp) { if (!qp) return NULL; if (qp->ref == 1) return qp; qp->ref--; return isl_qpolynomial_dup(qp); } __isl_null isl_qpolynomial *isl_qpolynomial_free( __isl_take isl_qpolynomial *qp) { if (!qp) return NULL; if (--qp->ref > 0) return NULL; isl_space_free(qp->dim); isl_mat_free(qp->div); isl_poly_free(qp->poly); free(qp); return NULL; } __isl_give isl_poly *isl_poly_var_pow(isl_ctx *ctx, int pos, int power) { int i; isl_poly_rec *rec; isl_poly_cst *cst; rec = isl_poly_alloc_rec(ctx, pos, 1 + power); if (!rec) return NULL; for (i = 0; i < 1 + power; ++i) { rec->p[i] = isl_poly_zero(ctx); if (!rec->p[i]) goto error; rec->n++; } cst = isl_poly_as_cst(rec->p[power]); isl_int_set_si(cst->n, 1); return &rec->poly; error: isl_poly_free(&rec->poly); return NULL; } /* r array maps original positions to new positions. */ static __isl_give isl_poly *reorder(__isl_take isl_poly *poly, int *r) { int i; isl_bool is_cst; isl_poly_rec *rec; isl_poly *base; isl_poly *res; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return poly; rec = isl_poly_as_rec(poly); if (!rec) goto error; isl_assert(poly->ctx, rec->n >= 1, goto error); base = isl_poly_var_pow(poly->ctx, r[poly->var], 1); res = reorder(isl_poly_copy(rec->p[rec->n - 1]), r); for (i = rec->n - 2; i >= 0; --i) { res = isl_poly_mul(res, isl_poly_copy(base)); res = isl_poly_sum(res, reorder(isl_poly_copy(rec->p[i]), r)); } isl_poly_free(base); isl_poly_free(poly); return res; error: isl_poly_free(poly); return NULL; } static isl_bool compatible_divs(__isl_keep isl_mat *div1, __isl_keep isl_mat *div2) { int n_row, n_col; isl_bool equal; isl_assert(div1->ctx, div1->n_row >= div2->n_row && div1->n_col >= div2->n_col, return isl_bool_error); if (div1->n_row == div2->n_row) return isl_mat_is_equal(div1, div2); n_row = div1->n_row; n_col = div1->n_col; div1->n_row = div2->n_row; div1->n_col = div2->n_col; equal = isl_mat_is_equal(div1, div2); div1->n_row = n_row; div1->n_col = n_col; return equal; } static int cmp_row(__isl_keep isl_mat *div, int i, int j) { int li, lj; li = isl_seq_last_non_zero(div->row[i], div->n_col); lj = isl_seq_last_non_zero(div->row[j], div->n_col); if (li != lj) return li - lj; return isl_seq_cmp(div->row[i], div->row[j], div->n_col); } struct isl_div_sort_info { isl_mat *div; int row; }; static int div_sort_cmp(const void *p1, const void *p2) { const struct isl_div_sort_info *i1, *i2; i1 = (const struct isl_div_sort_info *) p1; i2 = (const struct isl_div_sort_info *) p2; return cmp_row(i1->div, i1->row, i2->row); } /* Sort divs and remove duplicates. */ static __isl_give isl_qpolynomial *sort_divs(__isl_take isl_qpolynomial *qp) { int i; int skip; int len; struct isl_div_sort_info *array = NULL; int *pos = NULL, *at = NULL; int *reordering = NULL; isl_size div_pos; if (!qp) return NULL; if (qp->div->n_row <= 1) return qp; div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) return isl_qpolynomial_free(qp); array = isl_alloc_array(qp->div->ctx, struct isl_div_sort_info, qp->div->n_row); pos = isl_alloc_array(qp->div->ctx, int, qp->div->n_row); at = isl_alloc_array(qp->div->ctx, int, qp->div->n_row); len = qp->div->n_col - 2; reordering = isl_alloc_array(qp->div->ctx, int, len); if (!array || !pos || !at || !reordering) goto error; for (i = 0; i < qp->div->n_row; ++i) { array[i].div = qp->div; array[i].row = i; pos[i] = i; at[i] = i; } qsort(array, qp->div->n_row, sizeof(struct isl_div_sort_info), div_sort_cmp); for (i = 0; i < div_pos; ++i) reordering[i] = i; for (i = 0; i < qp->div->n_row; ++i) { if (pos[array[i].row] == i) continue; qp->div = isl_mat_swap_rows(qp->div, i, pos[array[i].row]); pos[at[i]] = pos[array[i].row]; at[pos[array[i].row]] = at[i]; at[i] = array[i].row; pos[array[i].row] = i; } skip = 0; for (i = 0; i < len - div_pos; ++i) { if (i > 0 && isl_seq_eq(qp->div->row[i - skip - 1], qp->div->row[i - skip], qp->div->n_col)) { qp->div = isl_mat_drop_rows(qp->div, i - skip, 1); isl_mat_col_add(qp->div, 2 + div_pos + i - skip - 1, 2 + div_pos + i - skip); qp->div = isl_mat_drop_cols(qp->div, 2 + div_pos + i - skip, 1); skip++; } reordering[div_pos + array[i].row] = div_pos + i - skip; } qp->poly = reorder(qp->poly, reordering); if (!qp->poly || !qp->div) goto error; free(at); free(pos); free(array); free(reordering); return qp; error: free(at); free(pos); free(array); free(reordering); isl_qpolynomial_free(qp); return NULL; } static __isl_give isl_poly *expand(__isl_take isl_poly *poly, int *exp, int first) { int i; isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return poly; if (poly->var < first) return poly; if (exp[poly->var - first] == poly->var - first) return poly; poly = isl_poly_cow(poly); if (!poly) goto error; poly->var = exp[poly->var - first] + first; rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { rec->p[i] = expand(rec->p[i], exp, first); if (!rec->p[i]) goto error; } return poly; error: isl_poly_free(poly); return NULL; } static __isl_give isl_qpolynomial *with_merged_divs( __isl_give isl_qpolynomial *(*fn)(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2), __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { int *exp1 = NULL; int *exp2 = NULL; isl_mat *div = NULL; int n_div1, n_div2; qp1 = isl_qpolynomial_cow(qp1); qp2 = isl_qpolynomial_cow(qp2); if (!qp1 || !qp2) goto error; isl_assert(qp1->div->ctx, qp1->div->n_row >= qp2->div->n_row && qp1->div->n_col >= qp2->div->n_col, goto error); n_div1 = qp1->div->n_row; n_div2 = qp2->div->n_row; exp1 = isl_alloc_array(qp1->div->ctx, int, n_div1); exp2 = isl_alloc_array(qp2->div->ctx, int, n_div2); if ((n_div1 && !exp1) || (n_div2 && !exp2)) goto error; div = isl_merge_divs(qp1->div, qp2->div, exp1, exp2); if (!div) goto error; isl_mat_free(qp1->div); qp1->div = isl_mat_copy(div); isl_mat_free(qp2->div); qp2->div = isl_mat_copy(div); qp1->poly = expand(qp1->poly, exp1, div->n_col - div->n_row - 2); qp2->poly = expand(qp2->poly, exp2, div->n_col - div->n_row - 2); if (!qp1->poly || !qp2->poly) goto error; isl_mat_free(div); free(exp1); free(exp2); return fn(qp1, qp2); error: isl_mat_free(div); free(exp1); free(exp2); isl_qpolynomial_free(qp1); isl_qpolynomial_free(qp2); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_add(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { isl_bool compatible; isl_poly *poly; if (isl_qpolynomial_check_equal_space(qp1, qp2) < 0) goto error; if (qp1->div->n_row < qp2->div->n_row) return isl_qpolynomial_add(qp2, qp1); compatible = compatible_divs(qp1->div, qp2->div); if (compatible < 0) goto error; if (!compatible) return with_merged_divs(isl_qpolynomial_add, qp1, qp2); poly = isl_qpolynomial_take_poly(qp1); poly = isl_poly_sum(poly, isl_qpolynomial_get_poly(qp2)); qp1 = isl_qpolynomial_restore_poly(qp1, poly); isl_qpolynomial_free(qp2); return qp1; error: isl_qpolynomial_free(qp1); isl_qpolynomial_free(qp2); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_add_on_domain( __isl_keep isl_set *dom, __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { qp1 = isl_qpolynomial_add(qp1, qp2); qp1 = isl_qpolynomial_gist(qp1, isl_set_copy(dom)); return qp1; } __isl_give isl_qpolynomial *isl_qpolynomial_sub(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { return isl_qpolynomial_add(qp1, isl_qpolynomial_neg(qp2)); } __isl_give isl_qpolynomial *isl_qpolynomial_add_isl_int( __isl_take isl_qpolynomial *qp, isl_int v) { isl_poly *poly; if (isl_int_is_zero(v)) return qp; poly = isl_qpolynomial_take_poly(qp); poly = isl_poly_add_isl_int(poly, v); qp = isl_qpolynomial_restore_poly(qp, poly); return qp; } __isl_give isl_qpolynomial *isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp) { if (!qp) return NULL; return isl_qpolynomial_mul_isl_int(qp, qp->dim->ctx->negone); } __isl_give isl_qpolynomial *isl_qpolynomial_mul_isl_int( __isl_take isl_qpolynomial *qp, isl_int v) { isl_poly *poly; if (isl_int_is_one(v)) return qp; if (qp && isl_int_is_zero(v)) { isl_qpolynomial *zero; zero = isl_qpolynomial_zero_on_domain(isl_space_copy(qp->dim)); isl_qpolynomial_free(qp); return zero; } poly = isl_qpolynomial_take_poly(qp); poly = isl_poly_mul_isl_int(poly, v); qp = isl_qpolynomial_restore_poly(qp, poly); return qp; } __isl_give isl_qpolynomial *isl_qpolynomial_scale( __isl_take isl_qpolynomial *qp, isl_int v) { return isl_qpolynomial_mul_isl_int(qp, v); } /* Multiply "qp" by "v". */ __isl_give isl_qpolynomial *isl_qpolynomial_scale_val( __isl_take isl_qpolynomial *qp, __isl_take isl_val *v) { isl_poly *poly; if (!qp || !v) goto error; if (!isl_val_is_rat(v)) isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, "expecting rational factor", goto error); if (isl_val_is_one(v)) { isl_val_free(v); return qp; } if (isl_val_is_zero(v)) { isl_space *space; space = isl_qpolynomial_get_domain_space(qp); isl_qpolynomial_free(qp); isl_val_free(v); return isl_qpolynomial_zero_on_domain(space); } poly = isl_qpolynomial_take_poly(qp); poly = isl_poly_scale_val(poly, v); qp = isl_qpolynomial_restore_poly(qp, poly); isl_val_free(v); return qp; error: isl_val_free(v); isl_qpolynomial_free(qp); return NULL; } /* Divide "qp" by "v". */ __isl_give isl_qpolynomial *isl_qpolynomial_scale_down_val( __isl_take isl_qpolynomial *qp, __isl_take isl_val *v) { if (!qp || !v) goto error; if (!isl_val_is_rat(v)) isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, "expecting rational factor", goto error); if (isl_val_is_zero(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "cannot scale down by zero", goto error); return isl_qpolynomial_scale_val(qp, isl_val_inv(v)); error: isl_val_free(v); isl_qpolynomial_free(qp); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_mul(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2) { isl_bool compatible; isl_poly *poly; if (isl_qpolynomial_check_equal_space(qp1, qp2) < 0) goto error; if (qp1->div->n_row < qp2->div->n_row) return isl_qpolynomial_mul(qp2, qp1); compatible = compatible_divs(qp1->div, qp2->div); if (compatible < 0) goto error; if (!compatible) return with_merged_divs(isl_qpolynomial_mul, qp1, qp2); poly = isl_qpolynomial_take_poly(qp1); poly = isl_poly_mul(poly, isl_qpolynomial_get_poly(qp2)); qp1 = isl_qpolynomial_restore_poly(qp1, poly); isl_qpolynomial_free(qp2); return qp1; error: isl_qpolynomial_free(qp1); isl_qpolynomial_free(qp2); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_pow(__isl_take isl_qpolynomial *qp, unsigned power) { isl_poly *poly; poly = isl_qpolynomial_take_poly(qp); poly = isl_poly_pow(poly, power); qp = isl_qpolynomial_restore_poly(qp, poly); return qp; } __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow( __isl_take isl_pw_qpolynomial *pwqp, unsigned power) { int i; if (power == 1) return pwqp; pwqp = isl_pw_qpolynomial_cow(pwqp); if (!pwqp) return NULL; for (i = 0; i < pwqp->n; ++i) { pwqp->p[i].qp = isl_qpolynomial_pow(pwqp->p[i].qp, power); if (!pwqp->p[i].qp) return isl_pw_qpolynomial_free(pwqp); } return pwqp; } __isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain( __isl_take isl_space *domain) { if (!domain) return NULL; return isl_qpolynomial_alloc(domain, 0, isl_poly_zero(domain->ctx)); } __isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain( __isl_take isl_space *domain) { if (!domain) return NULL; return isl_qpolynomial_alloc(domain, 0, isl_poly_one(domain->ctx)); } __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain( __isl_take isl_space *domain) { if (!domain) return NULL; return isl_qpolynomial_alloc(domain, 0, isl_poly_infty(domain->ctx)); } __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain( __isl_take isl_space *domain) { if (!domain) return NULL; return isl_qpolynomial_alloc(domain, 0, isl_poly_neginfty(domain->ctx)); } __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain( __isl_take isl_space *domain) { if (!domain) return NULL; return isl_qpolynomial_alloc(domain, 0, isl_poly_nan(domain->ctx)); } __isl_give isl_qpolynomial *isl_qpolynomial_cst_on_domain( __isl_take isl_space *domain, isl_int v) { struct isl_qpolynomial *qp; isl_poly_cst *cst; qp = isl_qpolynomial_zero_on_domain(domain); if (!qp) return NULL; cst = isl_poly_as_cst(qp->poly); isl_int_set(cst->n, v); return qp; } isl_bool isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, isl_int *n, isl_int *d) { isl_bool is_cst; isl_poly *poly; isl_poly_cst *cst; poly = isl_qpolynomial_peek_poly(qp); is_cst = isl_poly_is_cst(poly); if (is_cst < 0 || !is_cst) return is_cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_bool_error; if (n) isl_int_set(*n, cst->n); if (d) isl_int_set(*d, cst->d); return isl_bool_true; } /* Return the constant term of "poly". */ static __isl_give isl_val *isl_poly_get_constant_val(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_cst *cst; if (!poly) return NULL; while ((is_cst = isl_poly_is_cst(poly)) == isl_bool_false) { isl_poly_rec *rec; rec = isl_poly_as_rec(poly); if (!rec) return NULL; poly = rec->p[0]; } if (is_cst < 0) return NULL; cst = isl_poly_as_cst(poly); if (!cst) return NULL; return isl_val_rat_from_isl_int(cst->poly.ctx, cst->n, cst->d); } /* Return the constant term of "qp". */ __isl_give isl_val *isl_qpolynomial_get_constant_val( __isl_keep isl_qpolynomial *qp) { return isl_poly_get_constant_val(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_poly_is_affine(__isl_keep isl_poly *poly) { isl_bool is_cst; isl_poly_rec *rec; if (!poly) return isl_bool_error; if (poly->var < 0) return isl_bool_true; rec = isl_poly_as_rec(poly); if (!rec) return isl_bool_error; if (rec->n > 2) return isl_bool_false; isl_assert(poly->ctx, rec->n > 1, return isl_bool_error); is_cst = isl_poly_is_cst(rec->p[1]); if (is_cst < 0 || !is_cst) return is_cst; return isl_poly_is_affine(rec->p[0]); } /* Can "qp" be converted to an isl_aff? * That is, does it represent a quasi-affine expression? */ isl_bool isl_qpolynomial_isa_aff(__isl_keep isl_qpolynomial *qp) { return isl_poly_is_affine(isl_qpolynomial_peek_poly(qp)); } isl_bool isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial *qp) { if (!qp) return isl_bool_error; if (qp->div->n_row > 0) return isl_bool_false; return isl_qpolynomial_isa_aff(qp); } static void update_coeff(__isl_keep isl_vec *aff, __isl_keep isl_poly_cst *cst, int pos) { isl_int gcd; isl_int f; if (isl_int_is_zero(cst->n)) return; isl_int_init(gcd); isl_int_init(f); isl_int_gcd(gcd, cst->d, aff->el[0]); isl_int_divexact(f, cst->d, gcd); isl_int_divexact(gcd, aff->el[0], gcd); isl_seq_scale(aff->el, aff->el, f, aff->size); isl_int_mul(aff->el[1 + pos], gcd, cst->n); isl_int_clear(gcd); isl_int_clear(f); } int isl_poly_update_affine(__isl_keep isl_poly *poly, __isl_keep isl_vec *aff) { isl_poly_cst *cst; isl_poly_rec *rec; if (!poly || !aff) return -1; if (poly->var < 0) { isl_poly_cst *cst; cst = isl_poly_as_cst(poly); if (!cst) return -1; update_coeff(aff, cst, 0); return 0; } rec = isl_poly_as_rec(poly); if (!rec) return -1; isl_assert(poly->ctx, rec->n == 2, return -1); cst = isl_poly_as_cst(rec->p[1]); if (!cst) return -1; update_coeff(aff, cst, 1 + poly->var); return isl_poly_update_affine(rec->p[0], aff); } __isl_give isl_vec *isl_qpolynomial_extract_affine( __isl_keep isl_qpolynomial *qp) { isl_vec *aff; isl_size d; d = isl_qpolynomial_domain_dim(qp, isl_dim_all); if (d < 0) return NULL; aff = isl_vec_alloc(qp->div->ctx, 2 + d); if (!aff) return NULL; isl_seq_clr(aff->el + 1, 1 + d); isl_int_set_si(aff->el[0], 1); if (isl_poly_update_affine(qp->poly, aff) < 0) goto error; return aff; error: isl_vec_free(aff); return NULL; } /* Compare two quasi-polynomials. * * Return -1 if "qp1" is "smaller" than "qp2", 1 if "qp1" is "greater" * than "qp2" and 0 if they are equal. */ int isl_qpolynomial_plain_cmp(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2) { int cmp; if (qp1 == qp2) return 0; if (!qp1) return -1; if (!qp2) return 1; cmp = isl_space_cmp(qp1->dim, qp2->dim); if (cmp != 0) return cmp; cmp = isl_local_cmp(qp1->div, qp2->div); if (cmp != 0) return cmp; return isl_poly_plain_cmp(qp1->poly, qp2->poly); } /* Is "qp1" obviously equal to "qp2"? * * NaN is not equal to anything, not even to another NaN. */ isl_bool isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2) { isl_bool equal; if (!qp1 || !qp2) return isl_bool_error; if (isl_qpolynomial_is_nan(qp1) || isl_qpolynomial_is_nan(qp2)) return isl_bool_false; equal = isl_space_is_equal(qp1->dim, qp2->dim); if (equal < 0 || !equal) return equal; equal = isl_mat_is_equal(qp1->div, qp2->div); if (equal < 0 || !equal) return equal; return isl_poly_is_equal(qp1->poly, qp2->poly); } static isl_stat poly_update_den(__isl_keep isl_poly *poly, isl_int *d) { int i; isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_stat_error; if (is_cst) { isl_poly_cst *cst; cst = isl_poly_as_cst(poly); if (!cst) return isl_stat_error; isl_int_lcm(*d, *d, cst->d); return isl_stat_ok; } rec = isl_poly_as_rec(poly); if (!rec) return isl_stat_error; for (i = 0; i < rec->n; ++i) poly_update_den(rec->p[i], d); return isl_stat_ok; } __isl_give isl_val *isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp) { isl_val *d; if (!qp) return NULL; d = isl_val_one(isl_qpolynomial_get_ctx(qp)); if (!d) return NULL; if (poly_update_den(qp->poly, &d->n) < 0) return isl_val_free(d); return d; } __isl_give isl_qpolynomial *isl_qpolynomial_var_pow_on_domain( __isl_take isl_space *domain, int pos, int power) { struct isl_ctx *ctx; if (!domain) return NULL; ctx = domain->ctx; return isl_qpolynomial_alloc(domain, 0, isl_poly_var_pow(ctx, pos, power)); } __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain( __isl_take isl_space *domain, enum isl_dim_type type, unsigned pos) { isl_size off; if (isl_space_check_is_set(domain) < 0) goto error; if (isl_space_check_range(domain, type, pos, 1) < 0) goto error; off = isl_space_offset(domain, type); if (off < 0) goto error; return isl_qpolynomial_var_pow_on_domain(domain, off + pos, 1); error: isl_space_free(domain); return NULL; } __isl_give isl_poly *isl_poly_subs(__isl_take isl_poly *poly, unsigned first, unsigned n, __isl_keep isl_poly **subs) { int i; isl_bool is_cst; isl_poly_rec *rec; isl_poly *base, *res; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst) return poly; if (poly->var < first) return poly; rec = isl_poly_as_rec(poly); if (!rec) goto error; isl_assert(poly->ctx, rec->n >= 1, goto error); if (poly->var >= first + n) base = isl_poly_var_pow(poly->ctx, poly->var, 1); else base = isl_poly_copy(subs[poly->var - first]); res = isl_poly_subs(isl_poly_copy(rec->p[rec->n - 1]), first, n, subs); for (i = rec->n - 2; i >= 0; --i) { isl_poly *t; t = isl_poly_subs(isl_poly_copy(rec->p[i]), first, n, subs); res = isl_poly_mul(res, isl_poly_copy(base)); res = isl_poly_sum(res, t); } isl_poly_free(base); isl_poly_free(poly); return res; error: isl_poly_free(poly); return NULL; } __isl_give isl_poly *isl_poly_from_affine(isl_ctx *ctx, isl_int *f, isl_int denom, unsigned len) { int i; isl_poly *poly; isl_assert(ctx, len >= 1, return NULL); poly = isl_poly_rat_cst(ctx, f[0], denom); for (i = 0; i < len - 1; ++i) { isl_poly *t; isl_poly *c; if (isl_int_is_zero(f[1 + i])) continue; c = isl_poly_rat_cst(ctx, f[1 + i], denom); t = isl_poly_var_pow(ctx, i, 1); t = isl_poly_mul(c, t); poly = isl_poly_sum(poly, t); } return poly; } /* Remove common factor of non-constant terms and denominator. */ static void normalize_div(__isl_keep isl_qpolynomial *qp, int div) { isl_ctx *ctx = qp->div->ctx; unsigned total = qp->div->n_col - 2; isl_seq_gcd(qp->div->row[div] + 2, total, &ctx->normalize_gcd); isl_int_gcd(ctx->normalize_gcd, ctx->normalize_gcd, qp->div->row[div][0]); if (isl_int_is_one(ctx->normalize_gcd)) return; isl_seq_scale_down(qp->div->row[div] + 2, qp->div->row[div] + 2, ctx->normalize_gcd, total); isl_int_divexact(qp->div->row[div][0], qp->div->row[div][0], ctx->normalize_gcd); isl_int_fdiv_q(qp->div->row[div][1], qp->div->row[div][1], ctx->normalize_gcd); } /* Replace the integer division identified by "div" by the polynomial "s". * The integer division is assumed not to appear in the definition * of any other integer divisions. */ static __isl_give isl_qpolynomial *substitute_div( __isl_take isl_qpolynomial *qp, int div, __isl_take isl_poly *s) { int i; isl_size div_pos; int *reordering; isl_ctx *ctx; if (!qp || !s) goto error; qp = isl_qpolynomial_cow(qp); if (!qp) goto error; div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) goto error; qp->poly = isl_poly_subs(qp->poly, div_pos + div, 1, &s); if (!qp->poly) goto error; ctx = isl_qpolynomial_get_ctx(qp); reordering = isl_alloc_array(ctx, int, div_pos + qp->div->n_row); if (!reordering) goto error; for (i = 0; i < div_pos + div; ++i) reordering[i] = i; for (i = div_pos + div + 1; i < div_pos + qp->div->n_row; ++i) reordering[i] = i - 1; qp->div = isl_mat_drop_rows(qp->div, div, 1); qp->div = isl_mat_drop_cols(qp->div, 2 + div_pos + div, 1); qp->poly = reorder(qp->poly, reordering); free(reordering); if (!qp->poly || !qp->div) goto error; isl_poly_free(s); return qp; error: isl_qpolynomial_free(qp); isl_poly_free(s); return NULL; } /* Replace all integer divisions [e/d] that turn out to not actually be integer * divisions because d is equal to 1 by their definition, i.e., e. */ static __isl_give isl_qpolynomial *substitute_non_divs( __isl_take isl_qpolynomial *qp) { int i, j; isl_size div_pos; isl_poly *s; div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) return isl_qpolynomial_free(qp); for (i = 0; qp && i < qp->div->n_row; ++i) { if (!isl_int_is_one(qp->div->row[i][0])) continue; for (j = i + 1; j < qp->div->n_row; ++j) { if (isl_int_is_zero(qp->div->row[j][2 + div_pos + i])) continue; isl_seq_combine(qp->div->row[j] + 1, qp->div->ctx->one, qp->div->row[j] + 1, qp->div->row[j][2 + div_pos + i], qp->div->row[i] + 1, 1 + div_pos + i); isl_int_set_si(qp->div->row[j][2 + div_pos + i], 0); normalize_div(qp, j); } s = isl_poly_from_affine(qp->dim->ctx, qp->div->row[i] + 1, qp->div->row[i][0], qp->div->n_col - 1); qp = substitute_div(qp, i, s); --i; } return qp; } /* Reduce the coefficients of div "div" to lie in the interval [0, d-1], * with d the denominator. When replacing the coefficient e of x by * d * frac(e/d) = e - d * floor(e/d), we are subtracting d * floor(e/d) * x * inside the division, so we need to add floor(e/d) * x outside. * That is, we replace q by q' + floor(e/d) * x and we therefore need * to adjust the coefficient of x in each later div that depends on the * current div "div" and also in the affine expressions in the rows of "mat" * (if they too depend on "div"). */ static void reduce_div(__isl_keep isl_qpolynomial *qp, int div, __isl_keep isl_mat **mat) { int i, j; isl_int v; unsigned total = qp->div->n_col - qp->div->n_row - 2; isl_int_init(v); for (i = 0; i < 1 + total + div; ++i) { if (isl_int_is_nonneg(qp->div->row[div][1 + i]) && isl_int_lt(qp->div->row[div][1 + i], qp->div->row[div][0])) continue; isl_int_fdiv_q(v, qp->div->row[div][1 + i], qp->div->row[div][0]); isl_int_fdiv_r(qp->div->row[div][1 + i], qp->div->row[div][1 + i], qp->div->row[div][0]); *mat = isl_mat_col_addmul(*mat, i, v, 1 + total + div); for (j = div + 1; j < qp->div->n_row; ++j) { if (isl_int_is_zero(qp->div->row[j][2 + total + div])) continue; isl_int_addmul(qp->div->row[j][1 + i], v, qp->div->row[j][2 + total + div]); } } isl_int_clear(v); } /* Check if the last non-zero coefficient is bigger that half of the * denominator. If so, we will invert the div to further reduce the number * of distinct divs that may appear. * If the last non-zero coefficient is exactly half the denominator, * then we continue looking for earlier coefficients that are bigger * than half the denominator. */ static int needs_invert(__isl_keep isl_mat *div, int row) { int i; int cmp; for (i = div->n_col - 1; i >= 1; --i) { if (isl_int_is_zero(div->row[row][i])) continue; isl_int_mul_ui(div->row[row][i], div->row[row][i], 2); cmp = isl_int_cmp(div->row[row][i], div->row[row][0]); isl_int_divexact_ui(div->row[row][i], div->row[row][i], 2); if (cmp) return cmp > 0; if (i == 1) return 1; } return 0; } /* Replace div "div" q = [e/d] by -[(-e+(d-1))/d]. * We only invert the coefficients of e (and the coefficient of q in * later divs and in the rows of "mat"). After calling this function, the * coefficients of e should be reduced again. */ static void invert_div(__isl_keep isl_qpolynomial *qp, int div, __isl_keep isl_mat **mat) { unsigned total = qp->div->n_col - qp->div->n_row - 2; isl_seq_neg(qp->div->row[div] + 1, qp->div->row[div] + 1, qp->div->n_col - 1); isl_int_sub_ui(qp->div->row[div][1], qp->div->row[div][1], 1); isl_int_add(qp->div->row[div][1], qp->div->row[div][1], qp->div->row[div][0]); *mat = isl_mat_col_neg(*mat, 1 + total + div); isl_mat_col_mul(qp->div, 2 + total + div, qp->div->ctx->negone, 2 + total + div); } /* Reduce all divs of "qp" to have coefficients * in the interval [0, d-1], with d the denominator and such that the * last non-zero coefficient that is not equal to d/2 is smaller than d/2. * The modifications to the integer divisions need to be reflected * in the factors of the polynomial that refer to the original * integer divisions. To this end, the modifications are collected * as a set of affine expressions and then plugged into the polynomial. * * After the reduction, some divs may have become redundant or identical, * so we call substitute_non_divs and sort_divs. If these functions * eliminate divs or merge two or more divs into one, the coefficients * of the enclosing divs may have to be reduced again, so we call * ourselves recursively if the number of divs decreases. */ static __isl_give isl_qpolynomial *reduce_divs(__isl_take isl_qpolynomial *qp) { int i; isl_ctx *ctx; isl_mat *mat; isl_poly **s; unsigned o_div; isl_size n_div, total, new_n_div; total = isl_qpolynomial_domain_dim(qp, isl_dim_all); n_div = isl_qpolynomial_domain_dim(qp, isl_dim_div); o_div = isl_qpolynomial_domain_offset(qp, isl_dim_div); if (total < 0 || n_div < 0) return isl_qpolynomial_free(qp); ctx = isl_qpolynomial_get_ctx(qp); mat = isl_mat_zero(ctx, n_div, 1 + total); for (i = 0; i < n_div; ++i) mat = isl_mat_set_element_si(mat, i, o_div + i, 1); for (i = 0; i < qp->div->n_row; ++i) { normalize_div(qp, i); reduce_div(qp, i, &mat); if (needs_invert(qp->div, i)) { invert_div(qp, i, &mat); reduce_div(qp, i, &mat); } } if (!mat) goto error; s = isl_alloc_array(ctx, struct isl_poly *, n_div); if (n_div && !s) goto error; for (i = 0; i < n_div; ++i) s[i] = isl_poly_from_affine(ctx, mat->row[i], ctx->one, 1 + total); qp->poly = isl_poly_subs(qp->poly, o_div - 1, n_div, s); for (i = 0; i < n_div; ++i) isl_poly_free(s[i]); free(s); if (!qp->poly) goto error; isl_mat_free(mat); qp = substitute_non_divs(qp); qp = sort_divs(qp); new_n_div = isl_qpolynomial_domain_dim(qp, isl_dim_div); if (new_n_div < 0) return isl_qpolynomial_free(qp); if (new_n_div < n_div) return reduce_divs(qp); return qp; error: isl_qpolynomial_free(qp); isl_mat_free(mat); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( __isl_take isl_space *domain, const isl_int n, const isl_int d) { struct isl_qpolynomial *qp; isl_poly_cst *cst; qp = isl_qpolynomial_zero_on_domain(domain); if (!qp) return NULL; cst = isl_poly_as_cst(qp->poly); isl_int_set(cst->n, n); isl_int_set(cst->d, d); return qp; } /* Return an isl_qpolynomial that is equal to "val" on domain space "domain". */ __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain( __isl_take isl_space *domain, __isl_take isl_val *val) { isl_qpolynomial *qp; isl_poly_cst *cst; qp = isl_qpolynomial_zero_on_domain(domain); if (!qp || !val) goto error; cst = isl_poly_as_cst(qp->poly); isl_int_set(cst->n, val->n); isl_int_set(cst->d, val->d); isl_val_free(val); return qp; error: isl_val_free(val); isl_qpolynomial_free(qp); return NULL; } static isl_stat poly_set_active(__isl_keep isl_poly *poly, int *active, int d) { isl_bool is_cst; isl_poly_rec *rec; int i; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_stat_error; if (is_cst) return isl_stat_ok; if (poly->var < d) active[poly->var] = 1; rec = isl_poly_as_rec(poly); for (i = 0; i < rec->n; ++i) if (poly_set_active(rec->p[i], active, d) < 0) return isl_stat_error; return isl_stat_ok; } static isl_stat set_active(__isl_keep isl_qpolynomial *qp, int *active) { int i, j; isl_size d; isl_space *space; space = isl_qpolynomial_peek_domain_space(qp); d = isl_space_dim(space, isl_dim_all); if (d < 0 || !active) return isl_stat_error; for (i = 0; i < d; ++i) for (j = 0; j < qp->div->n_row; ++j) { if (isl_int_is_zero(qp->div->row[j][2 + i])) continue; active[i] = 1; break; } return poly_set_active(isl_qpolynomial_peek_poly(qp), active, d); } #undef TYPE #define TYPE isl_qpolynomial static #include "check_type_range_templ.c" isl_bool isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n) { int i; int *active = NULL; isl_bool involves = isl_bool_false; isl_size offset; isl_size d; isl_space *space; if (!qp) return isl_bool_error; if (n == 0) return isl_bool_false; if (isl_qpolynomial_check_range(qp, type, first, n) < 0) return isl_bool_error; isl_assert(qp->dim->ctx, type == isl_dim_param || type == isl_dim_in, return isl_bool_error); space = isl_qpolynomial_peek_domain_space(qp); d = isl_space_dim(space, isl_dim_all); if (d < 0) return isl_bool_error; active = isl_calloc_array(qp->dim->ctx, int, d); if (set_active(qp, active) < 0) goto error; offset = isl_qpolynomial_domain_var_offset(qp, domain_type(type)); if (offset < 0) goto error; first += offset; for (i = 0; i < n; ++i) if (active[first + i]) { involves = isl_bool_true; break; } free(active); return involves; error: free(active); return isl_bool_error; } /* Remove divs that do not appear in the quasi-polynomial, nor in any * of the divs that do appear in the quasi-polynomial. */ static __isl_give isl_qpolynomial *remove_redundant_divs( __isl_take isl_qpolynomial *qp) { int i, j; isl_size div_pos; int len; int skip; int *active = NULL; int *reordering = NULL; int redundant = 0; int n_div; isl_ctx *ctx; if (!qp) return NULL; if (qp->div->n_row == 0) return qp; div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) return isl_qpolynomial_free(qp); len = qp->div->n_col - 2; ctx = isl_qpolynomial_get_ctx(qp); active = isl_calloc_array(ctx, int, len); if (!active) goto error; if (poly_set_active(isl_qpolynomial_peek_poly(qp), active, len) < 0) goto error; for (i = qp->div->n_row - 1; i >= 0; --i) { if (!active[div_pos + i]) { redundant = 1; continue; } for (j = 0; j < i; ++j) { if (isl_int_is_zero(qp->div->row[i][2 + div_pos + j])) continue; active[div_pos + j] = 1; break; } } if (!redundant) { free(active); return qp; } reordering = isl_alloc_array(qp->div->ctx, int, len); if (!reordering) goto error; for (i = 0; i < div_pos; ++i) reordering[i] = i; skip = 0; n_div = qp->div->n_row; for (i = 0; i < n_div; ++i) { if (!active[div_pos + i]) { qp->div = isl_mat_drop_rows(qp->div, i - skip, 1); qp->div = isl_mat_drop_cols(qp->div, 2 + div_pos + i - skip, 1); skip++; } reordering[div_pos + i] = div_pos + i - skip; } qp->poly = reorder(qp->poly, reordering); if (!qp->poly || !qp->div) goto error; free(active); free(reordering); return qp; error: free(active); free(reordering); isl_qpolynomial_free(qp); return NULL; } __isl_give isl_poly *isl_poly_drop(__isl_take isl_poly *poly, unsigned first, unsigned n) { int i; isl_poly_rec *rec; if (!poly) return NULL; if (n == 0 || poly->var < 0 || poly->var < first) return poly; if (poly->var < first + n) { poly = replace_by_constant_term(poly); return isl_poly_drop(poly, first, n); } poly = isl_poly_cow(poly); if (!poly) return NULL; poly->var -= n; rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { rec->p[i] = isl_poly_drop(rec->p[i], first, n); if (!rec->p[i]) goto error; } return poly; error: isl_poly_free(poly); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned pos, const char *s) { isl_space *space; if (!qp) return NULL; if (type == isl_dim_out) isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, "cannot set name of output/set dimension", return isl_qpolynomial_free(qp)); type = domain_type(type); space = isl_qpolynomial_take_domain_space(qp); space = isl_space_set_dim_name(space, type, pos, s); qp = isl_qpolynomial_restore_domain_space(qp, space); return qp; } __isl_give isl_qpolynomial *isl_qpolynomial_drop_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n) { isl_space *space; isl_size offset; if (!qp) return NULL; if (type == isl_dim_out) isl_die(qp->dim->ctx, isl_error_invalid, "cannot drop output/set dimension", goto error); if (isl_qpolynomial_check_range(qp, type, first, n) < 0) return isl_qpolynomial_free(qp); type = domain_type(type); if (n == 0 && !isl_space_is_named_or_nested(qp->dim, type)) return qp; isl_assert(qp->dim->ctx, type == isl_dim_param || type == isl_dim_set, goto error); space = isl_qpolynomial_take_domain_space(qp); space = isl_space_drop_dims(space, type, first, n); qp = isl_qpolynomial_restore_domain_space(qp, space); qp = isl_qpolynomial_cow(qp); if (!qp) return NULL; offset = isl_qpolynomial_domain_var_offset(qp, type); if (offset < 0) goto error; first += offset; qp->div = isl_mat_drop_cols(qp->div, 2 + first, n); if (!qp->div) goto error; qp->poly = isl_poly_drop(qp->poly, first, n); if (!qp->poly) goto error; return qp; error: isl_qpolynomial_free(qp); return NULL; } /* Project the domain of the quasi-polynomial onto its parameter space. * The quasi-polynomial may not involve any of the domain dimensions. */ __isl_give isl_qpolynomial *isl_qpolynomial_project_domain_on_params( __isl_take isl_qpolynomial *qp) { isl_space *space; isl_size n; isl_bool involves; n = isl_qpolynomial_dim(qp, isl_dim_in); if (n < 0) return isl_qpolynomial_free(qp); involves = isl_qpolynomial_involves_dims(qp, isl_dim_in, 0, n); if (involves < 0) return isl_qpolynomial_free(qp); if (involves) isl_die(isl_qpolynomial_get_ctx(qp), isl_error_invalid, "polynomial involves some of the domain dimensions", return isl_qpolynomial_free(qp)); qp = isl_qpolynomial_drop_dims(qp, isl_dim_in, 0, n); space = isl_qpolynomial_get_domain_space(qp); space = isl_space_params(space); qp = isl_qpolynomial_reset_domain_space(qp, space); return qp; } static __isl_give isl_qpolynomial *isl_qpolynomial_substitute_equalities_lifted( __isl_take isl_qpolynomial *qp, __isl_take isl_basic_set *eq) { int i, j, k; isl_int denom; unsigned total; unsigned n_div; isl_poly *poly; if (!eq) goto error; if (eq->n_eq == 0) { isl_basic_set_free(eq); return qp; } qp = isl_qpolynomial_cow(qp); if (!qp) goto error; qp->div = isl_mat_cow(qp->div); if (!qp->div) goto error; total = isl_basic_set_offset(eq, isl_dim_div); n_div = eq->n_div; isl_int_init(denom); for (i = 0; i < eq->n_eq; ++i) { j = isl_seq_last_non_zero(eq->eq[i], total + n_div); if (j < 0 || j == 0 || j >= total) continue; for (k = 0; k < qp->div->n_row; ++k) { if (isl_int_is_zero(qp->div->row[k][1 + j])) continue; isl_seq_elim(qp->div->row[k] + 1, eq->eq[i], j, total, &qp->div->row[k][0]); normalize_div(qp, k); } if (isl_int_is_pos(eq->eq[i][j])) isl_seq_neg(eq->eq[i], eq->eq[i], total); isl_int_abs(denom, eq->eq[i][j]); isl_int_set_si(eq->eq[i][j], 0); poly = isl_poly_from_affine(qp->dim->ctx, eq->eq[i], denom, total); qp->poly = isl_poly_subs(qp->poly, j - 1, 1, &poly); isl_poly_free(poly); } isl_int_clear(denom); if (!qp->poly) goto error; isl_basic_set_free(eq); qp = substitute_non_divs(qp); qp = sort_divs(qp); return qp; error: isl_basic_set_free(eq); isl_qpolynomial_free(qp); return NULL; } /* Exploit the equalities in "eq" to simplify the quasi-polynomial. */ __isl_give isl_qpolynomial *isl_qpolynomial_substitute_equalities( __isl_take isl_qpolynomial *qp, __isl_take isl_basic_set *eq) { if (!qp || !eq) goto error; if (qp->div->n_row > 0) eq = isl_basic_set_add_dims(eq, isl_dim_set, qp->div->n_row); return isl_qpolynomial_substitute_equalities_lifted(qp, eq); error: isl_basic_set_free(eq); isl_qpolynomial_free(qp); return NULL; } /* Look for equalities among the variables shared by context and qp * and the integer divisions of qp, if any. * The equalities are then used to eliminate variables and/or integer * divisions from qp. */ __isl_give isl_qpolynomial *isl_qpolynomial_gist( __isl_take isl_qpolynomial *qp, __isl_take isl_set *context) { isl_local_space *ls; isl_basic_set *aff; ls = isl_qpolynomial_get_domain_local_space(qp); context = isl_local_space_lift_set(ls, context); aff = isl_set_affine_hull(context); return isl_qpolynomial_substitute_equalities_lifted(qp, aff); } __isl_give isl_qpolynomial *isl_qpolynomial_gist_params( __isl_take isl_qpolynomial *qp, __isl_take isl_set *context) { isl_space *space = isl_qpolynomial_get_domain_space(qp); isl_set *dom_context = isl_set_universe(space); dom_context = isl_set_intersect_params(dom_context, context); return isl_qpolynomial_gist(qp, dom_context); } /* Return a zero isl_qpolynomial in the given space. * * This is a helper function for isl_pw_*_as_* that ensures a uniform * interface over all piecewise types. */ static __isl_give isl_qpolynomial *isl_qpolynomial_zero_in_space( __isl_take isl_space *space) { return isl_qpolynomial_zero_on_domain(isl_space_domain(space)); } #define isl_qpolynomial_involves_nan isl_qpolynomial_is_nan #undef PW #define PW isl_pw_qpolynomial #undef BASE #define BASE qpolynomial #undef EL_IS_ZERO #define EL_IS_ZERO is_zero #undef ZERO #define ZERO zero #undef IS_ZERO #define IS_ZERO is_zero #undef FIELD #define FIELD qp #undef DEFAULT_IS_ZERO #define DEFAULT_IS_ZERO 1 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef BASE #define BASE pw_qpolynomial #include #include #include #include #include int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial *pwqp) { if (!pwqp) return -1; if (pwqp->n != -1) return 0; if (!isl_set_plain_is_universe(pwqp->p[0].set)) return 0; return isl_qpolynomial_is_one(pwqp->p[0].qp); } __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add( __isl_take isl_pw_qpolynomial *pwqp1, __isl_take isl_pw_qpolynomial *pwqp2) { return isl_pw_qpolynomial_union_add_(pwqp1, pwqp2); } __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul( __isl_take isl_pw_qpolynomial *pwqp1, __isl_take isl_pw_qpolynomial *pwqp2) { int i, j, n; struct isl_pw_qpolynomial *res; if (!pwqp1 || !pwqp2) goto error; isl_assert(pwqp1->dim->ctx, isl_space_is_equal(pwqp1->dim, pwqp2->dim), goto error); if (isl_pw_qpolynomial_is_zero(pwqp1)) { isl_pw_qpolynomial_free(pwqp2); return pwqp1; } if (isl_pw_qpolynomial_is_zero(pwqp2)) { isl_pw_qpolynomial_free(pwqp1); return pwqp2; } if (isl_pw_qpolynomial_is_one(pwqp1)) { isl_pw_qpolynomial_free(pwqp1); return pwqp2; } if (isl_pw_qpolynomial_is_one(pwqp2)) { isl_pw_qpolynomial_free(pwqp2); return pwqp1; } n = pwqp1->n * pwqp2->n; res = isl_pw_qpolynomial_alloc_size(isl_space_copy(pwqp1->dim), n); for (i = 0; i < pwqp1->n; ++i) { for (j = 0; j < pwqp2->n; ++j) { struct isl_set *common; struct isl_qpolynomial *prod; common = isl_set_intersect(isl_set_copy(pwqp1->p[i].set), isl_set_copy(pwqp2->p[j].set)); if (isl_set_plain_is_empty(common)) { isl_set_free(common); continue; } prod = isl_qpolynomial_mul( isl_qpolynomial_copy(pwqp1->p[i].qp), isl_qpolynomial_copy(pwqp2->p[j].qp)); res = isl_pw_qpolynomial_add_piece(res, common, prod); } } isl_pw_qpolynomial_free(pwqp1); isl_pw_qpolynomial_free(pwqp2); return res; error: isl_pw_qpolynomial_free(pwqp1); isl_pw_qpolynomial_free(pwqp2); return NULL; } __isl_give isl_val *isl_poly_eval(__isl_take isl_poly *poly, __isl_take isl_vec *vec) { int i; isl_bool is_cst; isl_poly_rec *rec; isl_val *res; isl_val *base; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) goto error; if (is_cst) { isl_vec_free(vec); res = isl_poly_get_constant_val(poly); isl_poly_free(poly); return res; } rec = isl_poly_as_rec(poly); if (!rec || !vec) goto error; isl_assert(poly->ctx, rec->n >= 1, goto error); base = isl_val_rat_from_isl_int(poly->ctx, vec->el[1 + poly->var], vec->el[0]); res = isl_poly_eval(isl_poly_copy(rec->p[rec->n - 1]), isl_vec_copy(vec)); for (i = rec->n - 2; i >= 0; --i) { res = isl_val_mul(res, isl_val_copy(base)); res = isl_val_add(res, isl_poly_eval(isl_poly_copy(rec->p[i]), isl_vec_copy(vec))); } isl_val_free(base); isl_poly_free(poly); isl_vec_free(vec); return res; error: isl_poly_free(poly); isl_vec_free(vec); return NULL; } /* Evaluate "qp" in the void point "pnt". * In particular, return the value NaN. */ static __isl_give isl_val *eval_void(__isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt) { isl_ctx *ctx; ctx = isl_point_get_ctx(pnt); isl_qpolynomial_free(qp); isl_point_free(pnt); return isl_val_nan(ctx); } __isl_give isl_val *isl_qpolynomial_eval(__isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt) { isl_bool is_void; isl_vec *ext; isl_val *v; if (!qp || !pnt) goto error; isl_assert(pnt->dim->ctx, isl_space_is_equal(pnt->dim, qp->dim), goto error); is_void = isl_point_is_void(pnt); if (is_void < 0) goto error; if (is_void) return eval_void(qp, pnt); ext = isl_local_extend_point_vec(qp->div, isl_vec_copy(pnt->vec)); v = isl_poly_eval(isl_qpolynomial_get_poly(qp), ext); isl_qpolynomial_free(qp); isl_point_free(pnt); return v; error: isl_qpolynomial_free(qp); isl_point_free(pnt); return NULL; } int isl_poly_cmp(__isl_keep isl_poly_cst *cst1, __isl_keep isl_poly_cst *cst2) { int cmp; isl_int t; isl_int_init(t); isl_int_mul(t, cst1->n, cst2->d); isl_int_submul(t, cst2->n, cst1->d); cmp = isl_int_sgn(t); isl_int_clear(t); return cmp; } __isl_give isl_qpolynomial *isl_qpolynomial_insert_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n) { unsigned total; unsigned g_pos; int *exp; isl_space *space; if (!qp) return NULL; if (type == isl_dim_out) isl_die(qp->div->ctx, isl_error_invalid, "cannot insert output/set dimensions", goto error); if (isl_qpolynomial_check_range(qp, type, first, 0) < 0) return isl_qpolynomial_free(qp); type = domain_type(type); if (n == 0 && !isl_space_is_named_or_nested(qp->dim, type)) return qp; qp = isl_qpolynomial_cow(qp); if (!qp) return NULL; g_pos = pos(qp->dim, type) + first; qp->div = isl_mat_insert_zero_cols(qp->div, 2 + g_pos, n); if (!qp->div) goto error; total = qp->div->n_col - 2; if (total > g_pos) { int i; exp = isl_alloc_array(qp->div->ctx, int, total - g_pos); if (!exp) goto error; for (i = 0; i < total - g_pos; ++i) exp[i] = i + n; qp->poly = expand(qp->poly, exp, g_pos); free(exp); if (!qp->poly) goto error; } space = isl_qpolynomial_take_domain_space(qp); space = isl_space_insert_dims(space, type, first, n); qp = isl_qpolynomial_restore_domain_space(qp, space); return qp; error: isl_qpolynomial_free(qp); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_add_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned n) { isl_size pos; pos = isl_qpolynomial_dim(qp, type); if (pos < 0) return isl_qpolynomial_free(qp); return isl_qpolynomial_insert_dims(qp, type, pos, n); } static int *reordering_move(isl_ctx *ctx, unsigned len, unsigned dst, unsigned src, unsigned n) { int i; int *reordering; reordering = isl_alloc_array(ctx, int, len); if (!reordering) return NULL; if (dst <= src) { for (i = 0; i < dst; ++i) reordering[i] = i; for (i = 0; i < n; ++i) reordering[src + i] = dst + i; for (i = 0; i < src - dst; ++i) reordering[dst + i] = dst + n + i; for (i = 0; i < len - src - n; ++i) reordering[src + n + i] = src + n + i; } else { for (i = 0; i < src; ++i) reordering[i] = i; for (i = 0; i < n; ++i) reordering[src + i] = dst + i; for (i = 0; i < dst - src; ++i) reordering[src + n + i] = src + i; for (i = 0; i < len - dst - n; ++i) reordering[dst + n + i] = dst + n + i; } return reordering; } /* Move the "n" variables starting at "src_pos" of "qp" to "dst_pos". * Only modify the polynomial expression and the local variables of "qp". * The caller is responsible for modifying the space accordingly. */ static __isl_give isl_qpolynomial *local_poly_move_dims( __isl_take isl_qpolynomial *qp, unsigned dst_pos, unsigned src_pos, unsigned n) { isl_ctx *ctx; isl_size total; int *reordering; isl_local *local; isl_poly *poly; local = isl_qpolynomial_take_local(qp); local = isl_local_move_vars(local, dst_pos, src_pos, n); qp = isl_qpolynomial_restore_local(qp, local); qp = sort_divs(qp); total = isl_qpolynomial_domain_dim(qp, isl_dim_all); if (total < 0) return isl_qpolynomial_free(qp); ctx = isl_qpolynomial_get_ctx(qp); reordering = reordering_move(ctx, total, dst_pos, src_pos, n); if (!reordering) return isl_qpolynomial_free(qp); poly = isl_qpolynomial_take_poly(qp); poly = reorder(poly, reordering); qp = isl_qpolynomial_restore_poly(qp, poly); free(reordering); return qp; } __isl_give isl_qpolynomial *isl_qpolynomial_move_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n) { isl_ctx *ctx; unsigned g_dst_pos; unsigned g_src_pos; isl_size src_off, dst_off; isl_space *space; if (!qp) return NULL; ctx = isl_qpolynomial_get_ctx(qp); if (dst_type == isl_dim_out || src_type == isl_dim_out) isl_die(ctx, isl_error_invalid, "cannot move output/set dimension", return isl_qpolynomial_free(qp)); if (src_type == isl_dim_div || dst_type == isl_dim_div) isl_die(ctx, isl_error_invalid, "cannot move local variables", return isl_qpolynomial_free(qp)); if (isl_qpolynomial_check_range(qp, src_type, src_pos, n) < 0) return isl_qpolynomial_free(qp); if (dst_type == isl_dim_in) dst_type = isl_dim_set; if (src_type == isl_dim_in) src_type = isl_dim_set; if (n == 0 && !isl_space_is_named_or_nested(qp->dim, src_type) && !isl_space_is_named_or_nested(qp->dim, dst_type)) return qp; src_off = isl_qpolynomial_domain_var_offset(qp, src_type); dst_off = isl_qpolynomial_domain_var_offset(qp, dst_type); if (src_off < 0 || dst_off < 0) return isl_qpolynomial_free(qp); g_dst_pos = dst_off + dst_pos; g_src_pos = src_off + src_pos; if (dst_type > src_type) g_dst_pos -= n; qp = local_poly_move_dims(qp, g_dst_pos, g_src_pos, n); space = isl_qpolynomial_take_domain_space(qp); space = isl_space_move_dims(space, dst_type, dst_pos, src_type, src_pos, n); qp = isl_qpolynomial_restore_domain_space(qp, space); return qp; } /* Given a quasi-polynomial on a domain (A -> B), * interchange A and B in the wrapped domain * to obtain a quasi-polynomial on the domain (B -> A). */ __isl_give isl_qpolynomial *isl_qpolynomial_domain_reverse( __isl_take isl_qpolynomial *qp) { isl_space *space; isl_size n_in, n_out, offset; space = isl_qpolynomial_peek_domain_space(qp); offset = isl_space_offset(space, isl_dim_set); n_in = isl_space_wrapped_dim(space, isl_dim_set, isl_dim_in); n_out = isl_space_wrapped_dim(space, isl_dim_set, isl_dim_out); if (offset < 0 || n_in < 0 || n_out < 0) return isl_qpolynomial_free(qp); qp = local_poly_move_dims(qp, offset, offset + n_in, n_out); space = isl_qpolynomial_take_domain_space(qp); space = isl_space_wrapped_reverse(space); qp = isl_qpolynomial_restore_domain_space(qp, space); return qp; } __isl_give isl_qpolynomial *isl_qpolynomial_from_affine( __isl_take isl_space *space, isl_int *f, isl_int denom) { isl_size d; isl_poly *poly; space = isl_space_domain(space); if (!space) return NULL; d = isl_space_dim(space, isl_dim_all); poly = d < 0 ? NULL : isl_poly_from_affine(space->ctx, f, denom, 1 + d); return isl_qpolynomial_alloc(space, 0, poly); } __isl_give isl_qpolynomial *isl_qpolynomial_from_aff(__isl_take isl_aff *aff) { isl_ctx *ctx; isl_poly *poly; isl_qpolynomial *qp; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); poly = isl_poly_from_affine(ctx, aff->v->el + 1, aff->v->el[0], aff->v->size - 1); qp = isl_qpolynomial_alloc(isl_aff_get_domain_space(aff), aff->ls->div->n_row, poly); if (!qp) goto error; isl_mat_free(qp->div); qp->div = isl_mat_copy(aff->ls->div); qp->div = isl_mat_cow(qp->div); if (!qp->div) goto error; isl_aff_free(aff); qp = reduce_divs(qp); qp = remove_redundant_divs(qp); return qp; error: isl_aff_free(aff); return isl_qpolynomial_free(qp); } __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff( __isl_take isl_pw_aff *pwaff) { int i; isl_pw_qpolynomial *pwqp; if (!pwaff) return NULL; pwqp = isl_pw_qpolynomial_alloc_size(isl_pw_aff_get_space(pwaff), pwaff->n); for (i = 0; i < pwaff->n; ++i) { isl_set *dom; isl_qpolynomial *qp; dom = isl_set_copy(pwaff->p[i].set); qp = isl_qpolynomial_from_aff(isl_aff_copy(pwaff->p[i].aff)); pwqp = isl_pw_qpolynomial_add_piece(pwqp, dom, qp); } isl_pw_aff_free(pwaff); return pwqp; } __isl_give isl_qpolynomial *isl_qpolynomial_from_constraint( __isl_take isl_constraint *c, enum isl_dim_type type, unsigned pos) { isl_aff *aff; aff = isl_constraint_get_bound(c, type, pos); isl_constraint_free(c); return isl_qpolynomial_from_aff(aff); } /* For each 0 <= i < "n", replace variable "first" + i of type "type" * in "qp" by subs[i]. */ __isl_give isl_qpolynomial *isl_qpolynomial_substitute( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned first, unsigned n, __isl_keep isl_qpolynomial **subs) { int i; isl_poly *poly; isl_poly **polys; if (n == 0) return qp; if (!qp) return NULL; if (type == isl_dim_out) isl_die(qp->dim->ctx, isl_error_invalid, "cannot substitute output/set dimension", goto error); if (isl_qpolynomial_check_range(qp, type, first, n) < 0) return isl_qpolynomial_free(qp); type = domain_type(type); for (i = 0; i < n; ++i) if (!subs[i]) goto error; for (i = 0; i < n; ++i) if (isl_qpolynomial_check_equal_space(qp, subs[i]) < 0) goto error; isl_assert(qp->dim->ctx, qp->div->n_row == 0, goto error); for (i = 0; i < n; ++i) isl_assert(qp->dim->ctx, subs[i]->div->n_row == 0, goto error); first += pos(qp->dim, type); polys = isl_alloc_array(qp->dim->ctx, struct isl_poly *, n); if (!polys) goto error; for (i = 0; i < n; ++i) polys[i] = subs[i]->poly; poly = isl_qpolynomial_take_poly(qp); poly = isl_poly_subs(poly, first, n, polys); qp = isl_qpolynomial_restore_poly(qp, poly); free(polys); return qp; error: isl_qpolynomial_free(qp); return NULL; } /* Extend "bset" with extra set dimensions for each integer division * in "qp" and then call "fn" with the extended bset and the polynomial * that results from replacing each of the integer divisions by the * corresponding extra set dimension. */ isl_stat isl_qpolynomial_as_polynomial_on_domain(__isl_keep isl_qpolynomial *qp, __isl_keep isl_basic_set *bset, isl_stat (*fn)(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, void *user), void *user) { isl_space *space; isl_local_space *ls; isl_poly *poly; isl_qpolynomial *polynomial; if (!qp || !bset) return isl_stat_error; if (qp->div->n_row == 0) return fn(isl_basic_set_copy(bset), isl_qpolynomial_copy(qp), user); space = isl_space_copy(qp->dim); space = isl_space_add_dims(space, isl_dim_set, qp->div->n_row); poly = isl_qpolynomial_get_poly(qp); polynomial = isl_qpolynomial_alloc(space, 0, poly); bset = isl_basic_set_copy(bset); ls = isl_qpolynomial_get_domain_local_space(qp); bset = isl_local_space_lift_basic_set(ls, bset); return fn(bset, polynomial, user); } /* Return total degree in variables first (inclusive) up to last (exclusive). */ int isl_poly_degree(__isl_keep isl_poly *poly, int first, int last) { int deg = -1; int i; isl_bool is_zero, is_cst; isl_poly_rec *rec; is_zero = isl_poly_is_zero(poly); if (is_zero < 0) return -2; if (is_zero) return -1; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return -2; if (is_cst || poly->var < first) return 0; rec = isl_poly_as_rec(poly); if (!rec) return -2; for (i = 0; i < rec->n; ++i) { int d; is_zero = isl_poly_is_zero(rec->p[i]); if (is_zero < 0) return -2; if (is_zero) continue; d = isl_poly_degree(rec->p[i], first, last); if (poly->var < last) d += i; if (d > deg) deg = d; } return deg; } /* Return total degree in set variables. */ int isl_qpolynomial_degree(__isl_keep isl_qpolynomial *poly) { isl_size ovar; isl_size nvar; if (!poly) return -2; ovar = isl_space_offset(poly->dim, isl_dim_set); nvar = isl_space_dim(poly->dim, isl_dim_set); if (ovar < 0 || nvar < 0) return -2; return isl_poly_degree(poly->poly, ovar, ovar + nvar); } __isl_give isl_poly *isl_poly_coeff(__isl_keep isl_poly *poly, unsigned pos, int deg) { int i; isl_bool is_cst; isl_poly_rec *rec; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return NULL; if (is_cst || poly->var < pos) { if (deg == 0) return isl_poly_copy(poly); else return isl_poly_zero(poly->ctx); } rec = isl_poly_as_rec(poly); if (!rec) return NULL; if (poly->var == pos) { if (deg < rec->n) return isl_poly_copy(rec->p[deg]); else return isl_poly_zero(poly->ctx); } poly = isl_poly_copy(poly); poly = isl_poly_cow(poly); rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { isl_poly *t; t = isl_poly_coeff(rec->p[i], pos, deg); if (!t) goto error; isl_poly_free(rec->p[i]); rec->p[i] = t; } return poly; error: isl_poly_free(poly); return NULL; } /* Return coefficient of power "deg" of variable "t_pos" of type "type". */ __isl_give isl_qpolynomial *isl_qpolynomial_coeff( __isl_keep isl_qpolynomial *qp, enum isl_dim_type type, unsigned t_pos, int deg) { unsigned g_pos; isl_poly *poly; isl_qpolynomial *c; if (!qp) return NULL; if (type == isl_dim_out) isl_die(qp->div->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return NULL); if (isl_qpolynomial_check_range(qp, type, t_pos, 1) < 0) return NULL; type = domain_type(type); g_pos = pos(qp->dim, type) + t_pos; poly = isl_poly_coeff(isl_qpolynomial_peek_poly(qp), g_pos, deg); c = isl_qpolynomial_alloc(isl_space_copy(qp->dim), qp->div->n_row, poly); if (!c) return NULL; isl_mat_free(c->div); c->div = isl_qpolynomial_get_local(qp); if (!c->div) goto error; return c; error: isl_qpolynomial_free(c); return NULL; } /* Homogenize the polynomial in the variables first (inclusive) up to * last (exclusive) by inserting powers of variable first. * Variable first is assumed not to appear in the input. */ __isl_give isl_poly *isl_poly_homogenize(__isl_take isl_poly *poly, int deg, int target, int first, int last) { int i; isl_bool is_zero, is_cst; isl_poly_rec *rec; is_zero = isl_poly_is_zero(poly); if (is_zero < 0) return isl_poly_free(poly); if (is_zero) return poly; if (deg == target) return poly; is_cst = isl_poly_is_cst(poly); if (is_cst < 0) return isl_poly_free(poly); if (is_cst || poly->var < first) { isl_poly *hom; hom = isl_poly_var_pow(poly->ctx, first, target - deg); if (!hom) goto error; rec = isl_poly_as_rec(hom); rec->p[target - deg] = isl_poly_mul(rec->p[target - deg], poly); return hom; } poly = isl_poly_cow(poly); rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { is_zero = isl_poly_is_zero(rec->p[i]); if (is_zero < 0) return isl_poly_free(poly); if (is_zero) continue; rec->p[i] = isl_poly_homogenize(rec->p[i], poly->var < last ? deg + i : i, target, first, last); if (!rec->p[i]) goto error; } return poly; error: isl_poly_free(poly); return NULL; } /* Homogenize the polynomial in the set variables by introducing * powers of an extra set variable at position 0. */ __isl_give isl_qpolynomial *isl_qpolynomial_homogenize( __isl_take isl_qpolynomial *poly) { isl_size ovar; isl_size nvar; int deg = isl_qpolynomial_degree(poly); if (deg < -1) goto error; poly = isl_qpolynomial_insert_dims(poly, isl_dim_in, 0, 1); poly = isl_qpolynomial_cow(poly); if (!poly) goto error; ovar = isl_space_offset(poly->dim, isl_dim_set); nvar = isl_space_dim(poly->dim, isl_dim_set); if (ovar < 0 || nvar < 0) return isl_qpolynomial_free(poly); poly->poly = isl_poly_homogenize(poly->poly, 0, deg, ovar, ovar + nvar); if (!poly->poly) goto error; return poly; error: isl_qpolynomial_free(poly); return NULL; } __isl_give isl_term *isl_term_alloc(__isl_take isl_space *space, __isl_take isl_mat *div) { isl_term *term; isl_size d; int n; d = isl_space_dim(space, isl_dim_all); if (d < 0 || !div) goto error; n = d + div->n_row; term = isl_calloc(space->ctx, struct isl_term, sizeof(struct isl_term) + (n - 1) * sizeof(int)); if (!term) goto error; term->ref = 1; term->dim = space; term->div = div; isl_int_init(term->n); isl_int_init(term->d); return term; error: isl_space_free(space); isl_mat_free(div); return NULL; } __isl_give isl_term *isl_term_copy(__isl_keep isl_term *term) { if (!term) return NULL; term->ref++; return term; } __isl_give isl_term *isl_term_dup(__isl_keep isl_term *term) { int i; isl_term *dup; isl_size total; total = isl_term_dim(term, isl_dim_all); if (total < 0) return NULL; dup = isl_term_alloc(isl_space_copy(term->dim), isl_mat_copy(term->div)); if (!dup) return NULL; isl_int_set(dup->n, term->n); isl_int_set(dup->d, term->d); for (i = 0; i < total; ++i) dup->pow[i] = term->pow[i]; return dup; } __isl_give isl_term *isl_term_cow(__isl_take isl_term *term) { if (!term) return NULL; if (term->ref == 1) return term; term->ref--; return isl_term_dup(term); } __isl_null isl_term *isl_term_free(__isl_take isl_term *term) { if (!term) return NULL; if (--term->ref > 0) return NULL; isl_space_free(term->dim); isl_mat_free(term->div); isl_int_clear(term->n); isl_int_clear(term->d); free(term); return NULL; } isl_size isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type) { isl_size dim; if (!term) return isl_size_error; switch (type) { case isl_dim_param: case isl_dim_in: case isl_dim_out: return isl_space_dim(term->dim, type); case isl_dim_div: return term->div->n_row; case isl_dim_all: dim = isl_space_dim(term->dim, isl_dim_all); if (dim < 0) return isl_size_error; return dim + term->div->n_row; default: return isl_size_error; } } #undef TYPE #define TYPE isl_term #undef FIELD_TYPE #define FIELD_TYPE isl_space #undef FIELD_NAME #define FIELD_NAME dim #undef PROPERTY #define PROPERTY space static #include "isl_peek_templ.c" /* Return the offset of the first variable of type "type" within * the variables of "term". */ static isl_size isl_term_offset(__isl_keep isl_term *term, enum isl_dim_type type) { isl_space *space; space = isl_term_peek_space(term); if (!space) return isl_size_error; switch (type) { case isl_dim_param: case isl_dim_set: return isl_space_offset(space, type); case isl_dim_div: return isl_space_dim(space, isl_dim_all); default: isl_die(isl_term_get_ctx(term), isl_error_invalid, "invalid dimension type", return isl_size_error); } } isl_ctx *isl_term_get_ctx(__isl_keep isl_term *term) { return term ? term->dim->ctx : NULL; } void isl_term_get_num(__isl_keep isl_term *term, isl_int *n) { if (!term) return; isl_int_set(*n, term->n); } /* Return the coefficient of the term "term". */ __isl_give isl_val *isl_term_get_coefficient_val(__isl_keep isl_term *term) { if (!term) return NULL; return isl_val_rat_from_isl_int(isl_term_get_ctx(term), term->n, term->d); } #undef TYPE #define TYPE isl_term static #include "check_type_range_templ.c" isl_size isl_term_get_exp(__isl_keep isl_term *term, enum isl_dim_type type, unsigned pos) { isl_size offset; if (isl_term_check_range(term, type, pos, 1) < 0) return isl_size_error; offset = isl_term_offset(term, type); if (offset < 0) return isl_size_error; return term->pow[offset + pos]; } __isl_give isl_aff *isl_term_get_div(__isl_keep isl_term *term, unsigned pos) { isl_local_space *ls; isl_aff *aff; if (isl_term_check_range(term, isl_dim_div, pos, 1) < 0) return NULL; ls = isl_local_space_alloc_div(isl_space_copy(term->dim), isl_mat_copy(term->div)); aff = isl_aff_alloc(ls); if (!aff) return NULL; isl_seq_cpy(aff->v->el, term->div->row[pos], aff->v->size); aff = isl_aff_normalize(aff); return aff; } __isl_give isl_term *isl_poly_foreach_term(__isl_keep isl_poly *poly, isl_stat (*fn)(__isl_take isl_term *term, void *user), __isl_take isl_term *term, void *user) { int i; isl_bool is_zero, is_bad, is_cst; isl_poly_rec *rec; is_zero = isl_poly_is_zero(poly); if (is_zero < 0 || !term) goto error; if (is_zero) return term; is_cst = isl_poly_is_cst(poly); is_bad = isl_poly_is_nan(poly); if (is_bad >= 0 && !is_bad) is_bad = isl_poly_is_infty(poly); if (is_bad >= 0 && !is_bad) is_bad = isl_poly_is_neginfty(poly); if (is_cst < 0 || is_bad < 0) return isl_term_free(term); if (is_bad) isl_die(isl_term_get_ctx(term), isl_error_invalid, "cannot handle NaN/infty polynomial", return isl_term_free(term)); if (is_cst) { isl_poly_cst *cst; cst = isl_poly_as_cst(poly); if (!cst) goto error; term = isl_term_cow(term); if (!term) goto error; isl_int_set(term->n, cst->n); isl_int_set(term->d, cst->d); if (fn(isl_term_copy(term), user) < 0) goto error; return term; } rec = isl_poly_as_rec(poly); if (!rec) goto error; for (i = 0; i < rec->n; ++i) { term = isl_term_cow(term); if (!term) goto error; term->pow[poly->var] = i; term = isl_poly_foreach_term(rec->p[i], fn, term, user); if (!term) goto error; } term = isl_term_cow(term); if (!term) return NULL; term->pow[poly->var] = 0; return term; error: isl_term_free(term); return NULL; } isl_stat isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user) { isl_local *local; isl_term *term; if (!qp) return isl_stat_error; local = isl_qpolynomial_get_local(qp); term = isl_term_alloc(isl_space_copy(qp->dim), local); if (!term) return isl_stat_error; term = isl_poly_foreach_term(isl_qpolynomial_peek_poly(qp), fn, term, user); isl_term_free(term); return term ? isl_stat_ok : isl_stat_error; } __isl_give isl_qpolynomial *isl_qpolynomial_from_term(__isl_take isl_term *term) { isl_poly *poly; isl_qpolynomial *qp; int i; isl_size n; n = isl_term_dim(term, isl_dim_all); if (n < 0) term = isl_term_free(term); if (!term) return NULL; poly = isl_poly_rat_cst(term->dim->ctx, term->n, term->d); for (i = 0; i < n; ++i) { if (!term->pow[i]) continue; poly = isl_poly_mul(poly, isl_poly_var_pow(term->dim->ctx, i, term->pow[i])); } qp = isl_qpolynomial_alloc(isl_space_copy(term->dim), term->div->n_row, poly); if (!qp) goto error; isl_mat_free(qp->div); qp->div = isl_mat_copy(term->div); if (!qp->div) goto error; isl_term_free(term); return qp; error: isl_qpolynomial_free(qp); isl_term_free(term); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_lift(__isl_take isl_qpolynomial *qp, __isl_take isl_space *space) { int i; int extra; isl_size total, d_set, d_qp; if (!qp || !space) goto error; if (isl_space_is_equal(qp->dim, space)) { isl_space_free(space); return qp; } qp = isl_qpolynomial_cow(qp); if (!qp) goto error; d_set = isl_space_dim(space, isl_dim_set); d_qp = isl_qpolynomial_domain_dim(qp, isl_dim_set); extra = d_set - d_qp; total = isl_space_dim(qp->dim, isl_dim_all); if (d_set < 0 || d_qp < 0 || total < 0) goto error; if (qp->div->n_row) { int *exp; exp = isl_alloc_array(qp->div->ctx, int, qp->div->n_row); if (!exp) goto error; for (i = 0; i < qp->div->n_row; ++i) exp[i] = extra + i; qp->poly = expand(qp->poly, exp, total); free(exp); if (!qp->poly) goto error; } qp->div = isl_mat_insert_cols(qp->div, 2 + total, extra); if (!qp->div) goto error; for (i = 0; i < qp->div->n_row; ++i) isl_seq_clr(qp->div->row[i] + 2 + total, extra); isl_space_free(isl_qpolynomial_take_domain_space(qp)); qp = isl_qpolynomial_restore_domain_space(qp, space); return qp; error: isl_space_free(space); isl_qpolynomial_free(qp); return NULL; } /* For each parameter or variable that does not appear in qp, * first eliminate the variable from all constraints and then set it to zero. */ static __isl_give isl_set *fix_inactive(__isl_take isl_set *set, __isl_keep isl_qpolynomial *qp) { int *active = NULL; int i; isl_size d; isl_size nparam; isl_size nvar; d = isl_set_dim(set, isl_dim_all); if (d < 0 || !qp) goto error; active = isl_calloc_array(set->ctx, int, d); if (set_active(qp, active) < 0) goto error; for (i = 0; i < d; ++i) if (!active[i]) break; if (i == d) { free(active); return set; } nparam = isl_set_dim(set, isl_dim_param); nvar = isl_set_dim(set, isl_dim_set); if (nparam < 0 || nvar < 0) goto error; for (i = 0; i < nparam; ++i) { if (active[i]) continue; set = isl_set_eliminate(set, isl_dim_param, i, 1); set = isl_set_fix_si(set, isl_dim_param, i, 0); } for (i = 0; i < nvar; ++i) { if (active[nparam + i]) continue; set = isl_set_eliminate(set, isl_dim_set, i, 1); set = isl_set_fix_si(set, isl_dim_set, i, 0); } free(active); return set; error: free(active); isl_set_free(set); return NULL; } struct isl_opt_data { isl_qpolynomial *qp; int first; isl_val *opt; int max; }; static isl_stat opt_fn(__isl_take isl_point *pnt, void *user) { struct isl_opt_data *data = (struct isl_opt_data *)user; isl_val *val; val = isl_qpolynomial_eval(isl_qpolynomial_copy(data->qp), pnt); if (data->first) { data->first = 0; data->opt = val; } else if (data->max) { data->opt = isl_val_max(data->opt, val); } else { data->opt = isl_val_min(data->opt, val); } return isl_stat_ok; } __isl_give isl_val *isl_qpolynomial_opt_on_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max) { struct isl_opt_data data = { NULL, 1, NULL, max }; isl_bool is_cst; if (!set) goto error; is_cst = isl_poly_is_cst(isl_qpolynomial_peek_poly(qp)); if (is_cst < 0) goto error; if (is_cst) { isl_set_free(set); data.opt = isl_qpolynomial_get_constant_val(qp); isl_qpolynomial_free(qp); return data.opt; } set = fix_inactive(set, qp); data.qp = qp; if (isl_set_foreach_point(set, opt_fn, &data) < 0) goto error; if (data.first) data.opt = isl_val_zero(isl_set_get_ctx(set)); isl_set_free(set); isl_qpolynomial_free(qp); return data.opt; error: isl_set_free(set); isl_qpolynomial_free(qp); isl_val_free(data.opt); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_morph_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_morph *morph) { int i; int n_sub; isl_ctx *ctx; isl_space *space; isl_poly **subs; isl_mat *mat, *diag; qp = isl_qpolynomial_cow(qp); space = isl_qpolynomial_peek_domain_space(qp); if (isl_morph_check_applies(morph, space) < 0) goto error; ctx = isl_qpolynomial_get_ctx(qp); n_sub = morph->inv->n_row - 1; if (morph->inv->n_row != morph->inv->n_col) n_sub += qp->div->n_row; subs = isl_calloc_array(ctx, struct isl_poly *, n_sub); if (n_sub && !subs) goto error; for (i = 0; 1 + i < morph->inv->n_row; ++i) subs[i] = isl_poly_from_affine(ctx, morph->inv->row[1 + i], morph->inv->row[0][0], morph->inv->n_col); if (morph->inv->n_row != morph->inv->n_col) for (i = 0; i < qp->div->n_row; ++i) subs[morph->inv->n_row - 1 + i] = isl_poly_var_pow(ctx, morph->inv->n_col - 1 + i, 1); qp->poly = isl_poly_subs(qp->poly, 0, n_sub, subs); for (i = 0; i < n_sub; ++i) isl_poly_free(subs[i]); free(subs); diag = isl_mat_diag(ctx, 1, morph->inv->row[0][0]); mat = isl_mat_diagonal(diag, isl_mat_copy(morph->inv)); diag = isl_mat_diag(ctx, qp->div->n_row, morph->inv->row[0][0]); mat = isl_mat_diagonal(mat, diag); qp->div = isl_mat_product(qp->div, mat); if (!qp->poly || !qp->div) goto error; isl_space_free(isl_qpolynomial_take_domain_space(qp)); space = isl_space_copy(morph->ran->dim); qp = isl_qpolynomial_restore_domain_space(qp, space); isl_morph_free(morph); return qp; error: isl_qpolynomial_free(qp); isl_morph_free(morph); return NULL; } __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2) { return isl_union_pw_qpolynomial_match_bin_op(upwqp1, upwqp2, &isl_pw_qpolynomial_mul); } /* Reorder the dimension of "qp" according to the given reordering. */ __isl_give isl_qpolynomial *isl_qpolynomial_realign_domain( __isl_take isl_qpolynomial *qp, __isl_take isl_reordering *r) { isl_space *space; isl_poly *poly; isl_local *local; if (!qp) goto error; r = isl_reordering_extend(r, qp->div->n_row); if (!r) goto error; local = isl_qpolynomial_take_local(qp); local = isl_local_reorder(local, isl_reordering_copy(r)); qp = isl_qpolynomial_restore_local(qp, local); poly = isl_qpolynomial_take_poly(qp); poly = reorder(poly, r->pos); qp = isl_qpolynomial_restore_poly(qp, poly); space = isl_reordering_get_space(r); qp = isl_qpolynomial_reset_domain_space(qp, space); isl_reordering_free(r); return qp; error: isl_qpolynomial_free(qp); isl_reordering_free(r); return NULL; } __isl_give isl_qpolynomial *isl_qpolynomial_align_params( __isl_take isl_qpolynomial *qp, __isl_take isl_space *model) { isl_space *domain_space; isl_bool equal_params; domain_space = isl_qpolynomial_peek_domain_space(qp); equal_params = isl_space_has_equal_params(domain_space, model); if (equal_params < 0) goto error; if (!equal_params) { isl_reordering *exp; exp = isl_parameter_alignment_reordering(domain_space, model); qp = isl_qpolynomial_realign_domain(qp, exp); } isl_space_free(model); return qp; error: isl_space_free(model); isl_qpolynomial_free(qp); return NULL; } struct isl_split_periods_data { int max_periods; isl_pw_qpolynomial *res; }; /* Create a slice where the integer division "div" has the fixed value "v". * In particular, if "div" refers to floor(f/m), then create a slice * * m v <= f <= m v + (m - 1) * * or * * f - m v >= 0 * -f + m v + (m - 1) >= 0 */ static __isl_give isl_set *set_div_slice(__isl_take isl_space *space, __isl_keep isl_qpolynomial *qp, int div, isl_int v) { isl_size total; isl_basic_set *bset = NULL; int k; total = isl_space_dim(space, isl_dim_all); if (total < 0 || !qp) goto error; bset = isl_basic_set_alloc_space(isl_space_copy(space), 0, 0, 2); k = isl_basic_set_alloc_inequality(bset); if (k < 0) goto error; isl_seq_cpy(bset->ineq[k], qp->div->row[div] + 1, 1 + total); isl_int_submul(bset->ineq[k][0], v, qp->div->row[div][0]); k = isl_basic_set_alloc_inequality(bset); if (k < 0) goto error; isl_seq_neg(bset->ineq[k], qp->div->row[div] + 1, 1 + total); isl_int_addmul(bset->ineq[k][0], v, qp->div->row[div][0]); isl_int_add(bset->ineq[k][0], bset->ineq[k][0], qp->div->row[div][0]); isl_int_sub_ui(bset->ineq[k][0], bset->ineq[k][0], 1); isl_space_free(space); return isl_set_from_basic_set(bset); error: isl_basic_set_free(bset); isl_space_free(space); return NULL; } static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user); /* Create a slice of the domain "set" such that integer division "div" * has the fixed value "v" and add the results to data->res, * replacing the integer division by "v" in "qp". */ static isl_stat set_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int v, struct isl_split_periods_data *data) { int i; isl_size div_pos; isl_set *slice; isl_poly *cst; slice = set_div_slice(isl_set_get_space(set), qp, div, v); set = isl_set_intersect(set, slice); div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) goto error; for (i = div + 1; i < qp->div->n_row; ++i) { if (isl_int_is_zero(qp->div->row[i][2 + div_pos + div])) continue; isl_int_addmul(qp->div->row[i][1], qp->div->row[i][2 + div_pos + div], v); isl_int_set_si(qp->div->row[i][2 + div_pos + div], 0); } cst = isl_poly_rat_cst(qp->dim->ctx, v, qp->dim->ctx->one); qp = substitute_div(qp, div, cst); return split_periods(set, qp, data); error: isl_set_free(set); isl_qpolynomial_free(qp); return isl_stat_error; } /* Split the domain "set" such that integer division "div" * has a fixed value (ranging from "min" to "max") on each slice * and add the results to data->res. */ static isl_stat split_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int min, isl_int max, struct isl_split_periods_data *data) { for (; isl_int_le(min, max); isl_int_add_ui(min, min, 1)) { isl_set *set_i = isl_set_copy(set); isl_qpolynomial *qp_i = isl_qpolynomial_copy(qp); if (set_div(set_i, qp_i, div, min, data) < 0) goto error; } isl_set_free(set); isl_qpolynomial_free(qp); return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_free(qp); return isl_stat_error; } /* If "qp" refers to any integer division * that can only attain "max_periods" distinct values on "set" * then split the domain along those distinct values. * Add the results (or the original if no splitting occurs) * to data->res. */ static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user) { int i; isl_pw_qpolynomial *pwqp; struct isl_split_periods_data *data; isl_int min, max; isl_size div_pos; isl_stat r = isl_stat_ok; data = (struct isl_split_periods_data *)user; if (!set || !qp) goto error; if (qp->div->n_row == 0) { pwqp = isl_pw_qpolynomial_alloc(set, qp); data->res = isl_pw_qpolynomial_add_disjoint(data->res, pwqp); return isl_stat_ok; } div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) goto error; isl_int_init(min); isl_int_init(max); for (i = 0; i < qp->div->n_row; ++i) { enum isl_lp_result lp_res; if (isl_seq_any_non_zero(qp->div->row[i] + 2 + div_pos, qp->div->n_row)) continue; lp_res = isl_set_solve_lp(set, 0, qp->div->row[i] + 1, set->ctx->one, &min, NULL, NULL); if (lp_res == isl_lp_error) goto error2; if (lp_res == isl_lp_unbounded || lp_res == isl_lp_empty) continue; isl_int_fdiv_q(min, min, qp->div->row[i][0]); lp_res = isl_set_solve_lp(set, 1, qp->div->row[i] + 1, set->ctx->one, &max, NULL, NULL); if (lp_res == isl_lp_error) goto error2; if (lp_res == isl_lp_unbounded || lp_res == isl_lp_empty) continue; isl_int_fdiv_q(max, max, qp->div->row[i][0]); isl_int_sub(max, max, min); if (isl_int_cmp_si(max, data->max_periods) < 0) { isl_int_add(max, max, min); break; } } if (i < qp->div->n_row) { r = split_div(set, qp, i, min, max, data); } else { pwqp = isl_pw_qpolynomial_alloc(set, qp); data->res = isl_pw_qpolynomial_add_disjoint(data->res, pwqp); } isl_int_clear(max); isl_int_clear(min); return r; error2: isl_int_clear(max); isl_int_clear(min); error: isl_set_free(set); isl_qpolynomial_free(qp); return isl_stat_error; } /* If any quasi-polynomial in pwqp refers to any integer division * that can only attain "max_periods" distinct values on its domain * then split the domain along those distinct values. */ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_split_periods( __isl_take isl_pw_qpolynomial *pwqp, int max_periods) { struct isl_split_periods_data data; data.max_periods = max_periods; data.res = isl_pw_qpolynomial_zero(isl_pw_qpolynomial_get_space(pwqp)); if (isl_pw_qpolynomial_foreach_piece(pwqp, &split_periods, &data) < 0) goto error; isl_pw_qpolynomial_free(pwqp); return data.res; error: isl_pw_qpolynomial_free(data.res); isl_pw_qpolynomial_free(pwqp); return NULL; } /* Construct a piecewise quasipolynomial that is constant on the given * domain. In particular, it is * 0 if cst == 0 * 1 if cst == 1 * infinity if cst == -1 * * If cst == -1, then explicitly check whether the domain is empty and, * if so, return 0 instead. */ static __isl_give isl_pw_qpolynomial *constant_on_domain( __isl_take isl_basic_set *bset, int cst) { isl_space *space; isl_qpolynomial *qp; if (cst < 0 && isl_basic_set_is_empty(bset) == isl_bool_true) cst = 0; if (!bset) return NULL; bset = isl_basic_set_params(bset); space = isl_basic_set_get_space(bset); if (cst < 0) qp = isl_qpolynomial_infty_on_domain(space); else if (cst == 0) qp = isl_qpolynomial_zero_on_domain(space); else qp = isl_qpolynomial_one_on_domain(space); return isl_pw_qpolynomial_alloc(isl_set_from_basic_set(bset), qp); } /* Internal data structure for multiplicative_call_factor_pw_qpolynomial. * "fn" is the function that is called on each factor. * "pwpq" collects the results. */ struct isl_multiplicative_call_data_pw_qpolynomial { __isl_give isl_pw_qpolynomial *(*fn)(__isl_take isl_basic_set *bset); isl_pw_qpolynomial *pwqp; }; /* Call "fn" on "bset" and return the result, * but first check if "bset" has any redundant constraints or * implicit equality constraints. * If so, there may be further opportunities for detecting factors or * removing equality constraints, so recursively call * the top-level isl_basic_set_multiplicative_call. */ static __isl_give isl_pw_qpolynomial *multiplicative_call_base( __isl_take isl_basic_set *bset, __isl_give isl_pw_qpolynomial *(*fn)(__isl_take isl_basic_set *bset)) { isl_size n1, n2, n_eq; n1 = isl_basic_set_n_constraint(bset); if (n1 < 0) bset = isl_basic_set_free(bset); bset = isl_basic_set_remove_redundancies(bset); bset = isl_basic_set_detect_equalities(bset); n2 = isl_basic_set_n_constraint(bset); n_eq = isl_basic_set_n_equality(bset); if (n2 < 0 || n_eq < 0) bset = isl_basic_set_free(bset); else if (n2 < n1 || n_eq > 0) return isl_basic_set_multiplicative_call(bset, fn); return fn(bset); } /* isl_factorizer_every_factor_basic_set callback that applies * data->fn to the factor "bset" and multiplies in the result * in data->pwqp. */ static isl_bool multiplicative_call_factor_pw_qpolynomial( __isl_keep isl_basic_set *bset, void *user) { struct isl_multiplicative_call_data_pw_qpolynomial *data = user; isl_pw_qpolynomial *res; bset = isl_basic_set_copy(bset); res = multiplicative_call_base(bset, data->fn); data->pwqp = isl_pw_qpolynomial_mul(data->pwqp, res); if (!data->pwqp) return isl_bool_error; return isl_bool_true; } /* Factor bset, call fn on each of the factors and return the product. * * If no factors can be found, simply call fn on the input. * Otherwise, construct the factors based on the factorizer, * call fn on each factor and compute the product. */ static __isl_give isl_pw_qpolynomial *compressed_multiplicative_call( __isl_take isl_basic_set *bset, __isl_give isl_pw_qpolynomial *(*fn)(__isl_take isl_basic_set *bset)) { struct isl_multiplicative_call_data_pw_qpolynomial data = { fn }; isl_space *space; isl_set *set; isl_factorizer *f; isl_qpolynomial *qp; isl_bool every; f = isl_basic_set_factorizer(bset); if (!f) goto error; if (f->n_group == 0) { isl_factorizer_free(f); return multiplicative_call_base(bset, fn); } space = isl_basic_set_get_space(bset); space = isl_space_params(space); set = isl_set_universe(isl_space_copy(space)); qp = isl_qpolynomial_one_on_domain(space); data.pwqp = isl_pw_qpolynomial_alloc(set, qp); every = isl_factorizer_every_factor_basic_set(f, &multiplicative_call_factor_pw_qpolynomial, &data); if (every < 0) data.pwqp = isl_pw_qpolynomial_free(data.pwqp); isl_basic_set_free(bset); isl_factorizer_free(f); return data.pwqp; error: isl_basic_set_free(bset); return NULL; } /* Factor bset, call fn on each of the factors and return the product. * The function is assumed to evaluate to zero on empty domains, * to one on zero-dimensional domains and to infinity on unbounded domains * and will not be called explicitly on zero-dimensional or unbounded domains. * * We first check for some special cases and remove all equalities. * Then we hand over control to compressed_multiplicative_call. */ __isl_give isl_pw_qpolynomial *isl_basic_set_multiplicative_call( __isl_take isl_basic_set *bset, __isl_give isl_pw_qpolynomial *(*fn)(__isl_take isl_basic_set *bset)) { isl_bool bounded; isl_size dim; isl_morph *morph; isl_pw_qpolynomial *pwqp; if (!bset) return NULL; if (isl_basic_set_plain_is_empty(bset)) return constant_on_domain(bset, 0); dim = isl_basic_set_dim(bset, isl_dim_set); if (dim < 0) goto error; if (dim == 0) return constant_on_domain(bset, 1); bounded = isl_basic_set_is_bounded(bset); if (bounded < 0) goto error; if (!bounded) return constant_on_domain(bset, -1); if (bset->n_eq == 0) return compressed_multiplicative_call(bset, fn); morph = isl_basic_set_full_compression(bset); bset = isl_morph_basic_set(isl_morph_copy(morph), bset); pwqp = compressed_multiplicative_call(bset, fn); morph = isl_morph_dom_params(morph); morph = isl_morph_ran_params(morph); morph = isl_morph_inverse(morph); pwqp = isl_pw_qpolynomial_morph_domain(pwqp, morph); return pwqp; error: isl_basic_set_free(bset); return NULL; } /* Drop all floors in "qp", turning each integer division [a/m] into * a rational division a/m. If "down" is set, then the integer division * is replaced by (a-(m-1))/m instead. */ static __isl_give isl_qpolynomial *qp_drop_floors( __isl_take isl_qpolynomial *qp, int down) { int i; isl_poly *s; if (!qp) return NULL; if (qp->div->n_row == 0) return qp; qp = isl_qpolynomial_cow(qp); if (!qp) return NULL; for (i = qp->div->n_row - 1; i >= 0; --i) { if (down) { isl_int_sub(qp->div->row[i][1], qp->div->row[i][1], qp->div->row[i][0]); isl_int_add_ui(qp->div->row[i][1], qp->div->row[i][1], 1); } s = isl_poly_from_affine(qp->dim->ctx, qp->div->row[i] + 1, qp->div->row[i][0], qp->div->n_col - 1); qp = substitute_div(qp, i, s); if (!qp) return NULL; } return qp; } /* Drop all floors in "pwqp", turning each integer division [a/m] into * a rational division a/m. */ static __isl_give isl_pw_qpolynomial *pwqp_drop_floors( __isl_take isl_pw_qpolynomial *pwqp) { int i; if (!pwqp) return NULL; if (isl_pw_qpolynomial_is_zero(pwqp)) return pwqp; pwqp = isl_pw_qpolynomial_cow(pwqp); if (!pwqp) return NULL; for (i = 0; i < pwqp->n; ++i) { pwqp->p[i].qp = qp_drop_floors(pwqp->p[i].qp, 0); if (!pwqp->p[i].qp) goto error; } return pwqp; error: isl_pw_qpolynomial_free(pwqp); return NULL; } /* Adjust all the integer divisions in "qp" such that they are at least * one over the given orthant (identified by "signs"). This ensures * that they will still be non-negative even after subtracting (m-1)/m. * * In particular, f is replaced by f' + v, changing f = [a/m] * to f' = [(a - m v)/m]. * If the constant term k in a is smaller than m, * the constant term of v is set to floor(k/m) - 1. * For any other term, if the coefficient c and the variable x have * the same sign, then no changes are needed. * Otherwise, if the variable is positive (and c is negative), * then the coefficient of x in v is set to floor(c/m). * If the variable is negative (and c is positive), * then the coefficient of x in v is set to ceil(c/m). */ static __isl_give isl_qpolynomial *make_divs_pos(__isl_take isl_qpolynomial *qp, int *signs) { int i, j; isl_size div_pos; isl_vec *v = NULL; isl_poly *s; qp = isl_qpolynomial_cow(qp); div_pos = isl_qpolynomial_domain_var_offset(qp, isl_dim_div); if (div_pos < 0) return isl_qpolynomial_free(qp); qp->div = isl_mat_cow(qp->div); if (!qp->div) goto error; v = isl_vec_alloc(qp->div->ctx, qp->div->n_col - 1); for (i = 0; i < qp->div->n_row; ++i) { isl_int *row = qp->div->row[i]; v = isl_vec_clr(v); if (!v) goto error; if (isl_int_lt(row[1], row[0])) { isl_int_fdiv_q(v->el[0], row[1], row[0]); isl_int_sub_ui(v->el[0], v->el[0], 1); isl_int_submul(row[1], row[0], v->el[0]); } for (j = 0; j < div_pos; ++j) { if (isl_int_sgn(row[2 + j]) * signs[j] >= 0) continue; if (signs[j] < 0) isl_int_cdiv_q(v->el[1 + j], row[2 + j], row[0]); else isl_int_fdiv_q(v->el[1 + j], row[2 + j], row[0]); isl_int_submul(row[2 + j], row[0], v->el[1 + j]); } for (j = 0; j < i; ++j) { if (isl_int_sgn(row[2 + div_pos + j]) >= 0) continue; isl_int_fdiv_q(v->el[1 + div_pos + j], row[2 + div_pos + j], row[0]); isl_int_submul(row[2 + div_pos + j], row[0], v->el[1 + div_pos + j]); } for (j = i + 1; j < qp->div->n_row; ++j) { if (isl_int_is_zero(qp->div->row[j][2 + div_pos + i])) continue; isl_seq_combine(qp->div->row[j] + 1, qp->div->ctx->one, qp->div->row[j] + 1, qp->div->row[j][2 + div_pos + i], v->el, v->size); } isl_int_set_si(v->el[1 + div_pos + i], 1); s = isl_poly_from_affine(qp->dim->ctx, v->el, qp->div->ctx->one, v->size); qp->poly = isl_poly_subs(qp->poly, div_pos + i, 1, &s); isl_poly_free(s); if (!qp->poly) goto error; } isl_vec_free(v); return qp; error: isl_vec_free(v); isl_qpolynomial_free(qp); return NULL; } struct isl_to_poly_data { int sign; isl_pw_qpolynomial *res; isl_qpolynomial *qp; }; /* Appoximate data->qp by a polynomial on the orthant identified by "signs". * We first make all integer divisions positive and then split the * quasipolynomials into terms with sign data->sign (the direction * of the requested approximation) and terms with the opposite sign. * In the first set of terms, each integer division [a/m] is * overapproximated by a/m, while in the second it is underapproximated * by (a-(m-1))/m. */ static isl_stat to_polynomial_on_orthant(__isl_take isl_set *orthant, int *signs, void *user) { struct isl_to_poly_data *data = user; isl_pw_qpolynomial *t; isl_qpolynomial *qp, *up, *down; qp = isl_qpolynomial_copy(data->qp); qp = make_divs_pos(qp, signs); up = isl_qpolynomial_terms_of_sign(qp, signs, data->sign); up = qp_drop_floors(up, 0); down = isl_qpolynomial_terms_of_sign(qp, signs, -data->sign); down = qp_drop_floors(down, 1); isl_qpolynomial_free(qp); qp = isl_qpolynomial_add(up, down); t = isl_pw_qpolynomial_alloc(orthant, qp); data->res = isl_pw_qpolynomial_add_disjoint(data->res, t); return isl_stat_ok; } /* Approximate each quasipolynomial by a polynomial. If "sign" is positive, * the polynomial will be an overapproximation. If "sign" is negative, * it will be an underapproximation. If "sign" is zero, the approximation * will lie somewhere in between. * * In particular, is sign == 0, we simply drop the floors, turning * the integer divisions into rational divisions. * Otherwise, we split the domains into orthants, make all integer divisions * positive and then approximate each [a/m] by either a/m or (a-(m-1))/m, * depending on the requested sign and the sign of the term in which * the integer division appears. */ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial( __isl_take isl_pw_qpolynomial *pwqp, int sign) { int i; struct isl_to_poly_data data; if (sign == 0) return pwqp_drop_floors(pwqp); if (!pwqp) return NULL; data.sign = sign; data.res = isl_pw_qpolynomial_zero(isl_pw_qpolynomial_get_space(pwqp)); for (i = 0; i < pwqp->n; ++i) { if (pwqp->p[i].qp->div->n_row == 0) { isl_pw_qpolynomial *t; t = isl_pw_qpolynomial_alloc( isl_set_copy(pwqp->p[i].set), isl_qpolynomial_copy(pwqp->p[i].qp)); data.res = isl_pw_qpolynomial_add_disjoint(data.res, t); continue; } data.qp = pwqp->p[i].qp; if (isl_set_foreach_orthant(pwqp->p[i].set, &to_polynomial_on_orthant, &data) < 0) goto error; } isl_pw_qpolynomial_free(pwqp); return data.res; error: isl_pw_qpolynomial_free(pwqp); isl_pw_qpolynomial_free(data.res); return NULL; } static __isl_give isl_pw_qpolynomial *poly_entry( __isl_take isl_pw_qpolynomial *pwqp, void *user) { int *sign = user; return isl_pw_qpolynomial_to_polynomial(pwqp, *sign); } __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_to_polynomial( __isl_take isl_union_pw_qpolynomial *upwqp, int sign) { return isl_union_pw_qpolynomial_transform_inplace(upwqp, &poly_entry, &sign); } /* Return an isl_aff that is equivalent to "qp". */ __isl_give isl_aff *isl_qpolynomial_as_aff(__isl_take isl_qpolynomial *qp) { isl_local_space *ls; isl_vec *vec; isl_aff *aff; isl_bool is_affine; is_affine = isl_qpolynomial_isa_aff(qp); if (is_affine < 0) goto error; if (!is_affine) isl_die(qp->dim->ctx, isl_error_invalid, "input quasi-polynomial not affine", goto error); ls = isl_qpolynomial_get_domain_local_space(qp); vec = isl_qpolynomial_extract_affine(qp); aff = isl_aff_alloc_vec(ls, vec); isl_qpolynomial_free(qp); return aff; error: isl_qpolynomial_free(qp); return NULL; } __isl_give isl_basic_map *isl_basic_map_from_qpolynomial( __isl_take isl_qpolynomial *qp) { return isl_basic_map_from_aff(isl_qpolynomial_as_aff(qp)); } isl-0.28/isl_map_bound_templ.c0000664000175000017500000000306315072740040015503 0ustar00skimoskimo/* * Copyright 2018 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include "isl_multi_macro.h" #undef TYPE #define TYPE CAT(isl_,BASE) /* Check that "map" and "multi" live in the same space, ignoring parameters. */ static isl_stat FN(check_map_equal_tuples_multi,BASE)(__isl_keep isl_map *map, __isl_keep MULTI(BASE) *multi) { isl_space *map_space, *multi_space; map_space = isl_map_peek_space(map); multi_space = FN(MULTI(BASE),peek_space)(multi); return isl_space_check_equal_tuples(map_space, multi_space); } /* Apply "map_bound" to "map" with the corresponding value in "bound" * for each output dimension. * If "bound" has an explicit domain (which implies that "bound" * is zero-dimensional), then intersect the domain of "map" * with this explicit domain instead. */ static __isl_give isl_map *FN(map_bound_multi,BASE)(__isl_take isl_map *map, __isl_take MULTI(BASE) *bound, __isl_give isl_map *map_bound(__isl_take isl_map *map, unsigned pos, __isl_take TYPE *value)) { int i; isl_size dim; dim = isl_map_dim(map, isl_dim_out); if (dim < 0 || FN(check_map_equal_tuples_multi,BASE)(map, bound) < 0) goto error; for (i = 0; i < dim; ++i) { TYPE *el; el = FN(MULTI(BASE),get_at)(bound, i); map = map_bound(map, i, el); } map = FN(FN(isl_map_intersect_multi,BASE),explicit_domain)(map, bound); FN(MULTI(BASE),free)(bound); return map; error: isl_map_free(map); FN(MULTI(BASE),free)(bound); return NULL; } isl-0.28/isl_set_list.c0000664000175000017500000000077615072740040014174 0ustar00skimoskimo#include #include #undef EL #define EL isl_basic_set #include #undef EL #define EL isl_set #include #undef EL #define EL isl_union_set #include #undef EL_BASE #define EL_BASE basic_set #include #undef EL_BASE #define EL_BASE set #include #include #undef EL_BASE #define EL_BASE union_set #include #include isl-0.28/config.sub0000755000175000017500000010511615072740067013317 0ustar00skimoskimo#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: isl-0.28/isl_bind_domain_templ.c0000664000175000017500000001234115072740040016001 0ustar00skimoskimo/* * Copyright 2018 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include /* Merge parameter "param" into the input dimension "i" of "obj". * * First plug in the parameter for the input dimension in "obj". * The drop the (now defunct) input dimension and * move the parameter in its original position. * Since dimension manipulations destroy spaces, modify the space * separately by only dropping the parameter. */ static __isl_give TYPE *FN(TYPE,merge_param)(__isl_take TYPE *obj, int i, int param) { isl_id *id; isl_aff *aff; isl_space *space; isl_multi_aff *ma; space = FN(TYPE,get_domain_space)(obj); id = isl_space_get_dim_id(space, isl_dim_param, param); aff = isl_aff_param_on_domain_space_id(isl_space_copy(space), id); space = isl_space_map_from_set(space); ma = isl_multi_aff_identity(space); ma = isl_multi_aff_set_aff(ma, i, aff); obj = FN(TYPE,pullback_multi_aff)(obj, ma); space = FN(TYPE,get_domain_space)(obj); obj = FN(TYPE,drop_dims)(obj, isl_dim_in, i, 1); obj = FN(TYPE,move_dims)(obj, isl_dim_in, i, isl_dim_param, param, 1); space = isl_space_drop_dims(space, isl_dim_param, param, 1); obj = FN(TYPE,reset_domain_space)(obj, space); return obj; } /* Given a tuple of identifiers "tuple" that correspond * to the initial input dimensions of "obj", * if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_initial_params)(__isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { int i; isl_size n; n = isl_multi_id_size(tuple); if (n < 0) return FN(TYPE,free)(obj); for (i = 0; i < n; ++i) { isl_id *id; int pos; id = isl_multi_id_get_at(tuple, i); if (!id) return FN(TYPE,free)(obj); pos = FN(TYPE,find_dim_by_id)(obj, isl_dim_param, id); isl_id_free(id); if (pos < 0) continue; obj = FN(TYPE,merge_param)(obj, i, pos); } return obj; } /* Given a tuple of identifiers "tuple" in a space that corresponds * to the domain of "obj", if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_domain_params)(__isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { isl_stat r; isl_space *obj_space, *tuple_space; obj_space = FN(TYPE,get_space)(obj); tuple_space = isl_multi_id_peek_space(tuple); r = isl_space_check_domain_tuples(tuple_space, obj_space); isl_space_free(obj_space); if (r < 0) return FN(TYPE,free)(obj); return FN(TYPE,equate_initial_params)(obj, tuple); } /* Bind the domain dimensions of the function "obj" to parameters * with identifiers specified by "tuple", living in the same space * as the domain of "obj". * * If no parameters with these identifiers appear in "obj" already, * then the domain dimensions are simply reinterpreted as parameters. * Otherwise, the parameters are first equated to the corresponding * domain dimensions. */ __isl_give TYPE *FN(TYPE,bind_domain)(__isl_take TYPE *obj, __isl_take isl_multi_id *tuple) { isl_space *space; obj = FN(TYPE,equate_domain_params)(obj, tuple); space = FN(TYPE,get_space)(obj); space = isl_space_bind_map_domain(space, tuple); isl_multi_id_free(tuple); obj = FN(TYPE,reset_space)(obj, space); return obj; } /* Given a tuple of identifiers "tuple" in a space that corresponds * to the domain of the wrapped relation in the domain of "obj", * if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_domain_wrapped_domain_params)( __isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { isl_stat r; isl_space *obj_space, *tuple_space; obj_space = FN(TYPE,get_space)(obj); tuple_space = isl_multi_id_peek_space(tuple); r = isl_space_check_domain_wrapped_domain_tuples(tuple_space, obj_space); isl_space_free(obj_space); if (r < 0) return FN(TYPE,free)(obj); return FN(TYPE,equate_initial_params)(obj, tuple); } /* Given a function living in a space of the form [A -> B] -> C and * a tuple of identifiers in A, bind the domain dimensions of the relation * wrapped in the domain of "obj" with identifiers specified by "tuple", * returning a function in the space B -> C. * * If no parameters with these identifiers appear in "obj" already, * then the domain dimensions are simply reinterpreted as parameters. * Otherwise, the parameters are first equated to the corresponding * domain dimensions. */ __isl_give TYPE *FN(TYPE,bind_domain_wrapped_domain)(__isl_take TYPE *obj, __isl_take isl_multi_id *tuple) { isl_space *space; obj = FN(TYPE,equate_domain_wrapped_domain_params)(obj, tuple); space = FN(TYPE,get_space)(obj); space = isl_space_bind_domain_wrapped_domain(space, tuple); isl_multi_id_free(tuple); obj = FN(TYPE,reset_space)(obj, space); return obj; } isl-0.28/isl_domain_factor_templ.c0000664000175000017500000000365615072740040016354 0ustar00skimoskimo/* * Copyright 2012 Ecole Normale Superieure * Copyright 2017 Sven Verdoolaege * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) /* Drop the "n" domain dimensions starting at "first" from "obj", * after checking that they do not appear in the affine expression. */ static __isl_give TYPE *FN(TYPE,drop_domain)(__isl_take TYPE *obj, unsigned first, unsigned n) { isl_bool involves; involves = FN(TYPE,involves_dims)(obj, isl_dim_in, first, n); if (involves < 0) return FN(TYPE,free)(obj); if (involves) isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid, "affine expression involves some of the domain dimensions", return FN(TYPE,free)(obj)); return FN(TYPE,drop_dims)(obj, isl_dim_in, first, n); } /* Check that the domain of "obj" is a product. */ static isl_stat FN(TYPE,check_domain_product)(__isl_keep TYPE *obj) { isl_bool is_product; is_product = FN(TYPE,domain_is_product)(obj); if (is_product < 0) return isl_stat_error; if (!is_product) isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid, "domain is not a product", return isl_stat_error); return isl_stat_ok; } /* Given an affine function with a domain of the form [A -> B] that * does not depend on B, return the same function on domain A. */ __isl_give TYPE *FN(TYPE,domain_factor_domain)(__isl_take TYPE *obj) { isl_space *space; isl_size n, n_in; if (FN(TYPE,check_domain_product)(obj) < 0) return FN(TYPE,free)(obj); space = FN(TYPE,get_domain_space)(obj); n = isl_space_dim(space, isl_dim_set); space = isl_space_factor_domain(space); n_in = isl_space_dim(space, isl_dim_set); if (n < 0 || n_in < 0) obj = FN(TYPE,free)(obj); else obj = FN(TYPE,drop_domain)(obj, n_in, n - n_in); obj = FN(TYPE,reset_domain_space)(obj, space); return obj; } isl-0.28/isl_pw_pullback_templ.c0000664000175000017500000000537015072740040016045 0ustar00skimoskimo/* * Copyright 2012 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #undef SUFFIX #define SUFFIX multi_aff #undef ARG1 #define ARG1 PW #undef ARG2 #define ARG2 isl_multi_aff static #include "isl_align_params_templ.c" #undef SUFFIX #define SUFFIX pw_multi_aff #undef ARG1 #define ARG1 PW #undef ARG2 #define ARG2 isl_pw_multi_aff static #include "isl_align_params_templ.c" /* Compute the pullback of "pw" by the function represented by "ma". * In other words, plug in "ma" in "pw". */ __isl_give PW *FN(PW,pullback_multi_aff)(__isl_take PW *pw, __isl_take isl_multi_aff *ma) { int i; isl_size n; isl_space *space = NULL; FN(PW,align_params_multi_aff)(&pw, &ma); ma = isl_multi_aff_align_divs(ma); n = FN(PW,n_piece)(pw); if (n < 0 || !ma) goto error; space = isl_space_join(isl_multi_aff_get_space(ma), FN(PW,get_space)(pw)); for (i = 0; i < n; ++i) { isl_set *domain; EL *el; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_preimage_multi_aff(domain, isl_multi_aff_copy(ma)); pw = FN(PW,restore_domain_at)(pw, i, domain); el = FN(PW,take_base_at)(pw, i); el = FN(EL,pullback_multi_aff)(el, isl_multi_aff_copy(ma)); pw = FN(PW,restore_base_at)(pw, i, el); } pw = FN(PW,reset_space)(pw, space); isl_multi_aff_free(ma); return pw; error: isl_space_free(space); isl_multi_aff_free(ma); FN(PW,free)(pw); return NULL; } /* Compute the pullback of "pw" by the function represented by "pma". * In other words, plug in "pma" in "pw". */ static __isl_give PW *FN(PW,pullback_pw_multi_aff_aligned)(__isl_take PW *pw, __isl_take isl_pw_multi_aff *pma) { int i; PW *res; if (!pma) goto error; if (pma->n == 0) { isl_space *space; space = isl_space_join(isl_pw_multi_aff_get_space(pma), FN(PW,get_space)(pw)); isl_pw_multi_aff_free(pma); res = FN(PW,empty)(space); FN(PW,free)(pw); return res; } res = FN(PW,pullback_multi_aff)(FN(PW,copy)(pw), isl_multi_aff_copy(pma->p[0].maff)); res = FN(PW,intersect_domain)(res, isl_set_copy(pma->p[0].set)); for (i = 1; i < pma->n; ++i) { PW *res_i; res_i = FN(PW,pullback_multi_aff)(FN(PW,copy)(pw), isl_multi_aff_copy(pma->p[i].maff)); res_i = FN(PW,intersect_domain)(res_i, isl_set_copy(pma->p[i].set)); res = FN(PW,add_disjoint)(res, res_i); } isl_pw_multi_aff_free(pma); FN(PW,free)(pw); return res; error: isl_pw_multi_aff_free(pma); FN(PW,free)(pw); return NULL; } __isl_give PW *FN(PW,pullback_pw_multi_aff)(__isl_take PW *pw, __isl_take isl_pw_multi_aff *pma) { FN(PW,align_params_pw_multi_aff)(&pw, &pma); return FN(PW,pullback_pw_multi_aff_aligned)(pw, pma); } isl-0.28/m4/0000775000175000017500000000000015222442312011637 5ustar00skimoskimoisl-0.28/m4/ltsugar.m40000644000175000017500000001045315072740064013573 0ustar00skimoskimo# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) isl-0.28/m4/ax_prog_cxx_for_build.m40000664000175000017500000000674215072740040016462 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html # =========================================================================== # # SYNOPSIS # # AX_PROG_CXX_FOR_BUILD # # DESCRIPTION # # This macro searches for a C++ compiler that generates native # executables, that is a C++ compiler that surely is not a cross-compiler. # This can be useful if you have to generate source code at compile-time # like for example GCC does. # # The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything # needed to compile or link (CXX_FOR_BUILD) and preprocess # (CXXCPP_FOR_BUILD). The value of these variables can be overridden by # the user by specifying a compiler with an environment variable (like you # do for standard CXX). # # LICENSE # # Copyright (c) 2008 Paolo Bonzini # Copyright (c) 2012 Avionic Design GmbH # # Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini. # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 3 AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_PROG_CXXCPP])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl dnl Use the standard macros, but make them use other variable names dnl pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl pushdef([CXX], CXX_FOR_BUILD)dnl pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl pushdef([host], build)dnl pushdef([host_alias], build_alias)dnl pushdef([host_cpu], build_cpu)dnl pushdef([host_vendor], build_vendor)dnl pushdef([host_os], build_os)dnl pushdef([ac_cv_host], ac_cv_build)dnl pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl pushdef([ac_cv_host_os], ac_cv_build_os)dnl pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl pushdef([ac_compile], ac_build_compile)dnl pushdef([ac_link], ac_build_link)dnl save_cross_compiling=$cross_compiling save_ac_tool_prefix=$ac_tool_prefix cross_compiling=no ac_tool_prefix= AC_PROG_CXX AC_PROG_CXXCPP ac_tool_prefix=$save_ac_tool_prefix cross_compiling=$save_cross_compiling dnl Restore the old definitions dnl popdef([ac_link])dnl popdef([ac_compile])dnl popdef([ac_cxxcpp])dnl popdef([ac_cv_host_os])dnl popdef([ac_cv_host_vendor])dnl popdef([ac_cv_host_cpu])dnl popdef([ac_cv_host_alias])dnl popdef([ac_cv_host])dnl popdef([host_os])dnl popdef([host_vendor])dnl popdef([host_cpu])dnl popdef([host_alias])dnl popdef([host])dnl popdef([CXXCPPFLAGS])dnl popdef([CPPFLAGS])dnl popdef([CXXFLAGS])dnl popdef([CXXCPP])dnl popdef([CXX])dnl popdef([ac_cv_prog_cxx_g])dnl popdef([ac_cv_prog_cxx_cross])dnl popdef([ac_cv_prog_cxx_works])dnl popdef([ac_cv_prog_gxx])dnl popdef([ac_cv_prog_CXXCPP])dnl dnl Finally, set Makefile variables dnl AC_SUBST([CXXFLAGS_FOR_BUILD])dnl AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl ]) isl-0.28/m4/ax_gcc_warn_unused_result.m40000664000175000017500000000247415072740040017346 0ustar00skimoskimo# ============================================================================== # https://www.gnu.org/software/autoconf-archive/ax_gcc_warn_unused_result.html # ============================================================================== # # SYNOPSIS # # AX_GCC_WARN_UNUSED_RESULT # # DESCRIPTION # # The macro will compile a test program to see whether the compiler does # understand the per-function postfix pragma. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 10 AC_DEFUN([AX_GCC_WARN_UNUSED_RESULT],[dnl AC_CACHE_CHECK( [whether the compiler supports function __attribute__((__warn_unused_result__))], ax_cv_gcc_warn_unused_result,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[__attribute__((__warn_unused_result__)) int f(int i) { return i; }]], [])], [ax_cv_gcc_warn_unused_result=yes], [ax_cv_gcc_warn_unused_result=no])]) if test "$ax_cv_gcc_warn_unused_result" = yes; then AC_DEFINE([GCC_WARN_UNUSED_RESULT],[__attribute__((__warn_unused_result__))], [most gcc compilers know a function __attribute__((__warn_unused_result__))]) fi ]) isl-0.28/m4/isl_detect_clang.m40000664000175000017500000001013515215726270015376 0ustar00skimoskimoAC_DEFUN([ISL_DETECT_CLANG], [ AC_SUBST(CLANG_CXXFLAGS) AC_SUBST(CLANG_LDFLAGS) AC_SUBST(CLANG_RFLAG) AC_SUBST(CLANG_LIBS) AC_PROG_GREP AC_PROG_SED if test "x$with_clang_prefix" != "x"; then LLVM_CONFIG="$with_clang_prefix/bin/llvm-config" fi AC_PATH_PROG([LLVM_CONFIG], ["llvm-config"]) if test -z "$LLVM_CONFIG" || test ! -x "$LLVM_CONFIG"; then AC_MSG_ERROR([llvm-config not found]) fi CLANG_CXXFLAGS=`$LLVM_CONFIG --cxxflags | \ $SED -e 's/-Wcovered-switch-default//' \ -e 's/-gsplit-dwarf//' \ -e 's/-Wl,--no-keep-files-mapped//'` CLANG_LDFLAGS=`$LLVM_CONFIG --ldflags` # Construct a -R argument for libtool. # This is needed in case some of the clang libraries are shared libraries. CLANG_RFLAG=`echo "$CLANG_LDFLAGS" | $SED -e 's/-L/-R/g'` CLANG_VERSION=`$LLVM_CONFIG --version` CLANG_LIB="LLVM-$CLANG_VERSION" SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$CLANG_LDFLAGS $LDFLAGS" AC_CHECK_LIB([$CLANG_LIB], [main], [have_lib_llvm=yes], [have_lib_llvm=no]) LDFLAGS="$SAVE_LDFLAGS" # Use single libLLVM shared library when available. # Otherwise, try and figure out all the required libraries if test "$have_lib_llvm" = yes; then CLANG_LIBS="-l$CLANG_LIB" else targets=`$LLVM_CONFIG --targets-built` components="$targets asmparser bitreader support mc" # Link in option and frontendopenmp components when available # since they may be used by the clang libraries. for c in option frontendopenmp; do $LLVM_CONFIG --components | $GREP $c > /dev/null 2> /dev/null if test $? -eq 0; then components="$components $c" fi done CLANG_LIBS=`$LLVM_CONFIG --libs $components` fi systemlibs=`$LLVM_CONFIG --system-libs 2> /dev/null | tail -1` if test $? -eq 0; then CLANG_LIBS="$CLANG_LIBS $systemlibs" fi AC_LANG_PUSH(C++) SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$CLANG_CXXFLAGS -I$srcdir $CPPFLAGS" LDFLAGS="$CLANG_LDFLAGS $LDFLAGS" # A test program for checking whether linking against libclang-cpp works. m4_define([_ISL_DETECT_CLANG_PROGRAM], [AC_LANG_PROGRAM( [[#include ]], [[ new clang::CompilerInstance(); ]])]) # Use single libclang-cpp shared library when available. # Otherwise, use a selection of clang libraries that appears to work. AC_CHECK_LIB([clang-cpp], [main], [have_lib_clang=yes], [have_lib_clang=no]) if test "$have_lib_clang" = yes; then # The LLVM libraries may be linked into libclang-cpp already. # Linking against them again can cause errors about options # being registered more than once. # Check whether linking against libclang-cpp requires # linking against the LLVM libraries as well. # Fail if linking fails with or without the LLVM libraries. AC_MSG_CHECKING([whether libclang-cpp needs LLVM libraries]) LIBS="-lclang-cpp $SAVE_LIBS" AC_LINK_IFELSE([_ISL_DETECT_CLANG_PROGRAM], [clangcpp_needs_llvm=no], [ LIBS="-lclang-cpp $CLANG_LIBS $SAVE_LIBS" AC_LINK_IFELSE([_ISL_DETECT_CLANG_PROGRAM], [clangcpp_needs_llvm=yes], [clangcpp_needs_llvm=unknown]) ]) AC_MSG_RESULT([$clangcpp_needs_llvm]) AS_IF([test "$clangcpp_needs_llvm" = "no"], [CLANG_LIBS="-lclang-cpp"], [test "$clangcpp_needs_llvm" = "yes"], [CLANG_LIBS="-lclang-cpp $CLANG_LIBS"], [AC_MSG_FAILURE([unable to link against libclang-cpp])]) else _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangSupport]) CLANG_LIBS="-lclangDriver -lclangBasic $CLANG_LIBS" _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangOptions]) _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangASTMatchers]) CLANG_LIBS="-lclangAnalysis -lclangAST -lclangLex $CLANG_LIBS" _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangAnalysisLifetimeSafety]) _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangEdit]) _ISL_DETECT_CLANG_ADD_CLANG_LIB([clangAPINotes]) CLANG_LIBS="-lclangParse -lclangSema $CLANG_LIBS" CLANG_LIBS="-lclangFrontend -lclangSerialization $CLANG_LIBS" fi CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" AC_LANG_POP ]) # Check if the specified (clang) library exists and, if so, # add it to CLANG_LIBS. # SAVE_LIBS is assumed to hold the original LIBS. m4_define([_ISL_DETECT_CLANG_ADD_CLANG_LIB], [ LIBS="$CLANG_LIBS $SAVE_LIBS" AC_CHECK_LIB($1, [main], [CLANG_LIBS="-l$1 $CLANG_LIBS"]) ]) isl-0.28/m4/ax_check_compile_flag.m40000664000175000017500000000407015072740040016352 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 6 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS isl-0.28/m4/ax_prog_cc_for_build.m40000664000175000017500000001533015072740040016236 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html # =========================================================================== # # SYNOPSIS # # AX_PROG_CC_FOR_BUILD # # DESCRIPTION # # This macro searches for a C compiler that generates native executables, # that is a C compiler that surely is not a cross-compiler. This can be # useful if you have to generate source code at compile-time like for # example GCC does. # # The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything # needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). # The value of these variables can be overridden by the user by specifying # a compiler with an environment variable (like you do for standard CC). # # It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object # file extensions for the build platform, and GCC_FOR_BUILD to `yes' if # the compiler we found is GCC. All these variables but GCC_FOR_BUILD are # substituted in the Makefile. # # LICENSE # # Copyright (c) 2008 Paolo Bonzini # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 21 AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl dnl Use the standard macros, but make them use other variable names dnl pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl pushdef([ac_cv_objext], ac_cv_build_objext)dnl pushdef([ac_exeext], ac_build_exeext)dnl pushdef([ac_objext], ac_build_objext)dnl pushdef([CC], CC_FOR_BUILD)dnl pushdef([CCDEPMODE], CCDEPMODE_FOR_BUILD)dnl pushdef([CPP], CPP_FOR_BUILD)dnl pushdef([GCC], GCC_FOR_BUILD)dnl pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl pushdef([EXEEXT], BUILD_EXEEXT)dnl pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl pushdef([OBJEXT], BUILD_OBJEXT)dnl pushdef([host], build)dnl pushdef([host_alias], build_alias)dnl pushdef([host_cpu], build_cpu)dnl pushdef([host_vendor], build_vendor)dnl pushdef([host_os], build_os)dnl pushdef([ac_cv_host], ac_cv_build)dnl pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl pushdef([ac_cv_host_os], ac_cv_build_os)dnl pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl pushdef([am__fastdepCC_FALSE], am__fastdepCC_build_FALSE)dnl pushdef([am__fastdepCC_TRUE], am__fastdepCC_build_TRUE)dnl pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl pushdef([cross_compiling], cross_compiling_build)dnl cross_compiling_build=no ac_build_tool_prefix= AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) AC_LANG_PUSH([C]) dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover dnl the use of this variable in _AC_LANG_COMPILER_GNU called by dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround. was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} AS_IF([test ${was_set_c_compiler_gnu}], [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu] AS_UNSET([[ac_cv_c_compiler_gnu]])]) AC_PROG_CC dnl Restore ac_cv_c_compiler_gnu AS_IF([test ${was_set_c_compiler_gnu}], [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]]) _AC_COMPILER_EXEEXT _AC_COMPILER_OBJEXT AC_PROG_CPP dnl Restore the old definitions dnl popdef([cross_compiling])dnl popdef([am_cv_prog_cc_c_o])dnl popdef([am__fastdepCC_TRUE])dnl popdef([am__fastdepCC_FALSE])dnl popdef([am_cv_CC_dependencies_compiler_type])dnl popdef([ac_tool_prefix])dnl popdef([ac_cv_host_os])dnl popdef([ac_cv_host_vendor])dnl popdef([ac_cv_host_cpu])dnl popdef([ac_cv_host_alias])dnl popdef([ac_cv_host])dnl popdef([host_os])dnl popdef([host_vendor])dnl popdef([host_cpu])dnl popdef([host_alias])dnl popdef([host])dnl popdef([OBJEXT])dnl popdef([LDFLAGS])dnl popdef([EXEEXT])dnl popdef([CPPFLAGS])dnl popdef([CFLAGS])dnl popdef([GCC])dnl popdef([CPP])dnl popdef([CCDEPMODE])dnl popdef([CC])dnl popdef([ac_objext])dnl popdef([ac_exeext])dnl popdef([ac_cv_objext])dnl popdef([ac_cv_exeext])dnl popdef([ac_cv_c_compiler_gnu])dnl popdef([ac_cv_prog_cc_g])dnl popdef([ac_cv_prog_cc_cross])dnl popdef([ac_cv_prog_cc_works])dnl popdef([ac_cv_prog_cc_c89])dnl popdef([ac_cv_prog_gcc])dnl popdef([ac_cv_prog_CPP])dnl dnl restore global variables ac_ext, ac_cpp, ac_compile, dnl ac_link, ac_compiler_gnu (dependant on the current dnl language after popping): AC_LANG_POP([C]) dnl Finally, set Makefile variables using the ac_cv_build_* variables dnl AC_SUBST(BUILD_EXEEXT)dnl AC_SUBST(BUILD_OBJEXT)dnl dnl Since autoconf 2.70, the call to AC_SUBST in the following lines dnl of _AC_COMPILER_EXEEXT dnl AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl dnl ac_exeext=$EXEEXT dnl no longer sets BUILD_EXEEXT, but EXEEXT instead. dnl This means not only that BUILD_EXEEXT is not getting set, dnl but also that the original EXEEXT is overwritten dnl by a possibly different value. Furthermore, ac_build_exeext dnl is assigned an undefined value. dnl Restore EXEEXT to the original value and dnl set BUILD_EXEEXT and ac_build_exeext. dnl Similarly for _AC_COMPILER_OBJEXT and OBJEXT. m4_version_prereq([2.70],[dnl EXEEXT=$ac_cv_exeext BUILD_EXEEXT=$ac_cv_build_exeext; ac_build_exeext=$ac_cv_build_exeext OBJEXT=$ac_cv_objext BUILD_OBJEXT=$ac_cv_build_objext; ac_build_objext=$ac_cv_build_objext],[[]]) dnl Similarly to _AC_COMPILER_EXEEXT and _AC_COMPILER_OBJEXT, dnl the line dnl AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) dnl of _AM_DEPENDENCIES no longer sets CCDEPMODE_FOR_BUILD, dnl but overrides CCDEPMODE. dnl Restore CCDEPMODE and set CCDEPMODE_FOR_BUILD. AC_SUBST(CCDEPMODE_FOR_BUILD)dnl CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type CCDEPMODE_FOR_BUILD=depmode=$am_cv_build_CC_dependencies_compiler_type AC_SUBST([CFLAGS_FOR_BUILD])dnl AC_SUBST([CPPFLAGS_FOR_BUILD])dnl AC_SUBST([LDFLAGS_FOR_BUILD])dnl ]) isl-0.28/m4/ax_submodule.m40000664000175000017500000000365615072740040014604 0ustar00skimoskimoAC_DEFUN([AX_SUBMODULE], [ m4_if(m4_bregexp($2,|,choice),choice, [AC_ARG_WITH($1, [AS_HELP_STRING([--with-$1=$2], [Which $1 to use [default=$3]])])]) case "system" in $2) AC_ARG_WITH($1_prefix, [AS_HELP_STRING([--with-$1-prefix=DIR], [Prefix of $1 installation])]) AC_ARG_WITH($1_exec_prefix, [AS_HELP_STRING([--with-$1-exec-prefix=DIR], [Exec prefix of $1 installation])]) esac m4_if(m4_bregexp($2,build,build),build, [AC_ARG_WITH($1_builddir, [AS_HELP_STRING([--with-$1-builddir=DIR], [Location of $1 builddir])])]) if test "x$with_$1_prefix" != "x" -a "x$with_$1_exec_prefix" = "x"; then with_$1_exec_prefix=$with_$1_prefix fi if test "x$with_$1_prefix" != "x" -o "x$with_$1_exec_prefix" != "x"; then if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xsystem"; then AC_MSG_ERROR([Setting $with_$1_prefix implies use of system $1]) fi with_$1="system" fi if test "x$with_$1_builddir" != "x"; then if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xbuild"; then AC_MSG_ERROR([Setting $with_$1_builddir implies use of build $1]) fi with_$1="build" $1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-` AC_MSG_NOTICE($1 sources in $$1_srcdir) fi if test "x$with_$1_exec_prefix" != "x"; then export PKG_CONFIG_PATH="$with_$1_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" fi case "$with_$1" in $2) ;; *) case "$3" in bundled) if test -d $srcdir/.git -a \ -d $srcdir/$1 -a \ ! -d $srcdir/$1/.git; then AC_MSG_WARN([git repo detected, but submodule $1 not initialized]) AC_MSG_WARN([You may want to run]) AC_MSG_WARN([ git submodule init]) AC_MSG_WARN([ git submodule update]) AC_MSG_WARN([ sh autogen.sh]) fi if test -f $srcdir/$1/configure; then with_$1="bundled" else with_$1="no" fi ;; *) with_$1="$3" ;; esac ;; esac AC_MSG_CHECKING([which $1 to use]) AC_MSG_RESULT($with_$1) ]) isl-0.28/m4/ax_create_pkgconfig_info.m40000664000175000017500000003415515072740040017110 0ustar00skimoskimo# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_create_pkgconfig_info.html # ============================================================================ # # SYNOPSIS # # AX_CREATE_PKGCONFIG_INFO [(outputfile, [requires [,libs [,summary [,cflags [, ldflags]]]]])] # # DESCRIPTION # # Defaults: # # $1 = $PACKAGE_NAME.pc # $2 = (empty) # $3 = $PACKAGE_LIBS $LIBS (as set at that point in configure.ac) # $4 = $PACKAGE_SUMMARY (or $1 Library) # $5 = $PACKAGE_CFLAGS (as set at the point in configure.ac) # $6 = $PACKAGE_LDFLAGS (as set at the point in configure.ac) # # PACKAGE_NAME defaults to $PACKAGE if not set. # PACKAGE_LIBS defaults to -l$PACKAGE_NAME if not set. # # The resulting file is called $PACKAGE.pc.in / $PACKAGE.pc # # You will find this macro most useful in conjunction with # ax_spec_defaults that can read good initializers from the .spec file. In # consequencd, most of the generatable installable stuff can be made from # information being updated in a single place for the whole project. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Sven Verdoolaege # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 12 AC_DEFUN([AX_CREATE_PKGCONFIG_INFO],[dnl AS_VAR_PUSHDEF([PKGCONFIG_suffix],[ax_create_pkgconfig_suffix])dnl AS_VAR_PUSHDEF([PKGCONFIG_libdir],[ax_create_pkgconfig_libdir])dnl AS_VAR_PUSHDEF([PKGCONFIG_libfile],[ax_create_pkgconfig_libfile])dnl AS_VAR_PUSHDEF([PKGCONFIG_libname],[ax_create_pkgconfig_libname])dnl AS_VAR_PUSHDEF([PKGCONFIG_version],[ax_create_pkgconfig_version])dnl AS_VAR_PUSHDEF([PKGCONFIG_description],[ax_create_pkgconfig_description])dnl AS_VAR_PUSHDEF([PKGCONFIG_requires],[ax_create_pkgconfig_requires])dnl AS_VAR_PUSHDEF([PKGCONFIG_pkglibs],[ax_create_pkgconfig_pkglibs])dnl AS_VAR_PUSHDEF([PKGCONFIG_libs],[ax_create_pkgconfig_libs])dnl AS_VAR_PUSHDEF([PKGCONFIG_ldflags],[ax_create_pkgconfig_ldflags])dnl AS_VAR_PUSHDEF([PKGCONFIG_cppflags],[ax_create_pkgconfig_cppflags])dnl AS_VAR_PUSHDEF([PKGCONFIG_generate],[ax_create_pkgconfig_generate])dnl AS_VAR_PUSHDEF([PKGCONFIG_src_libdir],[ax_create_pkgconfig_src_libdir])dnl AS_VAR_PUSHDEF([PKGCONFIG_src_headers],[ax_create_pkgconfig_src_headers])dnl # we need the expanded forms... test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' AC_MSG_CHECKING(our pkgconfig libname) test ".$PKGCONFIG_libname" != "." || \ PKGCONFIG_libname="ifelse($1,,${PACKAGE_NAME},`basename $1 .pc`)" test ".$PKGCONFIG_libname" != "." || \ PKGCONFIG_libname="$PACKAGE" PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"` PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"` AC_MSG_RESULT($PKGCONFIG_libname) AC_MSG_CHECKING(our pkgconfig version) test ".$PKGCONFIG_version" != "." || \ PKGCONFIG_version="${PACKAGE_VERSION}" test ".$PKGCONFIG_version" != "." || \ PKGCONFIG_version="$VERSION" PKGCONFIG_version=`eval echo "$PKGCONFIG_version"` PKGCONFIG_version=`eval echo "$PKGCONFIG_version"` AC_MSG_RESULT($PKGCONFIG_version) AC_MSG_CHECKING(our pkgconfig_libdir) test ".$pkgconfig_libdir" = "." && \ pkgconfig_libdir='${libdir}/pkgconfig' PKGCONFIG_libdir=`eval echo "$pkgconfig_libdir"` PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"` PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"` AC_MSG_RESULT($pkgconfig_libdir) test "$pkgconfig_libdir" != "$PKGCONFIG_libdir" && ( AC_MSG_RESULT(expanded our pkgconfig_libdir... $PKGCONFIG_libdir)) AC_SUBST([pkgconfig_libdir]) AC_MSG_CHECKING(our pkgconfig_libfile) test ".$pkgconfig_libfile" != "." || \ pkgconfig_libfile="ifelse($1,,$PKGCONFIG_libname.pc,`basename $1`)" PKGCONFIG_libfile=`eval echo "$pkgconfig_libfile"` PKGCONFIG_libfile=`eval echo "$PKGCONFIG_libfile"` AC_MSG_RESULT($pkgconfig_libfile) test "$pkgconfig_libfile" != "$PKGCONFIG_libfile" && ( AC_MSG_RESULT(expanded our pkgconfig_libfile... $PKGCONFIG_libfile)) AC_SUBST([pkgconfig_libfile]) AC_MSG_CHECKING(our package / suffix) PKGCONFIG_suffix="$program_suffix" test ".$PKGCONFIG_suffix" != .NONE || PKGCONFIG_suffix="" AC_MSG_RESULT(${PACKAGE_NAME} / ${PKGCONFIG_suffix}) AC_MSG_CHECKING(our pkgconfig description) PKGCONFIG_description="ifelse($4,,$PACKAGE_SUMMARY,$4)" test ".$PKGCONFIG_description" != "." || \ PKGCONFIG_description="$PKGCONFIG_libname Library" PKGCONFIG_description=`eval echo "$PKGCONFIG_description"` PKGCONFIG_description=`eval echo "$PKGCONFIG_description"` AC_MSG_RESULT($PKGCONFIG_description) AC_MSG_CHECKING(our pkgconfig requires) PKGCONFIG_requires="ifelse($2,,$PACKAGE_REQUIRES,$2)" PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"` PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"` AC_MSG_RESULT($PKGCONFIG_requires) AC_MSG_CHECKING(our pkgconfig ext libs) PKGCONFIG_pkglibs="$PACKAGE_LIBS" test ".$PKGCONFIG_pkglibs" != "." || PKGCONFIG_pkglibs="-l$PKGCONFIG_libname" PKGCONFIG_libs="ifelse($3,,$PKGCONFIG_pkglibs $LIBS,$3)" PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"` PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"` AC_MSG_RESULT($PKGCONFIG_libs) AC_MSG_CHECKING(our pkgconfig cppflags) PKGCONFIG_cppflags="ifelse($5,,$PACKAGE_CFLAGS,$5)" PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"` PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"` AC_MSG_RESULT($PKGCONFIG_cppflags) AC_MSG_CHECKING(our pkgconfig ldflags) PKGCONFIG_ldflags="ifelse($6,,$PACKAGE_LDFLAGS,$5)" PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"` PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"` AC_MSG_RESULT($PKGCONFIG_ldflags) test ".$PKGCONFIG_generate" != "." || \ PKGCONFIG_generate="ifelse($1,,$PKGCONFIG_libname.pc,$1)" PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"` PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"` test "$pkgconfig_libfile" != "$PKGCONFIG_generate" && ( AC_MSG_RESULT(generate the pkgconfig later... $PKGCONFIG_generate)) if test ".$PKGCONFIG_src_libdir" = "." ; then PKGCONFIG_src_libdir=`pwd` PKGCONFIG_src_libdir=`AS_DIRNAME("$PKGCONFIG_src_libdir/$PKGCONFIG_generate")` test ! -d $PKGCONFIG_src_libdir/src || \ PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/src" case ".$objdir" in *libs) PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/$objdir" ;; esac AC_MSG_RESULT(noninstalled pkgconfig -L $PKGCONFIG_src_libdir) fi if test ".$PKGCONFIG_src_headers" = "." ; then PKGCONFIG_src_headers=`pwd` v="$ac_top_srcdir" ; test ".$v" != "." || v="$ax_spec_dir" test ".$v" != "." || v="$srcdir" case "$v" in /*) PKGCONFIG_src_headers="" ;; esac PKGCONFIG_src_headers=`AS_DIRNAME("$PKGCONFIG_src_headers/$v/x")` test ! -d $PKGCONFIG_src_headers/incl[]ude || \ PKGCONFIG_src_headers="$PKGCONFIG_src_headers/incl[]ude" AC_MSG_RESULT(noninstalled pkgconfig -I $PKGCONFIG_src_headers) fi dnl AC_CONFIG_COMMANDS crap disallows to use $PKGCONFIG_libfile here... AC_CONFIG_COMMANDS([$ax_create_pkgconfig_generate],[ pkgconfig_generate="$ax_create_pkgconfig_generate" if test ! -f "$pkgconfig_generate.in" then generate="true" elif grep ' generated by configure ' $pkgconfig_generate.in >/dev/null then generate="true" else generate="false"; fi if $generate ; then AC_MSG_NOTICE(creating $pkgconfig_generate.in) cat > $pkgconfig_generate.in <conftest.sed < $pkgconfig_generate if test ! -s $pkgconfig_generate ; then AC_MSG_ERROR([$pkgconfig_generate is empty]) fi ; rm conftest.sed # DONE generate $pkgconfig_generate pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.pc/'` AC_MSG_NOTICE(creating $pkgconfig_uninstalled) cat >conftest.sed < $pkgconfig_uninstalled if test ! -s $pkgconfig_uninstalled ; then AC_MSG_ERROR([$pkgconfig_uninstalled is empty]) fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled pkgconfig_requires_add=`echo ${pkgconfig_requires}` if test ".$pkgconfig_requires_add" != "." ; then pkgconfig_requires_add="pkg-config $pkgconfig_requires_add" else pkgconfig_requires_add=":" ; fi pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.sh/'` AC_MSG_NOTICE(creating $pkgconfig_uninstalled) cat >conftest.sed <Name:>for option\\; do case \"\$option\" in --list-all|--name) echo > s>Description: *>\\;\\; --help) pkg-config --help \\; echo Buildscript Of > s>Version: *>\\;\\; --modversion|--version) echo > s>Requires:>\\;\\; --requires) echo $pkgconfig_requires_add> s>Libs: *>\\;\\; --libs) echo > s>Cflags: *>\\;\\; --cflags) echo > /--libs)/a\\ $pkgconfig_requires_add /--cflags)/a\\ $pkgconfig_requires_add\\ ;; --variable=*) eval echo '\$'\`echo \$option | sed -e 's/.*=//'\`\\ ;; --uninstalled) exit 0 \\ ;; *) ;; esac done AXEOF sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_uninstalled if test ! -s $pkgconfig_uninstalled ; then AC_MSG_ERROR([$pkgconfig_uninstalled is empty]) fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled ],[ dnl AC_CONFIG_COMMANDS crap, the AS_PUSHVAR defines are invalid here... ax_create_pkgconfig_generate="$ax_create_pkgconfig_generate" pkgconfig_prefix='$prefix' pkgconfig_execprefix='$exec_prefix' pkgconfig_bindir='$bindir' pkgconfig_libdir='$libdir' pkgconfig_includedir='$includedir' pkgconfig_datarootdir='$datarootdir' pkgconfig_datadir='$datadir' pkgconfig_sysconfdir='$sysconfdir' pkgconfig_suffix='$ax_create_pkgconfig_suffix' pkgconfig_package='$PACKAGE_NAME' pkgconfig_libname='$ax_create_pkgconfig_libname' pkgconfig_description='$ax_create_pkgconfig_description' pkgconfig_version='$ax_create_pkgconfig_version' pkgconfig_requires='$ax_create_pkgconfig_requires' pkgconfig_libs='$ax_create_pkgconfig_libs' pkgconfig_ldflags='$ax_create_pkgconfig_ldflags' pkgconfig_cppflags='$ax_create_pkgconfig_cppflags' pkgconfig_src_libdir='$ax_create_pkgconfig_src_libdir' pkgconfig_src_headers='$ax_create_pkgconfig_src_headers' ])dnl AS_VAR_POPDEF([PKGCONFIG_suffix])dnl AS_VAR_POPDEF([PKGCONFIG_libdir])dnl AS_VAR_POPDEF([PKGCONFIG_libfile])dnl AS_VAR_POPDEF([PKGCONFIG_libname])dnl AS_VAR_POPDEF([PKGCONFIG_version])dnl AS_VAR_POPDEF([PKGCONFIG_description])dnl AS_VAR_POPDEF([PKGCONFIG_requires])dnl AS_VAR_POPDEF([PKGCONFIG_pkglibs])dnl AS_VAR_POPDEF([PKGCONFIG_libs])dnl AS_VAR_POPDEF([PKGCONFIG_ldflags])dnl AS_VAR_POPDEF([PKGCONFIG_cppflags])dnl AS_VAR_POPDEF([PKGCONFIG_generate])dnl AS_VAR_POPDEF([PKGCONFIG_src_libdir])dnl AS_VAR_POPDEF([PKGCONFIG_src_headers])dnl ]) isl-0.28/m4/ax_detect_gmp.m40000664000175000017500000000260015072740040014704 0ustar00skimoskimoAC_DEFUN([AX_DETECT_GMP], [ AC_DEFINE([USE_GMP_FOR_MP], [], [use gmp to implement isl_int]) AX_SUBMODULE(gmp,system|build,system) case "$with_gmp" in system) if test "x$with_gmp_prefix" != "x"; then MP_CPPFLAGS="-I$with_gmp_prefix/include" MP_LDFLAGS="-L$with_gmp_prefix/lib" fi MP_LIBS=-lgmp SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" LDFLAGS="$MP_LDFLAGS $LDFLAGS" LIBS="$MP_LIBS $LIBS" AC_CHECK_HEADER([gmp.h], [], [AC_MSG_ERROR([gmp.h header not found])]) AC_CHECK_LIB([gmp], [main], [], [AC_MSG_ERROR([gmp library not found])]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ mpz_t n, d; if (mpz_divisible_p(n, d)) mpz_divexact_ui(n, n, 4); ]])], [], [AC_MSG_ERROR([gmp library too old])]) CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" ;; build) MP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" MP_LIBS="$with_gmp_builddir/libgmp.la" ;; esac SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" LDFLAGS="$MP_LDFLAGS $LDFLAGS" LIBS="$MP_LIBS $LIBS" need_get_memory_functions=false AC_CHECK_DECLS(mp_get_memory_functions,[],[ need_get_memory_functions=true ],[#include ]) CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue) ]) isl-0.28/m4/ax_cxx_compile_stdcxx_11_no_override.m40000664000175000017500000000231215072740040021374 0ustar00skimoskimo# Check if $CXX does or can be made to support C++11 by adding switches. # If $CXX explicitly selects a language standard, then # refrain from overriding this choice. AC_DEFUN([AX_CXX_COMPILE_STDCXX_11_NO_OVERRIDE], [dnl AC_PROG_GREP echo $CXX | $GREP -e "-std=" > /dev/null 2> /dev/null if test $? -eq 0; then _AX_CXX_COMPILE_STDCXX_11_DEFAULT else AX_CXX_COMPILE_STDCXX_11([noext], [optional]) fi ]) # Check if $CXX supports C++11 by default (without adding switches). # This is a trimmed down version of AX_CXX_COMPILE_STDCXX_11 # that reuses its _AX_CXX_COMPILE_STDCXX_testbody_11. AC_DEFUN([_AX_CXX_COMPILE_STDCXX_11_DEFAULT], [dnl AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_11])], [ax_cv_cxx_compile_cxx11=yes], [ax_cv_cxx_compile_cxx11=no])]) if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi AC_LANG_POP([C++]) if test x$ac_success = xno; then HAVE_CXX11=0 else HAVE_CXX11=1 AC_DEFINE(HAVE_CXX11,1, [define if the compiler supports basic C++11 syntax]) fi AC_SUBST(HAVE_CXX11) ]) isl-0.28/m4/ax_create_stdint_h.m40000664000175000017500000005755015072740040015746 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_create_stdint_h.html # =========================================================================== # # SYNOPSIS # # AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] # # DESCRIPTION # # the "ISO C9X: 7.18 Integer types " section requires the # existence of an include file that defines a set of typedefs, # especially uint8_t,int32_t,uintptr_t. Many older installations will not # provide this file, but some will have the very same definitions in # . In other environments we can use the inet-types in # which would define the typedefs int8_t and u_int8_t # respectively. # # This macros will create a local "_stdint.h" or the headerfile given as # an argument. In many cases that file will just "#include " or # "#include ", while in other environments it will provide the # set of basic 'stdint's definitions/typedefs: # # int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t # int_least32_t.. int_fast32_t.. intmax_t # # which may or may not rely on the definitions of other files, or using # the AC_CHECK_SIZEOF macro to determine the actual sizeof each type. # # if your header files require the stdint-types you will want to create an # installable file mylib-int.h that all your other installable header may # include. So if you have a library package named "mylib", just use # # AX_CREATE_STDINT_H(mylib-int.h) # # in configure.ac and go to install that very header file in Makefile.am # along with the other headers (mylib.h) - and the mylib-specific headers # can simply use "#include " to obtain the stdint-types. # # Remember, if the system already had a valid , the generated # file will include it directly. No need for fuzzy HAVE_STDINT_H things... # (oops, GCC 4.2.x has deliberately disabled its stdint.h for non-c99 # compilation and the c99-mode is not the default. Therefore this macro # will not use the compiler's stdint.h - please complain to the GCC # developers). # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 21 AC_DEFUN([AX_CHECK_DATA_MODEL],[ AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void*) ac_cv_char_data_model="" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" AC_MSG_CHECKING([data model]) case "$ac_cv_char_data_model/$ac_cv_long_data_model" in 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; 222/*|333/*|444/*|666/*|888/*) : ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; *) ac_cv_data_model="none" ; n="very unusual model" ;; esac AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) ]) dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$2],[$2]) break done AC_MSG_CHECKING([for stdint uintptr_t]) ]) ]) AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$2],[$2]) break break; done AC_MSG_CHECKING([for stdint uint32_t]) ]) ]) AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$2],[$2]) break break; done AC_MSG_CHECKING([for stdint u_int32_t]) ]) ]) AC_DEFUN([AX_CREATE_STDINT_H], [# ------ AX CREATE STDINT H ------------------------------------- AC_MSG_CHECKING([for stdint types]) ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. AC_CACHE_VAL([ac_cv_header_stdint_t],[ old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int_least32_t v = 0;]])], [ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h";], [ac_cv_header_stdint_t=""]) if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then CFLAGS="-std=c99" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int_least32_t v = 0;]])], [AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)], []) fi CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" ]) v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) elif test "$ac_stdint_h" = "inttypes.h" ; then AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) elif test "_$ac_cv_header_stdint_t" = "_" ; then AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) else ac_cv_header_stdint="$ac_cv_header_stdint_t" AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) fi if test "_$ac_cv_header_stdint_t" = "_" ; then # cannot shortcircuit.. dnl .....intro message done, now do a few system checks..... dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW dnl instead that is triggered with 3 or more arguments (see types.m4) inttype_headers=`echo $2 | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" AX_CHECK_HEADER_STDINT_X(dnl stdint.h inttypes.h sys/inttypes.h $inttype_headers, ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") if test "_$ac_cv_header_stdint_x" = "_" ; then AX_CHECK_HEADER_STDINT_O(dnl, inttypes.h sys/inttypes.h stdint.h $inttype_headers, ac_cv_stdint_result="(seen uint32_t$and64 in $i)") fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then AX_CHECK_HEADER_STDINT_U(dnl, sys/types.h inttypes.h sys/inttypes.h $inttype_headers, ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") fi fi dnl if there was no good C99 header file, do some typedef checks... if test "_$ac_cv_header_stdint_x" = "_" ; then AC_MSG_CHECKING([for stdint datatype model]) AC_MSG_RESULT([(..)]) AX_CHECK_DATA_MODEL fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi AC_MSG_CHECKING([for extra inttypes in chosen header]) AC_MSG_RESULT([($ac_cv_header_stdint)]) dnl see if int_least and int_fast types are present in _this_ header. unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) fi # shortcircuit to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl $ac_cv_stdint_result]) dnl ----------------------------------------------------------------- # ----------------- DONE inttypes.h checks START header ------------- AC_CONFIG_COMMANDS([$ac_stdint_h],[ AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint echo "#include " >>$ac_stdint echo "#endif" >>$ac_stdint echo "#endif" >>$ac_stdint else cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_char_data_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-addressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ dnl /* have a look at "64bit and data size neutrality" at */ dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ dnl /* (the shorthand "ILP" types always have a "P" part) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsigned int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* The ISO C99 standard specifies that in C++ implementations these should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS #ifndef UINT32_C /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # ifdef _HAVE_LONGLONG_UINT64_T # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c ## U # define UINT16_C(c) c ## U # define UINT32_C(c) c ## U # ifdef _HAVE_LONGLONG_UINT64_T # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # ifdef _HAVE_LONGLONG_UINT64_T # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif /* literalnumbers */ #endif #endif /* These limits are merrily those of a two complement byte-oriented system */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) #ifndef INT64_MIN # define INT64_MIN (-__INT64_C(9223372036854775807)-1) #endif /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) #ifndef INT64_MAX # define INT64_MAX (__INT64_C(9223372036854775807)) #endif /* Maximum of unsigned integral types. */ #ifndef UINT8_MAX # define UINT8_MAX (255) #endif #ifndef UINT16_MAX # define UINT16_MAX (65535) #endif # define UINT32_MAX (4294967295U) #ifndef UINT64_MAX # define UINT64_MAX (__UINT64_C(18446744073709551615)) #endif /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN INT8_MIN # define INT_LEAST16_MIN INT16_MIN # define INT_LEAST32_MIN INT32_MIN # define INT_LEAST64_MIN INT64_MIN /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX INT8_MAX # define INT_LEAST16_MAX INT16_MAX # define INT_LEAST32_MAX INT32_MAX # define INT_LEAST64_MAX INT64_MAX /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX UINT8_MAX # define UINT_LEAST16_MAX UINT16_MAX # define UINT_LEAST32_MAX UINT32_MAX # define UINT_LEAST64_MAX UINT64_MAX /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF fi if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then AC_MSG_NOTICE([$ac_stdint_h is unchanged]) else ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` AS_MKDIR_P(["$ac_dir"]) rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ],[# variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_char_data_model="$ac_cv_char_data_model" ac_cv_long_data_model="$ac_cv_long_data_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" ]) ]) isl-0.28/m4/ltoptions.m40000644000175000017500000003612115072740064014145 0ustar00skimoskimo# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 10 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --enable-aix-soname configure option, and support the # `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. # DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_ENABLE([aix-soname], [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $enableval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --enable-aix-soname]) ;; esac lt_cv_with_aix_soname=$enable_aix_soname], [_AC_ENABLE_IF([with], [aix-soname], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)]) enable_aix_soname=$lt_cv_with_aix_soname]) with_aix_soname=$enable_aix_soname AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --enable-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_ENABLE([pic], [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [dnl Continue to support --with-pic and --without-pic, for backward dnl compatibility. _AC_ENABLE_IF([with], [pic], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])])] ) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) isl-0.28/m4/ax_c___attribute__.m40000664000175000017500000000476715072740040015712 0ustar00skimoskimo# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html # =========================================================================== # # SYNOPSIS # # AX_C___ATTRIBUTE__ # # DESCRIPTION # # Provides a test for the compiler support of __attribute__ extensions. # Defines HAVE___ATTRIBUTE__ if it is found. # # LICENSE # # Copyright (c) 2008 Stepan Kasal # Copyright (c) 2008 Christian Haggstrom # Copyright (c) 2008 Ryan McCabe # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AC_DEFUN([AX_C___ATTRIBUTE__], [ AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include static void foo(void) __attribute__ ((unused)); static void foo(void) { exit(1); } ]], [])], [ax_cv___attribute__=yes], [ax_cv___attribute__=no] ) ]) if test "$ax_cv___attribute__" = "yes"; then AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has __attribute__]) fi ]) isl-0.28/m4/ax_compiler_vendor.m40000664000175000017500000001041115072740040015757 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS # # AX_COMPILER_VENDOR # # DESCRIPTION # # Determine the vendor of the C, C++ or Fortran compiler. The vendor is # returned in the cache variable $ax_cv_c_compiler_vendor for C, # $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for # (modern) Fortran. The value is one of "intel", "ibm", "pathscale", # "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC # Compiler), "portland" (PGI), "pcc", "gnu" (GCC), "sun" (Oracle Developer # Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi", # "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if # the compiler cannot be determined). # # To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT # with an appropriate preprocessor-enabled extension. For example: # # AC_LANG_PUSH([Fortran]) # AC_PROG_FC # AC_FC_PP_SRCEXT([F]) # AX_COMPILER_VENDOR # AC_LANG_POP([Fortran]) # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # Copyright (c) 2018-19 John Zaitseff # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 32 AC_DEFUN([AX_COMPILER_VENDOR], [dnl AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl dnl If you modify this list of vendors, please add similar support dnl to ax_compiler_version.m4 if at all possible. dnl dnl Note: Do NOT check for GCC first since some other compilers dnl define __GNUC__ to remain compatible with it. Compilers that dnl are very slow to start (such as Intel) are listed first. vendors=" intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ cray: _CRAYC fujitsu: __FUJITSU sdcc: SDCC,__SDCC sx: _SX nvhpc: __NVCOMPILER portland: __PGI pcc: __PCC__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ comeau: __COMO__ kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ tcc: __TINYC__ unknown: UNKNOWN " for ventest in $vendors; do case $ventest in *:) vendor=$ventest continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ #if !($vencpp) thisisanerror; #endif ]])], [break]) done ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` ]) ])dnl isl-0.28/m4/libtool.m40000644000175000017500000114100515072740064013555 0ustar00skimoskimo# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 63 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), in case it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2024 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' AC_CACHE_CHECK([for -no_fixup_chains linker flag], [lt_cv_support_no_fixup_chains], [ save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" AC_LINK_IFELSE( [AC_LANG_PROGRAM([],[])], lt_cv_support_no_fixup_chains=yes, lt_cv_support_no_fixup_chains=no ) LDFLAGS=$save_LDFLAGS ] ) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains']) fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_REQUIRE([AC_PROG_RANLIB]) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[int test_pointer_size[sizeof (void *) - 5]; ]])], [shlibpath_var=LD_LIBRARY_PATH], [shlibpath_var=LD_32_LIBRARY_PATH]) ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" _LT_COMPILER_PIC($1)='-fPIC' _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(no_undefined_flag, $1)= ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool], [lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BCDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *-mlibc) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; serenity*) ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=no ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; *-mlibc) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; serenity*) ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e. impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=no ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; *-mlibc) _LT_TAGVAR(ld_shlibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; serenity*) ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. if test x-L = x"$p" || test x-R = x"$p" || test x-l = x"$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_PROG([FILECMD], [file], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS isl-0.28/m4/ax_cxx_compile_stdcxx.m40000664000175000017500000004655015072740040016514 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) # or '14' (for the C++14 standard). # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for no added switch, and then for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # Copyright (c) 2016, 2018 Krzesimir Nowak # Copyright (c) 2019 Enji Cooper # Copyright (c) 2020 Jason Merrill # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 12 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], [$2], [noext], [], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], [$3], [optional], [ax_cxx_compile_cxx$1_required=false], [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no m4_if([$2], [], [dnl AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ac_success=yes fi]) m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi]) m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi fi if test x$ac_success = xno; then HAVE_CXX$1=0 AC_MSG_NOTICE([No compiler with C++$1 support was found]) else HAVE_CXX$1=1 AC_DEFINE(HAVE_CXX$1,1, [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) ]) dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ) dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L ]]) dnl Tests for new features in C++14 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L ]]) dnl Tests for new features in C++17 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else #include #include #include namespace cxx17 { namespace test_constexpr_lambdas { constexpr int foo = [](){return 42;}(); } namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } namespace test_template_argument_deduction_for_class_templates { template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } namespace test_structured_bindings { int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } namespace test_exception_spec_type_system { struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // __cplusplus < 201703L ]]) isl-0.28/m4/ax_set_warning_flags.m40000664000175000017500000000127215072740040016271 0ustar00skimoskimodnl Add a set of flags to WARNING_FLAGS, that enable compiler warnings for dnl isl. The warnings that are enabled vary with the compiler and only include dnl warnings that did not trigger at the time of adding these flags. AC_DEFUN([AX_SET_WARNING_FLAGS],[dnl AX_COMPILER_VENDOR WARNING_FLAGS="" if test "${ax_cv_c_compiler_vendor}" = "clang"; then dnl isl is at the moment clean of -Wall warnings. If clang adds dnl new warnings to -Wall which cause false positives, the dnl specific warning types will be disabled explicitally (by dnl adding for example -Wno-return-type). To temporarily disable dnl all warnings run configure with CFLAGS=-Wno-all. WARNING_FLAGS="-Wall" fi ]) isl-0.28/m4/ax_detect_clang.m40000664000175000017500000001335015215726270015221 0ustar00skimoskimoAC_DEFUN([AX_DETECT_CLANG], [ ISL_DETECT_CLANG CLANG_PREFIX=`$LLVM_CONFIG --prefix` AC_DEFINE_UNQUOTED(ISL_CLANG_PREFIX, ["$CLANG_PREFIX"], [Clang installation prefix]) AC_MSG_CHECKING([for clang resource directory]) CLANG_RESOURCE_DIR=`$CLANG_PREFIX/bin/clang -print-resource-dir 2>/dev/null` if test $? -eq 0 && test "x$CLANG_RESOURCE_DIR" != "x"; then AC_MSG_RESULT([$CLANG_RESOURCE_DIR]) AC_DEFINE_UNQUOTED(ISL_CLANG_RESOURCE_DIR, ["$CLANG_RESOURCE_DIR"], [Clang resource directory]) else AC_MSG_RESULT([not found or not supported]) fi # If $CLANG_PREFIX/bin/clang cannot find the standard include files, # then see if setting sysroot to `xcode-select -p`/SDKs/MacOSX.sdk helps. # This may be required on some versions of OS X since they lack /usr/include. # If so, set ISL_CLANG_SYSROOT accordingly. SAVE_CC="$CC" CC="$CLANG_PREFIX/bin/clang" AC_MSG_CHECKING( [whether $CLANG_PREFIX/bin/clang can find standard include files]) found_header=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [found_header=yes]) AC_MSG_RESULT([$found_header]) if test "x$found_header" != "xyes"; then AC_CHECK_PROG(XCODE_SELECT, xcode-select, xcode-select, []) if test -z "$XCODE_SELECT"; then AC_MSG_ERROR([Cannot find xcode-select]) fi sysroot=`$XCODE_SELECT -p`/SDKs/MacOSX.sdk SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -isysroot $sysroot" AC_MSG_CHECKING( [whether standard include files can be found with sysroot set]) found_header=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [found_header=yes]) AC_MSG_RESULT([$found_header]) CPPFLAGS="$SAVE_CPPFLAGS" if test "x$found_header" != "xyes"; then AC_MSG_ERROR([Cannot find standard include files]) else AC_DEFINE_UNQUOTED([ISL_CLANG_SYSROOT], ["$sysroot"], [Define to sysroot if needed]) fi fi CC="$SAVE_CC" AC_LANG_PUSH(C++) SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CLANG_CXXFLAGS -I$srcdir $CPPFLAGS" AC_CHECK_HEADER([clang/Basic/SourceLocation.h], [], [AC_MSG_ERROR([clang header file not found])]) AC_CHECK_HEADER([llvm/TargetParser/Host.h], [AC_DEFINE([HAVE_TARGETPARSER_HOST_H], [], [Define if llvm/TargetParser/Host.h exists])], [AC_EGREP_HEADER([getDefaultTargetTriple], [llvm/Support/Host.h], [], [AC_DEFINE([getDefaultTargetTriple], [getHostTriple], [Define to getHostTriple for older versions of clang])]) ]) AC_EGREP_HEADER([getExpansionLineNumber], [clang/Basic/SourceLocation.h], [], [AC_DEFINE([getExpansionLineNumber], [getInstantiationLineNumber], [Define to getInstantiationLineNumber for older versions of clang])]) AC_EGREP_HEADER([getImmediateExpansionRange], [clang/Basic/SourceManager.h], [], [AC_DEFINE([getImmediateExpansionRange], [getImmediateInstantiationRange], [Define to getImmediateInstantiationRange for older versions of clang])] ) AC_EGREP_HEADER([ArrayRef.*CommandLineArgs], [clang/Frontend/CompilerInvocation.h], [AC_DEFINE([CREATE_FROM_ARGS_TAKES_ARRAYREF], [], [Define if CompilerInvocation::CreateFromArgs takes ArrayRef]) ]) AC_EGREP_HEADER([void HandleTopLevelDecl\(], [clang/AST/ASTConsumer.h], [AC_DEFINE([HandleTopLevelDeclReturn], [void], [Return type of HandleTopLevelDeclReturn]) AC_DEFINE([HandleTopLevelDeclContinue], [], [Return type of HandleTopLevelDeclReturn])], [AC_DEFINE([HandleTopLevelDeclReturn], [bool], [Return type of HandleTopLevelDeclReturn]) AC_DEFINE([HandleTopLevelDeclContinue], [true], [Return type of HandleTopLevelDeclReturn])]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ using namespace clang; std::shared_ptr TO; DiagnosticsEngine *Diags; TargetInfo::CreateTargetInfo(*Diags, TO); ]])], [AC_DEFINE([CREATETARGETINFO_TAKES_SHARED_PTR], [], [Define if TargetInfo::CreateTargetInfo takes shared_ptr])]) AC_EGREP_HEADER([getReturnType], [clang/AST/CanonicalType.h], [], [AC_DEFINE([getReturnType], [getResultType], [Define to getResultType for older versions of clang])]) AC_EGREP_HEADER([initializeBuiltins], [clang/Basic/Builtins.h], [], [AC_DEFINE([initializeBuiltins], [InitializeBuiltins], [Define to InitializeBuiltins for older versions of clang])]) AC_EGREP_HEADER([IK_C], [clang/Frontend/FrontendOptions.h], [], [AC_CHECK_HEADER([clang/Basic/LangStandard.h], [IK_C=Language::C], [IK_C=InputKind::C]) AC_DEFINE_UNQUOTED([IK_C], [$IK_C], [Define to Language::C or InputKind::C for newer versions of clang]) ]) # llvmorg-15-init-7544-g93471e65df48 AC_EGREP_HEADER([setLangDefaults], [clang/Basic/LangOptions.h], [SETLANGDEFAULTS=LangOptions], [SETLANGDEFAULTS=CompilerInvocation]) AC_DEFINE_UNQUOTED([SETLANGDEFAULTS], [$SETLANGDEFAULTS], [Define to class with setLangDefaults method]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include "include/isl-interface/set_lang_defaults_arg4.h" ]], [[ using namespace clang; CompilerInstance *Clang; TargetOptions TO; llvm::Triple T(TO.Triple); PreprocessorOptions PO; SETLANGDEFAULTS::setLangDefaults(Clang->getLangOpts(), IK_C, T, setLangDefaultsArg4(PO), LangStandard::lang_unspecified); ]])], [AC_DEFINE([SETLANGDEFAULTS_TAKES_5_ARGUMENTS], [], [Define if CompilerInvocation::setLangDefaults takes 5 arguments])]) AC_CHECK_HEADER([llvm/Option/Arg.h], [AC_DEFINE([HAVE_LLVM_OPTION_ARG_H], [], [Define if llvm/Option/Arg.h exists])]) # llvmorg-20-init-12950-gbdd10d9d249b AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[ clang::CompilerInstance *Clang; Clang->createDiagnostics(*llvm::vfs::getRealFileSystem()); ]])], [AC_DEFINE([CREATEDIAGNOSTICS_TAKES_VFS], [], [Define if CompilerInstance::createDiagnostics takes VFS])]) CPPFLAGS="$SAVE_CPPFLAGS" AC_LANG_POP ]) isl-0.28/m4/isl_detect_diff_options.m40000664000175000017500000000045115072740040016765 0ustar00skimoskimoAC_DEFUN([ISL_DETECT_DIFF_OPTIONS], [ AC_SUBST([DIFF_OPTIONS]) AC_PATH_PROG([DIFF], [diff]) AC_MSG_CHECKING([for $DIFF context option]) for opt in -u -c; do if $DIFF $opt /dev/null /dev/null > /dev/null 2>&1; then DIFF_OPTIONS=$opt break fi done AC_MSG_RESULT([$DIFF_OPTIONS]) ]) isl-0.28/m4/ax_detect_git_head.m40000664000175000017500000000207715215726270015705 0ustar00skimoskimoAC_DEFUN([AX_DETECT_GIT_HEAD], [ AC_SUBST(GIT_HEAD_ID) AC_SUBST(GIT_HEAD) AC_SUBST(GIT_HEAD_VERSION) if test -f $srcdir/.git; then gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` abs_gitdir=`(cd "$gitdir"; pwd)` GIT_HEAD="$abs_gitdir/index" GIT_REPO="$abs_gitdir" GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/.git/HEAD; then abs_srcdir=`(cd "$srcdir"; pwd)` GIT_HEAD="$abs_srcdir/.git/index" GIT_REPO="$abs_srcdir/.git" GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/GIT_HEAD_ID; then GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID` else mysrcdir=`(cd $srcdir; pwd)` head=`basename $mysrcdir | sed -e 's/.*-//'` head2=`echo $head | sed -e 's/[^0-9a-f]//'` head3=`echo $head2 | sed -e 's/........................................//'` if test "x$head3" = "x" -a "x$head" = "x$head2"; then GIT_HEAD_ID="$head" else GIT_HEAD_ID="UNKNOWN" fi fi if test -z "$GIT_REPO" ; then GIT_HEAD_VERSION="$GIT_HEAD_ID" else GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe --always\`" fi ]) isl-0.28/m4/ltversion.m40000644000175000017500000000131215072740064014131 0ustar00skimoskimo# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4441 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.5.4]) m4_define([LT_PACKAGE_REVISION], [2.5.4]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.5.4' macro_revision='2.5.4' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) isl-0.28/m4/ax_cxx_compile_stdcxx_11.m40000664000175000017500000000321215072740040017001 0ustar00skimoskimo# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 17 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) isl-0.28/m4/ax_detect_imath.m40000664000175000017500000000072615072740040015232 0ustar00skimoskimoAC_DEFUN([AX_DETECT_IMATH], [ AC_DEFINE([USE_IMATH_FOR_MP], [], [use imath to implement isl_int]) MP_CPPFLAGS="-I$srcdir/imath_wrap" MP_LDFLAGS="" MP_LIBS="" SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" AC_CHECK_HEADER([imath.h], [], [AC_MSG_ERROR([imath.h header not found])]) AC_CHECK_HEADER([gmp_compat.h], [], [AC_MSG_ERROR([gmp_compat.h header not found])]) CPPFLAGS="$SAVE_CPPFLAGS" AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x = xfalse) ]) isl-0.28/m4/ax_cxx_compile_stdcxx_17.m40000664000175000017500000000260515072740040017014 0ustar00skimoskimo# ============================================================================= # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html # ============================================================================= # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++17 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++17. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2015 Moritz Klammler # Copyright (c) 2016 Krzesimir Nowak # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 2 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])]) isl-0.28/m4/ax_cc_maxopt.m40000664000175000017500000002036415072740040014555 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html # =========================================================================== # # SYNOPSIS # # AX_CC_MAXOPT # # DESCRIPTION # # Try to turn on "good" C optimization flags for various compilers and # architectures, for some definition of "good". (In our case, good for # FFTW and hopefully for other scientific codes. Modify as needed.) # # The user can override the flags by setting the CFLAGS environment # variable. The user can also specify --enable-portable-binary in order to # disable any optimization flags that might result in a binary that only # runs on the host architecture. # # Note also that the flags assume that ANSI C aliasing rules are followed # by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point # computations can be re-ordered as needed. # # Requires macros: AX_CHECK_COMPILE_FLAG, AX_COMPILER_VENDOR, # AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 23 AC_DEFUN([AX_CC_MAXOPT], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AX_COMPILER_VENDOR]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])], acx_maxopt_portable=$enableval, acx_maxopt_portable=no) # Try to determine "good" native compiler flags if none specified via CFLAGS if test "x$ac_test_CFLAGS" = "x"; then case $ax_cv_c_compiler_vendor in dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" if test "x$acx_maxopt_portable" = xno; then CFLAGS="$CFLAGS -arch host" fi;; sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS -xarch=generic" fi;; hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS +DAportable" fi;; ibm) if test "x$acx_maxopt_portable" = xno; then xlc_opt="-qarch=auto -qtune=auto" else xlc_opt="-qtune=auto" fi AX_CHECK_COMPILE_FLAG($xlc_opt, CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt", [CFLAGS="$CFLAGS -O3 -qansialias -w" echo "******************************************************" echo "* You seem to have the IBM C compiler. It is *" echo "* recommended for best performance that you use: *" echo "* *" echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" echo "* ^^^ ^^^ *" echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" echo "* CPU you have. (Set the CFLAGS environment var. *" echo "* and re-run configure.) For more info, man cc. *" echo "******************************************************"]) ;; intel) CFLAGS="$CFLAGS -O3 -ansi_alias" if test "x$acx_maxopt_portable" = xno; then icc_archflag=unknown icc_flags="" case $host_cpu in i686*|x86_64*) # icc accepts gcc assembly syntax, so these should work: AX_GCC_X86_CPUID(0) AX_GCC_X86_CPUID(1) case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG *:756e6547:6c65746e:49656e69) # Intel case $ax_cv_gcc_x86_cpuid_1 in *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) icc_flags="-xK" ;; *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) icc_flags="-xSSE2 -xB -xK" ;; *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) icc_flags="-xSSE3 -xP -xO -xB -xK" ;; *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) icc_flags="-xSSSE3 -xT -xB -xK" ;; *1?6[[7d]]?:*:*:*) icc_flags="-xSSE4.1 -xS -xT -xB -xK" ;; *1?6[[aef]]?:*:*:*|*2?6[[5cef]]?:*:*:*) icc_flags="-xSSE4.2 -xS -xT -xB -xK" ;; *2?6[[ad]]?:*:*:*) icc_flags="-xAVX -SSE4.2 -xS -xT -xB -xK" ;; *3?6[[ae]]?:*:*:*) icc_flags="-xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) icc_flags="-xCORE-AVX2 -xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) icc_flags="-xSSE3 -xP -xO -xN -xW -xK" ;; *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) icc_flags="-xSSE2 -xN -xW -xK" ;; esac ;; esac ;; esac if test "x$icc_flags" != x; then for flag in $icc_flags; do AX_CHECK_COMPILE_FLAG($flag, [icc_archflag=$flag; break]) done fi AC_MSG_CHECKING([for icc architecture flag]) AC_MSG_RESULT($icc_archflag) if test "x$icc_archflag" != xunknown; then CFLAGS="$CFLAGS $icc_archflag" fi fi ;; nvhpc) # default optimization flags for nvhpc CFLAGS="$CFLAGS -O3" ;; gnu) # default optimization flags for gcc on all systems CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" # -malign-double for x86 systems AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") # -fstrict-aliasing for gcc-2.95+ AX_CHECK_COMPILE_FLAG(-fstrict-aliasing, CFLAGS="$CFLAGS -fstrict-aliasing") # note that we enable "unsafe" fp optimization with other compilers, too AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math") AX_GCC_ARCHFLAG($acx_maxopt_portable) # drop to -O1 for gcc 4.2 $CC --version | sed -e 's/.* \(@<:@0-9@:>@@<:@0-9@:>@*\)\.\(@<:@0-9@:>@@<:@0-9@:>@*\).*/\1 \2/' | (read major minor if test $major -eq 4 -a $minor -eq 2; then exit 0 fi exit 1 ) && CFLAGS="-O1" ;; microsoft) # default optimization flags for MSVC opt builds CFLAGS="$CFLAGS -O2" ;; esac if test -z "$CFLAGS"; then echo "" echo "********************************************************" echo "* WARNING: Don't know the best CFLAGS for this system *" echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" echo "********************************************************" echo "" CFLAGS="$CFLAGS -O3" fi AX_CHECK_COMPILE_FLAG($CFLAGS, [], [ echo "" echo "********************************************************" echo "* WARNING: The guessed CFLAGS don't seem to work with *" echo "* your compiler. *" echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "********************************************************" echo "" ]) fi ]) isl-0.28/m4/ax_gcc_archflag.m40000664000175000017500000003156315072740040015166 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html # =========================================================================== # # SYNOPSIS # # AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) # # DESCRIPTION # # This macro tries to guess the "native" arch corresponding to the target # architecture for use with gcc's -march=arch or -mtune=arch flags. If # found, the cache variable $ax_cv_gcc_archflag is set to this flag and # ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to # "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is # to add $ax_cv_gcc_archflag to the end of $CFLAGS. # # PORTABLE? should be either [yes] (default) or [no]. In the former case, # the flag is set to -mtune (or equivalent) so that the architecture is # only used for tuning, but the instruction set used is still portable. In # the latter case, the flag is set to -march (or equivalent) so that # architecture-specific instructions are enabled. # # The user can specify --with-gcc-arch= in order to override the # macro's choice of architecture, or --without-gcc-arch to disable this. # # When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is # called unless the user specified --with-gcc-arch manually. # # Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID # # (The main emphasis here is on recent CPUs, on the principle that doing # high-performance computing on old hardware is uncommon.) # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # Copyright (c) 2014 Tsukasa Oi # Copyright (c) 2017-2018 Alexey Kopytov # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 22 AC_DEFUN([AX_GCC_ARCHFLAG], [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AX_COMPILER_VENDOR]) AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=], [use architecture for gcc -march/-mtune, instead of guessing])], ax_gcc_arch=$withval, ax_gcc_arch=yes) AC_MSG_CHECKING([for gcc architecture flag]) AC_MSG_RESULT([]) AC_CACHE_VAL(ax_cv_gcc_archflag, [ ax_cv_gcc_archflag="unknown" if test "$GCC" = yes; then if test "x$ax_gcc_arch" = xyes; then ax_gcc_arch="" if test "$cross_compiling" = no; then case $host_cpu in i[[3456]]86*|x86_64*|amd64*) # use cpuid codes AX_GCC_X86_CPUID(0) AX_GCC_X86_CPUID(1) case $ax_cv_gcc_x86_cpuid_0 in *:756e6547:6c65746e:49656e69) # Intel case $ax_cv_gcc_x86_cpuid_1 in *5[[4578]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; *5[[123]]?:*:*:*) ax_gcc_arch=pentium ;; *0?61?:*:*:*|?61?:*:*:*|61?:*:*:*) ax_gcc_arch=pentiumpro ;; *0?6[[356]]?:*:*:*|?6[[356]]?:*:*:*|6[[356]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) ax_gcc_arch="yonah pentium-m pentium3 pentiumpro" ;; *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;; *1?6[[7d]]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;; *1?6[[aef]]?:*:*:*|*2?6e?:*:*:*) ax_gcc_arch="nehalem corei7 core2 pentium-m pentium3 pentiumpro" ;; *2?6[[5cf]]?:*:*:*) ax_gcc_arch="westmere corei7 core2 pentium-m pentium3 pentiumpro" ;; *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) ax_gcc_arch="nocona prescott pentium4 pentiumpro" ;; # fallback *5??:*:*:*) ax_gcc_arch=pentium ;; *??6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;; *6??:*:*:*) ax_gcc_arch=pentiumpro ;; *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; esac ;; *:68747541:444d4163:69746e65) # AMD case $ax_cv_gcc_x86_cpuid_1 in *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; *5[[8]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; *5[[9d]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; *6[[678a]]?:*:*:*) ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; *000?f[[4578bcef]]?:*:*:*|?f[[4578bcef]]?:*:*:*|f[[4578bcef]]?:*:*:*|*001?f[[4578bcf]]?:*:*:*|1?f[[4578bcf]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; *002?f[[13457bcf]]?:*:*:*|2?f[[13457bcf]]?:*:*:*|*004?f[[138bcf]]?:*:*:*|4?f[[138bcf]]?:*:*:*|*005?f[[df]]?:*:*:*|5?f[[df]]?:*:*:*|*006?f[[8bcf]]?:*:*:*|6?f[[8bcf]]?:*:*:*|*007?f[[cf]]?:*:*:*|7?f[[cf]]?:*:*:*|*00c?f1?:*:*:*|c?f1?:*:*:*|*020?f3?:*:*:*|20?f3?:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; *010?f[[245689a]]?:*:*:*|10?f[[245689a]]?:*:*:*|*030?f1?:*:*:*|30?f1?:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; *050?f[[12]]?:*:*:*|50?f[[12]]?:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; *060?f1?:*:*:*|60?f1?:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; *060?f2?:*:*:*|60?f2?:*:*:*|*061?f[[03]]?:*:*:*|61?f[[03]]?:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; *063?f0?:*:*:*|63?f0?:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; *07[[03]]?f0?:*:*:*|7[[03]]?f0?:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; # fallback *0[[13]]??f??:*:*:*|[[13]]??f??:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; *020?f??:*:*:*|20?f??:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; *05??f??:*:*:*|5??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; *060?f??:*:*:*|60?f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; *061?f??:*:*:*|61?f??:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; *06??f??:*:*:*|6??f??:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; *070?f??:*:*:*|70?f??:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; *???f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;; esac ;; *:746e6543:736c7561:48727561) # IDT / VIA (Centaur) case $ax_cv_gcc_x86_cpuid_1 in *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; *5[[89]]?:*:*:*) ax_gcc_arch=winchip2 ;; *66?:*:*:*) ax_gcc_arch=winchip2 ;; *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; *6[[9adf]]?:*:*:*) ax_gcc_arch="c3-2 c3" ;; esac ;; esac if test x"$ax_gcc_arch" = x; then # fallback case $host_cpu in i586*) ax_gcc_arch=pentium ;; i686*) ax_gcc_arch=pentiumpro ;; esac fi ;; sparc*) AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` cputype=`echo "$cputype" | tr -d ' -' | $SED 's/SPARCIIi/SPARCII/' |tr $as_cr_LETTERS $as_cr_letters` case $cputype in *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; *cypress*) ax_gcc_arch=cypress ;; esac ;; alphaev5) ax_gcc_arch=ev5 ;; alphaev56) ax_gcc_arch=ev56 ;; alphapca56) ax_gcc_arch="pca56 ev56" ;; alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; alphaev6) ax_gcc_arch=ev6 ;; alphaev67) ax_gcc_arch=ev67 ;; alphaev68) ax_gcc_arch="ev68 ev67" ;; alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; powerpc*) cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | $SED 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` cputype=`echo $cputype | $SED -e 's/ppc//g;s/ *//g'` case $cputype in *750*) ax_gcc_arch="750 G3" ;; *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; *970*) ax_gcc_arch="970 G5 power4";; *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; 603ev|8240) ax_gcc_arch="$cputype 603e 603";; *POWER7*) ax_gcc_arch="power7";; *POWER8*) ax_gcc_arch="power8";; *POWER9*) ax_gcc_arch="power9";; *POWER10*) ax_gcc_arch="power10";; *) ax_gcc_arch=$cputype ;; esac ax_gcc_arch="$ax_gcc_arch powerpc" ;; aarch64) cpuimpl=`grep 'CPU implementer' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` cpuarch=`grep 'CPU architecture' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` cpuvar=`grep 'CPU variant' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` case $cpuimpl in 0x42) case $cpuarch in 8) case $cpuvar in 0x0) ax_gcc_arch="thunderx2t99 vulcan armv8.1-a armv8-a+lse armv8-a native" ;; esac ;; esac ;; 0x43) case $cpuarch in 8) case $cpuvar in 0x0) ax_gcc_arch="thunderx armv8-a native" ;; 0x1) ax_gcc_arch="thunderx+lse armv8.1-a armv8-a+lse armv8-a native" ;; esac ;; esac ;; esac ;; esac fi # not cross-compiling fi # guess arch if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code flag_prefixes="-mtune=" if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then flag_prefixes="-march="; fi # -mcpu=$arch and m$arch generate nonportable code on every arch except # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. case $host_cpu in i*86|x86_64*|amd64*) flag_prefixes="$flag_prefixes -mcpu= -m";; esac else flag_prefixes="-march= -mcpu= -m" fi for flag_prefix in $flag_prefixes; do for arch in $ax_gcc_arch; do flag="$flag_prefix$arch" AX_CHECK_COMPILE_FLAG($flag, [if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then if test "x[]m4_default([$1],yes)" = xyes; then if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi fi fi; ax_cv_gcc_archflag=$flag; break]) done test "x$ax_cv_gcc_archflag" = xunknown || break done fi fi # $GCC=yes ]) AC_MSG_CHECKING([for gcc architecture flag]) AC_MSG_RESULT($ax_cv_gcc_archflag) if test "x$ax_cv_gcc_archflag" = xunknown; then m4_default([$3],:) else m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) fi ]) isl-0.28/m4/lt~obsolete.m40000644000175000017500000001400715072740064014463 0ustar00skimoskimo# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) isl-0.28/m4/ax_gcc_x86_cpuid.m40000664000175000017500000000716715072740040015233 0ustar00skimoskimo# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html # =========================================================================== # # SYNOPSIS # # AX_GCC_X86_CPUID(OP) # AX_GCC_X86_CPUID_COUNT(OP, COUNT) # # DESCRIPTION # # On Pentium and later x86 processors, with gcc or a compiler that has a # compatible syntax for inline assembly instructions, run a small program # that executes the cpuid instruction with input OP. This can be used to # detect the CPU type. AX_GCC_X86_CPUID_COUNT takes an additional COUNT # parameter that gets passed into register ECX before calling cpuid. # # On output, the values of the eax, ebx, ecx, and edx registers are stored # as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable # ax_cv_gcc_x86_cpuid_OP. # # If the cpuid instruction fails (because you are running a # cross-compiler, or because you are not using gcc, or because you are on # a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP # is set to the string "unknown". # # This macro mainly exists to be used in AX_GCC_ARCHFLAG. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # Copyright (c) 2015 Michael Petch # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 10 AC_DEFUN([AX_GCC_X86_CPUID], [AX_GCC_X86_CPUID_COUNT($1, 0) ]) AC_DEFUN([AX_GCC_X86_CPUID_COUNT], [AC_REQUIRE([AC_PROG_CC]) AC_LANG_PUSH([C]) AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ int op = $1, level = $2, eax, ebx, ecx, edx; FILE *f; __asm__ __volatile__ ("xchg %%ebx, %1\n" "cpuid\n" "xchg %%ebx, %1\n" : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "a" (op), "2" (level)); f = fopen("conftest_cpuid", "w"); if (!f) return 1; fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); fclose(f); return 0; ])], [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], [ax_cv_gcc_x86_cpuid_$1=unknown])]) AC_LANG_POP([C]) ]) isl-0.28/isl_project_out_param_templ.c0000664000175000017500000000244415072740040017256 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) /* If "obj" involves a parameter with identifier "id", * then turn it into an existentially quantified variable. */ __isl_give TYPE *FN(TYPE,project_out_param_id)(__isl_take TYPE *obj, __isl_take isl_id *id) { int pos; if (!obj || !id) goto error; pos = FN(TYPE,find_dim_by_id)(obj, isl_dim_param, id); isl_id_free(id); if (pos < 0) return obj; return FN(TYPE,project_out)(obj, isl_dim_param, pos, 1); error: FN(TYPE,free)(obj); isl_id_free(id); return NULL; } /* If "obj" involves any of the parameters with identifiers in "list", * then turn them into existentially quantified variables. */ __isl_give TYPE *FN(TYPE,project_out_param_id_list)(__isl_take TYPE *obj, __isl_take isl_id_list *list) { int i; isl_size n; n = isl_id_list_size(list); if (n < 0) goto error; for (i = 0; i < n; ++i) { isl_id *id; id = isl_id_list_get_at(list, i); obj = FN(TYPE,project_out_param_id)(obj, id); } isl_id_list_free(list); return obj; error: isl_id_list_free(list); FN(TYPE,free)(obj); return NULL; } isl-0.28/isl_pw_templ.c0000664000175000017500000012543715215726270014207 0ustar00skimoskimo/* * Copyright 2010-2011 INRIA Saclay * Copyright 2011 Sven Verdoolaege * Copyright 2012-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ #include #include #include #include #include #include "opt_type.h" __isl_give PW *FN(PW,alloc_size)(__isl_take isl_space *space OPT_TYPE_PARAM, int n) { isl_ctx *ctx; struct PW *pw; if (!space) return NULL; ctx = isl_space_get_ctx(space); isl_assert(ctx, n >= 0, goto error); pw = isl_alloc(ctx, struct PW, sizeof(struct PW) + (n - 1) * sizeof(S(PW,piece))); if (!pw) goto error; pw->ref = 1; OPT_SET_TYPE(pw->, type); pw->size = n; pw->n = 0; pw->dim = space; return pw; error: isl_space_free(space); return NULL; } __isl_give PW *FN(PW,ZERO)(__isl_take isl_space *space OPT_TYPE_PARAM) { return FN(PW,alloc_size)(space OPT_TYPE_ARG(NO_LOC), 0); } /* Add a piece with domain "set" and base expression "el" * to the piecewise expression "pw". * * Do this independently of the values of "set" and "el", * such that this function can be used by isl_pw_*_dup. */ static __isl_give PW *FN(PW,add_dup_piece)(__isl_take PW *pw, __isl_take isl_set *set, __isl_take EL *el) { isl_ctx *ctx; isl_space *el_dim = NULL; if (!pw || !set || !el) goto error; ctx = isl_set_get_ctx(set); if (!OPT_EQUAL_TYPES(pw->, el->)) isl_die(ctx, isl_error_invalid, "fold types don't match", goto error); el_dim = FN(EL,get_space(el)); isl_assert(ctx, isl_space_is_equal(pw->dim, el_dim), goto error); isl_assert(ctx, pw->n < pw->size, goto error); pw->p[pw->n].set = set; pw->p[pw->n].FIELD = el; pw->n++; isl_space_free(el_dim); return pw; error: isl_space_free(el_dim); FN(PW,free)(pw); isl_set_free(set); FN(EL,free)(el); return NULL; } /* Add a piece with domain "set" and base expression "el" * to the piecewise expression "pw", provided the domain * is not obviously empty and the base expression * is not equal to the default value. */ __isl_give PW *FN(PW,add_piece)(__isl_take PW *pw, __isl_take isl_set *set, __isl_take EL *el) { isl_bool skip; skip = isl_set_plain_is_empty(set); if (skip >= 0 && !skip) skip = FN(EL,EL_IS_ZERO)(el); if (skip >= 0 && !skip) return FN(PW,add_dup_piece)(pw, set, el); isl_set_free(set); FN(EL,free)(el); if (skip < 0) return FN(PW,free)(pw); return pw; } /* Does the space of "set" correspond to that of the domain of "el". */ static isl_bool FN(PW,compatible_domain)(__isl_keep EL *el, __isl_keep isl_set *set) { isl_bool ok; isl_space *el_space, *set_space; if (!set || !el) return isl_bool_error; set_space = isl_set_get_space(set); el_space = FN(EL,get_space)(el); ok = isl_space_is_domain_internal(set_space, el_space); isl_space_free(el_space); isl_space_free(set_space); return ok; } /* Check that the space of "set" corresponds to that of the domain of "el". */ static isl_stat FN(PW,check_compatible_domain)(__isl_keep EL *el, __isl_keep isl_set *set) { isl_bool ok; ok = FN(PW,compatible_domain)(el, set); if (ok < 0) return isl_stat_error; if (!ok) isl_die(isl_set_get_ctx(set), isl_error_invalid, "incompatible spaces", return isl_stat_error); return isl_stat_ok; } __isl_give PW *FN(PW,alloc)(OPT_TYPE_PARAM_FIRST __isl_take isl_set *set, __isl_take EL *el) { PW *pw; if (FN(PW,check_compatible_domain)(el, set) < 0) goto error; pw = FN(PW,alloc_size)(FN(EL,get_space)(el) OPT_TYPE_ARG(NO_LOC), 1); return FN(PW,add_piece)(pw, set, el); error: isl_set_free(set); FN(EL,free)(el); return NULL; } __isl_give PW *FN(PW,dup)(__isl_keep PW *pw) { int i; PW *dup; if (!pw) return NULL; dup = FN(PW,alloc_size)(isl_space_copy(pw->dim) OPT_TYPE_ARG(pw->), pw->n); if (!dup) return NULL; for (i = 0; i < pw->n; ++i) dup = FN(PW,add_dup_piece)(dup, isl_set_copy(pw->p[i].set), FN(EL,copy)(pw->p[i].FIELD)); return dup; } __isl_give PW *FN(PW,cow)(__isl_take PW *pw) { if (!pw) return NULL; if (pw->ref == 1) return pw; pw->ref--; return FN(PW,dup)(pw); } __isl_give PW *FN(PW,copy)(__isl_keep PW *pw) { if (!pw) return NULL; pw->ref++; return pw; } __isl_null PW *FN(PW,free)(__isl_take PW *pw) { int i; if (!pw) return NULL; if (--pw->ref > 0) return NULL; for (i = 0; i < pw->n; ++i) { isl_set_free(pw->p[i].set); FN(EL,free)(pw->p[i].FIELD); } isl_space_free(pw->dim); free(pw); return NULL; } #undef TYPE #define TYPE PW #undef FIELD_TYPE #define FIELD_TYPE isl_space #undef FIELD_NAME #define FIELD_NAME dim #undef PROPERTY #define PROPERTY space #include "isl_peek_templ.c" #include "isl_get_templ.c" static #include "isl_take_templ.c" static #include "isl_restore_templ.c" /* Check that "pos" is a valid position for a cell in "pw". */ static isl_stat FN(PW,check_pos)(__isl_keep PW *pw, int pos) { if (!pw) return isl_stat_error; if (pos < 0 || pos >= pw->n) isl_die(FN(PW,get_ctx)(pw), isl_error_internal, "position out of bounds", return isl_stat_error); return isl_stat_ok; } /* Return the cell at position "pos" in "pw". */ static __isl_keep isl_set *FN(PW,peek_domain_at)(__isl_keep PW *pw, int pos) { if (FN(PW,check_pos)(pw, pos) < 0) return NULL; return pw->p[pos].set; } /* Return a copy of the cell at position "pos" in "pw". */ static __isl_give isl_set *FN(PW,get_domain_at)(__isl_keep PW *pw, int pos) { return isl_set_copy(FN(PW,peek_domain_at)(pw, pos)); } /* Return the cell at position "pos" in "pw". * This may be either a copy or the cell itself * if there is only one reference to "pw". * This allows the cell to be modified inplace * if both the piecewise expression and this cell * have only a single reference. * The caller is not allowed to modify "pw" between this call and * the subsequent call to isl_pw_*_restore_domain_at. * The only exception is that isl_pw_*_free can be called instead. */ static __isl_give isl_set *FN(PW,take_domain_at)(__isl_keep PW *pw, int pos) { isl_set *domain; if (!pw) return NULL; if (pw->ref != 1) return FN(PW,get_domain_at)(pw, pos); if (FN(PW,check_pos)(pw, pos) < 0) return NULL; domain = pw->p[pos].set; pw->p[pos].set = NULL; return domain; } /* Set the cell at position "pos" in "pw" to "el", * where this cell may be missing * due to a preceding call to isl_pw_*_take_domain_at. * However, in this case, "pw" only has a single reference and * then the call to isl_pw_*_cow has no effect. */ static __isl_give PW *FN(PW,restore_domain_at)(__isl_take PW *pw, int pos, __isl_take isl_set *domain) { if (FN(PW,check_pos)(pw, pos) < 0 || !domain) goto error; if (pw->p[pos].set == domain) { isl_set_free(domain); return pw; } pw = FN(PW,cow)(pw); if (!pw) goto error; isl_set_free(pw->p[pos].set); pw->p[pos].set = domain; return pw; error: FN(PW,free)(pw); isl_set_free(domain); return NULL; } /* Return the base expression associated to * the cell at position "pos" in "pw". */ __isl_keep EL *FN(PW,peek_base_at)(__isl_keep PW *pw, int pos) { if (FN(PW,check_pos)(pw, pos) < 0) return NULL; return pw->p[pos].FIELD; } /* Return a copy of the base expression associated to * the cell at position "pos" in "pw". */ static __isl_give EL *FN(PW,get_base_at)(__isl_keep PW *pw, int pos) { return FN(EL,copy)(FN(PW,peek_base_at)(pw, pos)); } /* Return the base expression associated to * the cell at position "pos" in "pw". * This may be either a copy or the base expression itself * if there is only one reference to "pw". * This allows the base expression to be modified inplace * if both the piecewise expression and this base expression * have only a single reference. * The caller is not allowed to modify "pw" between this call and * a subsequent call to isl_pw_*_restore_*. * The only exception is that isl_pw_*_free can be called instead. */ static __isl_give EL *FN(PW,take_base_at)(__isl_keep PW *pw, int pos) { EL *el; if (!pw) return NULL; if (pw->ref != 1) return FN(PW,get_base_at)(pw, pos); if (FN(PW,check_pos)(pw, pos) < 0) return NULL; el = pw->p[pos].FIELD; pw->p[pos].FIELD = NULL; return el; } /* Set the base expression associated to * the cell at position "pos" in "pw" to "el", * where this base expression may be missing * due to a preceding call to isl_pw_*_take_base_at. * However, in this case, "pw" only has a single reference and * then the call to isl_pw_*_cow has no effect. * If "inplace" is set, then replacing the base expression by "el" * is known not to change the meaning of "pw". It can therefore be replaced * in all references to "pw". */ static __isl_give PW *FN(PW,restore_base_at_)(__isl_take PW *pw, int pos, __isl_take EL *el, int inplace) { if (FN(PW,check_pos)(pw, pos) < 0 || !el) goto error; if (pw->p[pos].FIELD == el) { FN(EL,free)(el); return pw; } if (!inplace) pw = FN(PW,cow)(pw); if (!pw) goto error; FN(EL,free)(pw->p[pos].FIELD); pw->p[pos].FIELD = el; return pw; error: FN(PW,free)(pw); FN(EL,free)(el); return NULL; } /* Set the base expression associated to * the cell at position "pos" in "pw" to "el", * where this base expression may be missing * due to a preceding call to isl_pw_*_take_base_at. */ static __isl_give PW *FN(PW,restore_base_at)(__isl_take PW *pw, int pos, __isl_take EL *el) { return FN(PW,restore_base_at_)(pw, pos, el, 0); } /* Set the base expression associated to * the cell at position "pos" in "pw" to "el", * where this base expression may be missing * due to a preceding call to isl_pw_*_take_base_at. * Furthermore, replacing the base expression by "el" * is known not to change the meaning of "pw". */ static __isl_give PW *FN(PW,restore_base_at_inplace)(__isl_take PW *pw, int pos, __isl_take EL *el) { return FN(PW,restore_base_at_)(pw, pos, el, 1); } /* Create a piecewise expression with the given base expression on a universe * domain. */ static __isl_give PW *FN(FN(FN(PW,from),BASE),type_base)(__isl_take EL *el OPT_TYPE_PARAM) { isl_set *dom = isl_set_universe(FN(EL,get_domain_space)(el)); return FN(PW,alloc)(OPT_TYPE_ARG_FIRST(NO_LOC) dom, el); } /* Create a piecewise expression with the given base expression on a universe * domain. * * If the default value of this piecewise type is zero and * if "el" is effectively zero, then create an empty piecewise expression * instead. */ static __isl_give PW *FN(FN(FN(PW,from),BASE),type)(__isl_take EL *el OPT_TYPE_PARAM) { isl_bool is_zero; isl_space *space; if (!DEFAULT_IS_ZERO) return FN(FN(FN(PW,from),BASE),type_base)(el OPT_TYPE_ARG(NO_LOC)); is_zero = FN(EL,EL_IS_ZERO)(el); if (is_zero < 0) goto error; if (!is_zero) return FN(FN(FN(PW,from),BASE),type_base)(el OPT_TYPE_ARG(NO_LOC)); space = FN(EL,get_space)(el); FN(EL,free)(el); return FN(PW,ZERO)(space OPT_TYPE_ARG(NO_LOC)); error: FN(EL,free)(el); return NULL; } #ifdef HAS_TYPE /* Create a piecewise expression with the given base expression on a universe * domain. * * Pass along the type as an extra argument for improved uniformity * with piecewise types that do not have a fold type. */ __isl_give PW *FN(FN(PW,from),BASE)(__isl_take EL *el) { enum isl_fold type = FN(EL,get_type)(el); return FN(FN(FN(PW,from),BASE),type)(el, type); } #else __isl_give PW *FN(FN(PW,from),BASE)(__isl_take EL *el) { return FN(FN(FN(PW,from),BASE),type)(el); } #endif const char *FN(PW,get_dim_name)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos) { return pw ? isl_space_get_dim_name(pw->dim, type, pos) : NULL; } isl_bool FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos) { return pw ? isl_space_has_dim_id(pw->dim, type, pos) : isl_bool_error; } __isl_give isl_id *FN(PW,get_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos) { return pw ? isl_space_get_dim_id(pw->dim, type, pos) : NULL; } isl_bool FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) { return pw ? isl_space_has_tuple_name(pw->dim, type) : isl_bool_error; } const char *FN(PW,get_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) { return pw ? isl_space_get_tuple_name(pw->dim, type) : NULL; } isl_bool FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) { return pw ? isl_space_has_tuple_id(pw->dim, type) : isl_bool_error; } __isl_give isl_id *FN(PW,get_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) { return pw ? isl_space_get_tuple_id(pw->dim, type) : NULL; } isl_bool FN(PW,IS_ZERO)(__isl_keep PW *pw) { if (!pw) return isl_bool_error; return isl_bool_ok(pw->n == 0); } static __isl_give PW *FN(PW,realign_domain)(__isl_take PW *pw, __isl_take isl_reordering *exp) { int i; isl_size n; n = FN(PW,n_piece)(pw); if (n < 0 || !exp) goto error; for (i = 0; i < n; ++i) { isl_set *domain; EL *el; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_realign(domain, isl_reordering_copy(exp)); pw = FN(PW,restore_domain_at)(pw, i, domain); el = FN(PW,take_base_at)(pw, i); el = FN(EL,realign_domain)(el, isl_reordering_copy(exp)); pw = FN(PW,restore_base_at)(pw, i, el); } pw = FN(PW,reset_domain_space)(pw, isl_reordering_get_space(exp)); isl_reordering_free(exp); return pw; error: isl_reordering_free(exp); FN(PW,free)(pw); return NULL; } #undef TYPE #define TYPE PW #include "isl_check_named_params_templ.c" /* Align the parameters of "pw" to those of "model". */ __isl_give PW *FN(PW,align_params)(__isl_take PW *pw, __isl_take isl_space *model) { isl_ctx *ctx; isl_bool equal_params; if (!pw || !model) goto error; ctx = isl_space_get_ctx(model); if (!isl_space_has_named_params(model)) isl_die(ctx, isl_error_invalid, "model has unnamed parameters", goto error); if (FN(PW,check_named_params)(pw) < 0) goto error; equal_params = isl_space_has_equal_params(pw->dim, model); if (equal_params < 0) goto error; if (!equal_params) { isl_space *space; isl_reordering *exp; space = FN(PW,get_domain_space)(pw); exp = isl_parameter_alignment_reordering(space, model); isl_space_free(space); pw = FN(PW,realign_domain)(pw, exp); } isl_space_free(model); return pw; error: isl_space_free(model); FN(PW,free)(pw); return NULL; } #undef TYPE #define TYPE PW static #include "isl_align_params_bin_templ.c" #undef SUFFIX #define SUFFIX set #undef ARG1 #define ARG1 PW #undef ARG2 #define ARG2 isl_set static #include "isl_align_params_templ.c" #undef TYPE #define TYPE PW #include "isl_type_has_equal_space_bin_templ.c" #include "isl_type_check_equal_space_templ.c" /* Private version of "union_add". For isl_pw_qpolynomial and * isl_pw_qpolynomial_fold, we prefer to simply call it "add". */ static __isl_give PW *FN(PW,union_add_)(__isl_take PW *pw1, __isl_take PW *pw2) { int i, j, n; struct PW *res; isl_ctx *ctx; isl_set *set; if (FN(PW,align_params_bin)(&pw1, &pw2) < 0) goto error; ctx = isl_space_get_ctx(pw1->dim); if (!OPT_EQUAL_TYPES(pw1->, pw2->)) isl_die(ctx, isl_error_invalid, "fold types don't match", goto error); if (FN(PW,check_equal_space)(pw1, pw2) < 0) goto error; if (FN(PW,IS_ZERO)(pw1)) { FN(PW,free)(pw1); return pw2; } if (FN(PW,IS_ZERO)(pw2)) { FN(PW,free)(pw2); return pw1; } n = (pw1->n + 1) * (pw2->n + 1); res = FN(PW,alloc_size)(isl_space_copy(pw1->dim) OPT_TYPE_ARG(pw1->), n); for (i = 0; i < pw1->n; ++i) { set = isl_set_copy(pw1->p[i].set); for (j = 0; j < pw2->n; ++j) { struct isl_set *common; EL *sum; common = isl_set_intersect(isl_set_copy(pw1->p[i].set), isl_set_copy(pw2->p[j].set)); if (isl_set_plain_is_empty(common)) { isl_set_free(common); continue; } set = isl_set_subtract(set, isl_set_copy(pw2->p[j].set)); sum = FN(EL,add_on_domain)(common, FN(EL,copy)(pw1->p[i].FIELD), FN(EL,copy)(pw2->p[j].FIELD)); res = FN(PW,add_piece)(res, common, sum); } res = FN(PW,add_piece)(res, set, FN(EL,copy)(pw1->p[i].FIELD)); } for (j = 0; j < pw2->n; ++j) { set = isl_set_copy(pw2->p[j].set); for (i = 0; i < pw1->n; ++i) set = isl_set_subtract(set, isl_set_copy(pw1->p[i].set)); res = FN(PW,add_piece)(res, set, FN(EL,copy)(pw2->p[j].FIELD)); } FN(PW,free)(pw1); FN(PW,free)(pw2); return res; error: FN(PW,free)(pw1); FN(PW,free)(pw2); return NULL; } #if !DEFAULT_IS_ZERO /* Compute the sum of "pw1" and "pw2 on the union of their domains, * with the actual sum on the shared domain and * the defined expression on the symmetric difference of the domains. * * This function is only defined for object types that do not have * a default zero value. For other object types, this function * is simply called "add". */ __isl_give PW *FN(PW,union_add)(__isl_take PW *pw1, __isl_take PW *pw2) { return FN(PW,union_add_)(pw1, pw2); } #endif /* This function is currently only used from isl_aff.c */ static __isl_give PW *FN(PW,on_shared_domain_in)(__isl_take PW *pw1, __isl_take PW *pw2, __isl_take isl_space *space, __isl_give EL *(*fn)(__isl_take EL *el1, __isl_take EL *el2)) __attribute__ ((unused)); /* Apply "fn" to pairs of elements from pw1 and pw2 on shared domains. * The result of "fn" (and therefore also of this function) lives in "space". */ static __isl_give PW *FN(PW,on_shared_domain_in)(__isl_take PW *pw1, __isl_take PW *pw2, __isl_take isl_space *space, __isl_give EL *(*fn)(__isl_take EL *el1, __isl_take EL *el2)) { int i, j, n; PW *res = NULL; if (!pw1 || !pw2) goto error; n = pw1->n * pw2->n; res = FN(PW,alloc_size)(isl_space_copy(space) OPT_TYPE_ARG(pw1->), n); for (i = 0; i < pw1->n; ++i) { for (j = 0; j < pw2->n; ++j) { isl_set *common; EL *res_ij; int empty; common = isl_set_intersect( isl_set_copy(pw1->p[i].set), isl_set_copy(pw2->p[j].set)); empty = isl_set_plain_is_empty(common); if (empty < 0 || empty) { isl_set_free(common); if (empty < 0) goto error; continue; } res_ij = fn(FN(EL,copy)(pw1->p[i].FIELD), FN(EL,copy)(pw2->p[j].FIELD)); res_ij = FN(EL,gist)(res_ij, isl_set_copy(common)); res = FN(PW,add_piece)(res, common, res_ij); } } isl_space_free(space); FN(PW,free)(pw1); FN(PW,free)(pw2); return res; error: isl_space_free(space); FN(PW,free)(pw1); FN(PW,free)(pw2); FN(PW,free)(res); return NULL; } /* This function is currently only used from isl_aff.c */ static __isl_give PW *FN(PW,on_shared_domain)(__isl_take PW *pw1, __isl_take PW *pw2, __isl_give EL *(*fn)(__isl_take EL *el1, __isl_take EL *el2)) __attribute__ ((unused)); /* Apply "fn" to pairs of elements from pw1 and pw2 on shared domains. * The result of "fn" is assumed to live in the same space as "pw1" and "pw2". */ static __isl_give PW *FN(PW,on_shared_domain)(__isl_take PW *pw1, __isl_take PW *pw2, __isl_give EL *(*fn)(__isl_take EL *el1, __isl_take EL *el2)) { isl_space *space; if (FN(PW,check_equal_space)(pw1, pw2) < 0) goto error; space = isl_space_copy(pw1->dim); return FN(PW,on_shared_domain_in)(pw1, pw2, space, fn); error: FN(PW,free)(pw1); FN(PW,free)(pw2); return NULL; } /* Return the parameter domain of "pw". */ __isl_give isl_set *FN(PW,params)(__isl_take PW *pw) { return isl_set_params(FN(PW,domain)(pw)); } __isl_give isl_set *FN(PW,domain)(__isl_take PW *pw) { int i; isl_set *dom; if (!pw) return NULL; dom = isl_set_empty(FN(PW,get_domain_space)(pw)); for (i = 0; i < pw->n; ++i) dom = isl_set_union_disjoint(dom, isl_set_copy(pw->p[i].set)); FN(PW,free)(pw); return dom; } /* Exploit the equalities in the domain of piece "i" of "pw" * to simplify the associated function. * If the domain of piece "i" is empty, then remove it entirely, * replacing it with the final piece. */ static __isl_give PW *FN(PW,exploit_equalities_and_remove_if_empty)( __isl_take PW *pw, int i) { EL *el; isl_set *domain; isl_basic_set *aff; int empty; domain = FN(PW,peek_domain_at)(pw, i); empty = isl_set_plain_is_empty(domain); if (empty < 0) return FN(PW,free)(pw); if (empty) { isl_set_free(pw->p[i].set); FN(EL,free)(pw->p[i].FIELD); if (i != pw->n - 1) pw->p[i] = pw->p[pw->n - 1]; pw->n--; return pw; } aff = isl_set_affine_hull(FN(PW,get_domain_at)(pw, i)); el = FN(PW,take_base_at)(pw, i); el = FN(EL,substitute_equalities)(el, aff); pw = FN(PW,restore_base_at_inplace)(pw, i, el); return pw; } /* Restrict the domain of "pw" by combining each cell * with "set" through a call to "fn", where "fn" may be * isl_set_intersect, isl_set_intersect_params, isl_set_intersect_factor_domain, * isl_set_intersect_factor_range or isl_set_subtract. */ static __isl_give PW *FN(PW,restrict_domain)(__isl_take PW *pw, __isl_take isl_set *set, __isl_give isl_set *(*fn)(__isl_take isl_set *set1, __isl_take isl_set *set2)) { int i; isl_size n; FN(PW,align_params_set)(&pw, &set); n = FN(PW,n_piece)(pw); if (n < 0 || !set) goto error; for (i = n - 1; i >= 0; --i) { isl_set *domain; domain = FN(PW,take_domain_at)(pw, i); domain = fn(domain, isl_set_copy(set)); pw = FN(PW,restore_domain_at)(pw, i, domain); pw = FN(PW,exploit_equalities_and_remove_if_empty)(pw, i); } isl_set_free(set); return pw; error: isl_set_free(set); FN(PW,free)(pw); return NULL; } __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw, __isl_take isl_set *context) { return FN(PW,restrict_domain)(pw, context, &isl_set_intersect); } /* Intersect the domain of "pw" with the parameter domain "context". */ __isl_give PW *FN(PW,intersect_params)(__isl_take PW *pw, __isl_take isl_set *context) { return FN(PW,restrict_domain)(pw, context, &isl_set_intersect_params); } /* Given a piecewise expression "pw" with domain in a space [A -> B] and * a set in the space A, intersect the domain with the set. */ __isl_give PW *FN(PW,intersect_domain_wrapped_domain)(__isl_take PW *pw, __isl_take isl_set *set) { return FN(PW,restrict_domain)(pw, set, &isl_set_intersect_factor_domain); } /* Given a piecewise expression "pw" with domain in a space [A -> B] and * a set in the space B, intersect the domain with the set. */ __isl_give PW *FN(PW,intersect_domain_wrapped_range)(__isl_take PW *pw, __isl_take isl_set *set) { return FN(PW,restrict_domain)(pw, set, &isl_set_intersect_factor_range); } /* Subtract "domain' from the domain of "pw". */ __isl_give PW *FN(PW,subtract_domain)(__isl_take PW *pw, __isl_take isl_set *domain) { return FN(PW,restrict_domain)(pw, domain, &isl_set_subtract); } /* Return -1 if the piece "p1" should be sorted before "p2" * and 1 if it should be sorted after "p2". * Return 0 if they do not need to be sorted in a specific order. * * The two pieces are compared on the basis of their function value expressions. */ static int FN(PW,sort_field_cmp)(const void *p1, const void *p2, void *arg) { struct FN(PW,piece) const *pc1 = p1; struct FN(PW,piece) const *pc2 = p2; return FN(EL,plain_cmp)(pc1->FIELD, pc2->FIELD); } /* Sort the pieces of "pw" according to their function value * expressions and then combine pairs of adjacent pieces with * the same such expression. * * The sorting is performed in place because it does not * change the meaning of "pw", but care needs to be * taken not to change any possible other copies of "pw" * in case anything goes wrong. */ static __isl_give PW *FN(PW,sort_unique)(__isl_take PW *pw) { int i, j; isl_set *set; if (!pw) return NULL; if (pw->n <= 1) return pw; if (isl_sort(pw->p, pw->n, sizeof(pw->p[0]), &FN(PW,sort_field_cmp), NULL) < 0) return FN(PW,free)(pw); for (i = pw->n - 1; i >= 1; --i) { isl_bool equal; EL *el, *el_prev; isl_set *set_prev; el = FN(PW,peek_base_at)(pw, i); el_prev = FN(PW,peek_base_at)(pw, i - 1); equal = FN(EL,plain_is_equal)(el, el_prev); if (equal < 0) return FN(PW,free)(pw); if (!equal) continue; set = FN(PW,get_domain_at)(pw, i); set_prev = FN(PW,get_domain_at)(pw, i - 1); set = isl_set_union(set_prev, set); if (!set) return FN(PW,free)(pw); isl_set_free(pw->p[i].set); FN(EL,free)(pw->p[i].FIELD); isl_set_free(pw->p[i - 1].set); pw->p[i - 1].set = set; for (j = i + 1; j < pw->n; ++j) pw->p[j - 1] = pw->p[j]; pw->n--; } return pw; } /* Compute the gist of "pw" with respect to the domain constraints * of "context" for the case where the domain of the last element * of "pw" is equal to "context". * Compute the gist of this element, replace * its domain by the universe and drop all other elements * as their domains are necessarily disjoint from "context". */ static __isl_give PW *FN(PW,gist_last)(__isl_take PW *pw, __isl_take isl_set *context) { int i; isl_space *space; EL *el; for (i = 0; i < pw->n - 1; ++i) { isl_set_free(pw->p[i].set); FN(EL,free)(pw->p[i].FIELD); } pw->p[0].FIELD = pw->p[pw->n - 1].FIELD; pw->p[0].set = pw->p[pw->n - 1].set; pw->n = 1; space = isl_set_get_space(context); el = FN(PW,take_base_at)(pw, 0); el = FN(EL,gist)(el, context); pw = FN(PW,restore_base_at)(pw, 0, el); context = isl_set_universe(space); pw = FN(PW,restore_domain_at)(pw, 0, context); return pw; } /* Compute the gist of "pw" with respect to the domain constraints * of "context". * Call "fn_dom" to compute the gist of the domains and * "intersect_context" to intersect the domain with the context. * * If the piecewise expression is empty or the context is the universe, * then nothing can be simplified. * If "pw" has a single domain and it is equal to "context", * then simply replace the domain by the universe. * Combine duplicate function value expressions first * to increase the chance of "pw" having a single domain. */ static __isl_give PW *FN(PW,gist_fn)(__isl_take PW *pw, __isl_take isl_set *context, __isl_give isl_set *(*fn_dom)(__isl_take isl_set *set, __isl_take isl_set *context), __isl_give isl_set *intersect_context(__isl_take isl_set *set, __isl_take isl_set *context)) { int i; int is_universe; pw = FN(PW,sort_unique)(pw); if (!pw || !context) goto error; if (pw->n == 0) { isl_set_free(context); return pw; } is_universe = isl_set_plain_is_universe(context); if (is_universe < 0) goto error; if (is_universe) { isl_set_free(context); return pw; } FN(PW,align_params_set)(&pw, &context); pw = FN(PW,cow)(pw); if (!pw) goto error; if (pw->n == 1) { int equal; equal = isl_set_plain_is_equal(pw->p[0].set, context); if (equal < 0) goto error; if (equal) return FN(PW,gist_last)(pw, context); } context = isl_set_compute_divs(context); for (i = pw->n - 1; i >= 0; --i) { isl_set *set_i; EL *el; int empty; if (i == pw->n - 1) { int equal; equal = isl_set_plain_is_equal(pw->p[i].set, context); if (equal < 0) goto error; if (equal) return FN(PW,gist_last)(pw, context); } set_i = FN(PW,get_domain_at)(pw, i); set_i = intersect_context(set_i, isl_set_copy(context)); empty = isl_set_plain_is_empty(set_i); el = FN(PW,take_base_at)(pw, i); el = FN(EL,gist)(el, set_i); pw = FN(PW,restore_base_at)(pw, i, el); set_i = FN(PW,take_domain_at)(pw, i); set_i = fn_dom(set_i, isl_set_copy(context)); pw = FN(PW,restore_domain_at)(pw, i, set_i); if (empty < 0 || !pw) goto error; if (empty) { isl_set_free(pw->p[i].set); FN(EL,free)(pw->p[i].FIELD); if (i != pw->n - 1) pw->p[i] = pw->p[pw->n - 1]; pw->n--; } } isl_set_free(context); return pw; error: FN(PW,free)(pw); isl_set_free(context); return NULL; } __isl_give PW *FN(PW,gist)(__isl_take PW *pw, __isl_take isl_set *context) { return FN(PW,gist_fn)(pw, context, &isl_set_gist, &isl_set_intersect); } __isl_give PW *FN(PW,gist_params)(__isl_take PW *pw, __isl_take isl_set *context) { return FN(PW,gist_fn)(pw, context, &isl_set_gist_params, &isl_set_intersect_params); } /* Coalesce the domains of "pw". * * Prior to the actual coalescing, first sort the pieces such that * pieces with the same function value expression are combined * into a single piece, the combined domain of which can then * be coalesced. */ __isl_give PW *FN(PW,coalesce)(__isl_take PW *pw) { int i; isl_size n; pw = FN(PW,sort_unique)(pw); n = FN(PW,n_piece)(pw); if (n < 0) return FN(PW,free)(pw); for (i = 0; i < n; ++i) { pw->p[i].set = isl_set_coalesce(pw->p[i].set); if (!pw->p[i].set) goto error; } return pw; error: FN(PW,free)(pw); return NULL; } isl_ctx *FN(PW,get_ctx)(__isl_keep PW *pw) { return pw ? isl_space_get_ctx(pw->dim) : NULL; } isl_bool FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; enum isl_dim_type set_type; if (!pw) return isl_bool_error; if (pw->n == 0 || n == 0) return isl_bool_false; set_type = type == isl_dim_in ? isl_dim_set : type; for (i = 0; i < pw->n; ++i) { isl_bool involves = FN(EL,involves_dims)(pw->p[i].FIELD, type, first, n); if (involves < 0 || involves) return involves; involves = isl_set_involves_dims(pw->p[i].set, set_type, first, n); if (involves < 0 || involves) return involves; } return isl_bool_false; } __isl_give PW *FN(PW,set_dim_name)(__isl_take PW *pw, enum isl_dim_type type, unsigned pos, const char *s) { isl_space *space; space = FN(PW,get_space)(pw); space = isl_space_set_dim_name(space, type, pos, s); return FN(PW,reset_space)(pw, space); } __isl_give PW *FN(PW,drop_dims)(__isl_take PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_size n_piece; enum isl_dim_type set_type; isl_space *space; n_piece = FN(PW,n_piece)(pw); if (n_piece < 0) return FN(PW,free)(pw); if (n == 0 && !isl_space_get_tuple_name(pw->dim, type)) return pw; set_type = type == isl_dim_in ? isl_dim_set : type; space = FN(PW,take_space)(pw); space = isl_space_drop_dims(space, type, first, n); pw = FN(PW,restore_space)(pw, space); for (i = 0; i < n_piece; ++i) { isl_set *domain; EL *el; el = FN(PW,take_base_at)(pw, i); el = FN(EL,drop_dims)(el, type, first, n); pw = FN(PW,restore_base_at)(pw, i, el); if (type == isl_dim_out) continue; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_drop(domain, set_type, first, n); pw = FN(PW,restore_domain_at)(pw, i, domain); } return pw; } /* This function is very similar to drop_dims. * The only difference is that the cells may still involve * the specified dimensions. They are removed using * isl_set_project_out instead of isl_set_drop. */ __isl_give PW *FN(PW,project_out)(__isl_take PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_size n_piece; enum isl_dim_type set_type; isl_space *space; n_piece = FN(PW,n_piece)(pw); if (n_piece < 0) return FN(PW,free)(pw); if (n == 0 && !isl_space_get_tuple_name(pw->dim, type)) return pw; set_type = type == isl_dim_in ? isl_dim_set : type; space = FN(PW,take_space)(pw); space = isl_space_drop_dims(space, type, first, n); pw = FN(PW,restore_space)(pw, space); for (i = 0; i < n_piece; ++i) { isl_set *domain; EL *el; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_project_out(domain, set_type, first, n); pw = FN(PW,restore_domain_at)(pw, i, domain); el = FN(PW,take_base_at)(pw, i); el = FN(EL,drop_dims)(el, type, first, n); pw = FN(PW,restore_base_at)(pw, i, el); } return pw; } /* Project the domain of pw onto its parameter space. */ __isl_give PW *FN(PW,project_domain_on_params)(__isl_take PW *pw) { isl_space *space; isl_size n; n = FN(PW,dim)(pw, isl_dim_in); if (n < 0) return FN(PW,free)(pw); pw = FN(PW,project_out)(pw, isl_dim_in, 0, n); space = FN(PW,get_domain_space)(pw); space = isl_space_params(space); pw = FN(PW,reset_domain_space)(pw, space); return pw; } #undef TYPE #define TYPE PW #include "isl_drop_unused_params_templ.c" isl_size FN(PW,dim)(__isl_keep PW *pw, enum isl_dim_type type) { return isl_space_dim(FN(PW,peek_space)(pw), type); } __isl_give isl_space *FN(PW,get_domain_space)(__isl_keep PW *pw) { return pw ? isl_space_domain(isl_space_copy(pw->dim)) : NULL; } /* Return the position of the dimension of the given type and name * in "pw". * Return -1 if no such dimension can be found. */ int FN(PW,find_dim_by_name)(__isl_keep PW *pw, enum isl_dim_type type, const char *name) { if (!pw) return -1; return isl_space_find_dim_by_name(pw->dim, type, name); } /* Return the position of the dimension of the given type and identifier * in "pw". * Return -1 if no such dimension can be found. */ static int FN(PW,find_dim_by_id)(__isl_keep PW *pw, enum isl_dim_type type, __isl_keep isl_id *id) { isl_space *space; space = FN(PW,peek_space)(pw); return isl_space_find_dim_by_id(space, type, id); } /* Does the piecewise expression "pw" depend in any way * on the parameter with identifier "id"? */ isl_bool FN(PW,involves_param_id)(__isl_keep PW *pw, __isl_keep isl_id *id) { int pos; if (!pw || !id) return isl_bool_error; if (pw->n == 0) return isl_bool_false; pos = FN(PW,find_dim_by_id)(pw, isl_dim_param, id); if (pos < 0) return isl_bool_false; return FN(PW,involves_dims)(pw, isl_dim_param, pos, 1); } /* Reset the space of "pw". Since we don't know if the elements * represent the spaces themselves or their domains, we pass along * both when we call their reset_space_and_domain. */ static __isl_give PW *FN(PW,reset_space_and_domain)(__isl_take PW *pw, __isl_take isl_space *space, __isl_take isl_space *domain) { int i; isl_size n; n = FN(PW,n_piece)(pw); if (n < 0 || !space || !domain) goto error; for (i = 0; i < n; ++i) { isl_set *set; EL *el; set = FN(PW,take_domain_at)(pw, i); set = isl_set_reset_space(set, isl_space_copy(domain)); pw = FN(PW,restore_domain_at)(pw, i, set); el = FN(PW,take_base_at)(pw, i); el = FN(EL,reset_space_and_domain)(el, isl_space_copy(space), isl_space_copy(domain)); pw = FN(PW,restore_base_at)(pw, i, el); } isl_space_free(domain); pw = FN(PW,restore_space)(pw, space); return pw; error: isl_space_free(domain); isl_space_free(space); FN(PW,free)(pw); return NULL; } __isl_give PW *FN(PW,reset_domain_space)(__isl_take PW *pw, __isl_take isl_space *domain) { isl_space *space; space = isl_space_extend_domain_with_range(isl_space_copy(domain), FN(PW,get_space)(pw)); return FN(PW,reset_space_and_domain)(pw, space, domain); } __isl_give PW *FN(PW,reset_space)(__isl_take PW *pw, __isl_take isl_space *space) { isl_space *domain; domain = isl_space_domain(isl_space_copy(space)); return FN(PW,reset_space_and_domain)(pw, space, domain); } __isl_give PW *FN(PW,set_tuple_id)(__isl_take PW *pw, enum isl_dim_type type, __isl_take isl_id *id) { isl_space *space; pw = FN(PW,cow)(pw); if (!pw) goto error; space = FN(PW,get_space)(pw); space = isl_space_set_tuple_id(space, type, id); return FN(PW,reset_space)(pw, space); error: isl_id_free(id); return FN(PW,free)(pw); } /* Drop the id on the specified tuple. */ __isl_give PW *FN(PW,reset_tuple_id)(__isl_take PW *pw, enum isl_dim_type type) { isl_space *space; if (!pw) return NULL; if (!FN(PW,has_tuple_id)(pw, type)) return pw; pw = FN(PW,cow)(pw); if (!pw) return NULL; space = FN(PW,get_space)(pw); space = isl_space_reset_tuple_id(space, type); return FN(PW,reset_space)(pw, space); } __isl_give PW *FN(PW,set_dim_id)(__isl_take PW *pw, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id) { isl_space *space; space = FN(PW,get_space)(pw); space = isl_space_set_dim_id(space, type, pos, id); return FN(PW,reset_space)(pw, space); } /* Reset the user pointer on all identifiers of parameters and tuples * of the space of "pw". */ __isl_give PW *FN(PW,reset_user)(__isl_take PW *pw) { isl_space *space; space = FN(PW,get_space)(pw); space = isl_space_reset_user(space); return FN(PW,reset_space)(pw, space); } isl_size FN(PW,n_piece)(__isl_keep PW *pw) { return pw ? pw->n : isl_size_error; } isl_stat FN(PW,foreach_piece)(__isl_keep PW *pw, isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user) { int i; if (!pw) return isl_stat_error; for (i = 0; i < pw->n; ++i) if (fn(isl_set_copy(pw->p[i].set), FN(EL,copy)(pw->p[i].FIELD), user) < 0) return isl_stat_error; return isl_stat_ok; } /* Does "test" succeed on every cell of "pw"? */ isl_bool FN(PW,every_piece)(__isl_keep PW *pw, isl_bool (*test)(__isl_keep isl_set *set, __isl_keep EL *el, void *user), void *user) { int i; if (!pw) return isl_bool_error; for (i = 0; i < pw->n; ++i) { isl_bool r; r = test(pw->p[i].set, pw->p[i].FIELD, user); if (r < 0 || !r) return r; } return isl_bool_true; } /* Is "pw" defined over a single universe domain? * * If the default value of this piecewise type is zero, * then a "pw" with a zero number of cells is also accepted * as it represents the default zero value. */ isl_bool FN(FN(PW,isa),BASE)(__isl_keep PW *pw) { isl_size n; n = FN(PW,n_piece)(pw); if (n < 0) return isl_bool_error; if (DEFAULT_IS_ZERO && n == 0) return isl_bool_true; if (n != 1) return isl_bool_false; return isl_set_plain_is_universe(FN(PW,peek_domain_at)(pw, 0)); } /* Return a zero base expression in the same space (and of the same type) * as "pw". */ static __isl_give EL *FN(EL,zero_like_type)(__isl_take PW *pw OPT_TYPE_PARAM) { isl_space *space; space = FN(PW,get_space)(pw); FN(PW,free)(pw); return FN(EL,zero_in_space)(space OPT_TYPE_ARG(NO_LOC)); } #ifndef HAS_TYPE /* Return a zero base expression in the same space as "pw". */ static __isl_give EL *FN(EL,zero_like)(__isl_take PW *pw) { return FN(EL,zero_like_type)(pw); } #else /* Return a zero base expression in the same space and of the same type * as "pw". * * Pass along the type as an explicit argument for uniform handling * in isl_*_zero_like_type. */ static __isl_give EL *FN(EL,zero_like)(__isl_take PW *pw) { enum isl_fold type; type = FN(PW,get_type)(pw); if (type < 0) goto error; return FN(EL,zero_like_type)(pw, type); error: FN(PW,free)(pw); return NULL; } #endif /* Given that "pw" is defined over a single universe domain, * return the base expression associated to this domain. * * If the number of cells is zero, then "pw" is of a piecewise type * with a default zero value and effectively represents zero. * In this case, create a zero base expression in the same space * (and with the same type). * Otherwise, simply extract the associated base expression. */ __isl_give EL *FN(FN(PW,as),BASE)(__isl_take PW *pw) { isl_bool is_total; isl_size n; EL *el; is_total = FN(FN(PW,isa),BASE)(pw); if (is_total < 0) goto error; if (!is_total) isl_die(FN(PW,get_ctx)(pw), isl_error_invalid, "expecting single total function", goto error); n = FN(PW,n_piece)(pw); if (n < 0) goto error; if (n == 0) return FN(EL,zero_like)(pw); el = FN(PW,take_base_at)(pw, 0); FN(PW,free)(pw); return el; error: FN(PW,free)(pw); return NULL; } #ifdef HAS_TYPE /* Negate the type of "pw". */ static __isl_give PW *FN(PW,negate_type)(__isl_take PW *pw) { pw = FN(PW,cow)(pw); if (!pw) return NULL; pw->type = isl_fold_type_negate(pw->type); return pw; } #else /* Negate the type of "pw". * Since "pw" does not have a type, do nothing. */ static __isl_give PW *FN(PW,negate_type)(__isl_take PW *pw) { return pw; } #endif /* Multiply the pieces of "pw" by "v" and return the result. */ __isl_give PW *FN(PW,scale_val)(__isl_take PW *pw, __isl_take isl_val *v) { int i; isl_size n; if (!pw || !v) goto error; if (isl_val_is_one(v)) { isl_val_free(v); return pw; } if (pw && DEFAULT_IS_ZERO && isl_val_is_zero(v)) { PW *zero; isl_space *space = FN(PW,get_space)(pw); zero = FN(PW,ZERO)(space OPT_TYPE_ARG(pw->)); FN(PW,free)(pw); isl_val_free(v); return zero; } if (isl_val_is_neg(v)) pw = FN(PW,negate_type)(pw); n = FN(PW,n_piece)(pw); if (n < 0) goto error; for (i = 0; i < n; ++i) { EL *el; el = FN(PW,take_base_at)(pw, i); el = FN(EL,scale_val)(el, isl_val_copy(v)); pw = FN(PW,restore_base_at)(pw, i, el); } isl_val_free(v); return pw; error: isl_val_free(v); FN(PW,free)(pw); return NULL; } /* Divide the pieces of "pw" by "v" and return the result. */ __isl_give PW *FN(PW,scale_down_val)(__isl_take PW *pw, __isl_take isl_val *v) { int i; isl_size n; if (!pw || !v) goto error; if (isl_val_is_one(v)) { isl_val_free(v); return pw; } if (!isl_val_is_rat(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "expecting rational factor", goto error); if (isl_val_is_zero(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "cannot scale down by zero", goto error); if (isl_val_is_neg(v)) pw = FN(PW,negate_type)(pw); n = FN(PW,n_piece)(pw); if (n < 0) goto error; for (i = 0; i < n; ++i) { EL *el; el = FN(PW,take_base_at)(pw, i); el = FN(EL,scale_down_val)(el, isl_val_copy(v)); pw = FN(PW,restore_base_at)(pw, i, el); } isl_val_free(v); return pw; error: isl_val_free(v); FN(PW,free)(pw); return NULL; } /* Apply some normalization to "pw". * In particular, sort the pieces according to their function value * expressions, combining pairs of adjacent pieces with * the same such expression, and then normalize the domains of the pieces. * * We normalize in place, but if anything goes wrong we need * to return NULL, so we need to make sure we don't change the * meaning of any possible other copies of "pw". */ static __isl_give PW *FN(PW,normalize)(__isl_take PW *pw) { int i; isl_set *set; pw = FN(PW,sort_unique)(pw); if (!pw) return NULL; for (i = 0; i < pw->n; ++i) { set = isl_set_normalize(isl_set_copy(pw->p[i].set)); if (!set) return FN(PW,free)(pw); isl_set_free(pw->p[i].set); pw->p[i].set = set; } return pw; } /* Is pw1 obviously equal to pw2? * That is, do they have obviously identical cells and obviously identical * elements on each cell? * * If "pw1" or "pw2" contain any NaNs, then they are considered * not to be the same. A NaN is not equal to anything, not even * to another NaN. */ isl_bool FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) { int i; isl_bool equal, has_nan; if (!pw1 || !pw2) return isl_bool_error; has_nan = FN(PW,involves_nan)(pw1); if (has_nan >= 0 && !has_nan) has_nan = FN(PW,involves_nan)(pw2); if (has_nan < 0 || has_nan) return isl_bool_not(has_nan); if (pw1 == pw2) return isl_bool_true; equal = FN(PW,has_equal_space)(pw1, pw2); if (equal < 0 || !equal) return equal; pw1 = FN(PW,copy)(pw1); pw2 = FN(PW,copy)(pw2); pw1 = FN(PW,normalize)(pw1); pw2 = FN(PW,normalize)(pw2); if (!pw1 || !pw2) goto error; equal = isl_bool_ok(pw1->n == pw2->n); for (i = 0; equal && i < pw1->n; ++i) { equal = isl_set_plain_is_equal(pw1->p[i].set, pw2->p[i].set); if (equal < 0) goto error; if (!equal) break; equal = FN(EL,plain_is_equal)(pw1->p[i].FIELD, pw2->p[i].FIELD); if (equal < 0) goto error; } FN(PW,free)(pw1); FN(PW,free)(pw2); return equal; error: FN(PW,free)(pw1); FN(PW,free)(pw2); return isl_bool_error; } /* Does "pw" involve any NaNs? */ isl_bool FN(PW,involves_nan)(__isl_keep PW *pw) { int i; if (!pw) return isl_bool_error; if (pw->n == 0) return isl_bool_false; for (i = 0; i < pw->n; ++i) { isl_bool has_nan = FN(EL,involves_nan)(pw->p[i].FIELD); if (has_nan < 0 || has_nan) return has_nan; } return isl_bool_false; } isl-0.28/isl_printer.c0000664000175000017500000004672415072740040014034 0ustar00skimoskimo#include #include #include #include #include static __isl_give isl_printer *file_start_line(__isl_take isl_printer *p) { fprintf(p->file, "%s%*s%s", p->indent_prefix ? p->indent_prefix : "", p->indent, "", p->prefix ? p->prefix : ""); return p; } static __isl_give isl_printer *file_end_line(__isl_take isl_printer *p) { fprintf(p->file, "%s\n", p->suffix ? p->suffix : ""); return p; } static __isl_give isl_printer *file_flush(__isl_take isl_printer *p) { fflush(p->file); return p; } static __isl_give isl_printer *file_print_str(__isl_take isl_printer *p, const char *s) { fprintf(p->file, "%s", s); return p; } static __isl_give isl_printer *file_print_double(__isl_take isl_printer *p, double d) { fprintf(p->file, "%g", d); return p; } static __isl_give isl_printer *file_print_int(__isl_take isl_printer *p, int i) { fprintf(p->file, "%d", i); return p; } static __isl_give isl_printer *file_print_isl_int(__isl_take isl_printer *p, isl_int i) { isl_int_print(p->file, i, p->width); return p; } static int grow_buf(__isl_keep isl_printer *p, int extra) { int new_size; char *new_buf; if (p->buf_size == 0) return -1; new_size = ((p->buf_n + extra + 1) * 3) / 2; new_buf = isl_realloc_array(p->ctx, p->buf, char, new_size); if (!new_buf) { p->buf_size = 0; return -1; } p->buf = new_buf; p->buf_size = new_size; return 0; } static __isl_give isl_printer *str_print(__isl_take isl_printer *p, const char *s, int len) { if (p->buf_n + len + 1 >= p->buf_size && grow_buf(p, len)) goto error; memcpy(p->buf + p->buf_n, s, len); p->buf_n += len; p->buf[p->buf_n] = '\0'; return p; error: isl_printer_free(p); return NULL; } static __isl_give isl_printer *str_print_indent(__isl_take isl_printer *p, int indent) { int i; if (p->buf_n + indent + 1 >= p->buf_size && grow_buf(p, indent)) goto error; for (i = 0; i < indent; ++i) p->buf[p->buf_n++] = ' '; p->buf[p->buf_n] = '\0'; return p; error: isl_printer_free(p); return NULL; } static __isl_give isl_printer *str_start_line(__isl_take isl_printer *p) { if (p->indent_prefix) p = str_print(p, p->indent_prefix, strlen(p->indent_prefix)); p = str_print_indent(p, p->indent); if (p->prefix) p = str_print(p, p->prefix, strlen(p->prefix)); return p; } static __isl_give isl_printer *str_end_line(__isl_take isl_printer *p) { if (p->suffix) p = str_print(p, p->suffix, strlen(p->suffix)); p = str_print(p, "\n", strlen("\n")); return p; } static __isl_give isl_printer *str_flush(__isl_take isl_printer *p) { p->buf_n = 0; p->buf[p->buf_n] = '\0'; return p; } static __isl_give isl_printer *str_print_str(__isl_take isl_printer *p, const char *s) { return str_print(p, s, strlen(s)); } static __isl_give isl_printer *str_print_double(__isl_take isl_printer *p, double d) { int left = p->buf_size - p->buf_n; int need = snprintf(p->buf + p->buf_n, left, "%g", d); if (need >= left) { if (grow_buf(p, need)) goto error; left = p->buf_size - p->buf_n; need = snprintf(p->buf + p->buf_n, left, "%g", d); } p->buf_n += need; return p; error: isl_printer_free(p); return NULL; } static __isl_give isl_printer *str_print_int(__isl_take isl_printer *p, int i) { int left = p->buf_size - p->buf_n; int need = snprintf(p->buf + p->buf_n, left, "%d", i); if (need >= left) { if (grow_buf(p, need)) goto error; left = p->buf_size - p->buf_n; need = snprintf(p->buf + p->buf_n, left, "%d", i); } p->buf_n += need; return p; error: isl_printer_free(p); return NULL; } static __isl_give isl_printer *str_print_isl_int(__isl_take isl_printer *p, isl_int i) { char *s; int len; s = isl_int_get_str(i); len = strlen(s); if (len < p->width) p = str_print_indent(p, p->width - len); p = str_print(p, s, len); isl_int_free_str(s); return p; } struct isl_printer_ops { __isl_give isl_printer *(*start_line)(__isl_take isl_printer *p); __isl_give isl_printer *(*end_line)(__isl_take isl_printer *p); __isl_give isl_printer *(*print_double)(__isl_take isl_printer *p, double d); __isl_give isl_printer *(*print_int)(__isl_take isl_printer *p, int i); __isl_give isl_printer *(*print_isl_int)(__isl_take isl_printer *p, isl_int i); __isl_give isl_printer *(*print_str)(__isl_take isl_printer *p, const char *s); __isl_give isl_printer *(*flush)(__isl_take isl_printer *p); }; static struct isl_printer_ops file_ops = { file_start_line, file_end_line, file_print_double, file_print_int, file_print_isl_int, file_print_str, file_flush }; static struct isl_printer_ops str_ops = { str_start_line, str_end_line, str_print_double, str_print_int, str_print_isl_int, str_print_str, str_flush }; __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx, FILE *file) { struct isl_printer *p = isl_calloc_type(ctx, struct isl_printer); if (!p) return NULL; p->ctx = ctx; isl_ctx_ref(p->ctx); p->ops = &file_ops; p->file = file; p->buf = NULL; p->buf_n = 0; p->buf_size = 0; p->indent = 0; p->output_format = ISL_FORMAT_ISL; p->indent_prefix = NULL; p->prefix = NULL; p->suffix = NULL; p->width = 0; p->yaml_style = ISL_YAML_STYLE_FLOW; return p; } __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx) { struct isl_printer *p = isl_calloc_type(ctx, struct isl_printer); if (!p) return NULL; p->ctx = ctx; isl_ctx_ref(p->ctx); p->ops = &str_ops; p->file = NULL; p->buf = isl_alloc_array(ctx, char, 256); if (!p->buf) goto error; p->buf_n = 0; p->buf[0] = '\0'; p->buf_size = 256; p->indent = 0; p->output_format = ISL_FORMAT_ISL; p->indent_prefix = NULL; p->prefix = NULL; p->suffix = NULL; p->width = 0; p->yaml_style = ISL_YAML_STYLE_FLOW; return p; error: isl_printer_free(p); return NULL; } __isl_null isl_printer *isl_printer_free(__isl_take isl_printer *p) { if (!p) return NULL; free(p->buf); free(p->indent_prefix); free(p->prefix); free(p->suffix); free(p->yaml_state); isl_id_to_id_free(p->notes); isl_ctx_deref(p->ctx); free(p); return NULL; } isl_ctx *isl_printer_get_ctx(__isl_keep isl_printer *printer) { return printer ? printer->ctx : NULL; } FILE *isl_printer_get_file(__isl_keep isl_printer *printer) { if (!printer) return NULL; if (!printer->file) isl_die(isl_printer_get_ctx(printer), isl_error_invalid, "not a file printer", return NULL); return printer->file; } __isl_give isl_printer *isl_printer_set_isl_int_width(__isl_take isl_printer *p, int width) { if (!p) return NULL; p->width = width; return p; } __isl_give isl_printer *isl_printer_set_indent(__isl_take isl_printer *p, int indent) { if (!p) return NULL; p->indent = indent; return p; } __isl_give isl_printer *isl_printer_indent(__isl_take isl_printer *p, int indent) { if (!p) return NULL; p->indent += indent; if (p->indent < 0) p->indent = 0; return p; } /* Replace the indent prefix of "p" by "prefix". */ __isl_give isl_printer *isl_printer_set_indent_prefix(__isl_take isl_printer *p, const char *prefix) { if (!p) return NULL; free(p->indent_prefix); p->indent_prefix = prefix ? strdup(prefix) : NULL; return p; } __isl_give isl_printer *isl_printer_set_prefix(__isl_take isl_printer *p, const char *prefix) { if (!p) return NULL; free(p->prefix); p->prefix = prefix ? strdup(prefix) : NULL; return p; } __isl_give isl_printer *isl_printer_set_suffix(__isl_take isl_printer *p, const char *suffix) { if (!p) return NULL; free(p->suffix); p->suffix = suffix ? strdup(suffix) : NULL; return p; } __isl_give isl_printer *isl_printer_set_output_format(__isl_take isl_printer *p, int output_format) { if (!p) return NULL; p->output_format = output_format; return p; } int isl_printer_get_output_format(__isl_keep isl_printer *p) { if (!p) return -1; return p->output_format; } /* Does "p" have a note with identifier "id"? */ isl_bool isl_printer_has_note(__isl_keep isl_printer *p, __isl_keep isl_id *id) { if (!p || !id) return isl_bool_error; if (!p->notes) return isl_bool_false; return isl_id_to_id_has(p->notes, id); } /* Retrieve the note identified by "id" from "p". * The note is assumed to exist. */ __isl_give isl_id *isl_printer_get_note(__isl_keep isl_printer *p, __isl_take isl_id *id) { isl_bool has_note; has_note = isl_printer_has_note(p, id); if (has_note < 0) goto error; if (!has_note) isl_die(isl_printer_get_ctx(p), isl_error_invalid, "no such note", goto error); return isl_id_to_id_get(p->notes, id); error: isl_id_free(id); return NULL; } /* Associate "note" to the identifier "id" in "p", * replacing the previous note associated to the identifier, if any. */ __isl_give isl_printer *isl_printer_set_note(__isl_take isl_printer *p, __isl_take isl_id *id, __isl_take isl_id *note) { if (!p || !id || !note) goto error; if (!p->notes) { p->notes = isl_id_to_id_alloc(isl_printer_get_ctx(p), 1); if (!p->notes) goto error; } p->notes = isl_id_to_id_set(p->notes, id, note); if (!p->notes) return isl_printer_free(p); return p; error: isl_printer_free(p); isl_id_free(id); isl_id_free(note); return NULL; } /* Keep track of whether the printing to "p" is being performed from * an isl_*_dump function as specified by "dump". */ __isl_give isl_printer *isl_printer_set_dump(__isl_take isl_printer *p, int dump) { if (!p) return NULL; p->dump = dump; return p; } /* Set the YAML style of "p" to "yaml_style" and return the updated printer. */ __isl_give isl_printer *isl_printer_set_yaml_style(__isl_take isl_printer *p, int yaml_style) { if (!p) return NULL; p->yaml_style = yaml_style; return p; } /* Return the YAML style of "p" or -1 on error. */ int isl_printer_get_yaml_style(__isl_keep isl_printer *p) { if (!p) return -1; return p->yaml_style; } /* Push "state" onto the stack of currently active YAML elements and * return the updated printer. */ static __isl_give isl_printer *push_state(__isl_take isl_printer *p, enum isl_yaml_state state) { if (!p) return NULL; if (p->yaml_size < p->yaml_depth + 1) { enum isl_yaml_state *state; state = isl_realloc_array(p->ctx, p->yaml_state, enum isl_yaml_state, p->yaml_depth + 1); if (!state) return isl_printer_free(p); p->yaml_state = state; p->yaml_size = p->yaml_depth + 1; } p->yaml_state[p->yaml_depth] = state; p->yaml_depth++; return p; } /* Remove the innermost active YAML element from the stack and * return the updated printer. */ static __isl_give isl_printer *pop_state(__isl_take isl_printer *p) { if (!p) return NULL; p->yaml_depth--; return p; } /* Set the state of the innermost active YAML element to "state" and * return the updated printer. */ static __isl_give isl_printer *update_state(__isl_take isl_printer *p, enum isl_yaml_state state) { if (!p) return NULL; if (p->yaml_depth < 1) isl_die(isl_printer_get_ctx(p), isl_error_invalid, "not in YAML construct", return isl_printer_free(p)); p->yaml_state[p->yaml_depth - 1] = state; return p; } /* Return the state of the innermost active YAML element. * Return isl_yaml_none if we are not inside any YAML element. */ static enum isl_yaml_state current_state(__isl_keep isl_printer *p) { if (!p) return isl_yaml_none; if (p->yaml_depth < 1) return isl_yaml_none; return p->yaml_state[p->yaml_depth - 1]; } /* If we are printing a YAML document and we are at the start of an element, * print whatever is needed before we can print the actual element and * keep track of the fact that we are now printing the element. * If "eol" is set, then whatever we print is going to be the last * thing that gets printed on this line. * * If we are about the print the first key of a mapping, then nothing * extra needs to be printed. For any other key, however, we need * to either move to the next line (in block format) or print a comma * (in flow format). * Before printing a value in a mapping, we need to print a colon. * * For sequences, in flow format, we only need to print a comma * for each element except the first. * In block format, before the first element in the sequence, * we move to a new line, print a dash and increase the indentation. * Before any other element, we print a dash on a new line, * temporarily moving the indentation back. */ static __isl_give isl_printer *enter_state(__isl_take isl_printer *p, int eol) { enum isl_yaml_state state; if (!p) return NULL; state = current_state(p); if (state == isl_yaml_mapping_val_start) { if (eol) p = p->ops->print_str(p, ":"); else p = p->ops->print_str(p, ": "); p = update_state(p, isl_yaml_mapping_val); } else if (state == isl_yaml_mapping_first_key_start) { p = update_state(p, isl_yaml_mapping_key); } else if (state == isl_yaml_mapping_key_start) { if (p->yaml_style == ISL_YAML_STYLE_FLOW) p = p->ops->print_str(p, ", "); else { p = p->ops->end_line(p); p = p->ops->start_line(p); } p = update_state(p, isl_yaml_mapping_key); } else if (state == isl_yaml_sequence_first_start) { if (p->yaml_style != ISL_YAML_STYLE_FLOW) { p = p->ops->end_line(p); p = p->ops->start_line(p); p = p->ops->print_str(p, "- "); p = isl_printer_indent(p, 2); } p = update_state(p, isl_yaml_sequence); } else if (state == isl_yaml_sequence_start) { if (p->yaml_style == ISL_YAML_STYLE_FLOW) p = p->ops->print_str(p, ", "); else { p = p->ops->end_line(p); p = isl_printer_indent(p, -2); p = p->ops->start_line(p); p = p->ops->print_str(p, "- "); p = isl_printer_indent(p, 2); } p = update_state(p, isl_yaml_sequence); } return p; } __isl_give isl_printer *isl_printer_print_str(__isl_take isl_printer *p, const char *s) { if (!p) return NULL; if (!s) return isl_printer_free(p); p = enter_state(p, 0); if (!p) return NULL; return p->ops->print_str(p, s); } __isl_give isl_printer *isl_printer_print_double(__isl_take isl_printer *p, double d) { p = enter_state(p, 0); if (!p) return NULL; return p->ops->print_double(p, d); } __isl_give isl_printer *isl_printer_print_int(__isl_take isl_printer *p, int i) { p = enter_state(p, 0); if (!p) return NULL; return p->ops->print_int(p, i); } __isl_give isl_printer *isl_printer_print_isl_int(__isl_take isl_printer *p, isl_int i) { p = enter_state(p, 0); if (!p) return NULL; return p->ops->print_isl_int(p, i); } __isl_give isl_printer *isl_printer_start_line(__isl_take isl_printer *p) { if (!p) return NULL; return p->ops->start_line(p); } __isl_give isl_printer *isl_printer_end_line(__isl_take isl_printer *p) { if (!p) return NULL; return p->ops->end_line(p); } /* Return a copy of the string constructed by the string printer "printer". */ __isl_give char *isl_printer_get_str(__isl_keep isl_printer *printer) { if (!printer) return NULL; if (printer->ops != &str_ops) isl_die(isl_printer_get_ctx(printer), isl_error_invalid, "isl_printer_get_str can only be called on a string " "printer", return NULL); if (!printer->buf) return NULL; return strdup(printer->buf); } __isl_give isl_printer *isl_printer_flush(__isl_take isl_printer *p) { if (!p) return NULL; return p->ops->flush(p); } /* Start a YAML mapping and push a new state to reflect that we * are about to print the first key in a mapping. * * In flow style, print the opening brace. * In block style, move to the next line with an increased indentation, * except if this is the outer mapping or if we are inside a sequence * (in which case we have already increased the indentation and we want * to print the first key on the same line as the dash). */ __isl_give isl_printer *isl_printer_yaml_start_mapping( __isl_take isl_printer *p) { enum isl_yaml_state state; if (!p) return NULL; p = enter_state(p, p->yaml_style == ISL_YAML_STYLE_BLOCK); if (!p) return NULL; state = current_state(p); if (p->yaml_style == ISL_YAML_STYLE_FLOW) p = p->ops->print_str(p, "{ "); else if (state != isl_yaml_none && state != isl_yaml_sequence) { p = p->ops->end_line(p); p = isl_printer_indent(p, 2); p = p->ops->start_line(p); } p = push_state(p, isl_yaml_mapping_first_key_start); return p; } /* Finish a YAML mapping and pop it from the state stack. * * In flow style, print the closing brace. * * In block style, first check if we are still in the * isl_yaml_mapping_first_key_start state. If so, we have not printed * anything yet, so print "{}" to indicate an empty mapping. * If we increased the indentation in isl_printer_yaml_start_mapping, * then decrease it again. * If this is the outer mapping then print a newline. */ __isl_give isl_printer *isl_printer_yaml_end_mapping( __isl_take isl_printer *p) { enum isl_yaml_state state; state = current_state(p); p = pop_state(p); if (!p) return NULL; if (p->yaml_style == ISL_YAML_STYLE_FLOW) return p->ops->print_str(p, " }"); if (state == isl_yaml_mapping_first_key_start) p = p->ops->print_str(p, "{}"); if (!p) return NULL; state = current_state(p); if (state != isl_yaml_none && state != isl_yaml_sequence) p = isl_printer_indent(p, -2); if (state == isl_yaml_none) p = p->ops->end_line(p); return p; } /* Start a YAML sequence and push a new state to reflect that we * are about to print the first element in a sequence. * * In flow style, print the opening bracket. */ __isl_give isl_printer *isl_printer_yaml_start_sequence( __isl_take isl_printer *p) { if (!p) return NULL; p = enter_state(p, p->yaml_style == ISL_YAML_STYLE_BLOCK); p = push_state(p, isl_yaml_sequence_first_start); if (!p) return NULL; if (p->yaml_style == ISL_YAML_STYLE_FLOW) p = p->ops->print_str(p, "[ "); return p; } /* Finish a YAML sequence and pop it from the state stack. * * In flow style, print the closing bracket. * * In block style, check if we are still in the * isl_yaml_sequence_first_start state. If so, we have not printed * anything yet, so print "[]" or " []" to indicate an empty sequence. * We print the extra space when we instructed enter_state not * to print a space at the end of the line. * Otherwise, undo the increase in indentation performed by * enter_state when moving away from the isl_yaml_sequence_first_start * state. * If this is the outer sequence then print a newline. */ __isl_give isl_printer *isl_printer_yaml_end_sequence( __isl_take isl_printer *p) { enum isl_yaml_state state, up; state = current_state(p); p = pop_state(p); if (!p) return NULL; if (p->yaml_style == ISL_YAML_STYLE_FLOW) return p->ops->print_str(p, " ]"); up = current_state(p); if (state == isl_yaml_sequence_first_start) { if (up == isl_yaml_mapping_val) p = p->ops->print_str(p, " []"); else p = p->ops->print_str(p, "[]"); } else { p = isl_printer_indent(p, -2); } if (!p) return NULL; state = current_state(p); if (state == isl_yaml_none) p = p->ops->end_line(p); return p; } /* Mark the fact that the current element is finished and that * the next output belongs to the next element. * In particular, if we are printing a key, then prepare for * printing the subsequent value. If we are printing a value, * prepare for printing the next key. If we are printing an * element in a sequence, prepare for printing the next element. */ __isl_give isl_printer *isl_printer_yaml_next(__isl_take isl_printer *p) { enum isl_yaml_state state; if (!p) return NULL; if (p->yaml_depth < 1) isl_die(isl_printer_get_ctx(p), isl_error_invalid, "not in YAML construct", return isl_printer_free(p)); state = current_state(p); if (state == isl_yaml_mapping_key) state = isl_yaml_mapping_val_start; else if (state == isl_yaml_mapping_val) state = isl_yaml_mapping_key_start; else if (state == isl_yaml_sequence) state = isl_yaml_sequence_start; p = update_state(p, state); return p; } isl-0.28/AUTHORS0000664000175000017500000000270715072740040012377 0ustar00skimoskimoisl was written by Sven Verdoolaege 2006-2007 Leiden Institute of Advanced Computer Science Universiteit Leiden Niels Bohrweg 1 2333 CA Leiden The Netherlands 2008-2009 K.U.Leuven Departement Computerwetenschappen Celestijnenlaan 200A B-3001 Leuven Belgium 2010-2011 INRIA Saclay - Ile-de-France Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod 91893 Orsay France 2011-2012 consultant for Leiden Institute of Advanced Computer Science 2012-2014 Ecole Normale Superieure 45 rue d'Ulm, 75230 Paris France 2014-2015 INRIA Rocquencourt Domaine de Voluceau - Rocquencourt, B.P. 105 78153 Le Chesnay France 2015-2022 Polly Labs 2018-2021 Cerebras Systems 175 S San Antonio Rd Los Altos, CA USA 2021-2022 Cerebras Systems 1237 E Arques Ave Sunnyvale, CA USA Contributions by Mythri Alle Riyadh Baghdadi Serge Belyshev Basile Clement Albert Cohen Ray Donnelly Johannes Doerfert Andi Drebes Ron Estrin Clement Foyer Armin Groesslinger Tobias Grosser Frederik Harwath Alexandre Isoard Andreas Kloeckner Michael Kruse Manjunath Kudlur Alexander Matz Chielo Newctle Riccardo Mori Sebastian Pop Louis-Noel Pouchet Benoit Pradelle Uday Bondhugula Andreas Simbuerger Tianjiao Sun Malhar Thakkar Sergei Trofimovich Miheer Vaidya Sven van Haastregt Matt Whitlock Oleksandr Zinenko The merge sort implementation was written by Jeffrey Stedfast. isl-0.28/isl_pw_bind_domain_templ.c0000664000175000017500000000044515072740040016511 0ustar00skimoskimo/* * Copyright 2018 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include #undef TYPE #define TYPE PW #include isl-0.28/isl_sort.h0000664000175000017500000000030515072740040013326 0ustar00skimoskimo#ifndef ISL_SORT_H #define ISL_SORT_H #include int isl_sort(void *const pbase, size_t total_elems, size_t size, int (*cmp)(const void *, const void *, void *arg), void *arg); #endif isl-0.28/isl_pw_locals_templ.c0000664000175000017500000000152415072740040015522 0ustar00skimoskimo/* * Copyright 2020 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #include /* isl_pw_*_every_piece callback that checks whether "set" and "el" * are free of local variables. */ static isl_bool FN(PW,piece_no_local)(__isl_keep isl_set *set, __isl_keep EL *el, void *user) { isl_bool involves; involves = isl_set_involves_locals(set); if (involves >= 0 && !involves) involves = FN(EL,involves_locals)(el); return isl_bool_not(involves); } /* Does "pw" involve any local variables, i.e., integer divisions? */ isl_bool FN(PW,involves_locals)(__isl_keep PW *pw) { isl_bool no_locals; no_locals = FN(PW,every_piece)(pw, &FN(PW,piece_no_local), NULL); return isl_bool_not(no_locals); } isl-0.28/configure0000775000175000017500000334603415220014412013235 0ustar00skimoskimo#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for isl 0.28. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: isl-development@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='isl' PACKAGE_TARNAME='isl' PACKAGE_VERSION='0.28' PACKAGE_STRING='isl 0.28' PACKAGE_BUGREPORT='isl-development@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS subdirs GIT_HEAD_VERSION GIT_HEAD GIT_HEAD_ID pkgconfig_libfile pkgconfig_libdir WARNING_FLAGS HAVE_CLANG_FALSE HAVE_CLANG_TRUE SMALL_INT_OPT_FALSE SMALL_INT_OPT_TRUE HAVE_CXX17_FALSE HAVE_CXX17_TRUE HAVE_CXX11_FALSE HAVE_CXX11_TRUE GMP_FOR_MP_FALSE GMP_FOR_MP_TRUE IMATH_FOR_MP_FALSE IMATH_FOR_MP_TRUE NEED_GET_MEMORY_FUNCTIONS_FALSE NEED_GET_MEMORY_FUNCTIONS_TRUE MP_LIBS MP_LDFLAGS MP_CFLAGS MP_CPPFLAGS GENERATE_DOC_FALSE GENERATE_DOC_TRUE OS_SRCDIR DIFF DIFF_OPTIONS POD2HTML PDFLATEX PERL CYGPATH HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_PLATFORM PYTHON_VERSION PYTHON CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP LIBTOOL HAVE_CXX17 HAVE_CXX11 GREP PRTDIAG SED host_os host_vendor host_cpu host LDFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CFLAGS_FOR_BUILD CCDEPMODE_FOR_BUILD BUILD_OBJEXT BUILD_EXEEXT CPP_FOR_BUILD ac_ct_CC_FOR_BUILD CC_FOR_BUILD build_os build_vendor build_cpu build CPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC versioninfo am__xargs_n am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_portable_binary with_gcc_arch enable_shared enable_static enable_pic with_pic enable_fast_install enable_aix_soname with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_python_sys_prefix with_python_prefix with_python_exec_prefix with_int with_gmp with_gmp_prefix with_gmp_exec_prefix with_gmp_builddir with_clang with_clang_prefix with_clang_exec_prefix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP LT_SYS_LIBRARY_PATH CXXCPP PYTHON' ac_subdirs_all='interface' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures isl 0.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/isl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of isl 0.28:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-portable-binary disable compiler optimizations that would produce unportable binaries --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcc-arch= use architecture for gcc -march/-mtune, instead of guessing --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-python-sys-prefix use Python's sys.prefix and sys.exec_prefix values --with-python_prefix override the default PYTHON_PREFIX --with-python_exec_prefix override the default PYTHON_EXEC_PREFIX --with-int=gmp|imath|imath-32 Which package to use to represent multi-precision integers [default=gmp] --with-gmp=system|build Which gmp to use [default=system] --with-gmp-prefix=DIR Prefix of gmp installation --with-gmp-exec-prefix=DIR Exec prefix of gmp installation --with-gmp-builddir=DIR Location of gmp builddir --with-clang=system|no Which clang to use [default=no] --with-clang-prefix=DIR Prefix of clang installation --with-clang-exec-prefix=DIR Exec prefix of clang installation Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor PYTHON the Python interpreter Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF isl configure 0.28 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break else case e in #( e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break else case e in #( e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) ac_lo= ac_hi= ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid else case e in #( e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval (void) { return $2; } static unsigned long int ulongval (void) { return $2; } #include #include int main (void) { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by isl $as_me 0.28, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="ltmain.sh config.guess config.sub compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 am__api_version='1.18' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir ;; esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='isl' VERSION='0.28' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test x$am_uid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} elif test $am_uid -le $am_max_uid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test x$gm_gid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} elif test $am_gid -le $am_max_gid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 printf %s "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if test ${am_cv_prog_tar_ustar+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_prog_tar_ustar=$_am_tool ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi AM_DEFAULT_VERBOSITY=0 versioninfo=28:0:5 if test "x$prefix" != "xNONE"; then prefix_wd=`cd $prefix && pwd` srcdir_wd=`cd $srcdir && pwd` wd=`pwd` if test "x$prefix_wd" = "x$srcdir_wd"; then as_fn_error $? "Installation in source directory not supported" "$LINENO" 5 fi if test "x$prefix_wd" = "x$wd"; then as_fn_error $? "Installation in build directory not supported" "$LINENO" 5 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else case e in #( e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else case e in #( e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 ;; esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac cross_compiling_build=no ac_build_tool_prefix= if test -n "$build" then : ac_build_tool_prefix="$build-" elif test -n "$build_alias" then : ac_build_tool_prefix="$build_alias-" fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu was_set_c_compiler_gnu=${ac_cv_c_compiler_gnu+y} if test ${was_set_c_compiler_gnu} then : saved_c_compiler_gnu=$ac_cv_c_compiler_gnu { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;} fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_build_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_build_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC_FOR_BUILD"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC_FOR_BUILD="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC_FOR_BUILD shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC_FOR_BUILD to just the basename; use the full file name. shift ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_build_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="$ac_build_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC_FOR_BUILD" && break done fi if test -z "$CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC_FOR_BUILD" && break done if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_build_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi fi test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC_FOR_BUILD=yes else GCC_FOR_BUILD= fi ac_test_CFLAGS=${CFLAGS_FOR_BUILD+y} ac_save_CFLAGS=$CFLAGS_FOR_BUILD { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } if test ${ac_cv_build_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_build_prog_cc_g=no CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes else case e in #( e) CFLAGS_FOR_BUILD="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS_FOR_BUILD=$ac_save_CFLAGS elif test $ac_cv_build_prog_cc_g = yes; then if test "$GCC_FOR_BUILD" = yes; then CFLAGS_FOR_BUILD="-g -O2" else CFLAGS_FOR_BUILD="-g" fi else if test "$GCC_FOR_BUILD" = yes; then CFLAGS_FOR_BUILD="-O2" else CFLAGS_FOR_BUILD= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C11 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } if test ${ac_cv_build_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c11=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c11" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C99 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } if test ${ac_cv_build_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c99=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c99" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C89 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } if test ${ac_cv_build_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c89=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c89" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 printf %s "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } if test ${am_cv_build_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_build_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_build_objext; then : OK else am_cv_build_prog_cc_c_o=no break fi done # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_build_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_build_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_build_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_build_prog_cc_c_o" >&6; } if test "$am_cv_build_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu depcc="$CC_FOR_BUILD" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_build_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_build_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${BUILD_OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${BUILD_OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_build_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_build_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_build_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_build_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_build_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_build_TRUE= am__fastdepCC_build_FALSE='#' else am__fastdepCC_build_TRUE='#' am__fastdepCC_build_FALSE= fi if test ${was_set_c_compiler_gnu} then : ac_cv_c_compiler_gnu=$saved_c_compiler_gnu fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_build_exeext+y} && test "$ac_cv_build_exeext" != no; then :; else ac_cv_build_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_build_exeext" = no && ac_cv_build_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_build_exeext=$ac_cv_build_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_build_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_build_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_build_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_exeext" >&5 printf "%s\n" "$ac_cv_build_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_build_exeext ac_build_exeext=$BUILD_EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling_build" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_build_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling_build=no else if test "$cross_compiling_build" = maybe; then cross_compiling_build=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--build'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling_build" >&5 printf "%s\n" "$cross_compiling_build" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_build_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_build_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_build_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_build_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_objext" >&5 printf "%s\n" "$ac_cv_build_objext" >&6; } OBJEXT=$ac_cv_build_objext ac_build_objext=$BUILD_OBJEXT ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then CPP_FOR_BUILD= fi if test -z "$CPP_FOR_BUILD"; then if test ${ac_cv_build_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_build_prog_CPP=$CPP_FOR_BUILD ;; esac fi CPP_FOR_BUILD=$ac_cv_build_prog_CPP else ac_cv_build_prog_CPP=$CPP_FOR_BUILD fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 printf "%s\n" "$CPP_FOR_BUILD" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu EXEEXT=$ac_cv_exeext BUILD_EXEEXT=$ac_cv_build_exeext; ac_build_exeext=$ac_cv_build_exeext OBJEXT=$ac_cv_objext BUILD_OBJEXT=$ac_cv_build_objext; ac_build_objext=$ac_cv_build_objext CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type CCDEPMODE_FOR_BUILD=depmode=$am_cv_build_CC_dependencies_compiler_type { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 printf %s "checking for C compiler vendor... " >&6; } if test ${ax_cv_c_compiler_vendor+y} then : printf %s "(cached) " >&6 else case e in #( e) vendors=" intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ cray: _CRAYC fujitsu: __FUJITSU sdcc: SDCC,__SDCC sx: _SX nvhpc: __NVCOMPILER portland: __PGI pcc: __PCC__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ comeau: __COMO__ kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ tcc: __TINYC__ unknown: UNKNOWN " for ventest in $vendors; do case $ventest in *:) vendor=$ventest continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if !($vencpp) thisisanerror; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # Check whether --enable-portable-binary was given. if test ${enable_portable_binary+y} then : enableval=$enable_portable_binary; acx_maxopt_portable=$enableval else case e in #( e) acx_maxopt_portable=no ;; esac fi # Try to determine "good" native compiler flags if none specified via CFLAGS if test "x$ac_test_CFLAGS" = "x"; then case $ax_cv_c_compiler_vendor in dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" if test "x$acx_maxopt_portable" = xno; then CFLAGS="$CFLAGS -arch host" fi;; sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS -xarch=generic" fi;; hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS +DAportable" fi;; ibm) if test "x$acx_maxopt_portable" = xno; then xlc_opt="-qarch=auto -qtune=auto" else xlc_opt="-qtune=auto" fi as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$xlc_opt" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 printf %s "checking whether C compiler accepts $xlc_opt... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $xlc_opt" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt" else case e in #( e) CFLAGS="$CFLAGS -O3 -qansialias -w" echo "******************************************************" echo "* You seem to have the IBM C compiler. It is *" echo "* recommended for best performance that you use: *" echo "* *" echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" echo "* ^^^ ^^^ *" echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" echo "* CPU you have. (Set the CFLAGS environment var. *" echo "* and re-run configure.) For more info, man cc. *" echo "******************************************************" ;; esac fi ;; intel) CFLAGS="$CFLAGS -O3 -ansi_alias" if test "x$acx_maxopt_portable" = xno; then icc_archflag=unknown icc_flags="" case $host_cpu in i686*|x86_64*) # icc accepts gcc assembly syntax, so these should work: 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 printf %s "checking for x86 cpuid 0 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_0+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_0=unknown else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int op = 0, level = 0, eax, ebx, ecx, edx; FILE *f; __asm__ __volatile__ ("xchg %%ebx, %1\n" "cpuid\n" "xchg %%ebx, %1\n" : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "a" (op), "2" (level)); f = fopen("conftest_cpuid", "w"); if (!f) return 1; fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); fclose(f); return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid else case e in #( e) ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_0" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 printf %s "checking for x86 cpuid 1 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_1+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_1=unknown else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int op = 1, level = 0, eax, ebx, ecx, edx; FILE *f; __asm__ __volatile__ ("xchg %%ebx, %1\n" "cpuid\n" "xchg %%ebx, %1\n" : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "a" (op), "2" (level)); f = fopen("conftest_cpuid", "w"); if (!f) return 1; fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); fclose(f); return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid else case e in #( e) ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_1" >&6; } 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 case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG *:756e6547:6c65746e:49656e69) # Intel case $ax_cv_gcc_x86_cpuid_1 in *0?6[78ab]?:*:*:*|?6[78ab]?:*:*:*|6[78ab]?:*:*:*) icc_flags="-xK" ;; *0?6[9d]?:*:*:*|?6[9d]?:*:*:*|6[9d]?:*:*:*|*1?65?:*:*:*) icc_flags="-xSSE2 -xB -xK" ;; *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) icc_flags="-xSSE3 -xP -xO -xB -xK" ;; *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) icc_flags="-xSSSE3 -xT -xB -xK" ;; *1?6[7d]?:*:*:*) icc_flags="-xSSE4.1 -xS -xT -xB -xK" ;; *1?6[aef]?:*:*:*|*2?6[5cef]?:*:*:*) icc_flags="-xSSE4.2 -xS -xT -xB -xK" ;; *2?6[ad]?:*:*:*) icc_flags="-xAVX -SSE4.2 -xS -xT -xB -xK" ;; *3?6[ae]?:*:*:*) icc_flags="-xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; *3?6[cf]?:*:*:*|*4?6[56]?:*:*:*) icc_flags="-xCORE-AVX2 -xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; *000?f[346]?:*:*:*|?f[346]?:*:*:*|f[346]?:*:*:*) icc_flags="-xSSE3 -xP -xO -xN -xW -xK" ;; *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) icc_flags="-xSSE2 -xN -xW -xK" ;; esac ;; esac ;; esac if test "x$icc_flags" != x; then for flag in $icc_flags; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : icc_archflag=$flag; break else case e in #( e) : ;; esac fi done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 printf %s "checking for icc architecture flag... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 printf "%s\n" "$icc_archflag" >&6; } if test "x$icc_archflag" != xunknown; then CFLAGS="$CFLAGS $icc_archflag" fi fi ;; nvhpc) # default optimization flags for nvhpc CFLAGS="$CFLAGS -O3" ;; gnu) # default optimization flags for gcc on all systems CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" # -malign-double for x86 systems { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -malign-double" >&5 printf %s "checking whether C compiler accepts -malign-double... " >&6; } if test ${ax_cv_check_cflags___malign_double+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -malign-double" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv_check_cflags___malign_double=yes else case e in #( e) ax_cv_check_cflags___malign_double=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___malign_double" >&5 printf "%s\n" "$ax_cv_check_cflags___malign_double" >&6; } if test "x$ax_cv_check_cflags___malign_double" = xyes then : CFLAGS="$CFLAGS -malign-double" else case e in #( e) : ;; esac fi # -fstrict-aliasing for gcc-2.95+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 printf %s "checking whether C compiler accepts -fstrict-aliasing... " >&6; } if test ${ax_cv_check_cflags___fstrict_aliasing+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fstrict-aliasing" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv_check_cflags___fstrict_aliasing=yes else case e in #( e) ax_cv_check_cflags___fstrict_aliasing=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing" >&5 printf "%s\n" "$ax_cv_check_cflags___fstrict_aliasing" >&6; } if test "x$ax_cv_check_cflags___fstrict_aliasing" = xyes then : CFLAGS="$CFLAGS -fstrict-aliasing" else case e in #( e) : ;; esac fi # note that we enable "unsafe" fp optimization with other compilers, too { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 printf %s "checking whether C compiler accepts -ffast-math... " >&6; } if test ${ax_cv_check_cflags___ffast_math+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ffast-math" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv_check_cflags___ffast_math=yes else case e in #( e) ax_cv_check_cflags___ffast_math=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5 printf "%s\n" "$ax_cv_check_cflags___ffast_math" >&6; } if test "x$ax_cv_check_cflags___ffast_math" = xyes then : CFLAGS="$CFLAGS -ffast-math" else case e in #( e) : ;; esac fi # Check whether --with-gcc-arch was given. if test ${with_gcc_arch+y} then : withval=$with_gcc_arch; ax_gcc_arch=$withval else case e in #( e) ax_gcc_arch=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 printf %s "checking for gcc architecture flag... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 printf "%s\n" "" >&6; } if test ${ax_cv_gcc_archflag+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_cv_gcc_archflag="unknown" if test "$GCC" = yes; then if test "x$ax_gcc_arch" = xyes; then ax_gcc_arch="" if test "$cross_compiling" = no; then case $host_cpu in i[3456]86*|x86_64*|amd64*) # use cpuid codes 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 printf %s "checking for x86 cpuid 0 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_0+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_0=unknown else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int op = 0, level = 0, eax, ebx, ecx, edx; FILE *f; __asm__ __volatile__ ("xchg %%ebx, %1\n" "cpuid\n" "xchg %%ebx, %1\n" : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "a" (op), "2" (level)); f = fopen("conftest_cpuid", "w"); if (!f) return 1; fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); fclose(f); return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid else case e in #( e) ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_0" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 printf %s "checking for x86 cpuid 1 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_1+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_1=unknown else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int op = 1, level = 0, eax, ebx, ecx, edx; FILE *f; __asm__ __volatile__ ("xchg %%ebx, %1\n" "cpuid\n" "xchg %%ebx, %1\n" : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "a" (op), "2" (level)); f = fopen("conftest_cpuid", "w"); if (!f) return 1; fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); fclose(f); return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid else case e in #( e) ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_1" >&6; } 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 case $ax_cv_gcc_x86_cpuid_0 in *:756e6547:6c65746e:49656e69) # Intel case $ax_cv_gcc_x86_cpuid_1 in *5[4578]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; *5[123]?:*:*:*) ax_gcc_arch=pentium ;; *0?61?:*:*:*|?61?:*:*:*|61?:*:*:*) ax_gcc_arch=pentiumpro ;; *0?6[356]?:*:*:*|?6[356]?:*:*:*|6[356]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; *0?6[78ab]?:*:*:*|?6[78ab]?:*:*:*|6[78ab]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; *0?6[9d]?:*:*:*|?6[9d]?:*:*:*|6[9d]?:*:*:*|*1?65?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) ax_gcc_arch="yonah pentium-m pentium3 pentiumpro" ;; *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;; *1?6[7d]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;; *1?6[aef]?:*:*:*|*2?6e?:*:*:*) ax_gcc_arch="nehalem corei7 core2 pentium-m pentium3 pentiumpro" ;; *2?6[5cf]?:*:*:*) ax_gcc_arch="westmere corei7 core2 pentium-m pentium3 pentiumpro" ;; *2?6[ad]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[ae]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[cf]?:*:*:*|*4?6[56]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6d?:*:*:*|*4?6[7f]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *1?6c?:*:*:*|*2?6[67]?:*:*:*|*3?6[56]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; *3?67?:*:*:*|*[45]?6[ad]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; *000?f[012]?:*:*:*|?f[012]?:*:*:*|f[012]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; *000?f[346]?:*:*:*|?f[346]?:*:*:*|f[346]?:*:*:*) ax_gcc_arch="nocona prescott pentium4 pentiumpro" ;; # fallback *5??:*:*:*) ax_gcc_arch=pentium ;; *??6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;; *6??:*:*:*) ax_gcc_arch=pentiumpro ;; *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; esac ;; *:68747541:444d4163:69746e65) # AMD case $ax_cv_gcc_x86_cpuid_1 in *5[67]?:*:*:*) ax_gcc_arch=k6 ;; *5[8]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; *5[9d]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;; *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; *6[678a]?:*:*:*) ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; *000?f[4578bcef]?:*:*:*|?f[4578bcef]?:*:*:*|f[4578bcef]?:*:*:*|*001?f[4578bcf]?:*:*:*|1?f[4578bcf]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; *002?f[13457bcf]?:*:*:*|2?f[13457bcf]?:*:*:*|*004?f[138bcf]?:*:*:*|4?f[138bcf]?:*:*:*|*005?f[df]?:*:*:*|5?f[df]?:*:*:*|*006?f[8bcf]?:*:*:*|6?f[8bcf]?:*:*:*|*007?f[cf]?:*:*:*|7?f[cf]?:*:*:*|*00c?f1?:*:*:*|c?f1?:*:*:*|*020?f3?:*:*:*|20?f3?:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; *010?f[245689a]?:*:*:*|10?f[245689a]?:*:*:*|*030?f1?:*:*:*|30?f1?:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; *050?f[12]?:*:*:*|50?f[12]?:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; *060?f1?:*:*:*|60?f1?:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; *060?f2?:*:*:*|60?f2?:*:*:*|*061?f[03]?:*:*:*|61?f[03]?:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; *063?f0?:*:*:*|63?f0?:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; *07[03]?f0?:*:*:*|7[03]?f0?:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; # fallback *0[13]??f??:*:*:*|[13]??f??:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; *020?f??:*:*:*|20?f??:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; *05??f??:*:*:*|5??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; *060?f??:*:*:*|60?f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; *061?f??:*:*:*|61?f??:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; *06??f??:*:*:*|6??f??:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; *070?f??:*:*:*|70?f??:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; *???f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;; esac ;; *:746e6543:736c7561:48727561) # IDT / VIA (Centaur) case $ax_cv_gcc_x86_cpuid_1 in *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; *5[89]?:*:*:*) ax_gcc_arch=winchip2 ;; *66?:*:*:*) ax_gcc_arch=winchip2 ;; *6[78]?:*:*:*) ax_gcc_arch=c3 ;; *6[9adf]?:*:*:*) ax_gcc_arch="c3-2 c3" ;; esac ;; esac if test x"$ax_gcc_arch" = x; then # fallback case $host_cpu in i586*) ax_gcc_arch=pentium ;; i686*) ax_gcc_arch=pentiumpro ;; esac fi ;; sparc*) # Extract the first word of "prtdiag", so it can be a program name with args. set dummy prtdiag; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PRTDIAG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PRTDIAG in [\\/]* | ?:[\\/]*) ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" for as_dir in $as_dummy do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PRTDIAG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" ;; esac ;; esac fi PRTDIAG=$ac_cv_path_PRTDIAG if test -n "$PRTDIAG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 printf "%s\n" "$PRTDIAG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` cputype=`echo "$cputype" | tr -d ' -' | $SED 's/SPARCIIi/SPARCII/' |tr $as_cr_LETTERS $as_cr_letters` case $cputype in *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;; *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;; *cypress*) ax_gcc_arch=cypress ;; esac ;; alphaev5) ax_gcc_arch=ev5 ;; alphaev56) ax_gcc_arch=ev56 ;; alphapca56) ax_gcc_arch="pca56 ev56" ;; alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; alphaev6) ax_gcc_arch=ev6 ;; alphaev67) ax_gcc_arch=ev67 ;; alphaev68) ax_gcc_arch="ev68 ev67" ;; alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; powerpc*) cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | $SED 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` cputype=`echo $cputype | $SED -e 's/ppc//g;s/ *//g'` case $cputype in *750*) ax_gcc_arch="750 G3" ;; *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;; *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;; *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;; *970*) ax_gcc_arch="970 G5 power4";; *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; 603ev|8240) ax_gcc_arch="$cputype 603e 603";; *POWER7*) ax_gcc_arch="power7";; *POWER8*) ax_gcc_arch="power8";; *POWER9*) ax_gcc_arch="power9";; *POWER10*) ax_gcc_arch="power10";; *) ax_gcc_arch=$cputype ;; esac ax_gcc_arch="$ax_gcc_arch powerpc" ;; aarch64) cpuimpl=`grep 'CPU implementer' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` cpuarch=`grep 'CPU architecture' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` cpuvar=`grep 'CPU variant' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` case $cpuimpl in 0x42) case $cpuarch in 8) case $cpuvar in 0x0) ax_gcc_arch="thunderx2t99 vulcan armv8.1-a armv8-a+lse armv8-a native" ;; esac ;; esac ;; 0x43) case $cpuarch in 8) case $cpuvar in 0x0) ax_gcc_arch="thunderx armv8-a native" ;; 0x1) ax_gcc_arch="thunderx+lse armv8.1-a armv8-a+lse armv8-a native" ;; esac ;; esac ;; esac ;; esac fi # not cross-compiling fi # guess arch if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then if test "x$acx_maxopt_portable" = xyes; then # if we require portable code flag_prefixes="-mtune=" if test "x$ax_cv_c_compiler_vendor" = xclang; then flag_prefixes="-march="; fi # -mcpu=$arch and m$arch generate nonportable code on every arch except # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. case $host_cpu in i*86|x86_64*|amd64*) flag_prefixes="$flag_prefixes -mcpu= -m";; esac else flag_prefixes="-march= -mcpu= -m" fi for flag_prefix in $flag_prefixes; do for arch in $ax_gcc_arch; do flag="$flag_prefix$arch" as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test "x$ax_cv_c_compiler_vendor" = xclang; then if test "x$acx_maxopt_portable" = xyes; then if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi fi fi; ax_cv_gcc_archflag=$flag; break else case e in #( e) : ;; esac fi done test "x$ax_cv_gcc_archflag" = xunknown || break done fi fi # $GCC=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 printf %s "checking for gcc architecture flag... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 printf "%s\n" "$ax_cv_gcc_archflag" >&6; } if test "x$ax_cv_gcc_archflag" = xunknown; then : else CFLAGS="$CFLAGS $ax_cv_gcc_archflag" fi # drop to -O1 for gcc 4.2 $CC --version | sed -e 's/.* \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1 \2/' | (read major minor if test $major -eq 4 -a $minor -eq 2; then exit 0 fi exit 1 ) && CFLAGS="-O1" ;; microsoft) # default optimization flags for MSVC opt builds CFLAGS="$CFLAGS -O2" ;; esac if test -z "$CFLAGS"; then echo "" echo "********************************************************" echo "* WARNING: Don't know the best CFLAGS for this system *" echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" echo "********************************************************" echo "" CFLAGS="$CFLAGS -O3" fi as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 printf %s "checking whether C compiler accepts $CFLAGS... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : : else case e in #( e) echo "" echo "********************************************************" echo "* WARNING: The guessed CFLAGS don't seem to work with *" echo "* your compiler. *" echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "********************************************************" echo "" ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports function __attribute__((__warn_unused_result__))" >&5 printf %s "checking whether the compiler supports function __attribute__((__warn_unused_result__))... " >&6; } if test ${ax_cv_gcc_warn_unused_result+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __attribute__((__warn_unused_result__)) int f(int i) { return i; } int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv_gcc_warn_unused_result=yes else case e in #( e) ax_cv_gcc_warn_unused_result=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_warn_unused_result" >&5 printf "%s\n" "$ax_cv_gcc_warn_unused_result" >&6; } if test "$ax_cv_gcc_warn_unused_result" = yes; then printf "%s\n" "#define GCC_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5 printf %s "checking for __attribute__... " >&6; } if test ${ax_cv___attribute__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void foo(void) __attribute__ ((unused)); static void foo(void) { exit(1); } int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv___attribute__=yes else case e in #( e) ax_cv___attribute__=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv___attribute__" >&5 printf "%s\n" "$ax_cv___attribute__" >&6; } if test "$ax_cv___attribute__" = "yes"; then printf "%s\n" "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" echo $CXX | $GREP -e "-std=" > /dev/null 2> /dev/null if test $? -eq 0; 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 ac_success=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 printf %s "checking whether $CXX supports C++11 features by default... " >&6; } if test ${ax_cv_cxx_compile_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_compile_cxx11=yes else case e in #( e) ax_cv_cxx_compile_cxx11=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes 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 if test x$ac_success = xno; then HAVE_CXX11=0 else HAVE_CXX11=1 printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h fi else ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false 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 ac_success=no if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval $cachevar=yes else case e in #( e) eval $cachevar=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done 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 if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX11=0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h fi fi ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false 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 ac_success=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 printf %s "checking whether $CXX supports C++17 features by default... " >&6; } if test ${ax_cv_cxx_compile_cxx17+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else #include #include #include namespace cxx17 { namespace test_constexpr_lambdas { constexpr int foo = [](){return 42;}(); } namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } namespace test_template_argument_deduction_for_class_templates { template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } namespace test_structured_bindings { int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } namespace test_exception_spec_type_system { struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // __cplusplus < 201703L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_compile_cxx17=yes else case e in #( e) ax_cv_cxx_compile_cxx17=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5 printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; } if test x$ax_cv_cxx_compile_cxx17 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do switch="-std=gnu++${alternative}" cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else #include #include #include namespace cxx17 { namespace test_constexpr_lambdas { constexpr int foo = [](){return 42;}(); } namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } namespace test_template_argument_deduction_for_class_templates { template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } namespace test_structured_bindings { int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } namespace test_exception_spec_type_system { struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // __cplusplus < 201703L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval $cachevar=yes else case e in #( e) eval $cachevar=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else #include #include #include namespace cxx17 { namespace test_constexpr_lambdas { constexpr int foo = [](){return 42;}(); } namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } namespace test_template_argument_deduction_for_class_templates { template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } namespace test_structured_bindings { int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } namespace test_exception_spec_type_system { struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // __cplusplus < 201703L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval $cachevar=yes else case e in #( e) eval $cachevar=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done 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 if test x$ax_cxx_compile_cxx17_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX17=0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} else HAVE_CXX17=1 printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.5.4' macro_revision='2.5.4' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 printf %s "checking for -no_fixup_chains linker flag... " >&6; } if test ${lt_cv_support_no_fixup_chains+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_support_no_fixup_chains=yes else case e in #( e) lt_cv_support_no_fixup_chains=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_static=yes ;; esac fi # Check whether --enable-pic was given. if test ${enable_pic+y} then : enableval=$enable_pic; lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --enable-aix-soname was given. if test ${enable_aix_soname+y} then : enableval=$enable_aix_soname; case $enableval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$enable_aix_soname else case e in #( e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi ;; esac fi enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; *-mlibc) archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; serenity*) ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_c_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi ='-fPIC' archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc=no no_undefined_flag= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP ;; esac fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=no ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; *-mlibc) ld_shlibs_CXX=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; serenity*) ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. if test x-L = x"$p" || test x-R = x"$p" || test x-l = x"$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi ='-fPIC' archive_cmds_CXX='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc_CXX=no no_undefined_flag_CXX= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" 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: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.6" >&5 printf %s "checking whether $PYTHON version is >= 3.6... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Python interpreter is too old" "$LINENO" 5 ;; esac fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.6" >&5 printf %s "checking for a Python interpreter with version >= 3.6... " >&6; } if test ${am_cv_pathless_PYTHON+y} then : printf %s "(cached) " >&6 else case e in #( e) for am_cv_pathless_PYTHON in python python3 python3.20 python3.19 python3.18 python3.17 python3.16 python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then : break fi done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 printf "%s\n" "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PYTHON+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 printf "%s\n" "$PYTHON" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then : else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 printf %s "checking for $am_display_PYTHON version... " >&6; } if test ${am_cv_python_version+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[:2])"` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 printf "%s\n" "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 printf %s "checking for $am_display_PYTHON platform... " >&6; } if test ${am_cv_python_platform+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 printf "%s\n" "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform if test "x$prefix" = xNONE; then am__usable_prefix=$ac_default_prefix else am__usable_prefix=$prefix fi # Allow user to request using sys.* values from Python, # instead of the GNU $prefix values. # Check whether --with-python-sys-prefix was given. if test ${with_python_sys_prefix+y} then : withval=$with_python_sys_prefix; am_use_python_sys=: else case e in #( e) am_use_python_sys=false ;; esac fi # Allow user to override whatever the default Python prefix is. # Check whether --with-python_prefix was given. if test ${with_python_prefix+y} then : withval=$with_python_prefix; am_python_prefix_subst=$withval am_cv_python_prefix=$withval { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 printf %s "checking for explicit $am_display_PYTHON prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 printf "%s\n" "$am_cv_python_prefix" >&6; } else case e in #( e) if $am_use_python_sys; then # using python sys.prefix value, not GNU { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 printf %s "checking for python default $am_display_PYTHON prefix... " >&6; } if test ${am_cv_python_prefix+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 printf "%s\n" "$am_cv_python_prefix" >&6; } case $am_cv_python_prefix in $am__usable_prefix*) am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` ;; *) am_python_prefix_subst=$am_cv_python_prefix ;; esac else # using GNU prefix value, not python sys.prefix am_python_prefix_subst='${prefix}' am_python_prefix=$am_python_prefix_subst { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 printf %s "checking for GNU default $am_display_PYTHON prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 printf "%s\n" "$am_python_prefix" >&6; } fi ;; esac fi # Substituting python_prefix_subst value. PYTHON_PREFIX=$am_python_prefix_subst # emacs-page Now do it all over again for Python exec_prefix, but with yet # another conditional: fall back to regular prefix if that was specified. # Check whether --with-python_exec_prefix was given. if test ${with_python_exec_prefix+y} then : withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval am_cv_python_exec_prefix=$withval { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 printf %s "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } else case e in #( e) # no explicit --with-python_exec_prefix, but if # --with-python_prefix was given, use its value for python_exec_prefix too. if test -n "$with_python_prefix" then : am_python_exec_prefix_subst=$with_python_prefix am_cv_python_exec_prefix=$with_python_prefix { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 printf %s "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } else case e in #( e) # Set am__usable_exec_prefix whether using GNU or Python values, # since we use that variable for pyexecdir. if test "x$exec_prefix" = xNONE; then am__usable_exec_prefix=$am__usable_prefix else am__usable_exec_prefix=$exec_prefix fi # if $am_use_python_sys; then # using python sys.exec_prefix, not GNU { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 printf %s "checking for python default $am_display_PYTHON exec_prefix... " >&6; } if test ${am_cv_python_exec_prefix+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } case $am_cv_python_exec_prefix in $am__usable_exec_prefix*) am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` ;; *) am_python_exec_prefix_subst=$am_cv_python_exec_prefix ;; esac else # using GNU $exec_prefix, not python sys.exec_prefix am_python_exec_prefix_subst='${exec_prefix}' am_python_exec_prefix=$am_python_exec_prefix_subst { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 printf %s "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 printf "%s\n" "$am_python_exec_prefix" >&6; } fi ;; esac fi ;; esac fi # Substituting python_exec_prefix_subst. PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[:3] == '2.7': can_use_sysconfig = 0 except ImportError: pass" # end of am_python_setup_sysconfig # More repeated code, for figuring out the installation scheme to use. am_python_setup_scheme="if hasattr(sysconfig, 'get_default_scheme'): scheme = sysconfig.get_default_scheme() else: scheme = sysconfig._get_default_scheme() if scheme == 'posix_local': if '$am_py_prefix' == '/usr': scheme = 'deb_system' # should only happen during Debian package builds else: # Debian's default scheme installs to /usr/local/ but we want to # follow the prefix, as we always have. # See bugs#54412, #64837, et al. scheme = 'posix_prefix'" # end of am_python_setup_scheme { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 printf %s "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if test ${am_cv_python_pythondir+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$am_cv_python_prefix" = x; then am_py_prefix=$am__usable_prefix else am_py_prefix=$am_cv_python_prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: try: $am_python_setup_scheme sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'}) except: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` # case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" ;; esac ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 printf "%s\n" "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 printf %s "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if test ${am_cv_python_pyexecdir+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$am_cv_python_exec_prefix" = x; then am_py_exec_prefix=$am__usable_exec_prefix else am_py_exec_prefix=$am_cv_python_exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: try: $am_python_setup_scheme sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'}) except: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` # case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" ;; esac ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 printf "%s\n" "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi if test "$PYTHON" != :; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CYGPATH+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 printf "%s\n" "$CYGPATH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PERL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 printf "%s\n" "$PERL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PDFLATEX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$PDFLATEX"; then ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PDFLATEX="pdflatex" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi PDFLATEX=$ac_cv_prog_PDFLATEX if test -n "$PDFLATEX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5 printf "%s\n" "$PDFLATEX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "pod2html", so it can be a program name with args. set dummy pod2html; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_POD2HTML+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$POD2HTML"; then ac_cv_prog_POD2HTML="$POD2HTML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_POD2HTML="pod2html" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi POD2HTML=$ac_cv_prog_POD2HTML if test -n "$POD2HTML"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $POD2HTML" >&5 printf "%s\n" "$POD2HTML" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "diff", so it can be a program name with args. set dummy diff; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DIFF+y} then : printf %s "(cached) " >&6 else case e in #( e) case $DIFF in [\\/]* | ?:[\\/]*) ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_DIFF="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi DIFF=$ac_cv_path_DIFF if test -n "$DIFF"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 printf "%s\n" "$DIFF" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $DIFF context option" >&5 printf %s "checking for $DIFF context option... " >&6; } for opt in -u -c; do if $DIFF $opt /dev/null /dev/null > /dev/null 2>&1; then DIFF_OPTIONS=$opt break fi done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DIFF_OPTIONS" >&5 printf "%s\n" "$DIFF_OPTIONS" >&6; } if test "$host_os" = "mingw32" -a -n "$CYGPATH"; then OS_SRCDIR=`$CYGPATH -m "$srcdir"` else OS_SRCDIR="$srcdir" fi if test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML"; then GENERATE_DOC_TRUE= GENERATE_DOC_FALSE='#' else GENERATE_DOC_TRUE='#' GENERATE_DOC_FALSE= fi # ------ AX CREATE STDINT H ------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint types" >&5 printf %s "checking for stdint types... " >&6; } ac_stdint_h=`echo include/isl/stdint.h` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. if test ${ac_cv_header_stdint_t+y} then : printf %s "(cached) " >&6 else case e in #( e) old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int_least32_t v = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; else case e in #( e) ac_cv_header_stdint_t="" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then CFLAGS="-std=c99" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { int_least32_t v = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&5 printf "%s\n" "$as_me: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" ;; esac fi v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./stdint.h?)" >&5 printf "%s\n" "(are you sure you want them in ./stdint.h?)" >&6; } elif test "$ac_stdint_h" = "inttypes.h" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./inttypes.h?)" >&5 printf "%s\n" "(are you sure you want them in ./inttypes.h?)" >&6; } elif test "_$ac_cv_header_stdint_t" = "_" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (putting them into $ac_stdint_h)$v" >&5 printf "%s\n" "(putting them into $ac_stdint_h)$v" >&6; } else ac_cv_header_stdint="$ac_cv_header_stdint_t" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint (shortcircuit)" >&5 printf "%s\n" "$ac_cv_header_stdint (shortcircuit)" >&6; } fi if test "_$ac_cv_header_stdint_t" = "_" ; then # cannot shortcircuit.. inttype_headers=`echo | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 printf %s "checking for stdint uintptr_t... " >&6; } if test ${ac_cv_header_stdint_x+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 printf "%s\n" "(..)" >&6; } for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i> " if test "x$ac_cv_type_uintptr_t" = xyes then : ac_cv_header_stdint_x=$i else case e in #( e) continue ;; esac fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = xyes then : and64="/uint64_t" else case e in #( e) and64="" ;; esac fi ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 printf %s "checking for stdint uintptr_t... " >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_x" >&5 printf "%s\n" "$ac_cv_header_stdint_x" >&6; } if test "_$ac_cv_header_stdint_x" = "_" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 printf %s "checking for stdint uint32_t... " >&6; } if test ${ac_cv_header_stdint_o+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 printf "%s\n" "(..)" >&6; } for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i> " if test "x$ac_cv_type_uint32_t" = xyes then : ac_cv_header_stdint_o=$i else case e in #( e) continue ;; esac fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = xyes then : and64="/uint64_t" else case e in #( e) and64="" ;; esac fi ac_cv_stdint_result="(seen uint32_t$and64 in $i)" break break; done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 printf %s "checking for stdint uint32_t... " >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_o" >&5 printf "%s\n" "$ac_cv_header_stdint_o" >&6; } fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 printf %s "checking for stdint u_int32_t... " >&6; } if test ${ac_cv_header_stdint_u+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 printf "%s\n" "(..)" >&6; } for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i> " if test "x$ac_cv_type_u_int32_t" = xyes then : ac_cv_header_stdint_u=$i else case e in #( e) continue ;; esac fi ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include<$i> " if test "x$ac_cv_type_u_int64_t" = xyes then : and64="/u_int64_t" else case e in #( e) and64="" ;; esac fi ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" break break; done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 printf %s "checking for stdint u_int32_t... " >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_u" >&5 printf "%s\n" "$ac_cv_header_stdint_u" >&6; } fi fi if test "_$ac_cv_header_stdint_x" = "_" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint datatype model" >&5 printf %s "checking for stdint datatype model... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 printf "%s\n" "(..)" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 printf %s "checking size of char... " >&6; } if test ${ac_cv_sizeof_char+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_char" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_char=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 printf "%s\n" "$ac_cv_sizeof_char" >&6; } printf "%s\n" "#define SIZEOF_CHAR $ac_cv_sizeof_char" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 printf %s "checking size of short... " >&6; } if test ${ac_cv_sizeof_short+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_short" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 printf "%s\n" "$ac_cv_sizeof_short" >&6; } printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_long" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 printf %s "checking size of void*... " >&6; } if test ${ac_cv_sizeof_voidp+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_voidp" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void*) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_voidp=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 printf "%s\n" "$ac_cv_sizeof_voidp" >&6; } printf "%s\n" "#define SIZEOF_VOIDP $ac_cv_sizeof_voidp" >>confdefs.h ac_cv_char_data_model="" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking data model" >&5 printf %s "checking data model... " >&6; } case "$ac_cv_char_data_model/$ac_cv_long_data_model" in 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; 222/*|333/*|444/*|666/*|888/*) : ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; *) ac_cv_data_model="none" ; n="very unusual model" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_data_model ($ac_cv_long_data_model, $n)" >&5 printf "%s\n" "$ac_cv_data_model ($ac_cv_long_data_model, $n)" >&6; } fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for extra inttypes in chosen header" >&5 printf %s "checking for extra inttypes in chosen header... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ($ac_cv_header_stdint)" >&5 printf "%s\n" "($ac_cv_header_stdint)" >&6; } unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_int_least32_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint> " if test "x$ac_cv_type_int_fast32_t" = xyes then : fi ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_intmax_t" = xyes then : fi fi # shortcircuit to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5 printf "%s\n" "make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6; } # ----------------- DONE inttypes.h checks START header ------------- ac_config_commands="$ac_config_commands $ac_stdint_h" # Check whether --with-int was given. if test ${with_int+y} then : withval=$with_int; else case e in #( e) with_int=gmp ;; esac fi case "$with_int" in gmp|imath|imath-32) ;; *) as_fn_error $? "bad value ${withval} for --with-int (use gmp, imath or imath-32)" "$LINENO" 5 esac case "$with_int" in gmp) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac printf "%s\n" "#define USE_GMP_FOR_MP /**/" >>confdefs.h # Check whether --with-gmp was given. if test ${with_gmp+y} then : withval=$with_gmp; fi case "system" in system|build) # Check whether --with-gmp_prefix was given. if test ${with_gmp_prefix+y} then : withval=$with_gmp_prefix; fi # Check whether --with-gmp_exec_prefix was given. if test ${with_gmp_exec_prefix+y} then : withval=$with_gmp_exec_prefix; fi esac # Check whether --with-gmp_builddir was given. if test ${with_gmp_builddir+y} then : withval=$with_gmp_builddir; fi if test "x$with_gmp_prefix" != "x" -a "x$with_gmp_exec_prefix" = "x"; then with_gmp_exec_prefix=$with_gmp_prefix fi if test "x$with_gmp_prefix" != "x" -o "x$with_gmp_exec_prefix" != "x"; then if test "x$with_gmp" != "x" -a "x$with_gmp" != "xyes" -a "x$with_gmp" != "xsystem"; then as_fn_error $? "Setting $with_gmp_prefix implies use of system gmp" "$LINENO" 5 fi with_gmp="system" fi if test "x$with_gmp_builddir" != "x"; then if test "x$with_gmp" != "x" -a "x$with_gmp" != "xyes" -a "x$with_gmp" != "xbuild"; then as_fn_error $? "Setting $with_gmp_builddir implies use of build gmp" "$LINENO" 5 fi with_gmp="build" gmp_srcdir=`echo @abs_srcdir@ | $with_gmp_builddir/config.status --file=-` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: gmp sources in $gmp_srcdir" >&5 printf "%s\n" "$as_me: gmp sources in $gmp_srcdir" >&6;} fi if test "x$with_gmp_exec_prefix" != "x"; then export PKG_CONFIG_PATH="$with_gmp_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" fi case "$with_gmp" in system|build) ;; *) case "system" in bundled) if test -d $srcdir/.git -a \ -d $srcdir/gmp -a \ ! -d $srcdir/gmp/.git; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git repo detected, but submodule gmp not initialized" >&5 printf "%s\n" "$as_me: WARNING: git repo detected, but submodule gmp not initialized" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You may want to run" >&5 printf "%s\n" "$as_me: WARNING: You may want to run" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git submodule init" >&5 printf "%s\n" "$as_me: WARNING: git submodule init" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git submodule update" >&5 printf "%s\n" "$as_me: WARNING: git submodule update" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: sh autogen.sh" >&5 printf "%s\n" "$as_me: WARNING: sh autogen.sh" >&2;} fi if test -f $srcdir/gmp/configure; then with_gmp="bundled" else with_gmp="no" fi ;; *) with_gmp="system" ;; esac ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which gmp to use" >&5 printf %s "checking which gmp to use... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_gmp" >&5 printf "%s\n" "$with_gmp" >&6; } case "$with_gmp" in system) if test "x$with_gmp_prefix" != "x"; then MP_CPPFLAGS="-I$with_gmp_prefix/include" MP_LDFLAGS="-L$with_gmp_prefix/lib" fi MP_LIBS=-lgmp SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" LDFLAGS="$MP_LDFLAGS $LDFLAGS" LIBS="$MP_LIBS $LIBS" ac_fn_c_check_header_compile "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" if test "x$ac_cv_header_gmp_h" = xyes then : else case e in #( e) as_fn_error $? "gmp.h header not found" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lgmp" >&5 printf %s "checking for main in -lgmp... " >&6; } if test ${ac_cv_lib_gmp_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgmp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gmp_main=yes else case e in #( e) ac_cv_lib_gmp_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp_main" >&5 printf "%s\n" "$ac_cv_lib_gmp_main" >&6; } if test "x$ac_cv_lib_gmp_main" = xyes then : printf "%s\n" "#define HAVE_LIBGMP 1" >>confdefs.h LIBS="-lgmp $LIBS" else case e in #( e) as_fn_error $? "gmp library not found" "$LINENO" 5 ;; esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { mpz_t n, d; if (mpz_divisible_p(n, d)) mpz_divexact_ui(n, n, 4); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : else case e in #( e) as_fn_error $? "gmp library too old" "$LINENO" 5 ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" ;; build) MP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir" MP_LIBS="$with_gmp_builddir/libgmp.la" ;; esac SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" LDFLAGS="$MP_LDFLAGS $LDFLAGS" LIBS="$MP_LIBS $LIBS" need_get_memory_functions=false ac_fn_check_decl "$LINENO" "mp_get_memory_functions" "ac_cv_have_decl_mp_get_memory_functions" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_mp_get_memory_functions" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_MP_GET_MEMORY_FUNCTIONS $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) need_get_memory_functions=true ;; esac fi CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" if test x$need_get_memory_functions = xtrue; then NEED_GET_MEMORY_FUNCTIONS_TRUE= NEED_GET_MEMORY_FUNCTIONS_FALSE='#' else NEED_GET_MEMORY_FUNCTIONS_TRUE='#' NEED_GET_MEMORY_FUNCTIONS_FALSE= fi ;; imath|imath-32) printf "%s\n" "#define USE_IMATH_FOR_MP /**/" >>confdefs.h MP_CPPFLAGS="-I$srcdir/imath_wrap" MP_LDFLAGS="" MP_LIBS="" SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$MP_CPPFLAGS $CPPFLAGS" ac_fn_c_check_header_compile "$LINENO" "imath.h" "ac_cv_header_imath_h" "$ac_includes_default" if test "x$ac_cv_header_imath_h" = xyes then : else case e in #( e) as_fn_error $? "imath.h header not found" "$LINENO" 5 ;; esac fi ac_fn_c_check_header_compile "$LINENO" "gmp_compat.h" "ac_cv_header_gmp_compat_h" "$ac_includes_default" if test "x$ac_cv_header_gmp_compat_h" = xyes then : else case e in #( e) as_fn_error $? "gmp_compat.h header not found" "$LINENO" 5 ;; esac fi CPPFLAGS="$SAVE_CPPFLAGS" if test x = xfalse; then NEED_GET_MEMORY_FUNCTIONS_TRUE= NEED_GET_MEMORY_FUNCTIONS_FALSE='#' else NEED_GET_MEMORY_FUNCTIONS_TRUE='#' NEED_GET_MEMORY_FUNCTIONS_FALSE= fi ;; esac if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then MP_CFLAGS="-std=gnu99 $MP_CFLAGS" fi if test x$with_int = ximath -o x$with_int = ximath-32; then IMATH_FOR_MP_TRUE= IMATH_FOR_MP_FALSE='#' else IMATH_FOR_MP_TRUE='#' IMATH_FOR_MP_FALSE= fi if test x$with_int = xgmp; then GMP_FOR_MP_TRUE= GMP_FOR_MP_FALSE='#' else GMP_FOR_MP_TRUE='#' GMP_FOR_MP_FALSE= fi if test "x$HAVE_CXX11" = "x1"; then HAVE_CXX11_TRUE= HAVE_CXX11_FALSE='#' else HAVE_CXX11_TRUE='#' HAVE_CXX11_FALSE= fi if test "x$HAVE_CXX17" = "x1"; then HAVE_CXX17_TRUE= HAVE_CXX17_FALSE='#' else HAVE_CXX17_TRUE='#' HAVE_CXX17_FALSE= fi if test "x$with_int" = "ximath-32"; then SMALL_INT_OPT_TRUE= SMALL_INT_OPT_FALSE='#' else SMALL_INT_OPT_TRUE='#' SMALL_INT_OPT_FALSE= fi if test "x$with_int" = "ximath-32" then : printf "%s\n" "#define USE_SMALL_INT_OPT /**/" >>confdefs.h fi ac_fn_check_decl "$LINENO" "ffs" "ac_cv_have_decl_ffs" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_ffs" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_FFS $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "__builtin_ffs" "ac_cv_have_decl___builtin_ffs" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl___builtin_ffs" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL___BUILTIN_FFS $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "_BitScanForward" "ac_cv_have_decl__BitScanForward" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl__BitScanForward" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL__BITSCANFORWARD $ac_have_decl" >>confdefs.h if test "x$ac_cv_have_decl_ffs" = xno -a \ "x$ac_cv_have_decl___builtin_ffs" = xno -a \ "x$ac_cv_have_decl__BitScanForward" = xno; then as_fn_error $? "No ffs implementation found" "$LINENO" 5 fi ac_fn_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_strcasecmp" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_STRCASECMP $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_strncasecmp" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_STRNCASECMP $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "_stricmp" "ac_cv_have_decl__stricmp" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl__stricmp" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL__STRICMP $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "_strnicmp" "ac_cv_have_decl__strnicmp" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl__strnicmp" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL__STRNICMP $ac_have_decl" >>confdefs.h if test "x$ac_cv_have_decl_strcasecmp" = xno -a \ "x$ac_cv_have_decl__stricmp" = xno; then as_fn_error $? "No strcasecmp implementation found" "$LINENO" 5 fi if test "x$ac_cv_have_decl_strncasecmp" = xno -a \ "x$ac_cv_have_decl__strnicmp" = xno; then as_fn_error $? "No strncasecmp implementation found" "$LINENO" 5 fi ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_snprintf" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl__snprintf" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h if test "x$ac_cv_have_decl_snprintf" = xno -a \ "x$ac_cv_have_decl__snprintf" = xno; then as_fn_error $? "No snprintf implementation found" "$LINENO" 5 fi # Check whether --with-clang was given. if test ${with_clang+y} then : withval=$with_clang; fi case "system" in system|no) # Check whether --with-clang_prefix was given. if test ${with_clang_prefix+y} then : withval=$with_clang_prefix; fi # Check whether --with-clang_exec_prefix was given. if test ${with_clang_exec_prefix+y} then : withval=$with_clang_exec_prefix; fi esac if test "x$with_clang_prefix" != "x" -a "x$with_clang_exec_prefix" = "x"; then with_clang_exec_prefix=$with_clang_prefix fi if test "x$with_clang_prefix" != "x" -o "x$with_clang_exec_prefix" != "x"; then if test "x$with_clang" != "x" -a "x$with_clang" != "xyes" -a "x$with_clang" != "xsystem"; then as_fn_error $? "Setting $with_clang_prefix implies use of system clang" "$LINENO" 5 fi with_clang="system" fi if test "x$with_clang_builddir" != "x"; then if test "x$with_clang" != "x" -a "x$with_clang" != "xyes" -a "x$with_clang" != "xbuild"; then as_fn_error $? "Setting $with_clang_builddir implies use of build clang" "$LINENO" 5 fi with_clang="build" clang_srcdir=`echo @abs_srcdir@ | $with_clang_builddir/config.status --file=-` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: clang sources in $clang_srcdir" >&5 printf "%s\n" "$as_me: clang sources in $clang_srcdir" >&6;} fi if test "x$with_clang_exec_prefix" != "x"; then export PKG_CONFIG_PATH="$with_clang_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}" fi case "$with_clang" in system|no) ;; *) case "no" in bundled) if test -d $srcdir/.git -a \ -d $srcdir/clang -a \ ! -d $srcdir/clang/.git; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git repo detected, but submodule clang not initialized" >&5 printf "%s\n" "$as_me: WARNING: git repo detected, but submodule clang not initialized" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You may want to run" >&5 printf "%s\n" "$as_me: WARNING: You may want to run" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git submodule init" >&5 printf "%s\n" "$as_me: WARNING: git submodule init" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: git submodule update" >&5 printf "%s\n" "$as_me: WARNING: git submodule update" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: sh autogen.sh" >&5 printf "%s\n" "$as_me: WARNING: sh autogen.sh" >&2;} fi if test -f $srcdir/clang/configure; then with_clang="bundled" else with_clang="no" fi ;; *) with_clang="no" ;; esac ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which clang to use" >&5 printf %s "checking which clang to use... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_clang" >&5 printf "%s\n" "$with_clang" >&6; } if test $with_clang = system; then HAVE_CLANG_TRUE= HAVE_CLANG_FALSE='#' else HAVE_CLANG_TRUE='#' HAVE_CLANG_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 printf %s "checking for C compiler vendor... " >&6; } if test ${ax_cv_c_compiler_vendor+y} then : printf %s "(cached) " >&6 else case e in #( e) vendors=" intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ cray: _CRAYC fujitsu: __FUJITSU sdcc: SDCC,__SDCC sx: _SX nvhpc: __NVCOMPILER portland: __PGI pcc: __PCC__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ comeau: __COMO__ kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ tcc: __TINYC__ unknown: UNKNOWN " for ventest in $vendors; do case $ventest in *:) vendor=$ventest continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if !($vencpp) thisisanerror; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } WARNING_FLAGS="" if test "${ax_cv_c_compiler_vendor}" = "clang"; then WARNING_FLAGS="-Wall" fi PACKAGE_CFLAGS="$MP_CPPFLAGS" PACKAGE_LDFLAGS="$MP_LDFLAGS" PACKAGE_LIBS="-lisl $MP_LIBS" # we need the expanded forms... test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig libname" >&5 printf %s "checking our pkgconfig libname... " >&6; } test ".$ax_create_pkgconfig_libname" != "." || \ ax_create_pkgconfig_libname="${PACKAGE_NAME}" test ".$ax_create_pkgconfig_libname" != "." || \ ax_create_pkgconfig_libname="$PACKAGE" ax_create_pkgconfig_libname=`eval echo "$ax_create_pkgconfig_libname"` ax_create_pkgconfig_libname=`eval echo "$ax_create_pkgconfig_libname"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_libname" >&5 printf "%s\n" "$ax_create_pkgconfig_libname" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig version" >&5 printf %s "checking our pkgconfig version... " >&6; } test ".$ax_create_pkgconfig_version" != "." || \ ax_create_pkgconfig_version="${PACKAGE_VERSION}" test ".$ax_create_pkgconfig_version" != "." || \ ax_create_pkgconfig_version="$VERSION" ax_create_pkgconfig_version=`eval echo "$ax_create_pkgconfig_version"` ax_create_pkgconfig_version=`eval echo "$ax_create_pkgconfig_version"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_version" >&5 printf "%s\n" "$ax_create_pkgconfig_version" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig_libdir" >&5 printf %s "checking our pkgconfig_libdir... " >&6; } test ".$pkgconfig_libdir" = "." && \ pkgconfig_libdir='${libdir}/pkgconfig' ax_create_pkgconfig_libdir=`eval echo "$pkgconfig_libdir"` ax_create_pkgconfig_libdir=`eval echo "$ax_create_pkgconfig_libdir"` ax_create_pkgconfig_libdir=`eval echo "$ax_create_pkgconfig_libdir"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $pkgconfig_libdir" >&5 printf "%s\n" "$pkgconfig_libdir" >&6; } test "$pkgconfig_libdir" != "$ax_create_pkgconfig_libdir" && ( { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: expanded our pkgconfig_libdir... $ax_create_pkgconfig_libdir" >&5 printf "%s\n" "expanded our pkgconfig_libdir... $ax_create_pkgconfig_libdir" >&6; }) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig_libfile" >&5 printf %s "checking our pkgconfig_libfile... " >&6; } test ".$pkgconfig_libfile" != "." || \ pkgconfig_libfile="$ax_create_pkgconfig_libname.pc" ax_create_pkgconfig_libfile=`eval echo "$pkgconfig_libfile"` ax_create_pkgconfig_libfile=`eval echo "$ax_create_pkgconfig_libfile"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $pkgconfig_libfile" >&5 printf "%s\n" "$pkgconfig_libfile" >&6; } test "$pkgconfig_libfile" != "$ax_create_pkgconfig_libfile" && ( { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: expanded our pkgconfig_libfile... $ax_create_pkgconfig_libfile" >&5 printf "%s\n" "expanded our pkgconfig_libfile... $ax_create_pkgconfig_libfile" >&6; }) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our package / suffix" >&5 printf %s "checking our package / suffix... " >&6; } ax_create_pkgconfig_suffix="$program_suffix" test ".$ax_create_pkgconfig_suffix" != .NONE || ax_create_pkgconfig_suffix="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${PACKAGE_NAME} / ${ax_create_pkgconfig_suffix}" >&5 printf "%s\n" "${PACKAGE_NAME} / ${ax_create_pkgconfig_suffix}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig description" >&5 printf %s "checking our pkgconfig description... " >&6; } ax_create_pkgconfig_description="$PACKAGE_SUMMARY" test ".$ax_create_pkgconfig_description" != "." || \ ax_create_pkgconfig_description="$ax_create_pkgconfig_libname Library" ax_create_pkgconfig_description=`eval echo "$ax_create_pkgconfig_description"` ax_create_pkgconfig_description=`eval echo "$ax_create_pkgconfig_description"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_description" >&5 printf "%s\n" "$ax_create_pkgconfig_description" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig requires" >&5 printf %s "checking our pkgconfig requires... " >&6; } ax_create_pkgconfig_requires="$PACKAGE_REQUIRES" ax_create_pkgconfig_requires=`eval echo "$ax_create_pkgconfig_requires"` ax_create_pkgconfig_requires=`eval echo "$ax_create_pkgconfig_requires"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_requires" >&5 printf "%s\n" "$ax_create_pkgconfig_requires" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig ext libs" >&5 printf %s "checking our pkgconfig ext libs... " >&6; } ax_create_pkgconfig_pkglibs="$PACKAGE_LIBS" test ".$ax_create_pkgconfig_pkglibs" != "." || ax_create_pkgconfig_pkglibs="-l$ax_create_pkgconfig_libname" ax_create_pkgconfig_libs="$ax_create_pkgconfig_pkglibs $LIBS" ax_create_pkgconfig_libs=`eval echo "$ax_create_pkgconfig_libs"` ax_create_pkgconfig_libs=`eval echo "$ax_create_pkgconfig_libs"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_libs" >&5 printf "%s\n" "$ax_create_pkgconfig_libs" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig cppflags" >&5 printf %s "checking our pkgconfig cppflags... " >&6; } ax_create_pkgconfig_cppflags="$PACKAGE_CFLAGS" ax_create_pkgconfig_cppflags=`eval echo "$ax_create_pkgconfig_cppflags"` ax_create_pkgconfig_cppflags=`eval echo "$ax_create_pkgconfig_cppflags"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_cppflags" >&5 printf "%s\n" "$ax_create_pkgconfig_cppflags" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking our pkgconfig ldflags" >&5 printf %s "checking our pkgconfig ldflags... " >&6; } ax_create_pkgconfig_ldflags="$PACKAGE_LDFLAGS" ax_create_pkgconfig_ldflags=`eval echo "$ax_create_pkgconfig_ldflags"` ax_create_pkgconfig_ldflags=`eval echo "$ax_create_pkgconfig_ldflags"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_create_pkgconfig_ldflags" >&5 printf "%s\n" "$ax_create_pkgconfig_ldflags" >&6; } test ".$ax_create_pkgconfig_generate" != "." || \ ax_create_pkgconfig_generate="$ax_create_pkgconfig_libname.pc" ax_create_pkgconfig_generate=`eval echo "$ax_create_pkgconfig_generate"` ax_create_pkgconfig_generate=`eval echo "$ax_create_pkgconfig_generate"` test "$pkgconfig_libfile" != "$ax_create_pkgconfig_generate" && ( { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: generate the pkgconfig later... $ax_create_pkgconfig_generate" >&5 printf "%s\n" "generate the pkgconfig later... $ax_create_pkgconfig_generate" >&6; }) if test ".$ax_create_pkgconfig_src_libdir" = "." ; then ax_create_pkgconfig_src_libdir=`pwd` ax_create_pkgconfig_src_libdir=`$as_dirname -- "$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" || $as_expr X"$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" : 'X\(//\)[^/]' \| \ X"$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" : 'X\(//\)$' \| \ X"$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ax_create_pkgconfig_src_libdir/$ax_create_pkgconfig_generate" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test ! -d $ax_create_pkgconfig_src_libdir/src || \ ax_create_pkgconfig_src_libdir="$ax_create_pkgconfig_src_libdir/src" case ".$objdir" in *libs) ax_create_pkgconfig_src_libdir="$ax_create_pkgconfig_src_libdir/$objdir" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: noninstalled pkgconfig -L $ax_create_pkgconfig_src_libdir" >&5 printf "%s\n" "noninstalled pkgconfig -L $ax_create_pkgconfig_src_libdir" >&6; } fi if test ".$ax_create_pkgconfig_src_headers" = "." ; then ax_create_pkgconfig_src_headers=`pwd` v="$ac_top_srcdir" ; test ".$v" != "." || v="$ax_spec_dir" test ".$v" != "." || v="$srcdir" case "$v" in /*) ax_create_pkgconfig_src_headers="" ;; esac ax_create_pkgconfig_src_headers=`$as_dirname -- "$ax_create_pkgconfig_src_headers/$v/x" || $as_expr X"$ax_create_pkgconfig_src_headers/$v/x" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ax_create_pkgconfig_src_headers/$v/x" : 'X\(//\)[^/]' \| \ X"$ax_create_pkgconfig_src_headers/$v/x" : 'X\(//\)$' \| \ X"$ax_create_pkgconfig_src_headers/$v/x" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ax_create_pkgconfig_src_headers/$v/x" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test ! -d $ax_create_pkgconfig_src_headers/include || \ ax_create_pkgconfig_src_headers="$ax_create_pkgconfig_src_headers/include" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: noninstalled pkgconfig -I $ax_create_pkgconfig_src_headers" >&5 printf "%s\n" "noninstalled pkgconfig -I $ax_create_pkgconfig_src_headers" >&6; } fi ac_config_commands="$ac_config_commands $ax_create_pkgconfig_generate" if test -f $srcdir/.git; then gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` abs_gitdir=`(cd "$gitdir"; pwd)` GIT_HEAD="$abs_gitdir/index" GIT_REPO="$abs_gitdir" GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/.git/HEAD; then abs_srcdir=`(cd "$srcdir"; pwd)` GIT_HEAD="$abs_srcdir/.git/index" GIT_REPO="$abs_srcdir/.git" GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe --always` elif test -f $srcdir/GIT_HEAD_ID; then GIT_HEAD_ID=`cat $srcdir/GIT_HEAD_ID` else mysrcdir=`(cd $srcdir; pwd)` head=`basename $mysrcdir | sed -e 's/.*-//'` head2=`echo $head | sed -e 's/^0-9a-f//'` head3=`echo $head2 | sed -e 's/........................................//'` if test "x$head3" = "x" -a "x$head" = "x$head2"; then GIT_HEAD_ID="$head" else GIT_HEAD_ID="UNKNOWN" fi fi if test -z "$GIT_REPO" ; then GIT_HEAD_VERSION="$GIT_HEAD_ID" else GIT_HEAD_VERSION="\`GIT_DIR=$GIT_REPO git describe --always\`" fi ac_config_headers="$ac_config_headers isl_config.h" ac_config_files="$ac_config_files isl_srcdir.c" ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files doc/Makefile" if test $with_clang = system; then subdirs="$subdirs interface" fi ac_config_files="$ac_config_files bound_test.sh" ac_config_files="$ac_config_files codegen_test.sh" ac_config_files="$ac_config_files pip_test.sh" ac_config_files="$ac_config_files flow_test.sh" ac_config_files="$ac_config_files schedule_test.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GENERATE_DOC_TRUE}" && test -z "${GENERATE_DOC_FALSE}"; then as_fn_error $? "conditional \"GENERATE_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_GET_MEMORY_FUNCTIONS_TRUE}" && test -z "${NEED_GET_MEMORY_FUNCTIONS_FALSE}"; then as_fn_error $? "conditional \"NEED_GET_MEMORY_FUNCTIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_GET_MEMORY_FUNCTIONS_TRUE}" && test -z "${NEED_GET_MEMORY_FUNCTIONS_FALSE}"; then as_fn_error $? "conditional \"NEED_GET_MEMORY_FUNCTIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${IMATH_FOR_MP_TRUE}" && test -z "${IMATH_FOR_MP_FALSE}"; then as_fn_error $? "conditional \"IMATH_FOR_MP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GMP_FOR_MP_TRUE}" && test -z "${GMP_FOR_MP_FALSE}"; then as_fn_error $? "conditional \"GMP_FOR_MP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX11_TRUE}" && test -z "${HAVE_CXX11_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX17_TRUE}" && test -z "${HAVE_CXX17_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX17\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SMALL_INT_OPT_TRUE}" && test -z "${SMALL_INT_OPT_FALSE}"; then as_fn_error $? "conditional \"SMALL_INT_OPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CLANG_TRUE}" && test -z "${HAVE_CLANG_FALSE}"; then as_fn_error $? "conditional \"HAVE_CLANG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by isl $as_me 0.28, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ isl config.status 0.28 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' # variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=`printf "%s\n" "_$PACKAGE-$ac_stdint_h" | sed "$as_sed_cpp"` ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_char_data_model="$ac_cv_char_data_model" ac_cv_long_data_model="$ac_cv_long_data_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" ax_create_pkgconfig_generate="$ax_create_pkgconfig_generate" pkgconfig_prefix='$prefix' pkgconfig_execprefix='$exec_prefix' pkgconfig_bindir='$bindir' pkgconfig_libdir='$libdir' pkgconfig_includedir='$includedir' pkgconfig_datarootdir='$datarootdir' pkgconfig_datadir='$datadir' pkgconfig_sysconfdir='$sysconfdir' pkgconfig_suffix='$ax_create_pkgconfig_suffix' pkgconfig_package='$PACKAGE_NAME' pkgconfig_libname='$ax_create_pkgconfig_libname' pkgconfig_description='$ax_create_pkgconfig_description' pkgconfig_version='$ax_create_pkgconfig_version' pkgconfig_requires='$ax_create_pkgconfig_requires' pkgconfig_libs='$ax_create_pkgconfig_libs' pkgconfig_ldflags='$ax_create_pkgconfig_ldflags' pkgconfig_cppflags='$ax_create_pkgconfig_cppflags' pkgconfig_src_libdir='$ax_create_pkgconfig_src_libdir' pkgconfig_src_headers='$ax_create_pkgconfig_src_headers' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "$ac_stdint_h") CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; "$ax_create_pkgconfig_generate") CONFIG_COMMANDS="$CONFIG_COMMANDS $ax_create_pkgconfig_generate" ;; "isl_config.h") CONFIG_HEADERS="$CONFIG_HEADERS isl_config.h" ;; "isl_srcdir.c") CONFIG_FILES="$CONFIG_FILES isl_srcdir.c" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "bound_test.sh") CONFIG_FILES="$CONFIG_FILES bound_test.sh" ;; "codegen_test.sh") CONFIG_FILES="$CONFIG_FILES codegen_test.sh" ;; "pip_test.sh") CONFIG_FILES="$CONFIG_FILES pip_test.sh" ;; "flow_test.sh") CONFIG_FILES="$CONFIG_FILES flow_test.sh" ;; "schedule_test.sh") CONFIG_FILES="$CONFIG_FILES schedule_test.sh" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "$ac_stdint_h":C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_stdint_h : $_ac_stdint_h" >&5 printf "%s\n" "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;} ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint echo "#include " >>$ac_stdint echo "#endif" >>$ac_stdint echo "#endif" >>$ac_stdint else cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_char_data_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-addressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsigned int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* The ISO C99 standard specifies that in C++ implementations these should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS #ifndef UINT32_C /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # ifdef _HAVE_LONGLONG_UINT64_T # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c ## U # define UINT16_C(c) c ## U # define UINT32_C(c) c ## U # ifdef _HAVE_LONGLONG_UINT64_T # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # ifdef _HAVE_LONGLONG_UINT64_T # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif /* literalnumbers */ #endif #endif /* These limits are merrily those of a two complement byte-oriented system */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) #ifndef INT64_MIN # define INT64_MIN (-__INT64_C(9223372036854775807)-1) #endif /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) #ifndef INT64_MAX # define INT64_MAX (__INT64_C(9223372036854775807)) #endif /* Maximum of unsigned integral types. */ #ifndef UINT8_MAX # define UINT8_MAX (255) #endif #ifndef UINT16_MAX # define UINT16_MAX (65535) #endif # define UINT32_MAX (4294967295U) #ifndef UINT64_MAX # define UINT64_MAX (__UINT64_C(18446744073709551615)) #endif /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN INT8_MIN # define INT_LEAST16_MIN INT16_MIN # define INT_LEAST32_MIN INT32_MIN # define INT_LEAST64_MIN INT64_MIN /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX INT8_MAX # define INT_LEAST16_MAX INT16_MAX # define INT_LEAST32_MAX INT32_MAX # define INT_LEAST64_MAX INT64_MAX /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX UINT8_MAX # define UINT_LEAST16_MAX UINT16_MAX # define UINT_LEAST32_MAX UINT32_MAX # define UINT_LEAST64_MAX UINT64_MAX /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF fi if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_stdint_h is unchanged" >&5 printf "%s\n" "$as_me: $ac_stdint_h is unchanged" >&6;} else ac_dir=`$as_dirname -- "$ac_stdint_h" || $as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_stdint_h" : 'X\(//\)[^/]' \| \ X"$ac_stdint_h" : 'X\(//\)$' \| \ X"$ac_stdint_h" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_stdint_h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ;; "$ax_create_pkgconfig_generate":C) pkgconfig_generate="$ax_create_pkgconfig_generate" if test ! -f "$pkgconfig_generate.in" then generate="true" elif grep ' generated by configure ' $pkgconfig_generate.in >/dev/null then generate="true" else generate="false"; fi if $generate ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $pkgconfig_generate.in" >&5 printf "%s\n" "$as_me: creating $pkgconfig_generate.in" >&6;} cat > $pkgconfig_generate.in <&5 printf "%s\n" "$as_me: creating $pkgconfig_generate" >&6;} cat >conftest.sed < $pkgconfig_generate if test ! -s $pkgconfig_generate ; then as_fn_error $? "$pkgconfig_generate is empty" "$LINENO" 5 fi ; rm conftest.sed # DONE generate $pkgconfig_generate pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.pc/'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $pkgconfig_uninstalled" >&5 printf "%s\n" "$as_me: creating $pkgconfig_uninstalled" >&6;} cat >conftest.sed < $pkgconfig_uninstalled if test ! -s $pkgconfig_uninstalled ; then as_fn_error $? "$pkgconfig_uninstalled is empty" "$LINENO" 5 fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled pkgconfig_requires_add=`echo ${pkgconfig_requires}` if test ".$pkgconfig_requires_add" != "." ; then pkgconfig_requires_add="pkg-config $pkgconfig_requires_add" else pkgconfig_requires_add=":" ; fi pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.sh/'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $pkgconfig_uninstalled" >&5 printf "%s\n" "$as_me: creating $pkgconfig_uninstalled" >&6;} cat >conftest.sed <Name:>for option\\; do case \"\$option\" in --list-all|--name) echo > s>Description: *>\\;\\; --help) pkg-config --help \\; echo Buildscript Of > s>Version: *>\\;\\; --modversion|--version) echo > s>Requires:>\\;\\; --requires) echo $pkgconfig_requires_add> s>Libs: *>\\;\\; --libs) echo > s>Cflags: *>\\;\\; --cflags) echo > /--libs)/a\\ $pkgconfig_requires_add /--cflags)/a\\ $pkgconfig_requires_add\\ ;; --variable=*) eval echo '\$'\`echo \$option | sed -e 's/.*=//'\`\\ ;; --uninstalled) exit 0 \\ ;; *) ;; esac done AXEOF sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_uninstalled if test ! -s $pkgconfig_uninstalled ; then as_fn_error $? "$pkgconfig_uninstalled is empty" "$LINENO" 5 fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled ;; "bound_test.sh":F) chmod +x bound_test.sh ;; "codegen_test.sh":F) chmod +x codegen_test.sh ;; "pip_test.sh":F) chmod +x pip_test.sh ;; "flow_test.sh":F) chmod +x flow_test.sh ;; "schedule_test.sh":F) chmod +x schedule_test.sh ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 printf "%s\n" "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi isl-0.28/isl_multi_align_set.c0000664000175000017500000000021415072740040015510 0ustar00skimoskimo#undef SUFFIX #define SUFFIX set #undef ARG1 #define ARG1 MULTI(BASE) #undef ARG2 #define ARG2 isl_set #include "isl_align_params_templ.c" isl-0.28/isl_stride.c0000664000175000017500000003247315215726270013647 0ustar00skimoskimo/* * Copyright 2012-2013 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include #include #include #include /* Stride information about a specific set dimension. * The values of the set dimension are equal to * "offset" plus a multiple of "stride". */ struct isl_stride_info { isl_val *stride; isl_aff *offset; }; /* Return the ctx to which "si" belongs. */ isl_ctx *isl_stride_info_get_ctx(__isl_keep isl_stride_info *si) { if (!si) return NULL; return isl_val_get_ctx(si->stride); } /* Free "si" and return NULL. */ __isl_null isl_stride_info *isl_stride_info_free( __isl_take isl_stride_info *si) { if (!si) return NULL; isl_val_free(si->stride); isl_aff_free(si->offset); free(si); return NULL; } /* Construct an isl_stride_info object with given offset and stride. */ __isl_give isl_stride_info *isl_stride_info_alloc( __isl_take isl_val *stride, __isl_take isl_aff *offset) { struct isl_stride_info *si; if (!stride || !offset) goto error; si = isl_alloc_type(isl_val_get_ctx(stride), struct isl_stride_info); if (!si) goto error; si->stride = stride; si->offset = offset; return si; error: isl_val_free(stride); isl_aff_free(offset); return NULL; } /* Make a copy of "si" and return it. */ __isl_give isl_stride_info *isl_stride_info_copy( __isl_keep isl_stride_info *si) { if (!si) return NULL; return isl_stride_info_alloc(isl_val_copy(si->stride), isl_aff_copy(si->offset)); } /* Return the stride of "si". */ __isl_give isl_val *isl_stride_info_get_stride(__isl_keep isl_stride_info *si) { if (!si) return NULL; return isl_val_copy(si->stride); } /* Return the offset of "si". */ __isl_give isl_aff *isl_stride_info_get_offset(__isl_keep isl_stride_info *si) { if (!si) return NULL; return isl_aff_copy(si->offset); } /* Information used inside detect_stride. * * "pos" is the set dimension at which the stride is being determined. * "want_offset" is set if the offset should be computed. * "found" is set if some stride was found already. * "stride" and "offset" contain the (combined) stride and offset * found so far and are NULL when "found" is not set. * If "want_offset" is not set, then "offset" remains NULL. */ struct isl_detect_stride_data { int pos; int want_offset; int found; isl_val *stride; isl_aff *offset; }; /* Set the stride and offset of data->pos to the given * value and expression. * * If we had already found a stride before, then the two strides * are combined into a single stride. * * In particular, if the new stride information is of the form * * i = f + s (...) * * and the old stride information is of the form * * i = f2 + s2 (...) * * then we compute the extended gcd of s and s2 * * a s + b s2 = g, * * with g = gcd(s,s2), multiply the first equation with t1 = b s2/g * and the second with t2 = a s1/g. * This results in * * i = (b s2 + a s1)/g i = t1 f + t2 f2 + (s s2)/g (...) * * so that t1 f + t2 f2 is the combined offset and (s s2)/g = lcm(s,s2) * is the combined stride. */ static isl_stat set_stride(struct isl_detect_stride_data *data, __isl_take isl_val *stride, __isl_take isl_aff *offset) { if (!stride || !offset) goto error; if (data->found) { isl_val *stride2, *a, *b, *g; isl_aff *offset2; stride2 = data->stride; g = isl_val_gcdext(isl_val_copy(stride), isl_val_copy(stride2), &a, &b); a = isl_val_mul(a, isl_val_copy(stride)); a = isl_val_div(a, isl_val_copy(g)); stride2 = isl_val_div(stride2, g); b = isl_val_mul(b, isl_val_copy(stride2)); stride = isl_val_mul(stride, stride2); if (!data->want_offset) { isl_val_free(a); isl_val_free(b); } else { offset2 = data->offset; offset2 = isl_aff_scale_val(offset2, a); offset = isl_aff_scale_val(offset, b); offset = isl_aff_add(offset, offset2); } } data->found = 1; data->stride = stride; if (data->want_offset) data->offset = offset; else isl_aff_free(offset); if (!data->stride || (data->want_offset && !data->offset)) return isl_stat_error; return isl_stat_ok; error: isl_val_free(stride); isl_aff_free(offset); return isl_stat_error; } /* Check if constraint "c" imposes any stride on dimension data->pos * and, if so, update the stride information in "data". * The constraint may be equality constraint or it may be one * of a pair of constraints with opposite coefficients. * If "c" is an equality constraint, then "round" is 0 and "gap" * is not used (it is effectively considered to be equal to 0). * If "c" is an inequality constraint, then "round" is set to 1 * if "c" is a lower bound on data->pos (meaning that the ceil * of the derived offset needs to be computed) and set to -1 * if "c" is an upper bound on data->pos (meaning that the floor * of the derived offset needs to be computed), while "gap" * is the sum of the constant terms of the two constraints. * * In order to impose a stride on the dimension, * "c" needs to involve the dimension. * * Let c be of the form * * h(p) + g * v * i + g * stride * f(alpha) = 0 * * with h(p) an expression in terms of the parameters and other dimensions * and f(alpha) an expression in terms of the existentially quantified * variables. * If "c" is an inequality constraint, then it forms the pair * * 0 <= h(p) + g * v * i + g * stride * f(alpha) <= gap * * * If "stride" is not zero and not one, then it represents a non-trivial stride * on "i". We compute a and b such that * * a v + b stride = 1 * * We have * * g v i = -h(p) + g stride f(alpha) * * a g v i = -a h(p) + g stride f(alpha) * * a g v i + b g stride i = -a h(p) + g stride * (...) * * g i = -a h(p) + g stride * (...) * * i = -a h(p)/g + stride * (...) * * The expression "-a h(p)/g" can therefore be used as offset. * * If "c" is an inequality constraint, then the last equality is * * -a h(p)/g + stride * (...) <= i <= gap/g * * and so a stride can only be derived from this if gap < g. * In this case, the offset is "ceil(-a h(p)/g)" since "-a h(p)" * can no longer be assumed to be a multiple of g. * Note that this assumes that the original coefficient of i was positive * (a lower bound on i). If the coefficient is negative, then the offset * is "floor(-a h(p)/g)". */ static isl_stat detect_stride(struct isl_detect_stride_data *data, __isl_take isl_constraint *c, int round, __isl_keep isl_val *gap) { int i; isl_size n_div; isl_ctx *ctx; isl_stat r = isl_stat_ok; isl_val *v, *stride, *m; isl_bool relevant, valid, has_stride; relevant = isl_constraint_involves_dims(c, isl_dim_set, data->pos, 1); if (relevant < 0) goto error; if (!relevant) goto done; n_div = isl_constraint_dim(c, isl_dim_div); if (n_div < 0) goto error; ctx = isl_constraint_get_ctx(c); stride = isl_val_zero(ctx); for (i = 0; i < n_div; ++i) { v = isl_constraint_get_coefficient_val(c, isl_dim_div, i); stride = isl_val_gcd(stride, v); } v = isl_constraint_get_coefficient_val(c, isl_dim_set, data->pos); m = isl_val_gcd(isl_val_copy(stride), isl_val_copy(v)); stride = isl_val_div(stride, isl_val_copy(m)); v = isl_val_div(v, isl_val_copy(m)); valid = round ? isl_val_lt(gap, m) : isl_bool_true; has_stride = isl_val_gt_si(stride, 1); if (has_stride >= 0 && has_stride && valid >= 0 && valid) { isl_aff *aff; isl_val *gcd, *a, *b; gcd = isl_val_gcdext(v, isl_val_copy(stride), &a, &b); isl_val_free(gcd); isl_val_free(b); c = isl_constraint_drop_all_locals(c); aff = isl_constraint_get_aff(c); aff = isl_aff_set_coefficient_si(aff, isl_dim_in, data->pos, 0); a = isl_val_neg(a); aff = isl_aff_scale_val(aff, a); aff = isl_aff_scale_down_val(aff, m); if (round > 0) aff = isl_aff_ceil(aff); else if (round < 0) aff = isl_aff_floor(aff); r = set_stride(data, stride, aff); } else { isl_val_free(stride); isl_val_free(m); isl_val_free(v); } if (has_stride < 0 || valid < 0) error: r = isl_stat_error; done: isl_constraint_free(c); return r; } /* Check if constraint "c" imposes any stride on dimension data->pos * and, if so, update the stride information in "data". * * In order to impose a stride on the dimension, "c" needs to be an equality. * Note that "c" may also be * a div constraint and thus an inequality that we cannot use. */ static isl_stat detect_stride_eq(__isl_take isl_constraint *c, void *user) { struct isl_detect_stride_data *data = user; isl_bool is_eq; is_eq = isl_constraint_is_equality(c); if (is_eq < 0 || !is_eq) { isl_constraint_free(c); return isl_stat_non_error_bool(is_eq); } return detect_stride(data, c, 0, NULL); } /* Check if the equality constraints implied by "set" impose any stride * on set dimension "pos" and store the results in data->stride and * data->offset. * * In particular, compute the affine hull and then check if * any of the constraints in the hull impose any stride on the dimension. */ static isl_stat set_detect_stride_eq(__isl_keep isl_set *set, int pos, struct isl_detect_stride_data *data) { isl_basic_set *hull; isl_stat res; hull = isl_set_affine_hull(isl_set_copy(set)); res = isl_basic_set_foreach_constraint(hull, &detect_stride_eq, data); isl_basic_set_free(hull); return res; } /* Check if constraint "c", say * * f >= 0 * * together with the opposite constraint * * f <= gap * * impose any stride on dimension data->pos and, if so, * update the stride information in "data". */ static isl_stat detect_stride_ineq(__isl_take isl_constraint *c, __isl_take isl_val *gap, void *user) { struct isl_detect_stride_data *data = user; isl_stat res; isl_bool upper; upper = isl_constraint_is_upper_bound(c, isl_dim_set, data->pos); if (upper < 0) c = isl_constraint_free(c); res = detect_stride(data, c, upper ? -1 : 1, gap); isl_val_free(gap); return res; } /* Check if any pair of opposite inequality constraints in "set" * impose any stride on set dimension "pos" and store/update * the results in data->stride and data->offset. * * In particular, collect the inequality constraints in the description of "set" * that are valid for the entire set and then check if * that includes any pair of opposite inequality constraints * that impose a stride on the dimension. */ static isl_stat set_detect_stride_ineq(__isl_keep isl_set *set, int pos, struct isl_detect_stride_data *data) { isl_basic_set *hull; isl_stat res; hull = isl_set_plain_unshifted_simple_hull(isl_set_copy(set)); res = isl_basic_set_foreach_opposite_constraint_pair(hull, &detect_stride_ineq, data); isl_basic_set_free(hull); return res; } /* Check if the constraints in "set" imply any stride on set dimension "pos" and * store the results in data->stride and data->offset. * * In particular, check if any equality constraints implied by "set" * or any pair of opposite inequality constraints in "set" * impose any stride on the dimension. * If no such constraint can be found, then the offset is taken * to be the zero expression and the stride is taken to be one. */ static void set_detect_stride(__isl_keep isl_set *set, int pos, struct isl_detect_stride_data *data) { data->pos = pos; data->found = 0; data->stride = NULL; data->offset = NULL; if (set_detect_stride_eq(set, pos, data) < 0) goto error; if (set_detect_stride_ineq(set, pos, data) < 0) goto error; if (!data->found) { data->stride = isl_val_one(isl_set_get_ctx(set)); if (data->want_offset) { isl_space *space; isl_local_space *ls; space = isl_set_get_space(set); ls = isl_local_space_from_space(space); data->offset = isl_aff_zero_on_domain(ls); } } return; error: data->stride = isl_val_free(data->stride); data->offset = isl_aff_free(data->offset); } /* Check if the constraints in "set" imply any stride on set dimension "pos" and * return the results in the form of an offset and a stride. */ __isl_give isl_stride_info *isl_set_get_stride_info(__isl_keep isl_set *set, int pos) { struct isl_detect_stride_data data; data.want_offset = 1; set_detect_stride(set, pos, &data); return isl_stride_info_alloc(data.stride, data.offset); } /* Check if the constraints in "set" imply any stride on set dimension "pos" and * return this stride. */ __isl_give isl_val *isl_set_get_stride(__isl_keep isl_set *set, int pos) { struct isl_detect_stride_data data; data.want_offset = 0; set_detect_stride(set, pos, &data); return data.stride; } /* Check if the constraints in "map" imply any stride on output dimension "pos", * independently of any other output dimensions, and * return the results in the form of an offset and a stride. * * Convert the input to a set with only the input dimensions and * the single output dimension such that it be passed to * isl_set_get_stride_info and convert the result back to * an expression defined over the domain of "map". */ __isl_give isl_stride_info *isl_map_get_range_stride_info( __isl_keep isl_map *map, int pos) { isl_stride_info *si; isl_set *set; isl_size n_in; n_in = isl_map_dim(map, isl_dim_in); if (n_in < 0) return NULL; map = isl_map_copy(map); map = isl_map_project_onto(map, isl_dim_out, pos, 1); set = isl_map_wrap(map); si = isl_set_get_stride_info(set, n_in); isl_set_free(set); if (!si) return NULL; si->offset = isl_aff_domain_factor_domain(si->offset); if (!si->offset) return isl_stride_info_free(si); return si; } isl-0.28/libisl-gdb.py0000664000175000017500000000551315072740040013707 0ustar00skimoskimoimport gdb import re # GDB Pretty Printers for most isl objects class IslObjectPrinter: """Print an isl object""" def __init__ (self, val, type): self.val = val self.type = type def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() value = str(self.val.cast(void_ptr)) printer = gdb.parse_and_eval("isl_printer_to_str(isl_" + str(self.type) + "_get_ctx(" + value + "))") printer = gdb.parse_and_eval("isl_printer_print_" + str(self.type) + "(" + str(printer) + ", " + value + ")") string = gdb.parse_and_eval("(char*)isl_printer_get_str(" + str(printer) + ")") gdb.parse_and_eval("isl_printer_free(" + str(printer) + ")") return string def display_hint (self): return 'string' class IslIntPrinter: """Print an isl_int """ def __init__ (self, val): self.val = val def to_string (self): # Cast val to a void pointer to stop gdb using this pretty # printer for the pointer which would lead to an infinite loop. void_ptr = gdb.lookup_type('void').pointer() value = str(self.val.cast(void_ptr)) context = gdb.parse_and_eval("isl_ctx_alloc()") printer = gdb.parse_and_eval("isl_printer_to_str(" + str(context) + ")") printer = gdb.parse_and_eval("isl_printer_print_isl_int(" + str(printer) + ", " + value + ")") string = gdb.parse_and_eval("(char*)isl_printer_get_str(" + str(printer) + ")") gdb.parse_and_eval("isl_printer_free(" + str(printer) + ")") gdb.parse_and_eval("isl_ctx_free(" + str(context) + ")") return string def display_hint (self): return 'string' class IslPrintCommand (gdb.Command): """Print an isl value.""" def __init__ (self): super (IslPrintCommand, self).__init__ ("islprint", gdb.COMMAND_OBSCURE) def invoke (self, arg, from_tty): arg = gdb.parse_and_eval(arg); printer = str_lookup_function(arg) if printer == None: print("No isl printer for this type") return print(printer.to_string()) IslPrintCommand() def str_lookup_function (val): if val.type.code != gdb.TYPE_CODE_PTR: if str(val.type) == "isl_int": return IslIntPrinter(val) else: return None lookup_tag = val.type.target() regex = re.compile ("^isl_(.*)$") if lookup_tag == None: return None m = regex.match (str(lookup_tag)) if m: # Those types of printers defined in isl. if m.group(1) in ["basic_set", "set", "union_set", "basic_map", "map", "union_map", "qpolynomial", "pw_qpolynomial", "pw_qpolynomial_fold", "union_pw_qpolynomial", "union_pw_qpolynomial_fold"]: return IslObjectPrinter(val, m.group(1)) return None # Do not register the pretty printer. # gdb.current_objfile().pretty_printers.append(str_lookup_function) isl-0.28/set_from_map.c0000664000175000017500000000026215072740040014140 0ustar00skimoskimo#include /* Return the set that was treated as the map "map". */ static __isl_give isl_set *set_from_map(__isl_take isl_map *map) { return (isl_set *) map; } isl-0.28/isl_ast_build_expr.c0000664000175000017500000026472315215726270015366 0ustar00skimoskimo/* * Copyright 2012-2014 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France */ #include #include #include #include #include #include #include #include #include /* Compute the "opposite" of the (numerator of the) argument of a div * with denominator "d". * * In particular, compute * * -aff + (d - 1) */ static __isl_give isl_aff *oppose_div_arg(__isl_take isl_aff *aff, __isl_take isl_val *d) { aff = isl_aff_neg(aff); aff = isl_aff_add_constant_val(aff, d); aff = isl_aff_add_constant_si(aff, -1); return aff; } /* Internal data structure used inside isl_ast_expr_add_term. * The domain of "build" is used to simplify the expressions. * "build" needs to be set by the caller of isl_ast_expr_add_term. * "ls" is the domain local space of the affine expression * of which a term is being added. * "cst" is the constant term of the expression in which the added term * appears. It may be modified by isl_ast_expr_add_term. * * "v" is the coefficient of the term that is being constructed and * is set internally by isl_ast_expr_add_term. */ struct isl_ast_add_term_data { isl_ast_build *build; isl_local_space *ls; isl_val *cst; isl_val *v; }; /* Given the numerator "aff" of the argument of an integer division * with denominator "d", check if it can be made non-negative over * data->build->domain by stealing part of the constant term of * the expression in which the integer division appears. * * In particular, the outer expression is of the form * * v * floor(aff/d) + cst * * We already know that "aff" itself may attain negative values. * Here we check if aff + d*floor(cst/v) is non-negative, such * that we could rewrite the expression to * * v * floor((aff + d*floor(cst/v))/d) + cst - v*floor(cst/v) * * Note that aff + d*floor(cst/v) can only possibly be non-negative * if data->cst and data->v have the same sign. * Similarly, if floor(cst/v) is zero, then there is no point in * checking again. */ static isl_bool is_non_neg_after_stealing(__isl_keep isl_aff *aff, __isl_keep isl_val *d, struct isl_ast_add_term_data *data) { isl_aff *shifted; isl_val *shift; isl_bool is_zero; isl_bool non_neg; if (isl_val_sgn(data->cst) != isl_val_sgn(data->v)) return isl_bool_false; shift = isl_val_div(isl_val_copy(data->cst), isl_val_copy(data->v)); shift = isl_val_floor(shift); is_zero = isl_val_is_zero(shift); if (is_zero < 0 || is_zero) { isl_val_free(shift); return isl_bool_not(is_zero); } shift = isl_val_mul(shift, isl_val_copy(d)); shifted = isl_aff_copy(aff); shifted = isl_aff_add_constant_val(shifted, shift); non_neg = isl_ast_build_aff_is_nonneg(data->build, shifted); isl_aff_free(shifted); return non_neg; } /* Given the numerator "aff" of the argument of an integer division * with denominator "d", steal part of the constant term of * the expression in which the integer division appears to make it * non-negative over data->build->domain. * * In particular, the outer expression is of the form * * v * floor(aff/d) + cst * * We know that "aff" itself may attain negative values, * but that aff + d*floor(cst/v) is non-negative. * Find the minimal positive value that we need to add to "aff" * to make it positive and adjust data->cst accordingly. * That is, compute the minimal value "m" of "aff" over * data->build->domain and take * * s = ceil(-m/d) * * such that * * aff + d * s >= 0 * * and rewrite the expression to * * v * floor((aff + s*d)/d) + (cst - v*s) */ static __isl_give isl_aff *steal_from_cst(__isl_take isl_aff *aff, __isl_keep isl_val *d, struct isl_ast_add_term_data *data) { isl_set *domain; isl_val *shift, *t; domain = isl_ast_build_get_domain(data->build); shift = isl_set_min_val(domain, aff); isl_set_free(domain); shift = isl_val_neg(shift); shift = isl_val_div(shift, isl_val_copy(d)); shift = isl_val_ceil(shift); t = isl_val_copy(shift); t = isl_val_mul(t, isl_val_copy(data->v)); data->cst = isl_val_sub(data->cst, t); shift = isl_val_mul(shift, isl_val_copy(d)); return isl_aff_add_constant_val(aff, shift); } /* Construct an expression representing the binary operation "type" * (some division or modulo) applied to the expressions * constructed from "aff" and "v". */ static __isl_give isl_ast_expr *div_mod(enum isl_ast_expr_op_type type, __isl_take isl_aff *aff, __isl_take isl_val *v, __isl_keep isl_ast_build *build) { isl_ast_expr *expr1, *expr2; expr1 = isl_ast_expr_from_aff(aff, build); expr2 = isl_ast_expr_from_val(v); return isl_ast_expr_alloc_binary(type, expr1, expr2); } /* Create an isl_ast_expr evaluating the div at position "pos" in data->ls. * The result is simplified in terms of data->build->domain. * This function may change (the sign of) data->v. * * data->ls is known to be non-NULL. * * Let the div be of the form floor(e/d). * If the ast_build_prefer_pdiv option is set then we check if "e" * is non-negative, so that we can generate * * (pdiv_q, expr(e), expr(d)) * * instead of * * (fdiv_q, expr(e), expr(d)) * * If the ast_build_prefer_pdiv option is set and * if "e" is not non-negative, then we check if "-e + d - 1" is non-negative. * If so, we can rewrite * * floor(e/d) = -ceil(-e/d) = -floor((-e + d - 1)/d) * * and still use pdiv_q, while changing the sign of data->v. * * Otherwise, we check if * * e + d*floor(cst/v) * * is non-negative and if so, replace floor(e/d) by * * floor((e + s*d)/d) - s * * with s the minimal shift that makes the argument non-negative. */ static __isl_give isl_ast_expr *var_div(struct isl_ast_add_term_data *data, int pos) { isl_ctx *ctx = isl_local_space_get_ctx(data->ls); isl_aff *aff; isl_val *d; enum isl_ast_expr_op_type type; aff = isl_local_space_get_div(data->ls, pos); d = isl_aff_get_denominator_val(aff); aff = isl_aff_scale_val(aff, isl_val_copy(d)); type = isl_ast_expr_op_fdiv_q; if (isl_options_get_ast_build_prefer_pdiv(ctx)) { isl_bool non_neg; non_neg = isl_ast_build_aff_is_nonneg(data->build, aff); if (non_neg >= 0 && !non_neg) { isl_aff *opp = oppose_div_arg(isl_aff_copy(aff), isl_val_copy(d)); non_neg = isl_ast_build_aff_is_nonneg(data->build, opp); if (non_neg >= 0 && non_neg) { data->v = isl_val_neg(data->v); isl_aff_free(aff); aff = opp; } else isl_aff_free(opp); } if (non_neg >= 0 && !non_neg) { non_neg = is_non_neg_after_stealing(aff, d, data); if (non_neg >= 0 && non_neg) aff = steal_from_cst(aff, d, data); } if (non_neg < 0) aff = isl_aff_free(aff); else if (non_neg) type = isl_ast_expr_op_pdiv_q; } return div_mod(type, aff, d, data->build); } /* Create an isl_ast_expr evaluating the specified dimension of data->ls. * The result is simplified in terms of data->build->domain. * This function may change (the sign of) data->v. * * The isl_ast_expr is constructed based on the type of the dimension. * - divs are constructed by var_div * - set variables are constructed from the iterator isl_ids in data->build * - parameters are constructed from the isl_ids in data->ls */ static __isl_give isl_ast_expr *var(struct isl_ast_add_term_data *data, enum isl_dim_type type, int pos) { isl_ctx *ctx = isl_local_space_get_ctx(data->ls); isl_id *id; if (type == isl_dim_div) return var_div(data, pos); if (type == isl_dim_set) { id = isl_ast_build_get_iterator_id(data->build, pos); return isl_ast_expr_from_id(id); } if (!isl_local_space_has_dim_id(data->ls, type, pos)) isl_die(ctx, isl_error_internal, "unnamed dimension", return NULL); id = isl_local_space_get_dim_id(data->ls, type, pos); return isl_ast_expr_from_id(id); } /* Does "expr" represent the zero integer? */ static isl_bool ast_expr_is_zero(__isl_keep isl_ast_expr *expr) { if (!expr) return isl_bool_error; if (expr->type != isl_ast_expr_int) return isl_bool_false; return isl_val_is_zero(expr->u.v); } /* Create a binary expression by calling "fn" on "expr1" and "expr2", * provided neither of the two expressions is identically zero. * Otherwise, return the non-zero expression (or zero if they are both zero). */ static __isl_give isl_ast_expr *ast_expr_binary_non_zero( __isl_give isl_ast_expr *(*fn)(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2), __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { if (!expr1 || !expr2) goto error; if (ast_expr_is_zero(expr1)) { isl_ast_expr_free(expr1); return expr2; } if (ast_expr_is_zero(expr2)) { isl_ast_expr_free(expr2); return expr1; } return fn(expr1, expr2); error: isl_ast_expr_free(expr1); isl_ast_expr_free(expr2); return NULL; } /* Create an expression representing the sum of "expr1" and "expr2", * provided neither of the two expressions is identically zero. */ static __isl_give isl_ast_expr *ast_expr_add(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return ast_expr_binary_non_zero(&isl_ast_expr_add, expr1, expr2); } /* Create an expression representing the disjunction of "expr1" and "expr2", * provided neither of the two expressions is identically zero. */ static __isl_give isl_ast_expr *ast_expr_or(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return ast_expr_binary_non_zero(&isl_ast_expr_or, expr1, expr2); } /* Subtract expr2 from expr1. * * If expr2 is zero, we simply return expr1. * If expr1 is zero, we return * * (isl_ast_expr_op_minus, expr2) * * Otherwise, we return * * (isl_ast_expr_op_sub, expr1, expr2) */ static __isl_give isl_ast_expr *ast_expr_sub(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { if (!expr1 || !expr2) goto error; if (ast_expr_is_zero(expr2)) { isl_ast_expr_free(expr2); return expr1; } if (ast_expr_is_zero(expr1)) { isl_ast_expr_free(expr1); return isl_ast_expr_neg(expr2); } return isl_ast_expr_sub(expr1, expr2); error: isl_ast_expr_free(expr1); isl_ast_expr_free(expr2); return NULL; } /* Return an isl_ast_expr that represents * * v * (aff mod d) * * v is assumed to be non-negative. * The result is simplified in terms of build->domain. */ static __isl_give isl_ast_expr *isl_ast_expr_mod(__isl_keep isl_val *v, __isl_keep isl_aff *aff, __isl_keep isl_val *d, __isl_keep isl_ast_build *build) { isl_ast_expr *expr; isl_ast_expr *c; if (!aff) return NULL; expr = div_mod(isl_ast_expr_op_pdiv_r, isl_aff_copy(aff), isl_val_copy(d), build); if (!isl_val_is_one(v)) { c = isl_ast_expr_from_val(isl_val_copy(v)); expr = isl_ast_expr_mul(c, expr); } return expr; } /* Create an isl_ast_expr that scales "expr" by "v". * * If v is 1, we simply return expr. * If v is -1, we return * * (isl_ast_expr_op_minus, expr) * * Otherwise, we return * * (isl_ast_expr_op_mul, expr(v), expr) */ static __isl_give isl_ast_expr *scale(__isl_take isl_ast_expr *expr, __isl_take isl_val *v) { isl_ast_expr *c; if (!expr || !v) goto error; if (isl_val_is_one(v)) { isl_val_free(v); return expr; } if (isl_val_is_negone(v)) { isl_val_free(v); expr = isl_ast_expr_neg(expr); } else { c = isl_ast_expr_from_val(v); expr = isl_ast_expr_mul(c, expr); } return expr; error: isl_val_free(v); isl_ast_expr_free(expr); return NULL; } /* Add an expression for "*v" times the specified dimension of data->ls * to expr. * If the dimension is an integer division, then this function * may modify data->cst in order to make the numerator non-negative. * The result is simplified in terms of data->build->domain. * * Let e be the expression for the specified dimension, * multiplied by the absolute value of "*v". * If "*v" is negative, we create * * (isl_ast_expr_op_sub, expr, e) * * except when expr is trivially zero, in which case we create * * (isl_ast_expr_op_minus, e) * * instead. * * If "*v" is positive, we simply create * * (isl_ast_expr_op_add, expr, e) * */ static __isl_give isl_ast_expr *isl_ast_expr_add_term( __isl_take isl_ast_expr *expr, enum isl_dim_type type, int pos, __isl_take isl_val *v, struct isl_ast_add_term_data *data) { isl_ast_expr *term; if (!expr) return NULL; data->v = v; term = var(data, type, pos); v = data->v; if (isl_val_is_neg(v) && !ast_expr_is_zero(expr)) { v = isl_val_neg(v); term = scale(term, v); return ast_expr_sub(expr, term); } else { term = scale(term, v); return ast_expr_add(expr, term); } } /* Add an expression for "v" to expr. */ static __isl_give isl_ast_expr *isl_ast_expr_add_int( __isl_take isl_ast_expr *expr, __isl_take isl_val *v) { isl_ast_expr *expr_int; if (!expr || !v) goto error; if (isl_val_is_zero(v)) { isl_val_free(v); return expr; } if (isl_val_is_neg(v) && !ast_expr_is_zero(expr)) { v = isl_val_neg(v); expr_int = isl_ast_expr_from_val(v); return ast_expr_sub(expr, expr_int); } else { expr_int = isl_ast_expr_from_val(v); return ast_expr_add(expr, expr_int); } error: isl_ast_expr_free(expr); isl_val_free(v); return NULL; } /* Internal data structure used inside extract_modulos. * * If any modulo expressions are detected in "aff", then the * expression is removed from "aff" and added to either "pos" or "neg" * depending on the sign of the coefficient of the modulo expression * inside "aff". * * "add" is an expression that needs to be added to "aff" at the end of * the computation. It is NULL as long as no modulos have been extracted. * * "i" is the position in "aff" of the div under investigation * "v" is the coefficient in "aff" of the div * "div" is the argument of the div, with the denominator removed * "d" is the original denominator of the argument of the div * * If set, then "partial" is the (positively weighted) sum * of the affine expressions of one or more previously considered constraints * that could still be complemented to an expression equal to "div". * "nonneg" is an affine expression that is non-negative over "build" * and that can be used to extract a modulo expression from "div". * In particular, if "sign" is 1, then the coefficients of "nonneg" * are equal to those of "div" modulo "d". If "sign" is -1, then * the coefficients of "nonneg" are opposite to those of "div" modulo "d". * If "sign" is 0, then no such affine expression has been found (yet). */ struct isl_extract_mod_data { isl_ast_build *build; isl_aff *aff; isl_ast_expr *pos; isl_ast_expr *neg; isl_aff *add; int i; isl_val *v; isl_val *d; isl_aff *div; isl_aff *partial; isl_aff *nonneg; int sign; }; /* Does * * arg mod data->d * * represent (a special case of) a test for some linear expression * being even? * * In particular, is it of the form * * (lin - 1) mod 2 * * ? */ static isl_bool is_even_test(struct isl_extract_mod_data *data, __isl_keep isl_aff *arg) { isl_bool res; isl_val *cst; res = isl_val_eq_si(data->d, 2); if (res < 0 || !res) return res; cst = isl_aff_get_constant_val(arg); res = isl_val_eq_si(cst, -1); isl_val_free(cst); return res; } /* Given that data->v * div_i in data->aff is equal to * * f * (term - (arg mod d)) * * with data->d * f = data->v and "arg" non-negative on data->build, add * * f * term * * to data->add and * * abs(f) * (arg mod d) * * to data->neg or data->pos depending on the sign of -f. * * In the special case that "arg mod d" is of the form "(lin - 1) mod 2", * with "lin" some linear expression, first replace * * f * (term - ((lin - 1) mod 2)) * * by * * -f * (1 - term - (lin mod 2)) * * These two are equal because * * ((lin - 1) mod 2) + (lin mod 2) = 1 * * Also, if "lin - 1" is non-negative, then "lin" is non-negative too. */ static isl_stat extract_term_and_mod(struct isl_extract_mod_data *data, __isl_take isl_aff *term, __isl_take isl_aff *arg) { isl_bool even; isl_ast_expr *expr; int s; even = is_even_test(data, arg); if (even < 0) { arg = isl_aff_free(arg); } else if (even) { term = oppose_div_arg(term, isl_val_copy(data->d)); data->v = isl_val_neg(data->v); arg = isl_aff_set_constant_si(arg, 0); } data->v = isl_val_div(data->v, isl_val_copy(data->d)); s = isl_val_sgn(data->v); data->v = isl_val_abs(data->v); expr = isl_ast_expr_mod(data->v, arg, data->d, data->build); isl_aff_free(arg); if (s > 0) data->neg = ast_expr_add(data->neg, expr); else data->pos = ast_expr_add(data->pos, expr); data->aff = isl_aff_set_coefficient_si(data->aff, isl_dim_div, data->i, 0); if (s < 0) data->v = isl_val_neg(data->v); term = isl_aff_scale_val(term, isl_val_copy(data->v)); if (!data->add) data->add = term; else data->add = isl_aff_add(data->add, term); if (!data->add) return isl_stat_error; return isl_stat_ok; } /* Given that data->v * div_i in data->aff is of the form * * f * d * floor(div/d) * * with div nonnegative on data->build, rewrite it as * * f * (div - (div mod d)) = f * div - f * (div mod d) * * and add * * f * div * * to data->add and * * abs(f) * (div mod d) * * to data->neg or data->pos depending on the sign of -f. */ static isl_stat extract_mod(struct isl_extract_mod_data *data) { return extract_term_and_mod(data, isl_aff_copy(data->div), isl_aff_copy(data->div)); } /* Given that data->v * div_i in data->aff is of the form * * f * d * floor(div/d) (1) * * check if div is non-negative on data->build and, if so, * extract the corresponding modulo from data->aff. * If not, then check if * * -div + d - 1 * * is non-negative on data->build. If so, replace (1) by * * -f * d * floor((-div + d - 1)/d) * * and extract the corresponding modulo from data->aff. * * This function may modify data->div. */ static isl_stat extract_nonneg_mod(struct isl_extract_mod_data *data) { isl_bool mod; mod = isl_ast_build_aff_is_nonneg(data->build, data->div); if (mod < 0) goto error; if (mod) return extract_mod(data); data->div = oppose_div_arg(data->div, isl_val_copy(data->d)); mod = isl_ast_build_aff_is_nonneg(data->build, data->div); if (mod < 0) goto error; if (mod) { data->v = isl_val_neg(data->v); return extract_mod(data); } return isl_stat_ok; error: data->aff = isl_aff_free(data->aff); return isl_stat_error; } /* Does "c" have a constant term that is "too large"? * Here, "too large" is fairly arbitrarily set to 1 << 15. */ static isl_bool has_large_constant_term(__isl_keep isl_constraint *c) { isl_val *v; int sign; v = isl_val_abs(isl_constraint_get_constant_val(c)); if (!v) return isl_bool_error; sign = isl_val_cmp_si(v, 1 << 15); isl_val_free(v); return isl_bool_ok(sign > 0); } /* Is the affine expression with constant term returned by "get_constant" * "simpler" than data->nonneg * for use in extracting a modulo expression? * * Currently, only this constant term is considered. * In particular, we prefer the affine expression with the smallest constant * term. * This means that if there are two constraints, say x >= 0 and -x + 10 >= 0, * then we would pick x >= 0 * * More detailed heuristics could be used if it turns out that there is a need. */ static isl_bool is_simpler(struct isl_extract_mod_data *data, __isl_give isl_val *get_constant(struct isl_extract_mod_data *data, void *user), void *user) { isl_val *v1, *v2; isl_bool simpler; if (!data->nonneg) return isl_bool_true; v1 = isl_val_abs(get_constant(data, user)); v2 = isl_val_abs(isl_aff_get_constant_val(data->nonneg)); simpler = isl_val_lt(v1, v2); isl_val_free(v1); isl_val_free(v2); return simpler; } /* Return the constant term of "c". */ static __isl_give isl_val *get_constraint_constant( struct isl_extract_mod_data *data, void *user) { isl_constraint *c = user; return isl_constraint_get_constant_val(c); } /* Is the affine expression of constraint "c" "simpler" than data->nonneg * for use in extracting a modulo expression? * * The test is based on the constant term of "c". */ static isl_bool mod_constraint_is_simpler(struct isl_extract_mod_data *data, __isl_keep isl_constraint *c) { return is_simpler(data, &get_constraint_constant, c); } /* Replace data->nonneg by the affine expression "aff" and * set data->sign to "sign". */ static isl_stat replace_nonneg(struct isl_extract_mod_data *data, __isl_take isl_aff *aff, int sign) { isl_aff_free(data->nonneg); data->nonneg = aff; data->sign = sign; return isl_stat_non_null(data->nonneg); } /* If "c" is "simpler" than data->nonneg, * then replace data->nonneg by the affine expression of "c" and * set data->sign to "sign". */ static isl_stat replace_if_simpler(struct isl_extract_mod_data *data, __isl_keep isl_constraint *c, int sign) { isl_bool simpler; simpler = mod_constraint_is_simpler(data, c); if (simpler < 0 || !simpler) return isl_stat_non_error_bool(simpler); return replace_nonneg(data, isl_constraint_get_aff(c), sign); } /* Internal data structure used inside check_parallel_or_opposite. * * "data" is the information passed down from the caller. * "c" is the constraint being inspected. * * "n" contains the number of parameters and the number of input dimensions and * is set by the first call to parallel_or_opposite_scan. * "parallel" is set as long as the coefficients of "c" are still potentially * equal to those of data->div modulo data->d. * "opposite" is set as long as the coefficients of "c" are still potentially * opposite to those of data->div modulo data->d. * "partial" is set if the coefficients of "c" are still potentially * a subset of those of data->div. * "final" is set is the coefficients in data->partial together with those * of "c" still cover the coefficients of data->div. * * If "f" is set, then it is the factor with which the coefficients * of "c" need to be multiplied to match those of data->div. */ struct isl_parallel_stat { struct isl_extract_mod_data *data; isl_constraint *c; isl_size n[2]; isl_bool parallel; isl_bool opposite; isl_bool partial; int final; isl_val *f; }; /* Should the scan of coefficients be continued? * That is, are the coefficients still (potentially) (partially) equal or * opposite? */ static isl_bool parallel_or_opposite_continue(struct isl_parallel_stat *stat) { if (stat->parallel < 0 || stat->opposite < 0 || stat->partial < 0) return isl_bool_error; return isl_bool_ok(stat->parallel || stat->opposite || stat->partial); } /* Is coefficient "i" of type "c_type" of stat->c potentially equal or * opposite to coefficient "i" of type "a_type" of stat->data->div * modulo stat->data->div? * In particular, are they both zero or both non-zero? * * Note that while the coefficients of stat->data->div can be reasonably * expected not to involve any coefficients that are multiples of stat->data->d, * "c" may very well involve such coefficients. * This means that some cases of equal or opposite constraints can be missed * this way. * * If the coefficient of stat->data->div is zero, but that of "c" is not, * then the coefficients of "c" cannot form a subset of those * of stat->data->div. * If the coefficient of stat->data->div is not zero, * then check that it does not appear in both "c" and stat->data->partial. * If it does not appear in either, then it must appear in some later constraint * and "c" can therefore not be the last in the sequence of constraints * that sum up to stat->data->div. */ static isl_bool parallel_or_opposite_feasible(struct isl_parallel_stat *stat, enum isl_dim_type c_type, enum isl_dim_type a_type, int i) { isl_bool a, b; a = isl_constraint_involves_dims(stat->c, c_type, i, 1); b = isl_aff_involves_dims(stat->data->div, a_type, i, 1); if (a < 0 || b < 0) return isl_bool_error; if (a != b) stat->parallel = stat->opposite = isl_bool_false; if (!stat->partial) return parallel_or_opposite_continue(stat); if (!b && a) stat->partial = isl_bool_false; if (b && (a || stat->final) && stat->data->partial) { isl_bool c; c = isl_aff_involves_dims(stat->data->partial, a_type, i, 1); if (c < 0) return isl_bool_error; if (a && c) stat->partial = isl_bool_false; if (!a && !c) stat->final = 0; } return parallel_or_opposite_continue(stat); } /* Update stat->partial based on the coefficient "v1" of stat->c and * "v2" of stat->data->div, where "v2" is known not to be zero. * "v1" may be modified by this function and the modified value is returned. * This function may also set stat->f. * * If "v1" is zero, then no update needs to be performed. * Otherwise, stat->partial can only remain set if "c" is part * of some positively weighted sum that is equal to stat->data->div. * This means that v2 divided by v1 needs to be a positive integer. * This quotient is stored in stat->f. If this quotient has already * been set for a previous coefficient, then it needs to be the same. */ static __isl_give isl_val *update_is_partial(struct isl_parallel_stat *stat, __isl_take isl_val *v1, __isl_keep isl_val *v2) { if (!stat->partial) return v1; if (isl_val_is_zero(v1)) return v1; stat->partial = isl_val_is_divisible_by(v2, v1); if (stat->partial < 0 || !stat->partial) return v1; v1 = isl_val_div(isl_val_copy(v2), v1); stat->partial = isl_val_is_pos(v1); if (stat->partial < 0 || !stat->partial) return v1; if (!stat->f) stat->f = isl_val_copy(v1); stat->partial = isl_val_eq(v1, stat->f); return v1; } /* Is coefficient "i" of type "c_type" of stat->c equal or * opposite to coefficient "i" of type "a_type" of stat->data->div * modulo stat->data->div, or * could stat->c be part of a positively weighted sum equal to stat->data->div? * This function may set stat->f (at most once). * * If the coefficient of stat->data->div is zero, * then parallel_or_opposite_feasible has already checked * that the coefficient of stat->c is zero as well, * so no further checks are needed. */ static isl_bool is_parallel_or_opposite(struct isl_parallel_stat *stat, enum isl_dim_type c_type, enum isl_dim_type a_type, int i) { isl_val *v1, *v2; isl_bool b; b = isl_aff_involves_dims(stat->data->div, a_type, i, 1); if (b < 0 || !b) return isl_bool_not(b); v1 = isl_constraint_get_coefficient_val(stat->c, c_type, i); v2 = isl_aff_get_coefficient_val(stat->data->div, a_type, i); if (stat->parallel) { v1 = isl_val_sub(v1, isl_val_copy(v2)); stat->parallel = isl_val_is_divisible_by(v1, stat->data->d); v1 = isl_val_add(v1, isl_val_copy(v2)); } if (stat->opposite) { v1 = isl_val_add(v1, isl_val_copy(v2)); stat->opposite = isl_val_is_divisible_by(v1, stat->data->d); } v1 = update_is_partial(stat, v1, v2); isl_val_free(v1); isl_val_free(v2); return parallel_or_opposite_continue(stat); } /* Scan the coefficients of stat->c to see if they are (potentially) * equal or opposite to those of stat->data->div modulo stat->data->d, * calling "fn" on each coefficient. * IF "init" is set, then this is the first call to this function and * then stat->n is initialized. */ static isl_bool parallel_or_opposite_scan(struct isl_parallel_stat *stat, isl_bool (*fn)(struct isl_parallel_stat *stat, enum isl_dim_type c_type, enum isl_dim_type a_type, int i), int init) { enum isl_dim_type c_type[2] = { isl_dim_param, isl_dim_set }; enum isl_dim_type a_type[2] = { isl_dim_param, isl_dim_in }; int i, t; for (t = 0; t < 2; ++t) { if (init) { stat->n[t] = isl_constraint_dim(stat->c, c_type[t]); if (stat->n[t] < 0) return isl_bool_error; } for (i = 0; i < stat->n[t]; ++i) { isl_bool ok; ok = fn(stat, c_type[t], a_type[t], i); if (ok < 0 || !ok) return ok; } } return isl_bool_true; } /* Update stat->data->partial with stat->c. * * In particular, if stat->c with weight stat->f turns out * to potentially be a part of a weighted sum equal to stat->data->div * (i.e., stat->partial is set), then add this scaled version of stat->c * to stat->data->partial or initialize stat->data->partial if it has not * been set yet. */ static isl_stat update_partial(struct isl_parallel_stat *stat) { isl_aff *aff; if (!stat->partial) return isl_stat_ok; aff = isl_constraint_get_aff(stat->c); aff = isl_aff_scale_val(aff, isl_val_copy(stat->f)); if (!stat->data->partial) stat->data->partial = aff; else stat->data->partial = isl_aff_add(stat->data->partial, aff); return isl_stat_non_null(stat->data->partial); } /* Return the constant term of data->partial. */ static __isl_give isl_val *get_partial_constant( struct isl_extract_mod_data *data, void *user) { return isl_aff_get_constant_val(data->partial); } /* Is the affine expression data->partial "simpler" than data->nonneg * for use in extracting a modulo expression? * * The test is based on the constant term of data->partial. */ static isl_bool partial_is_simpler(struct isl_extract_mod_data *data) { return is_simpler(data, &get_partial_constant, NULL); } /* If stat->data->partial is complete and is "simpler" than data->nonneg, * then replace stat->data->nonneg by stat->data->partial. */ static isl_stat replace_by_partial_if_simpler(struct isl_parallel_stat *stat) { isl_bool simpler; isl_aff *partial; if (!stat->final) return isl_stat_ok; simpler = partial_is_simpler(stat->data); if (simpler < 0 || !simpler) return isl_stat_non_error_bool(simpler); partial = stat->data->partial; stat->data->partial = NULL; return replace_nonneg(stat->data, partial, 1); } /* Check if the coefficients of "c" are either equal or opposite to those * of data->div modulo data->d. If so, and if "c" is "simpler" than * data->nonneg, then replace data->nonneg by the affine expression of "c" * and set data->sign accordingly. * Also check if "c" is part of a positively weighted sum of constraints * that is equal to data->div, where each constraint has distinct non-zero * coefficients. If "c" does not involve any non-zero coefficients, * then it is not considered to be part of this sum. If "c" is * the last constraint in this sum (and the sum is "simpler" than data->nonneg) * then also replace data->nonneg by this sum. * If "c" is equal or opposite to data->div, then it is not considered * to be part of a sum. * * Both "c" and data->div are assumed not to involve any integer divisions. * * Before we start the actual comparison, we first quickly check if * "c" and data->div have the same non-zero coefficients. * If not, then we assume that "c" is not of the desired form. * * If the constant term is "too large", then the constraint is rejected. * We do this to avoid picking up constraints that bound a variable * by a very large number, say the largest or smallest possible * variable in the representation of some integer type. */ static isl_stat check_parallel_or_opposite(struct isl_extract_mod_data *data, __isl_keep isl_constraint *c) { struct isl_parallel_stat stat = { .data = data, .c = c, .parallel = isl_bool_true, .opposite = isl_bool_true, .partial = isl_bool_true, .final = data->partial != NULL, .f = NULL, }; isl_bool skip, ok; ok = parallel_or_opposite_scan(&stat, ¶llel_or_opposite_feasible, 1); if (ok < 0 || !ok) return isl_stat_non_error_bool(ok); skip = has_large_constant_term(c); if (skip < 0 || skip) return isl_stat_non_error_bool(skip); if (stat.parallel || stat.opposite) stat.partial = isl_bool_false; ok = parallel_or_opposite_scan(&stat, &is_parallel_or_opposite, 0); if (ok >= 0 && ok) { if (stat.partial && !stat.f) ok = isl_bool_false; else if (update_partial(&stat) < 0) ok = isl_bool_error; } isl_val_free(stat.f); if (ok < 0 || !ok) return isl_stat_non_error_bool(ok); if (stat.partial) return replace_by_partial_if_simpler(&stat); return replace_if_simpler(data, c, stat.parallel ? 1 : -1); } /* Wrapper around check_parallel_or_opposite for use * as a isl_basic_set_foreach_constraint callback. */ static isl_stat check_parallel_or_opposite_wrap(__isl_take isl_constraint *c, void *user) { struct isl_extract_mod_data *data = user; isl_stat res; res = check_parallel_or_opposite(data, c); isl_constraint_free(c); return res; } /* Given that data->v * div_i in data->aff is of the form * * f * d * floor(div/d) (1) * * see if we can find an expression div' that is non-negative over data->build * and that is related to div through * * div' = div + d * e * * or * * div' = -div + d - 1 + d * e * * with e some affine expression. * If so, we write (1) as * * f * div + f * (div' mod d) * * or * * -f * (-div + d - 1) - f * (div' mod d) * * exploiting (in the second case) the fact that * * f * d * floor(div/d) = -f * d * floor((-div + d - 1)/d) * * * We first try to find an appropriate expression for div' * from the constraints of data->build->domain (which is therefore * guaranteed to be non-negative on data->build), where we remove * any integer divisions from the constraints and skip this step * if "div" itself involves any integer divisions. * The following cases are considered for div': * - individual constraints, or * - a sum of constraints that involve disjoint sets of variables and * where the sum is exactly equal to div (i.e., e = 0). * If we cannot find an appropriate expression this way, then * we pass control to extract_nonneg_mod where check * if div or "-div + d -1" themselves happen to be * non-negative on data->build. * * While looking for an appropriate constraint in data->build->domain, * we ignore the constant term, so after finding such a constraint, * we still need to fix up the constant term. * In particular, if a is the constant term of "div" * (or d - 1 - the constant term of "div" if data->sign < 0) * and b is the constant term of the constraint, then we need to find * a non-negative constant c such that * * b + c \equiv a mod d * * We therefore take * * c = (a - b) mod d * * and add it to b to obtain the constant term of div'. * If this constant term is "too negative", then we add an appropriate * multiple of d to make it positive. * * * Note that the above is only a very simple heuristic for finding an * appropriate expression. We could try a bit harder by also considering * arbitrary linear combinations of constraints, * although that could potentially be much more expensive as it involves * the solution of an LP problem. * * In particular, if v_i is a column vector representing constraint i, * w represents div and e_i is the i-th unit vector, then we are looking * for a solution of the constraints * * \sum_i lambda_i v_i = w + \sum_i alpha_i d e_i * * with \lambda_i >= 0 and alpha_i of unrestricted sign. * If we are not just interested in a non-negative expression, but * also in one with a minimal range, then we don't just want * c = \sum_i lambda_i v_i to be non-negative over the domain, * but also beta - c = \sum_i mu_i v_i, where beta is a scalar * that we want to minimize and we now also have to take into account * the constant terms of the constraints. * Alternatively, we could first compute the dual of the domain * and plug in the constraints on the coefficients. */ static isl_stat try_extract_mod(struct isl_extract_mod_data *data) { isl_basic_set *hull; isl_val *v1, *v2; isl_stat r; isl_size n; if (!data->build) goto error; n = isl_aff_dim(data->div, isl_dim_div); if (n < 0) goto error; if (isl_aff_involves_dims(data->div, isl_dim_div, 0, n)) return extract_nonneg_mod(data); hull = isl_set_simple_hull(isl_set_copy(data->build->domain)); hull = isl_basic_set_remove_divs(hull); data->sign = 0; data->nonneg = NULL; data->partial = NULL; r = isl_basic_set_foreach_constraint(hull, &check_parallel_or_opposite_wrap, data); isl_aff_free(data->partial); isl_basic_set_free(hull); if (!data->sign || r < 0) { isl_aff_free(data->nonneg); if (r < 0) goto error; return extract_nonneg_mod(data); } v1 = isl_aff_get_constant_val(data->div); v2 = isl_aff_get_constant_val(data->nonneg); if (data->sign < 0) { v1 = isl_val_neg(v1); v1 = isl_val_add(v1, isl_val_copy(data->d)); v1 = isl_val_sub_ui(v1, 1); } v1 = isl_val_sub(v1, isl_val_copy(v2)); v1 = isl_val_mod(v1, isl_val_copy(data->d)); v1 = isl_val_add(v1, v2); v2 = isl_val_div(isl_val_copy(v1), isl_val_copy(data->d)); v2 = isl_val_ceil(v2); if (isl_val_is_neg(v2)) { v2 = isl_val_mul(v2, isl_val_copy(data->d)); v1 = isl_val_sub(v1, isl_val_copy(v2)); } data->nonneg = isl_aff_set_constant_val(data->nonneg, v1); isl_val_free(v2); if (data->sign < 0) { data->div = oppose_div_arg(data->div, isl_val_copy(data->d)); data->v = isl_val_neg(data->v); } return extract_term_and_mod(data, isl_aff_copy(data->div), data->nonneg); error: data->aff = isl_aff_free(data->aff); return isl_stat_error; } /* Check if "data->aff" involves any (implicit) modulo computations based * on div "data->i". * If so, remove them from aff and add expressions corresponding * to those modulo computations to data->pos and/or data->neg. * * "aff" is assumed to be an integer affine expression. * * In particular, check if (v * div_j) is of the form * * f * m * floor(a / m) * * and, if so, rewrite it as * * f * (a - (a mod m)) = f * a - f * (a mod m) * * and extract out -f * (a mod m). * In particular, if f > 0, we add (f * (a mod m)) to *neg. * If f < 0, we add ((-f) * (a mod m)) to *pos. * * Note that in order to represent "a mod m" as * * (isl_ast_expr_op_pdiv_r, a, m) * * we need to make sure that a is non-negative. * If not, we check if "-a + m - 1" is non-negative. * If so, we can rewrite * * floor(a/m) = -ceil(-a/m) = -floor((-a + m - 1)/m) * * and still extract a modulo. */ static int extract_modulo(struct isl_extract_mod_data *data) { data->div = isl_aff_get_div(data->aff, data->i); data->d = isl_aff_get_denominator_val(data->div); if (isl_val_is_divisible_by(data->v, data->d)) { data->div = isl_aff_scale_val(data->div, isl_val_copy(data->d)); if (try_extract_mod(data) < 0) data->aff = isl_aff_free(data->aff); } isl_aff_free(data->div); isl_val_free(data->d); return 0; } /* Check if "aff" involves any (implicit) modulo computations. * If so, remove them from aff and add expressions corresponding * to those modulo computations to *pos and/or *neg. * We only do this if the option ast_build_prefer_pdiv is set. * * "aff" is assumed to be an integer affine expression. * * A modulo expression is of the form * * a mod m = a - m * floor(a / m) * * To detect them in aff, we look for terms of the form * * f * m * floor(a / m) * * rewrite them as * * f * (a - (a mod m)) = f * a - f * (a mod m) * * and extract out -f * (a mod m). * In particular, if f > 0, we add (f * (a mod m)) to *neg. * If f < 0, we add ((-f) * (a mod m)) to *pos. */ static __isl_give isl_aff *extract_modulos(__isl_take isl_aff *aff, __isl_keep isl_ast_expr **pos, __isl_keep isl_ast_expr **neg, __isl_keep isl_ast_build *build) { struct isl_extract_mod_data data = { build, aff, *pos, *neg }; isl_ctx *ctx; isl_size n; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); if (!isl_options_get_ast_build_prefer_pdiv(ctx)) return aff; n = isl_aff_dim(data.aff, isl_dim_div); if (n < 0) return isl_aff_free(aff); for (data.i = 0; data.i < n; ++data.i) { data.v = isl_aff_get_coefficient_val(data.aff, isl_dim_div, data.i); if (!data.v) return isl_aff_free(aff); if (isl_val_is_zero(data.v) || isl_val_is_one(data.v) || isl_val_is_negone(data.v)) { isl_val_free(data.v); continue; } if (extract_modulo(&data) < 0) data.aff = isl_aff_free(data.aff); isl_val_free(data.v); if (!data.aff) break; } if (data.add) data.aff = isl_aff_add(data.aff, data.add); *pos = data.pos; *neg = data.neg; return data.aff; } /* Call "fn" on every non-zero coefficient of "aff", * passing it in the type of dimension (in terms of the domain), * the position and the value, as long as "fn" returns isl_bool_true. * If "reverse" is set, then the coefficients are considered in reverse order * within each type. */ static isl_bool every_non_zero_coefficient(__isl_keep isl_aff *aff, int reverse, isl_bool (*fn)(enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user), void *user) { int i, j; enum isl_dim_type t[] = { isl_dim_param, isl_dim_in, isl_dim_div }; enum isl_dim_type l[] = { isl_dim_param, isl_dim_set, isl_dim_div }; isl_val *v; for (i = 0; i < 3; ++i) { isl_size n; n = isl_aff_dim(aff, t[i]); if (n < 0) return isl_bool_error; for (j = 0; j < n; ++j) { isl_bool ok; int pos; pos = reverse ? n - 1 - j : j; v = isl_aff_get_coefficient_val(aff, t[i], pos); ok = isl_val_is_zero(v); if (ok >= 0 && !ok) ok = fn(l[i], pos, v, user); else isl_val_free(v); if (ok < 0 || !ok) return ok; } } return isl_bool_true; } /* Internal data structure for extract_rational. * * "d" is the denominator of the original affine expression. * "ls" is its domain local space. * "rat" collects the rational part. */ struct isl_ast_extract_rational_data { isl_val *d; isl_local_space *ls; isl_aff *rat; }; /* Given a non-zero term in an affine expression equal to "v" times * the variable of type "type" at position "pos", * add it to data->rat if "v" is not a multiple of data->d. */ static isl_bool add_rational(enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user) { struct isl_ast_extract_rational_data *data = user; isl_aff *rat; if (isl_val_is_divisible_by(v, data->d)) { isl_val_free(v); return isl_bool_true; } rat = isl_aff_var_on_domain(isl_local_space_copy(data->ls), type, pos); rat = isl_aff_scale_val(rat, v); data->rat = isl_aff_add(data->rat, rat); return isl_bool_true; } /* Check if aff involves any non-integer coefficients. * If so, split aff into * * aff = aff1 + (aff2 / d) * * with both aff1 and aff2 having only integer coefficients. * Return aff1 and add (aff2 / d) to *expr. */ static __isl_give isl_aff *extract_rational(__isl_take isl_aff *aff, __isl_keep isl_ast_expr **expr, __isl_keep isl_ast_build *build) { struct isl_ast_extract_rational_data data = { NULL }; isl_ast_expr *rat_expr; isl_val *v; if (!aff) return NULL; data.d = isl_aff_get_denominator_val(aff); if (!data.d) goto error; if (isl_val_is_one(data.d)) { isl_val_free(data.d); return aff; } aff = isl_aff_scale_val(aff, isl_val_copy(data.d)); data.ls = isl_aff_get_domain_local_space(aff); data.rat = isl_aff_zero_on_domain(isl_local_space_copy(data.ls)); if (every_non_zero_coefficient(aff, 0, &add_rational, &data) < 0) goto error; v = isl_aff_get_constant_val(aff); if (isl_val_is_divisible_by(v, data.d)) { isl_val_free(v); } else { isl_aff *rat_0; rat_0 = isl_aff_val_on_domain(isl_local_space_copy(data.ls), v); data.rat = isl_aff_add(data.rat, rat_0); } isl_local_space_free(data.ls); aff = isl_aff_sub(aff, isl_aff_copy(data.rat)); aff = isl_aff_scale_down_val(aff, isl_val_copy(data.d)); rat_expr = div_mod(isl_ast_expr_op_div, data.rat, data.d, build); *expr = ast_expr_add(*expr, rat_expr); return aff; error: isl_aff_free(data.rat); isl_local_space_free(data.ls); isl_aff_free(aff); isl_val_free(data.d); return NULL; } /* Internal data structure for isl_ast_expr_from_aff. * * "term" contains the information for adding a term. * "expr" collects the results. */ struct isl_ast_add_terms_data { struct isl_ast_add_term_data *term; isl_ast_expr *expr; }; /* Given a non-zero term in an affine expression equal to "v" times * the variable of type "type" at position "pos", * add the corresponding AST expression to data->expr. */ static isl_bool add_term(enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user) { struct isl_ast_add_terms_data *data = user; data->expr = isl_ast_expr_add_term(data->expr, type, pos, v, data->term); return isl_bool_true; } /* Add terms to "expr" for each variable in "aff". * The result is simplified in terms of data->build->domain. */ static __isl_give isl_ast_expr *add_terms(__isl_take isl_ast_expr *expr, __isl_keep isl_aff *aff, struct isl_ast_add_term_data *data) { struct isl_ast_add_terms_data terms_data = { data, expr }; if (every_non_zero_coefficient(aff, 0, &add_term, &terms_data) < 0) return isl_ast_expr_free(terms_data.expr); return terms_data.expr; } /* Construct an isl_ast_expr that evaluates the affine expression "aff". * The result is simplified in terms of build->domain. * * We first extract hidden modulo computations from the affine expression * and then add terms for each variable with a non-zero coefficient. * Finally, if the affine expression has a non-trivial denominator, * we divide the resulting isl_ast_expr by this denominator. */ __isl_give isl_ast_expr *isl_ast_expr_from_aff(__isl_take isl_aff *aff, __isl_keep isl_ast_build *build) { isl_ctx *ctx = isl_aff_get_ctx(aff); isl_ast_expr *expr, *expr_neg; struct isl_ast_add_term_data term_data; if (!aff) return NULL; expr = isl_ast_expr_alloc_int_si(ctx, 0); expr_neg = isl_ast_expr_alloc_int_si(ctx, 0); aff = extract_rational(aff, &expr, build); aff = extract_modulos(aff, &expr, &expr_neg, build); expr = ast_expr_sub(expr, expr_neg); term_data.build = build; term_data.ls = isl_aff_get_domain_local_space(aff); term_data.cst = isl_aff_get_constant_val(aff); expr = add_terms(expr, aff, &term_data); expr = isl_ast_expr_add_int(expr, term_data.cst); isl_local_space_free(term_data.ls); isl_aff_free(aff); return expr; } /* Internal data structure for coefficients_of_sign. * * "sign" is the sign of the coefficients that should be retained. * "aff" is the affine expression of which some coefficients are zeroed out. */ struct isl_ast_coefficients_of_sign_data { int sign; isl_aff *aff; }; /* Clear the specified coefficient of data->aff if the value "v" * does not have the required sign. */ static isl_bool clear_opposite_sign(enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user) { struct isl_ast_coefficients_of_sign_data *data = user; if (type == isl_dim_set) type = isl_dim_in; if (data->sign * isl_val_sgn(v) < 0) data->aff = isl_aff_set_coefficient_si(data->aff, type, pos, 0); isl_val_free(v); return isl_bool_true; } /* Extract the coefficients of "aff" (excluding the constant term) * that have the given sign. * * Take a copy of "aff" and clear the coefficients that do not have * the required sign. * Consider the coefficients in reverse order since clearing * the coefficient of an integer division in data.aff * could result in the removal of that integer division from data.aff, * changing the positions of all subsequent integer divisions of data.aff, * while those of "aff" remain the same. */ static __isl_give isl_aff *coefficients_of_sign(__isl_take isl_aff *aff, int sign) { struct isl_ast_coefficients_of_sign_data data; data.sign = sign; data.aff = isl_aff_copy(aff); if (every_non_zero_coefficient(aff, 1, &clear_opposite_sign, &data) < 0) data.aff = isl_aff_free(data.aff); isl_aff_free(aff); data.aff = isl_aff_set_constant_si(data.aff, 0); return data.aff; } /* Should the constant term "v" be considered positive? * * A positive constant will be added to "pos" by the caller, * while a negative constant will be added to "neg". * If either "pos" or "neg" is exactly zero, then we prefer * to add the constant "v" to that side, irrespective of the sign of "v". * This results in slightly shorter expressions and may reduce the risk * of overflows. */ static isl_bool constant_is_considered_positive(__isl_keep isl_val *v, __isl_keep isl_ast_expr *pos, __isl_keep isl_ast_expr *neg) { isl_bool zero; zero = ast_expr_is_zero(pos); if (zero < 0 || zero) return zero; zero = ast_expr_is_zero(neg); if (zero < 0 || zero) return isl_bool_not(zero); return isl_val_is_pos(v); } /* Check if the equality * * aff = 0 * * represents a stride constraint on the integer division "pos". * * In particular, if the integer division "pos" is equal to * * floor(e/d) * * then check if aff is equal to * * e - d floor(e/d) * * or its opposite. * * If so, the equality is exactly * * e mod d = 0 * * Note that in principle we could also accept * * e - d floor(e'/d) * * where e and e' differ by a constant. */ static isl_bool is_stride_constraint(__isl_keep isl_aff *aff, int pos) { isl_aff *div; isl_val *c, *d; isl_bool eq; div = isl_aff_get_div(aff, pos); c = isl_aff_get_coefficient_val(aff, isl_dim_div, pos); d = isl_aff_get_denominator_val(div); eq = isl_val_abs_eq(c, d); if (eq >= 0 && eq) { aff = isl_aff_copy(aff); aff = isl_aff_set_coefficient_si(aff, isl_dim_div, pos, 0); div = isl_aff_scale_val(div, d); if (isl_val_is_pos(c)) div = isl_aff_neg(div); eq = isl_aff_plain_is_equal(div, aff); isl_aff_free(aff); } else isl_val_free(d); isl_val_free(c); isl_aff_free(div); return eq; } /* Are all coefficients of "aff" (zero or) negative? */ static isl_bool all_negative_coefficients(__isl_keep isl_aff *aff) { int i; isl_size n; n = isl_aff_dim(aff, isl_dim_param); if (n < 0) return isl_bool_error; for (i = 0; i < n; ++i) if (isl_aff_coefficient_sgn(aff, isl_dim_param, i) > 0) return isl_bool_false; n = isl_aff_dim(aff, isl_dim_in); if (n < 0) return isl_bool_error; for (i = 0; i < n; ++i) if (isl_aff_coefficient_sgn(aff, isl_dim_in, i) > 0) return isl_bool_false; return isl_bool_true; } /* Give an equality of the form * * aff = e - d floor(e/d) = 0 * * or * * aff = -e + d floor(e/d) = 0 * * with the integer division "pos" equal to floor(e/d), * construct the AST expression * * (isl_ast_expr_op_eq, * (isl_ast_expr_op_zdiv_r, expr(e), expr(d)), expr(0)) * * If e only has negative coefficients, then construct * * (isl_ast_expr_op_eq, * (isl_ast_expr_op_zdiv_r, expr(-e), expr(d)), expr(0)) * * instead. */ static __isl_give isl_ast_expr *extract_stride_constraint( __isl_take isl_aff *aff, int pos, __isl_keep isl_ast_build *build) { isl_bool all_neg; isl_ctx *ctx; isl_val *c; isl_ast_expr *expr, *cst; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); c = isl_aff_get_coefficient_val(aff, isl_dim_div, pos); aff = isl_aff_set_coefficient_si(aff, isl_dim_div, pos, 0); all_neg = all_negative_coefficients(aff); if (all_neg < 0) aff = isl_aff_free(aff); else if (all_neg) aff = isl_aff_neg(aff); cst = isl_ast_expr_from_val(isl_val_abs(c)); expr = isl_ast_expr_from_aff(aff, build); expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_zdiv_r, expr, cst); cst = isl_ast_expr_alloc_int_si(ctx, 0); expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_eq, expr, cst); return expr; } /* Construct an isl_ast_expr evaluating * * "expr_pos" == "expr_neg", if "eq" is set, or * "expr_pos" >= "expr_neg", if "eq" is not set * * However, if "expr_pos" is an integer constant (and "expr_neg" is not), * then the two expressions are interchanged. This ensures that, * e.g., "i <= 5" is constructed rather than "5 >= i". */ static __isl_give isl_ast_expr *construct_constraint_expr(int eq, __isl_take isl_ast_expr *expr_pos, __isl_take isl_ast_expr *expr_neg) { isl_ast_expr *expr; enum isl_ast_expr_op_type type; int pos_is_cst, neg_is_cst; pos_is_cst = isl_ast_expr_get_type(expr_pos) == isl_ast_expr_int; neg_is_cst = isl_ast_expr_get_type(expr_neg) == isl_ast_expr_int; if (pos_is_cst && !neg_is_cst) { type = eq ? isl_ast_expr_op_eq : isl_ast_expr_op_le; expr = isl_ast_expr_alloc_binary(type, expr_neg, expr_pos); } else { type = eq ? isl_ast_expr_op_eq : isl_ast_expr_op_ge; expr = isl_ast_expr_alloc_binary(type, expr_pos, expr_neg); } return expr; } /* Construct an isl_ast_expr that evaluates the condition "aff" == 0 * (if "eq" is set) or "aff" >= 0 (otherwise). * The result is simplified in terms of build->domain. * * We first extract hidden modulo computations from "aff" * and then collect all the terms with a positive coefficient in cons_pos * and the terms with a negative coefficient in cons_neg. * * The result is then essentially of the form * * (isl_ast_expr_op_ge, expr(pos), expr(-neg))) * * or * * (isl_ast_expr_op_eq, expr(pos), expr(-neg))) * * However, if there are no terms with positive coefficients (or no terms * with negative coefficients), then the constant term is added to "pos" * (or "neg"), ignoring the sign of the constant term. */ static __isl_give isl_ast_expr *isl_ast_expr_from_constraint_no_stride( int eq, __isl_take isl_aff *aff, __isl_keep isl_ast_build *build) { isl_bool cst_is_pos; isl_ctx *ctx; isl_ast_expr *expr_pos; isl_ast_expr *expr_neg; isl_aff *aff_pos, *aff_neg; struct isl_ast_add_term_data data; ctx = isl_aff_get_ctx(aff); expr_pos = isl_ast_expr_alloc_int_si(ctx, 0); expr_neg = isl_ast_expr_alloc_int_si(ctx, 0); aff = extract_modulos(aff, &expr_pos, &expr_neg, build); data.build = build; data.ls = isl_aff_get_domain_local_space(aff); data.cst = isl_aff_get_constant_val(aff); aff_pos = coefficients_of_sign(isl_aff_copy(aff), 1); aff_neg = isl_aff_neg(coefficients_of_sign(aff, -1)); expr_pos = add_terms(expr_pos, aff_pos, &data); data.cst = isl_val_neg(data.cst); expr_neg = add_terms(expr_neg, aff_neg, &data); data.cst = isl_val_neg(data.cst); isl_local_space_free(data.ls); cst_is_pos = constant_is_considered_positive(data.cst, expr_pos, expr_neg); if (cst_is_pos < 0) expr_pos = isl_ast_expr_free(expr_pos); if (cst_is_pos) { expr_pos = isl_ast_expr_add_int(expr_pos, data.cst); } else { data.cst = isl_val_neg(data.cst); expr_neg = isl_ast_expr_add_int(expr_neg, data.cst); } isl_aff_free(aff_pos); isl_aff_free(aff_neg); return construct_constraint_expr(eq, expr_pos, expr_neg); } /* Construct an isl_ast_expr that evaluates the condition "constraint". * The result is simplified in terms of build->domain. * * We first check if the constraint is an equality of the form * * e - d floor(e/d) = 0 * * i.e., * * e mod d = 0 * * If so, we convert it to * * (isl_ast_expr_op_eq, * (isl_ast_expr_op_zdiv_r, expr(e), expr(d)), expr(0)) */ static __isl_give isl_ast_expr *isl_ast_expr_from_constraint( __isl_take isl_constraint *constraint, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_aff *aff; isl_bool eq; aff = isl_constraint_get_aff(constraint); eq = isl_constraint_is_equality(constraint); isl_constraint_free(constraint); if (eq < 0) goto error; n = isl_aff_dim(aff, isl_dim_div); if (n < 0) aff = isl_aff_free(aff); if (eq && n > 0) for (i = 0; i < n; ++i) { isl_bool is_stride; is_stride = is_stride_constraint(aff, i); if (is_stride < 0) goto error; if (is_stride) return extract_stride_constraint(aff, i, build); } return isl_ast_expr_from_constraint_no_stride(eq, aff, build); error: isl_aff_free(aff); return NULL; } /* Are "set" and "bset" disjoint? */ static isl_bool is_disjoint(__isl_keep isl_set *set, __isl_keep isl_basic_set *bset) { isl_set *set2; isl_bool disjoint; set2 = isl_set_from_basic_set(isl_basic_set_copy(bset)); disjoint = isl_set_is_disjoint(set, set2); isl_set_free(set2); return disjoint; } /* Wrapper around isl_constraint_cmp_last_non_zero for use * as a callback to isl_constraint_list_sort. * If isl_constraint_cmp_last_non_zero cannot tell the constraints * apart, then use isl_constraint_plain_cmp instead. */ static int cmp_constraint(__isl_keep isl_constraint *a, __isl_keep isl_constraint *b, void *user) { int cmp; cmp = isl_constraint_cmp_last_non_zero(a, b); if (cmp != 0) return cmp; return isl_constraint_plain_cmp(a, b); } /* Construct an isl_ast_expr that evaluates the conditions defining "bset". * The result is simplified in terms of build->domain. * * If "bset" is empty (within the build domain), then return the expression "0". * * If "bset" is not bounded by any constraint, then we construct * the expression "1", i.e., "true". * * Otherwise, we sort the constraints, putting constraints that involve * integer divisions after those that do not, and construct an "and" * of the ast expressions of the individual constraints. * * Each constraint is added to the generated constraints of the build * after it has been converted to an AST expression so that it can be used * to simplify the following constraints. This may change the truth value * of subsequent constraints that do not satisfy the earlier constraints, * but this does not affect the outcome of the conjunction as it is * only true if all the conjuncts are true (no matter in what order * they are evaluated). In particular, the constraints that do not * involve integer divisions may serve to simplify some constraints * that do involve integer divisions. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset) { int i; isl_bool disjoint; isl_size n; isl_constraint *c; isl_constraint_list *list; isl_ast_expr *res; isl_set *set, *domain; domain = isl_ast_build_get_domain(build); disjoint = is_disjoint(domain, bset); isl_set_free(domain); if (disjoint < 0) { build = NULL; } else if (disjoint) { isl_ctx *ctx = isl_ast_build_get_ctx(build); isl_basic_set_free(bset); return isl_ast_expr_from_val(isl_val_zero(ctx)); } list = isl_basic_set_get_constraint_list(bset); isl_basic_set_free(bset); list = isl_constraint_list_sort(list, &cmp_constraint, NULL); n = isl_constraint_list_n_constraint(list); if (n < 0) build = NULL; if (n == 0) { isl_ctx *ctx = isl_constraint_list_get_ctx(list); isl_constraint_list_free(list); return isl_ast_expr_alloc_int_si(ctx, 1); } build = isl_ast_build_copy(build); c = isl_constraint_list_get_constraint(list, 0); bset = isl_basic_set_from_constraint(isl_constraint_copy(c)); set = isl_set_from_basic_set(bset); res = isl_ast_expr_from_constraint(c, build); build = isl_ast_build_restrict_generated(build, set); for (i = 1; i < n; ++i) { isl_ast_expr *expr; c = isl_constraint_list_get_constraint(list, i); bset = isl_basic_set_from_constraint(isl_constraint_copy(c)); set = isl_set_from_basic_set(bset); expr = isl_ast_expr_from_constraint(c, build); build = isl_ast_build_restrict_generated(build, set); res = isl_ast_expr_and(res, expr); } isl_constraint_list_free(list); isl_ast_build_free(build); return res; } /* Construct an isl_ast_expr that evaluates the conditions defining "set". * The result is simplified in terms of build->domain. * * If "set" is an (obviously) empty set, then return the expression "0". * * If there are multiple disjuncts in the description of the set, * then subsequent disjuncts are simplified in a context where * the previous disjuncts have been removed from build->domain. * In particular, constraints that ensure that there is no overlap * with these previous disjuncts, can be removed. * This is mostly useful for disjuncts that are only defined by * a single constraint (relative to the build domain) as the opposite * of that single constraint can then be removed from the other disjuncts. * In order not to increase the number of disjuncts in the build domain * after subtracting the previous disjuncts of "set", the simple hull * is computed after taking the difference with each of these disjuncts. * This means that constraints that prevent overlap with a union * of multiple previous disjuncts are not removed. * * "set" lives in the internal schedule space. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal( __isl_keep isl_ast_build *build, __isl_take isl_set *set) { int i; isl_size n; isl_basic_set *bset; isl_basic_set_list *list; isl_set *domain; isl_ast_expr *res; list = isl_set_get_basic_set_list(set); isl_set_free(set); n = isl_basic_set_list_n_basic_set(list); if (n < 0) build = NULL; if (n == 0) { isl_ctx *ctx = isl_ast_build_get_ctx(build); isl_basic_set_list_free(list); return isl_ast_expr_from_val(isl_val_zero(ctx)); } domain = isl_ast_build_get_domain(build); bset = isl_basic_set_list_get_basic_set(list, 0); set = isl_set_from_basic_set(isl_basic_set_copy(bset)); res = isl_ast_build_expr_from_basic_set(build, bset); for (i = 1; i < n; ++i) { isl_ast_expr *expr; isl_set *rest; rest = isl_set_subtract(isl_set_copy(domain), set); rest = isl_set_from_basic_set(isl_set_simple_hull(rest)); domain = isl_set_intersect(domain, rest); bset = isl_basic_set_list_get_basic_set(list, i); set = isl_set_from_basic_set(isl_basic_set_copy(bset)); bset = isl_basic_set_gist(bset, isl_set_simple_hull(isl_set_copy(domain))); expr = isl_ast_build_expr_from_basic_set(build, bset); res = ast_expr_or(res, expr); } isl_set_free(domain); isl_set_free(set); isl_basic_set_list_free(list); return res; } /* Construct an isl_ast_expr that evaluates the conditions defining "set". * The result is simplified in terms of build->domain. * * If "set" is an (obviously) empty set, then return the expression "0". * * "set" lives in the external schedule space. * * The internal AST expression generation assumes that there are * no unknown divs, so make sure an explicit representation is available. * Since the set comes from the outside, it may have constraints that * are redundant with respect to the build domain. Remove them first. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_set( __isl_keep isl_ast_build *build, __isl_take isl_set *set) { isl_bool needs_map; needs_map = isl_ast_build_need_schedule_map(build); if (needs_map < 0) { set = isl_set_free(set); } else if (needs_map) { isl_multi_aff *ma; ma = isl_ast_build_get_schedule_map_multi_aff(build); set = isl_set_preimage_multi_aff(set, ma); } set = isl_set_compute_divs(set); set = isl_ast_build_compute_gist(build, set); return isl_ast_build_expr_from_set_internal(build, set); } /* State of data about previous pieces in * isl_ast_build_expr_from_pw_aff_internal. * * isl_state_none: no data about previous pieces * isl_state_single: data about a single previous piece * isl_state_min: data represents minimum of several pieces * isl_state_max: data represents maximum of several pieces */ enum isl_from_pw_aff_state { isl_state_none, isl_state_single, isl_state_min, isl_state_max }; /* Internal date structure representing a single piece in the input of * isl_ast_build_expr_from_pw_aff_internal. * * If "state" is isl_state_none, then "set_list" and "aff_list" are not used. * If "state" is isl_state_single, then "set_list" and "aff_list" contain the * single previous subpiece. * If "state" is isl_state_min, then "set_list" and "aff_list" contain * a sequence of several previous subpieces that are equal to the minimum * of the entries in "aff_list" over the union of "set_list" * If "state" is isl_state_max, then "set_list" and "aff_list" contain * a sequence of several previous subpieces that are equal to the maximum * of the entries in "aff_list" over the union of "set_list" * * During the construction of the pieces, "set" is NULL. * After the construction, "set" is set to the union of the elements * in "set_list", at which point "set_list" is set to NULL. */ struct isl_from_pw_aff_piece { enum isl_from_pw_aff_state state; isl_set *set; isl_set_list *set_list; isl_aff_list *aff_list; }; /* Internal data structure for isl_ast_build_expr_from_pw_aff_internal. * * "build" specifies the domain against which the result is simplified. * "dom" is the domain of the entire isl_pw_aff. * * "n" is the number of pieces constructed already. * In particular, during the construction of the pieces, "n" points to * the piece that is being constructed. After the construction of the * pieces, "n" is set to the total number of pieces. * "max" is the total number of allocated entries. * "p" contains the individual pieces. */ struct isl_from_pw_aff_data { isl_ast_build *build; isl_set *dom; int n; int max; struct isl_from_pw_aff_piece *p; }; /* Initialize "data" based on "build" and "pa". */ static isl_stat isl_from_pw_aff_data_init(struct isl_from_pw_aff_data *data, __isl_keep isl_ast_build *build, __isl_keep isl_pw_aff *pa) { isl_size n; isl_ctx *ctx; ctx = isl_pw_aff_get_ctx(pa); n = isl_pw_aff_n_piece(pa); if (n < 0) return isl_stat_error; if (n == 0) isl_die(ctx, isl_error_invalid, "cannot handle void expression", return isl_stat_error); data->max = n; data->p = isl_calloc_array(ctx, struct isl_from_pw_aff_piece, n); if (!data->p) return isl_stat_error; data->build = build; data->dom = isl_pw_aff_domain(isl_pw_aff_copy(pa)); data->n = 0; return isl_stat_ok; } /* Free all memory allocated for "data". */ static void isl_from_pw_aff_data_clear(struct isl_from_pw_aff_data *data) { int i; isl_set_free(data->dom); if (!data->p) return; for (i = 0; i < data->max; ++i) { isl_set_free(data->p[i].set); isl_set_list_free(data->p[i].set_list); isl_aff_list_free(data->p[i].aff_list); } free(data->p); } /* Initialize the current entry of "data" to an unused piece. */ static void set_none(struct isl_from_pw_aff_data *data) { data->p[data->n].state = isl_state_none; data->p[data->n].set_list = NULL; data->p[data->n].aff_list = NULL; } /* Store "set" and "aff" in the current entry of "data" as a single subpiece. */ static void set_single(struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff) { data->p[data->n].state = isl_state_single; data->p[data->n].set_list = isl_set_list_from_set(set); data->p[data->n].aff_list = isl_aff_list_from_aff(aff); } /* Extend the current entry of "data" with "set" and "aff" * as a minimum expression. */ static isl_stat extend_min(struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff) { int n = data->n; data->p[n].state = isl_state_min; data->p[n].set_list = isl_set_list_add(data->p[n].set_list, set); data->p[n].aff_list = isl_aff_list_add(data->p[n].aff_list, aff); if (!data->p[n].set_list || !data->p[n].aff_list) return isl_stat_error; return isl_stat_ok; } /* Extend the current entry of "data" with "set" and "aff" * as a maximum expression. */ static isl_stat extend_max(struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff) { int n = data->n; data->p[n].state = isl_state_max; data->p[n].set_list = isl_set_list_add(data->p[n].set_list, set); data->p[n].aff_list = isl_aff_list_add(data->p[n].aff_list, aff); if (!data->p[n].set_list || !data->p[n].aff_list) return isl_stat_error; return isl_stat_ok; } /* Extend the domain of the current entry of "data", which is assumed * to contain a single subpiece, with "set". If "replace" is set, * then also replace the affine function by "aff". Otherwise, * simply free "aff". */ static isl_stat extend_domain(struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff, int replace) { int n = data->n; isl_set *set_n; set_n = isl_set_list_get_set(data->p[n].set_list, 0); set_n = isl_set_union(set_n, set); data->p[n].set_list = isl_set_list_set_set(data->p[n].set_list, 0, set_n); if (replace) data->p[n].aff_list = isl_aff_list_set_aff(data->p[n].aff_list, 0, aff); else isl_aff_free(aff); if (!data->p[n].set_list || !data->p[n].aff_list) return isl_stat_error; return isl_stat_ok; } /* Construct an isl_ast_expr from "list" within "build". * If "state" is isl_state_single, then "list" contains a single entry and * an isl_ast_expr is constructed for that entry. * Otherwise a min or max expression is constructed from "list" * depending on "state". */ static __isl_give isl_ast_expr *ast_expr_from_aff_list( __isl_take isl_aff_list *list, enum isl_from_pw_aff_state state, __isl_keep isl_ast_build *build) { int i; isl_size n; isl_aff *aff; isl_ast_expr *expr = NULL; enum isl_ast_expr_op_type op_type; if (state == isl_state_single) { aff = isl_aff_list_get_aff(list, 0); isl_aff_list_free(list); return isl_ast_expr_from_aff(aff, build); } n = isl_aff_list_n_aff(list); if (n < 0) goto error; op_type = state == isl_state_min ? isl_ast_expr_op_min : isl_ast_expr_op_max; expr = isl_ast_expr_alloc_op(isl_ast_build_get_ctx(build), op_type, n); for (i = 0; i < n; ++i) { isl_ast_expr *expr_i; aff = isl_aff_list_get_aff(list, i); expr_i = isl_ast_expr_from_aff(aff, build); expr = isl_ast_expr_op_add_arg(expr, expr_i); } isl_aff_list_free(list); return expr; error: isl_aff_list_free(list); isl_ast_expr_free(expr); return NULL; } /* Extend the list of expressions in "next" to take into account * the piece at position "pos" in "data", allowing for a further extension * for the next piece(s). * In particular, "next" is extended with a select operation that selects * an isl_ast_expr corresponding to data->aff_list on data->set and * to an expression that will be filled in by later calls. * Return a pointer to the arguments of this select operation. * Afterwards, the state of "data" is set to isl_state_none. * * The constraints of data->set are added to the generated * constraints of the build such that they can be exploited to simplify * the AST expression constructed from data->aff_list. */ static isl_ast_expr_list **add_intermediate_piece( struct isl_from_pw_aff_data *data, int pos, isl_ast_expr_list **next) { isl_ctx *ctx; isl_ast_build *build; isl_ast_expr *ternary, *arg; isl_set *set, *gist; set = data->p[pos].set; data->p[pos].set = NULL; ctx = isl_ast_build_get_ctx(data->build); ternary = isl_ast_expr_alloc_op(ctx, isl_ast_expr_op_select, 3); gist = isl_set_gist(isl_set_copy(set), isl_set_copy(data->dom)); arg = isl_ast_build_expr_from_set_internal(data->build, gist); ternary = isl_ast_expr_op_add_arg(ternary, arg); build = isl_ast_build_copy(data->build); build = isl_ast_build_restrict_generated(build, set); arg = ast_expr_from_aff_list(data->p[pos].aff_list, data->p[pos].state, build); data->p[pos].aff_list = NULL; isl_ast_build_free(build); ternary = isl_ast_expr_op_add_arg(ternary, arg); data->p[pos].state = isl_state_none; if (!ternary) return NULL; *next = isl_ast_expr_list_add(*next, ternary); return &ternary->u.op.args; } /* Extend the list of expressions in "next" to take into account * the final piece, located at position "pos" in "data". * In particular, "next" is extended with an expression * to evaluate data->aff_list and the domain is ignored. * Return isl_stat_ok on success and isl_stat_error on failure. * * The constraints of data->set are however added to the generated * constraints of the build such that they can be exploited to simplify * the AST expression constructed from data->aff_list. */ static isl_stat add_last_piece(struct isl_from_pw_aff_data *data, int pos, isl_ast_expr_list **next) { isl_ast_build *build; isl_ast_expr *last; if (data->p[pos].state == isl_state_none) isl_die(isl_ast_build_get_ctx(data->build), isl_error_invalid, "cannot handle void expression", return isl_stat_error); build = isl_ast_build_copy(data->build); build = isl_ast_build_restrict_generated(build, data->p[pos].set); data->p[pos].set = NULL; last = ast_expr_from_aff_list(data->p[pos].aff_list, data->p[pos].state, build); *next = isl_ast_expr_list_add(*next, last); data->p[pos].aff_list = NULL; isl_ast_build_free(build); data->p[pos].state = isl_state_none; if (!*next) return isl_stat_error; return isl_stat_ok; } /* Return -1 if the piece "p1" should be sorted before "p2" * and 1 if it should be sorted after "p2". * Return 0 if they do not need to be sorted in a specific order. * * Pieces are sorted according to the number of disjuncts * in their domains. */ static int sort_pieces_cmp(const void *p1, const void *p2, void *arg) { const struct isl_from_pw_aff_piece *piece1 = p1; const struct isl_from_pw_aff_piece *piece2 = p2; isl_size n1, n2; n1 = isl_set_n_basic_set(piece1->set); n2 = isl_set_n_basic_set(piece2->set); return n1 - n2; } /* Construct an isl_ast_expr from the pieces in "data". * Return the result or NULL on failure. * * When this function is called, data->n points to the current piece. * If this is an effective piece, then first increment data->n such * that data->n contains the number of pieces. * The "set_list" fields are subsequently replaced by the corresponding * "set" fields, after which the pieces are sorted according to * the number of disjuncts in these "set" fields. * * Construct intermediate AST expressions for the initial pieces and * finish off with the final pieces. * * Any piece that is not the very first is added to the list of arguments * of the previously constructed piece. * In order not to have to special case the first piece, * an extra list is created to hold the final result. */ static isl_ast_expr *build_pieces(struct isl_from_pw_aff_data *data) { int i; isl_ctx *ctx; isl_ast_expr_list *res_list; isl_ast_expr_list **next = &res_list; isl_ast_expr *res; if (data->p[data->n].state != isl_state_none) data->n++; ctx = isl_ast_build_get_ctx(data->build); if (data->n == 0) isl_die(ctx, isl_error_invalid, "cannot handle void expression", return NULL); for (i = 0; i < data->n; ++i) { data->p[i].set = isl_set_list_union(data->p[i].set_list); if (data->p[i].state != isl_state_single) data->p[i].set = isl_set_coalesce(data->p[i].set); data->p[i].set_list = NULL; } if (isl_sort(data->p, data->n, sizeof(data->p[0]), &sort_pieces_cmp, NULL) < 0) return NULL; res_list = isl_ast_expr_list_alloc(ctx, 1); if (!res_list) return NULL; for (i = 0; i + 1 < data->n; ++i) { next = add_intermediate_piece(data, i, next); if (!next) goto error; } if (add_last_piece(data, data->n - 1, next) < 0) goto error; res = isl_ast_expr_list_get_at(res_list, 0); isl_ast_expr_list_free(res_list); return res; error: isl_ast_expr_list_free(res_list); return NULL; } /* Is the domain of the current entry of "data", which is assumed * to contain a single subpiece, a subset of "set"? */ static isl_bool single_is_subset(struct isl_from_pw_aff_data *data, __isl_keep isl_set *set) { isl_bool subset; isl_set *set_n; set_n = isl_set_list_get_set(data->p[data->n].set_list, 0); subset = isl_set_is_subset(set_n, set); isl_set_free(set_n); return subset; } /* Is "aff" a rational expression, i.e., does it have a denominator * different from one? */ static isl_bool aff_is_rational(__isl_keep isl_aff *aff) { isl_bool rational; isl_val *den; den = isl_aff_get_denominator_val(aff); rational = isl_bool_not(isl_val_is_one(den)); isl_val_free(den); return rational; } /* Does "list" consist of a single rational affine expression? */ static isl_bool is_single_rational_aff(__isl_keep isl_aff_list *list) { isl_size n; isl_bool rational; isl_aff *aff; n = isl_aff_list_n_aff(list); if (n < 0) return isl_bool_error; if (n != 1) return isl_bool_false; aff = isl_aff_list_get_aff(list, 0); rational = aff_is_rational(aff); isl_aff_free(aff); return rational; } /* Can the list of subpieces in the last piece of "data" be extended with * "set" and "aff" based on "test"? * In particular, is it the case for each entry (set_i, aff_i) that * * test(aff, aff_i) holds on set_i, and * test(aff_i, aff) holds on set? * * "test" returns the set of elements where the tests holds, meaning * that test(aff_i, aff) holds on set if set is a subset of test(aff_i, aff). * * This function is used to detect min/max expressions. * If the ast_build_detect_min_max option is turned off, then * do not even try and perform any detection and return false instead. * * Rational affine expressions are not considered for min/max expressions * since the combined expression will be defined on the union of the domains, * while a rational expression may only yield integer values * on its own definition domain. */ static isl_bool extends(struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff, __isl_give isl_basic_set *(*test)(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2)) { int i; isl_size n; isl_bool is_rational; isl_ctx *ctx; isl_set *dom; is_rational = aff_is_rational(aff); if (is_rational >= 0 && !is_rational) is_rational = is_single_rational_aff(data->p[data->n].aff_list); if (is_rational < 0 || is_rational) return isl_bool_not(is_rational); ctx = isl_ast_build_get_ctx(data->build); if (!isl_options_get_ast_build_detect_min_max(ctx)) return isl_bool_false; n = isl_set_list_n_set(data->p[data->n].set_list); if (n < 0) return isl_bool_error; dom = isl_ast_build_get_domain(data->build); set = isl_set_intersect(dom, isl_set_copy(set)); for (i = 0; i < n ; ++i) { isl_aff *aff_i; isl_set *valid; isl_set *dom, *required; isl_bool is_valid; aff_i = isl_aff_list_get_aff(data->p[data->n].aff_list, i); valid = isl_set_from_basic_set(test(isl_aff_copy(aff), aff_i)); required = isl_set_list_get_set(data->p[data->n].set_list, i); dom = isl_ast_build_get_domain(data->build); required = isl_set_intersect(dom, required); is_valid = isl_set_is_subset(required, valid); isl_set_free(required); isl_set_free(valid); if (is_valid < 0 || !is_valid) { isl_set_free(set); return is_valid; } aff_i = isl_aff_list_get_aff(data->p[data->n].aff_list, i); valid = isl_set_from_basic_set(test(aff_i, isl_aff_copy(aff))); is_valid = isl_set_is_subset(set, valid); isl_set_free(valid); if (is_valid < 0 || !is_valid) { isl_set_free(set); return is_valid; } } isl_set_free(set); return isl_bool_true; } /* Can the list of pieces in "data" be extended with "set" and "aff" * to form/preserve a minimum expression? * In particular, is it the case for each entry (set_i, aff_i) that * * aff >= aff_i on set_i, and * aff_i >= aff on set? */ static isl_bool extends_min(struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff) { return extends(data, set, aff, &isl_aff_ge_basic_set); } /* Can the list of pieces in "data" be extended with "set" and "aff" * to form/preserve a maximum expression? * In particular, is it the case for each entry (set_i, aff_i) that * * aff <= aff_i on set_i, and * aff_i <= aff on set? */ static isl_bool extends_max(struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff) { return extends(data, set, aff, &isl_aff_le_basic_set); } /* This function is called during the construction of an isl_ast_expr * that evaluates an isl_pw_aff. * If the last piece of "data" contains a single subpiece and * if its affine function is equal to "aff" on a part of the domain * that includes either "set" or the domain of that single subpiece, * then extend the domain of that single subpiece with "set". * If it was the original domain of the single subpiece where * the two affine functions are equal, then also replace * the affine function of the single subpiece by "aff". * If the last piece of "data" contains either a single subpiece * or a minimum, then check if this minimum expression can be extended * with (set, aff). * If so, extend the sequence and return. * Perform the same operation for maximum expressions. * If no such extension can be performed, then move to the next piece * in "data" (if the current piece contains any data), and then store * the current subpiece in the current piece of "data" for later handling. */ static isl_stat ast_expr_from_pw_aff(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { struct isl_from_pw_aff_data *data = user; isl_bool test; enum isl_from_pw_aff_state state; state = data->p[data->n].state; if (state == isl_state_single) { isl_aff *aff0; isl_set *eq; isl_bool subset1, subset2 = isl_bool_false; aff0 = isl_aff_list_get_aff(data->p[data->n].aff_list, 0); eq = isl_aff_eq_set(isl_aff_copy(aff), aff0); subset1 = isl_set_is_subset(set, eq); if (subset1 >= 0 && !subset1) subset2 = single_is_subset(data, eq); isl_set_free(eq); if (subset1 < 0 || subset2 < 0) goto error; if (subset1) return extend_domain(data, set, aff, 0); if (subset2) return extend_domain(data, set, aff, 1); } if (state == isl_state_single || state == isl_state_min) { test = extends_min(data, set, aff); if (test < 0) goto error; if (test) return extend_min(data, set, aff); } if (state == isl_state_single || state == isl_state_max) { test = extends_max(data, set, aff); if (test < 0) goto error; if (test) return extend_max(data, set, aff); } if (state != isl_state_none) data->n++; set_single(data, set, aff); return isl_stat_ok; error: isl_set_free(set); isl_aff_free(aff); return isl_stat_error; } /* Construct an isl_ast_expr that evaluates "pa". * The result is simplified in terms of build->domain. * * The domain of "pa" lives in the internal schedule space. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff_internal( __isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa) { struct isl_from_pw_aff_data data = { NULL }; isl_ast_expr *res = NULL; pa = isl_ast_build_compute_gist_pw_aff(build, pa); pa = isl_pw_aff_coalesce(pa); if (!pa) return NULL; if (isl_from_pw_aff_data_init(&data, build, pa) < 0) goto error; set_none(&data); if (isl_pw_aff_foreach_piece(pa, &ast_expr_from_pw_aff, &data) >= 0) res = build_pieces(&data); isl_pw_aff_free(pa); isl_from_pw_aff_data_clear(&data); return res; error: isl_pw_aff_free(pa); isl_from_pw_aff_data_clear(&data); return NULL; } /* Construct an isl_ast_expr that evaluates "pa". * The result is simplified in terms of build->domain. * * The domain of "pa" lives in the external schedule space. */ __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa) { isl_ast_expr *expr; isl_bool needs_map; needs_map = isl_ast_build_need_schedule_map(build); if (needs_map < 0) { pa = isl_pw_aff_free(pa); } else if (needs_map) { isl_multi_aff *ma; ma = isl_ast_build_get_schedule_map_multi_aff(build); pa = isl_pw_aff_pullback_multi_aff(pa, ma); } expr = isl_ast_build_expr_from_pw_aff_internal(build, pa); return expr; } /* Set the ids of the input dimensions of "mpa" to the iterator ids * of "build". * * The domain of "mpa" is assumed to live in the internal schedule domain. */ static __isl_give isl_multi_pw_aff *set_iterator_names( __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) { int i; isl_size n; n = isl_multi_pw_aff_dim(mpa, isl_dim_in); if (n < 0) return isl_multi_pw_aff_free(mpa); for (i = 0; i < n; ++i) { isl_id *id; id = isl_ast_build_get_iterator_id(build, i); mpa = isl_multi_pw_aff_set_dim_id(mpa, isl_dim_in, i, id); } return mpa; } /* Construct an isl_ast_expr of type "type" with as first argument "arg0" and * the remaining arguments derived from "mpa". * That is, construct a call or access expression that calls/accesses "arg0" * with arguments/indices specified by "mpa". */ static __isl_give isl_ast_expr *isl_ast_build_with_arguments( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_ast_expr *arg0, __isl_take isl_multi_pw_aff *mpa) { int i; isl_size n; isl_ctx *ctx; isl_ast_expr *expr; ctx = isl_ast_build_get_ctx(build); n = isl_multi_pw_aff_dim(mpa, isl_dim_out); expr = n >= 0 ? isl_ast_expr_alloc_op(ctx, type, 1 + n) : NULL; expr = isl_ast_expr_op_add_arg(expr, arg0); for (i = 0; i < n; ++i) { isl_pw_aff *pa; isl_ast_expr *arg; pa = isl_multi_pw_aff_get_pw_aff(mpa, i); arg = isl_ast_build_expr_from_pw_aff_internal(build, pa); expr = isl_ast_expr_op_add_arg(expr, arg); } isl_multi_pw_aff_free(mpa); return expr; } static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_multi_pw_aff *mpa); /* Construct an isl_ast_expr that accesses the member specified by "mpa". * The range of "mpa" is assumed to be wrapped relation. * The domain of this wrapped relation specifies the structure being * accessed, while the range of this wrapped relation spacifies the * member of the structure being accessed. * * The domain of "mpa" is assumed to live in the internal schedule domain. */ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_member( __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) { isl_id *id; isl_multi_pw_aff *domain; isl_ast_expr *domain_expr, *expr; enum isl_ast_expr_op_type type = isl_ast_expr_op_access; domain = isl_multi_pw_aff_copy(mpa); domain = isl_multi_pw_aff_range_factor_domain(domain); domain_expr = isl_ast_build_from_multi_pw_aff_internal(build, type, domain); mpa = isl_multi_pw_aff_range_factor_range(mpa); if (!isl_multi_pw_aff_has_tuple_id(mpa, isl_dim_out)) isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, "missing field name", goto error); id = isl_multi_pw_aff_get_tuple_id(mpa, isl_dim_out); expr = isl_ast_expr_from_id(id); expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_member, domain_expr, expr); return isl_ast_build_with_arguments(build, type, expr, mpa); error: isl_multi_pw_aff_free(mpa); return NULL; } /* Construct an isl_ast_expr of type "type" that calls or accesses * the element specified by "mpa". * The first argument is obtained from the output tuple name. * The remaining arguments are given by the piecewise affine expressions. * * If the range of "mpa" is a mapped relation, then we assume it * represents an access to a member of a structure. * * The domain of "mpa" is assumed to live in the internal schedule domain. */ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_multi_pw_aff *mpa) { isl_ctx *ctx; isl_id *id; isl_ast_expr *expr; if (!mpa) goto error; if (type == isl_ast_expr_op_access && isl_multi_pw_aff_range_is_wrapping(mpa)) return isl_ast_build_from_multi_pw_aff_member(build, mpa); mpa = set_iterator_names(build, mpa); if (!build || !mpa) goto error; ctx = isl_ast_build_get_ctx(build); if (isl_multi_pw_aff_has_tuple_id(mpa, isl_dim_out)) id = isl_multi_pw_aff_get_tuple_id(mpa, isl_dim_out); else id = isl_id_alloc(ctx, "", NULL); expr = isl_ast_expr_from_id(id); return isl_ast_build_with_arguments(build, type, expr, mpa); error: isl_multi_pw_aff_free(mpa); return NULL; } /* Construct an isl_ast_expr of type "type" that calls or accesses * the element specified by "pma". * The first argument is obtained from the output tuple name. * The remaining arguments are given by the piecewise affine expressions. * * The domain of "pma" is assumed to live in the internal schedule domain. */ static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff_internal( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_pw_multi_aff *pma) { isl_multi_pw_aff *mpa; mpa = isl_multi_pw_aff_from_pw_multi_aff(pma); return isl_ast_build_from_multi_pw_aff_internal(build, type, mpa); } /* Construct an isl_ast_expr of type "type" that calls or accesses * the element specified by "mpa". * The first argument is obtained from the output tuple name. * The remaining arguments are given by the piecewise affine expressions. * * The domain of "mpa" is assumed to live in the external schedule domain. */ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_multi_pw_aff *mpa) { isl_bool is_domain; isl_bool needs_map; isl_ast_expr *expr; isl_space *space_build, *space_mpa; space_build = isl_ast_build_get_space(build, 0); space_mpa = isl_multi_pw_aff_get_space(mpa); is_domain = isl_space_tuple_is_equal(space_build, isl_dim_set, space_mpa, isl_dim_in); isl_space_free(space_build); isl_space_free(space_mpa); if (is_domain < 0) goto error; if (!is_domain) isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, "spaces don't match", goto error); needs_map = isl_ast_build_need_schedule_map(build); if (needs_map < 0) goto error; if (needs_map) { isl_multi_aff *ma; ma = isl_ast_build_get_schedule_map_multi_aff(build); mpa = isl_multi_pw_aff_pullback_multi_aff(mpa, ma); } expr = isl_ast_build_from_multi_pw_aff_internal(build, type, mpa); return expr; error: isl_multi_pw_aff_free(mpa); return NULL; } /* Construct an isl_ast_expr that calls the domain element specified by "mpa". * The name of the function is obtained from the output tuple name. * The arguments are given by the piecewise affine expressions. * * The domain of "mpa" is assumed to live in the external schedule domain. */ __isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) { return isl_ast_build_from_multi_pw_aff(build, isl_ast_expr_op_call, mpa); } /* Construct an isl_ast_expr that accesses the array element specified by "mpa". * The name of the array is obtained from the output tuple name. * The index expressions are given by the piecewise affine expressions. * * The domain of "mpa" is assumed to live in the external schedule domain. */ __isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa) { return isl_ast_build_from_multi_pw_aff(build, isl_ast_expr_op_access, mpa); } /* Construct an isl_ast_expr of type "type" that calls or accesses * the element specified by "pma". * The first argument is obtained from the output tuple name. * The remaining arguments are given by the piecewise affine expressions. * * The domain of "pma" is assumed to live in the external schedule domain. */ static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff( __isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_pw_multi_aff *pma) { isl_multi_pw_aff *mpa; mpa = isl_multi_pw_aff_from_pw_multi_aff(pma); return isl_ast_build_from_multi_pw_aff(build, type, mpa); } /* Construct an isl_ast_expr that calls the domain element specified by "pma". * The name of the function is obtained from the output tuple name. * The arguments are given by the piecewise affine expressions. * * The domain of "pma" is assumed to live in the external schedule domain. */ __isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) { return isl_ast_build_from_pw_multi_aff(build, isl_ast_expr_op_call, pma); } /* Construct an isl_ast_expr that accesses the array element specified by "pma". * The name of the array is obtained from the output tuple name. * The index expressions are given by the piecewise affine expressions. * * The domain of "pma" is assumed to live in the external schedule domain. */ __isl_give isl_ast_expr *isl_ast_build_access_from_pw_multi_aff( __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma) { return isl_ast_build_from_pw_multi_aff(build, isl_ast_expr_op_access, pma); } /* Construct an isl_ast_expr that calls the domain element * specified by "executed". * * "executed" is assumed to be single-valued, with a domain that lives * in the internal schedule space. */ __isl_give isl_ast_node *isl_ast_build_call_from_executed( __isl_keep isl_ast_build *build, __isl_take isl_map *executed) { isl_pw_multi_aff *iteration; isl_ast_expr *expr; iteration = isl_pw_multi_aff_from_map(executed); iteration = isl_ast_build_compute_gist_pw_multi_aff(build, iteration); iteration = isl_pw_multi_aff_intersect_domain(iteration, isl_ast_build_get_domain(build)); expr = isl_ast_build_from_pw_multi_aff_internal(build, isl_ast_expr_op_call, iteration); return isl_ast_node_alloc_user(expr); } isl-0.28/isl_local.h0000664000175000017500000000204215072740040013431 0ustar00skimoskimo#ifndef ISL_LOCAL_H #define ISL_LOCAL_H #include #include typedef isl_mat isl_local; __isl_give isl_local *isl_local_copy(__isl_keep isl_local *local); __isl_null isl_local *isl_local_free(__isl_take isl_local *local); isl_bool isl_local_div_is_marked_unknown(__isl_keep isl_local *local, int pos); isl_bool isl_local_div_is_known(__isl_keep isl_local *local, int pos); isl_bool isl_local_divs_known(__isl_keep isl_local *local); int isl_local_cmp(__isl_keep isl_local *local1, __isl_keep isl_local *local2); isl_size isl_local_var_offset(__isl_keep isl_local *local, enum isl_dim_type type); __isl_give isl_local *isl_local_reorder(__isl_take isl_local *local, __isl_take isl_reordering *r); __isl_give isl_local *isl_local_move_vars(__isl_take isl_local *local, unsigned dst_pos, unsigned src_pos, unsigned n); isl_bool isl_local_involves_vars(__isl_keep isl_local *local, unsigned first, unsigned n); __isl_give isl_vec *isl_local_extend_point_vec(__isl_keep isl_local *local, __isl_take isl_vec *v); #endif isl-0.28/isl_ast.c0000664000175000017500000031151215072740040013126 0ustar00skimoskimo/* * Copyright 2012-2013 Ecole Normale Superieure * Copyright 2022 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include #include #include #include #include #undef EL_BASE #define EL_BASE ast_expr #include #undef EL_BASE #define EL_BASE ast_node #include isl_ctx *isl_ast_print_options_get_ctx( __isl_keep isl_ast_print_options *options) { return options ? options->ctx : NULL; } __isl_give isl_ast_print_options *isl_ast_print_options_alloc(isl_ctx *ctx) { isl_ast_print_options *options; options = isl_calloc_type(ctx, isl_ast_print_options); if (!options) return NULL; options->ctx = ctx; isl_ctx_ref(ctx); options->ref = 1; return options; } __isl_give isl_ast_print_options *isl_ast_print_options_dup( __isl_keep isl_ast_print_options *options) { isl_ctx *ctx; isl_ast_print_options *dup; if (!options) return NULL; ctx = isl_ast_print_options_get_ctx(options); dup = isl_ast_print_options_alloc(ctx); if (!dup) return NULL; dup->print_for = options->print_for; dup->print_for_user = options->print_for_user; dup->print_user = options->print_user; dup->print_user_user = options->print_user_user; return dup; } __isl_give isl_ast_print_options *isl_ast_print_options_cow( __isl_take isl_ast_print_options *options) { if (!options) return NULL; if (options->ref == 1) return options; options->ref--; return isl_ast_print_options_dup(options); } __isl_give isl_ast_print_options *isl_ast_print_options_copy( __isl_keep isl_ast_print_options *options) { if (!options) return NULL; options->ref++; return options; } __isl_null isl_ast_print_options *isl_ast_print_options_free( __isl_take isl_ast_print_options *options) { if (!options) return NULL; if (--options->ref > 0) return NULL; isl_ctx_deref(options->ctx); free(options); return NULL; } /* Set the print_user callback of "options" to "print_user". * * If this callback is set, then it is used to print user nodes in the AST. * Otherwise, the expression associated to the user node is printed. */ __isl_give isl_ast_print_options *isl_ast_print_options_set_print_user( __isl_take isl_ast_print_options *options, __isl_give isl_printer *(*print_user)(__isl_take isl_printer *p, __isl_take isl_ast_print_options *options, __isl_keep isl_ast_node *node, void *user), void *user) { options = isl_ast_print_options_cow(options); if (!options) return NULL; options->print_user = print_user; options->print_user_user = user; return options; } /* Set the print_for callback of "options" to "print_for". * * If this callback is set, then it used to print for nodes in the AST. */ __isl_give isl_ast_print_options *isl_ast_print_options_set_print_for( __isl_take isl_ast_print_options *options, __isl_give isl_printer *(*print_for)(__isl_take isl_printer *p, __isl_take isl_ast_print_options *options, __isl_keep isl_ast_node *node, void *user), void *user) { options = isl_ast_print_options_cow(options); if (!options) return NULL; options->print_for = print_for; options->print_for_user = user; return options; } /* Create a new operation expression of operation type "op", * with arguments "args". */ static __isl_give isl_ast_expr *alloc_op(enum isl_ast_expr_op_type op, __isl_take isl_ast_expr_list *args) { isl_ctx *ctx; isl_ast_expr *expr; if (!args) return NULL; ctx = isl_ast_expr_list_get_ctx(args); expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) goto error; expr->ctx = ctx; isl_ctx_ref(ctx); expr->ref = 1; expr->type = isl_ast_expr_op; expr->u.op.op = op; expr->u.op.args = args; return expr; error: isl_ast_expr_list_free(args); return NULL; } /* Create a new operation expression of operation type "op", * which will end up having "n_arg" arguments. * The caller still needs to add those arguments. */ __isl_give isl_ast_expr *isl_ast_expr_alloc_op(isl_ctx *ctx, enum isl_ast_expr_op_type op, int n_arg) { isl_ast_expr_list *args; args = isl_ast_expr_list_alloc(ctx, n_arg); return alloc_op(op, args); } __isl_give isl_ast_expr *isl_ast_expr_copy(__isl_keep isl_ast_expr *expr) { if (!expr) return NULL; expr->ref++; return expr; } __isl_give isl_ast_expr *isl_ast_expr_dup(__isl_keep isl_ast_expr *expr) { isl_ast_expr *dup; if (!expr) return NULL; switch (expr->type) { case isl_ast_expr_int: dup = isl_ast_expr_from_val(isl_val_copy(expr->u.v)); break; case isl_ast_expr_id: dup = isl_ast_expr_from_id(isl_id_copy(expr->u.id)); break; case isl_ast_expr_op: dup = alloc_op(expr->u.op.op, isl_ast_expr_list_copy(expr->u.op.args)); break; case isl_ast_expr_error: dup = NULL; } if (!dup) return NULL; return dup; } __isl_give isl_ast_expr *isl_ast_expr_cow(__isl_take isl_ast_expr *expr) { if (!expr) return NULL; if (expr->ref == 1) return expr; expr->ref--; return isl_ast_expr_dup(expr); } __isl_null isl_ast_expr *isl_ast_expr_free(__isl_take isl_ast_expr *expr) { if (!expr) return NULL; if (--expr->ref > 0) return NULL; isl_ctx_deref(expr->ctx); switch (expr->type) { case isl_ast_expr_int: isl_val_free(expr->u.v); break; case isl_ast_expr_id: isl_id_free(expr->u.id); break; case isl_ast_expr_op: isl_ast_expr_list_free(expr->u.op.args); break; case isl_ast_expr_error: break; } free(expr); return NULL; } isl_ctx *isl_ast_expr_get_ctx(__isl_keep isl_ast_expr *expr) { return expr ? expr->ctx : NULL; } enum isl_ast_expr_type isl_ast_expr_get_type(__isl_keep isl_ast_expr *expr) { return expr ? expr->type : isl_ast_expr_error; } /* Return the integer value represented by "expr". */ __isl_give isl_val *isl_ast_expr_int_get_val(__isl_keep isl_ast_expr *expr) { if (!expr) return NULL; if (expr->type != isl_ast_expr_int) isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, "expression not an int", return NULL); return isl_val_copy(expr->u.v); } /* This is an alternative name for the function above. */ __isl_give isl_val *isl_ast_expr_get_val(__isl_keep isl_ast_expr *expr) { return isl_ast_expr_int_get_val(expr); } __isl_give isl_id *isl_ast_expr_id_get_id(__isl_keep isl_ast_expr *expr) { if (!expr) return NULL; if (expr->type != isl_ast_expr_id) isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, "expression not an identifier", return NULL); return isl_id_copy(expr->u.id); } /* This is an alternative name for the function above. */ __isl_give isl_id *isl_ast_expr_get_id(__isl_keep isl_ast_expr *expr) { return isl_ast_expr_id_get_id(expr); } /* Check that "expr" is of type isl_ast_expr_op. */ static isl_stat isl_ast_expr_check_op(__isl_keep isl_ast_expr *expr) { if (!expr) return isl_stat_error; if (expr->type != isl_ast_expr_op) isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, "expression not an operation", return isl_stat_error); return isl_stat_ok; } /* Return the type of operation represented by "expr". */ enum isl_ast_expr_op_type isl_ast_expr_op_get_type( __isl_keep isl_ast_expr *expr) { if (isl_ast_expr_check_op(expr) < 0) return isl_ast_expr_op_error; return expr->u.op.op; } /* This is an alternative name for the function above. */ enum isl_ast_expr_op_type isl_ast_expr_get_op_type( __isl_keep isl_ast_expr *expr) { return isl_ast_expr_op_get_type(expr); } /* Return the number of arguments of the operation represented by "expr". */ isl_size isl_ast_expr_op_get_n_arg(__isl_keep isl_ast_expr *expr) { if (isl_ast_expr_check_op(expr) < 0) return isl_size_error; return isl_ast_expr_list_size(expr->u.op.args); } /* This is an alternative name for the function above. */ isl_size isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr) { return isl_ast_expr_op_get_n_arg(expr); } /* Return the argument at position "pos" of the operation represented by "expr". */ __isl_give isl_ast_expr *isl_ast_expr_op_get_arg(__isl_keep isl_ast_expr *expr, int pos) { if (isl_ast_expr_check_op(expr) < 0) return NULL; return isl_ast_expr_list_get_at(expr->u.op.args, pos); } /* This is an alternative name for the function above. */ __isl_give isl_ast_expr *isl_ast_expr_get_op_arg(__isl_keep isl_ast_expr *expr, int pos) { return isl_ast_expr_op_get_arg(expr, pos); } /* Return a copy of the arguments of the operation represented by "expr". */ static __isl_give isl_ast_expr_list *isl_ast_expr_op_get_args( __isl_keep isl_ast_expr *expr) { if (isl_ast_expr_check_op(expr) < 0) return NULL; return isl_ast_expr_list_copy(expr->u.op.args); } /* Return the arguments of the operation expression "expr". * This may be either a copy or the arguments themselves * if there is only one reference to "expr". * This allows the arguments to be modified inplace * if both "expr" and its arguments have only a single reference. * The caller is not allowed to modify "expr" between this call and * the subsequent call to isl_ast_expr_op_restore_args. * The only exception is that isl_ast_expr_free can be called instead. */ static __isl_give isl_ast_expr_list *isl_ast_expr_op_take_args( __isl_keep isl_ast_expr *expr) { isl_ast_expr_list *args; if (isl_ast_expr_check_op(expr) < 0) return NULL; if (expr->ref != 1) return isl_ast_expr_op_get_args(expr); args = expr->u.op.args; expr->u.op.args = NULL; return args; } /* Set the arguments of the operation expression "expr" to "args", * where the arguments of "args" may be missing * due to a preceding call to isl_ast_expr_op_take_args. * However, in this case, "expr" only has a single reference and * then the call to isl_ast_expr_cow has no effect. */ static __isl_give isl_ast_expr *isl_ast_expr_op_restore_args( __isl_take isl_ast_expr *expr, __isl_take isl_ast_expr_list *args) { if (isl_ast_expr_check_op(expr) < 0 || !args) goto error; if (expr->u.op.args == args) { isl_ast_expr_list_free(args); return expr; } expr = isl_ast_expr_cow(expr); if (!expr) goto error; isl_ast_expr_list_free(expr->u.op.args); expr->u.op.args = args; return expr; error: isl_ast_expr_free(expr); isl_ast_expr_list_free(args); return NULL; } /* Add "arg" to the arguments of the operation expression "expr". */ __isl_give isl_ast_expr *isl_ast_expr_op_add_arg(__isl_take isl_ast_expr *expr, __isl_take isl_ast_expr *arg) { isl_ast_expr_list *args; args = isl_ast_expr_op_take_args(expr); args = isl_ast_expr_list_add(args, arg); expr = isl_ast_expr_op_restore_args(expr, args); return expr; } /* Replace the argument at position "pos" of "expr" by "arg". */ __isl_give isl_ast_expr *isl_ast_expr_set_op_arg(__isl_take isl_ast_expr *expr, int pos, __isl_take isl_ast_expr *arg) { isl_ast_expr_list *args; args = isl_ast_expr_op_take_args(expr); args = isl_ast_expr_list_set_at(args, pos, arg); expr = isl_ast_expr_op_restore_args(expr, args); return expr; } /* Are the lists of AST expressions "list1" and "list2" the same? */ static isl_bool isl_ast_expr_list_is_equal(__isl_keep isl_ast_expr_list *list1, __isl_keep isl_ast_expr_list *list2) { int i; isl_size n1, n2; if (!list1 || !list2) return isl_bool_error; if (list1 == list2) return isl_bool_true; n1 = isl_ast_expr_list_size(list1); n2 = isl_ast_expr_list_size(list2); if (n1 < 0 || n2 < 0) return isl_bool_error; if (n1 != n2) return isl_bool_false; for (i = 0; i < n1; ++i) { isl_ast_expr *expr1, *expr2; isl_bool equal; expr1 = isl_ast_expr_list_get_at(list1, i); expr2 = isl_ast_expr_list_get_at(list2, i); equal = isl_ast_expr_is_equal(expr1, expr2); isl_ast_expr_free(expr1); isl_ast_expr_free(expr2); if (equal < 0 || !equal) return equal; } return isl_bool_true; } /* Is "expr1" equal to "expr2"? */ isl_bool isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, __isl_keep isl_ast_expr *expr2) { if (!expr1 || !expr2) return isl_bool_error; if (expr1 == expr2) return isl_bool_true; if (expr1->type != expr2->type) return isl_bool_false; switch (expr1->type) { case isl_ast_expr_int: return isl_val_eq(expr1->u.v, expr2->u.v); case isl_ast_expr_id: return isl_bool_ok(expr1->u.id == expr2->u.id); case isl_ast_expr_op: if (expr1->u.op.op != expr2->u.op.op) return isl_bool_false; return isl_ast_expr_list_is_equal(expr1->u.op.args, expr2->u.op.args); case isl_ast_expr_error: return isl_bool_error; } isl_die(isl_ast_expr_get_ctx(expr1), isl_error_internal, "unhandled case", return isl_bool_error); } /* Create a new id expression representing "id". */ __isl_give isl_ast_expr *isl_ast_expr_from_id(__isl_take isl_id *id) { isl_ctx *ctx; isl_ast_expr *expr; if (!id) return NULL; ctx = isl_id_get_ctx(id); expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) goto error; expr->ctx = ctx; isl_ctx_ref(ctx); expr->ref = 1; expr->type = isl_ast_expr_id; expr->u.id = id; return expr; error: isl_id_free(id); return NULL; } /* Create a new integer expression representing "i". */ __isl_give isl_ast_expr *isl_ast_expr_alloc_int_si(isl_ctx *ctx, int i) { isl_ast_expr *expr; expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) return NULL; expr->ctx = ctx; isl_ctx_ref(ctx); expr->ref = 1; expr->type = isl_ast_expr_int; expr->u.v = isl_val_int_from_si(ctx, i); if (!expr->u.v) return isl_ast_expr_free(expr); return expr; } /* Create a new integer expression representing "v". */ __isl_give isl_ast_expr *isl_ast_expr_from_val(__isl_take isl_val *v) { isl_ctx *ctx; isl_ast_expr *expr; if (!v) return NULL; if (!isl_val_is_int(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "expecting integer value", goto error); ctx = isl_val_get_ctx(v); expr = isl_calloc_type(ctx, isl_ast_expr); if (!expr) goto error; expr->ctx = ctx; isl_ctx_ref(ctx); expr->ref = 1; expr->type = isl_ast_expr_int; expr->u.v = v; return expr; error: isl_val_free(v); return NULL; } /* Create an expression representing the unary operation "type" applied to * "arg". */ __isl_give isl_ast_expr *isl_ast_expr_alloc_unary( enum isl_ast_expr_op_type type, __isl_take isl_ast_expr *arg) { isl_ctx *ctx; isl_ast_expr *expr = NULL; isl_ast_expr_list *args; if (!arg) return NULL; ctx = isl_ast_expr_get_ctx(arg); expr = isl_ast_expr_alloc_op(ctx, type, 1); args = isl_ast_expr_op_take_args(expr); args = isl_ast_expr_list_add(args, arg); expr = isl_ast_expr_op_restore_args(expr, args); return expr; } /* Create an expression representing the negation of "arg". */ __isl_give isl_ast_expr *isl_ast_expr_neg(__isl_take isl_ast_expr *arg) { return isl_ast_expr_alloc_unary(isl_ast_expr_op_minus, arg); } /* Create an expression representing the address of "expr". */ __isl_give isl_ast_expr *isl_ast_expr_address_of(__isl_take isl_ast_expr *expr) { if (!expr) return NULL; if (isl_ast_expr_get_type(expr) != isl_ast_expr_op || isl_ast_expr_get_op_type(expr) != isl_ast_expr_op_access) isl_die(isl_ast_expr_get_ctx(expr), isl_error_invalid, "can only take address of access expressions", return isl_ast_expr_free(expr)); return isl_ast_expr_alloc_unary(isl_ast_expr_op_address_of, expr); } /* Create an expression representing the binary operation "type" * applied to "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_alloc_binary( enum isl_ast_expr_op_type type, __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { isl_ctx *ctx; isl_ast_expr *expr = NULL; isl_ast_expr_list *args; if (!expr1 || !expr2) goto error; ctx = isl_ast_expr_get_ctx(expr1); expr = isl_ast_expr_alloc_op(ctx, type, 2); args = isl_ast_expr_op_take_args(expr); args = isl_ast_expr_list_add(args, expr1); args = isl_ast_expr_list_add(args, expr2); expr = isl_ast_expr_op_restore_args(expr, args); return expr; error: isl_ast_expr_free(expr1); isl_ast_expr_free(expr2); return NULL; } /* Create an expression representing the sum of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_add(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_add, expr1, expr2); } /* Create an expression representing the difference of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_sub(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_sub, expr1, expr2); } /* Create an expression representing the product of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_mul(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_mul, expr1, expr2); } /* Create an expression representing the quotient of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_div(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_div, expr1, expr2); } /* Create an expression representing the quotient of the integer * division of "expr1" by "expr2", where "expr1" is known to be * non-negative. */ __isl_give isl_ast_expr *isl_ast_expr_pdiv_q(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_pdiv_q, expr1, expr2); } /* Create an expression representing the remainder of the integer * division of "expr1" by "expr2", where "expr1" is known to be * non-negative. */ __isl_give isl_ast_expr *isl_ast_expr_pdiv_r(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_pdiv_r, expr1, expr2); } /* Create an expression representing the conjunction of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_and(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_and, expr1, expr2); } /* Create an expression representing the conjunction of "expr1" and "expr2", * where "expr2" is evaluated only if "expr1" is evaluated to true. */ __isl_give isl_ast_expr *isl_ast_expr_and_then(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_and_then, expr1, expr2); } /* Create an expression representing the disjunction of "expr1" and "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_or(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_or, expr1, expr2); } /* Create an expression representing the disjunction of "expr1" and "expr2", * where "expr2" is evaluated only if "expr1" is evaluated to false. */ __isl_give isl_ast_expr *isl_ast_expr_or_else(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_or_else, expr1, expr2); } /* Create an expression representing "expr1" less than or equal to "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_le(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_le, expr1, expr2); } /* Create an expression representing "expr1" less than "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_lt(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_lt, expr1, expr2); } /* Create an expression representing "expr1" greater than or equal to "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_ge(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_ge, expr1, expr2); } /* Create an expression representing "expr1" greater than "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_gt(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_gt, expr1, expr2); } /* Create an expression representing "expr1" equal to "expr2". */ __isl_give isl_ast_expr *isl_ast_expr_eq(__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2) { return isl_ast_expr_alloc_binary(isl_ast_expr_op_eq, expr1, expr2); } /* Create an expression of type "type" with as arguments "arg0" followed * by "arguments". */ static __isl_give isl_ast_expr *ast_expr_with_arguments( enum isl_ast_expr_op_type type, __isl_take isl_ast_expr *arg0, __isl_take isl_ast_expr_list *arguments) { arguments = isl_ast_expr_list_insert(arguments, 0, arg0); return alloc_op(type, arguments); } /* Create an expression representing an access to "array" with index * expressions "indices". */ __isl_give isl_ast_expr *isl_ast_expr_access(__isl_take isl_ast_expr *array, __isl_take isl_ast_expr_list *indices) { return ast_expr_with_arguments(isl_ast_expr_op_access, array, indices); } /* Create an expression representing a call to "function" with argument * expressions "arguments". */ __isl_give isl_ast_expr *isl_ast_expr_call(__isl_take isl_ast_expr *function, __isl_take isl_ast_expr_list *arguments) { return ast_expr_with_arguments(isl_ast_expr_op_call, function, arguments); } /* Wrapper around isl_ast_expr_substitute_ids for use * as an isl_ast_expr_list_map callback. */ static __isl_give isl_ast_expr *substitute_ids(__isl_take isl_ast_expr *expr, void *user) { isl_id_to_ast_expr *id2expr = user; return isl_ast_expr_substitute_ids(expr, isl_id_to_ast_expr_copy(id2expr)); } /* For each subexpression of "expr" of type isl_ast_expr_id, * if it appears in "id2expr", then replace it by the corresponding * expression. */ __isl_give isl_ast_expr *isl_ast_expr_substitute_ids( __isl_take isl_ast_expr *expr, __isl_take isl_id_to_ast_expr *id2expr) { isl_maybe_isl_ast_expr m; isl_ast_expr_list *args; if (!expr || !id2expr) goto error; switch (expr->type) { case isl_ast_expr_int: break; case isl_ast_expr_id: m = isl_id_to_ast_expr_try_get(id2expr, expr->u.id); if (m.valid < 0) goto error; if (!m.valid) break; isl_ast_expr_free(expr); expr = m.value; break; case isl_ast_expr_op: args = isl_ast_expr_op_take_args(expr); args = isl_ast_expr_list_map(args, &substitute_ids, id2expr); expr = isl_ast_expr_op_restore_args(expr, args); break; case isl_ast_expr_error: expr = isl_ast_expr_free(expr); break; } isl_id_to_ast_expr_free(id2expr); return expr; error: isl_ast_expr_free(expr); isl_id_to_ast_expr_free(id2expr); return NULL; } isl_ctx *isl_ast_node_get_ctx(__isl_keep isl_ast_node *node) { return node ? node->ctx : NULL; } enum isl_ast_node_type isl_ast_node_get_type(__isl_keep isl_ast_node *node) { return node ? node->type : isl_ast_node_error; } __isl_give isl_ast_node *isl_ast_node_alloc(isl_ctx *ctx, enum isl_ast_node_type type) { isl_ast_node *node; node = isl_calloc_type(ctx, isl_ast_node); if (!node) return NULL; node->ctx = ctx; isl_ctx_ref(ctx); node->ref = 1; node->type = type; return node; } /* Create an if node with the given guard. * * The then body needs to be filled in later. */ __isl_give isl_ast_node *isl_ast_node_alloc_if(__isl_take isl_ast_expr *guard) { isl_ast_node *node; if (!guard) return NULL; node = isl_ast_node_alloc(isl_ast_expr_get_ctx(guard), isl_ast_node_if); if (!node) goto error; node->u.i.guard = guard; return node; error: isl_ast_expr_free(guard); return NULL; } /* Create a for node with the given iterator. * * The remaining fields need to be filled in later. */ __isl_give isl_ast_node *isl_ast_node_alloc_for(__isl_take isl_id *id) { isl_ast_node *node; isl_ctx *ctx; if (!id) return NULL; ctx = isl_id_get_ctx(id); node = isl_ast_node_alloc(ctx, isl_ast_node_for); if (!node) goto error; node->u.f.iterator = isl_ast_expr_from_id(id); if (!node->u.f.iterator) return isl_ast_node_free(node); return node; error: isl_id_free(id); return NULL; } /* Create a mark node, marking "node" with "id". */ __isl_give isl_ast_node *isl_ast_node_alloc_mark(__isl_take isl_id *id, __isl_take isl_ast_node *node) { isl_ctx *ctx; isl_ast_node *mark; if (!id || !node) goto error; ctx = isl_id_get_ctx(id); mark = isl_ast_node_alloc(ctx, isl_ast_node_mark); if (!mark) goto error; mark->u.m.mark = id; mark->u.m.node = node; return mark; error: isl_id_free(id); isl_ast_node_free(node); return NULL; } /* Create a user node evaluating "expr". */ __isl_give isl_ast_node *isl_ast_node_user_from_expr( __isl_take isl_ast_expr *expr) { isl_ctx *ctx; isl_ast_node *node; if (!expr) return NULL; ctx = isl_ast_expr_get_ctx(expr); node = isl_ast_node_alloc(ctx, isl_ast_node_user); if (!node) goto error; node->u.e.expr = expr; return node; error: isl_ast_expr_free(expr); return NULL; } /* This is an alternative name for the function above. */ __isl_give isl_ast_node *isl_ast_node_alloc_user(__isl_take isl_ast_expr *expr) { return isl_ast_node_user_from_expr(expr); } /* Create a block node with the given children. */ __isl_give isl_ast_node *isl_ast_node_block_from_children( __isl_take isl_ast_node_list *list) { isl_ast_node *node; isl_ctx *ctx; if (!list) return NULL; ctx = isl_ast_node_list_get_ctx(list); node = isl_ast_node_alloc(ctx, isl_ast_node_block); if (!node) goto error; node->u.b.children = list; return node; error: isl_ast_node_list_free(list); return NULL; } /* This is an alternative name for the function above. */ __isl_give isl_ast_node *isl_ast_node_alloc_block( __isl_take isl_ast_node_list *list) { return isl_ast_node_block_from_children(list); } /* Represent the given list of nodes as a single node, either by * extract the node from a single element list or by creating * a block node with the list of nodes as children. */ __isl_give isl_ast_node *isl_ast_node_from_ast_node_list( __isl_take isl_ast_node_list *list) { isl_size n; isl_ast_node *node; n = isl_ast_node_list_n_ast_node(list); if (n < 0) goto error; if (n != 1) return isl_ast_node_alloc_block(list); node = isl_ast_node_list_get_ast_node(list, 0); isl_ast_node_list_free(list); return node; error: isl_ast_node_list_free(list); return NULL; } __isl_give isl_ast_node *isl_ast_node_copy(__isl_keep isl_ast_node *node) { if (!node) return NULL; node->ref++; return node; } /* Return a fresh copy of "node". * * In the case of a degenerate for node, take into account * that "cond" and "inc" are NULL. */ __isl_give isl_ast_node *isl_ast_node_dup(__isl_keep isl_ast_node *node) { isl_ast_node *dup; if (!node) return NULL; dup = isl_ast_node_alloc(isl_ast_node_get_ctx(node), node->type); if (!dup) return NULL; switch (node->type) { case isl_ast_node_if: dup->u.i.guard = isl_ast_expr_copy(node->u.i.guard); dup->u.i.then = isl_ast_node_copy(node->u.i.then); dup->u.i.else_node = isl_ast_node_copy(node->u.i.else_node); if (!dup->u.i.guard || !dup->u.i.then || (node->u.i.else_node && !dup->u.i.else_node)) return isl_ast_node_free(dup); break; case isl_ast_node_for: dup->u.f.degenerate = node->u.f.degenerate; dup->u.f.iterator = isl_ast_expr_copy(node->u.f.iterator); dup->u.f.init = isl_ast_expr_copy(node->u.f.init); dup->u.f.body = isl_ast_node_copy(node->u.f.body); if (!dup->u.f.iterator || !dup->u.f.init || !dup->u.f.body) return isl_ast_node_free(dup); if (node->u.f.degenerate) break; dup->u.f.cond = isl_ast_expr_copy(node->u.f.cond); dup->u.f.inc = isl_ast_expr_copy(node->u.f.inc); if (!dup->u.f.cond || !dup->u.f.inc) return isl_ast_node_free(dup); break; case isl_ast_node_block: dup->u.b.children = isl_ast_node_list_copy(node->u.b.children); if (!dup->u.b.children) return isl_ast_node_free(dup); break; case isl_ast_node_mark: dup->u.m.mark = isl_id_copy(node->u.m.mark); dup->u.m.node = isl_ast_node_copy(node->u.m.node); if (!dup->u.m.mark || !dup->u.m.node) return isl_ast_node_free(dup); break; case isl_ast_node_user: dup->u.e.expr = isl_ast_expr_copy(node->u.e.expr); if (!dup->u.e.expr) return isl_ast_node_free(dup); break; case isl_ast_node_error: break; } if (!node->annotation) return dup; dup->annotation = isl_id_copy(node->annotation); if (!dup->annotation) return isl_ast_node_free(dup); return dup; } __isl_give isl_ast_node *isl_ast_node_cow(__isl_take isl_ast_node *node) { if (!node) return NULL; if (node->ref == 1) return node; node->ref--; return isl_ast_node_dup(node); } __isl_null isl_ast_node *isl_ast_node_free(__isl_take isl_ast_node *node) { if (!node) return NULL; if (--node->ref > 0) return NULL; switch (node->type) { case isl_ast_node_if: isl_ast_expr_free(node->u.i.guard); isl_ast_node_free(node->u.i.then); isl_ast_node_free(node->u.i.else_node); break; case isl_ast_node_for: isl_ast_expr_free(node->u.f.iterator); isl_ast_expr_free(node->u.f.init); isl_ast_expr_free(node->u.f.cond); isl_ast_expr_free(node->u.f.inc); isl_ast_node_free(node->u.f.body); break; case isl_ast_node_block: isl_ast_node_list_free(node->u.b.children); break; case isl_ast_node_mark: isl_id_free(node->u.m.mark); isl_ast_node_free(node->u.m.node); break; case isl_ast_node_user: isl_ast_expr_free(node->u.e.expr); break; case isl_ast_node_error: break; } isl_id_free(node->annotation); isl_ctx_deref(node->ctx); free(node); return NULL; } /* Check that "node" is of type "type", printing "msg" if not. */ static isl_stat isl_ast_node_check_type(__isl_keep isl_ast_node *node, enum isl_ast_node_type type, const char *msg) { if (!node) return isl_stat_error; if (node->type != type) isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, msg, return isl_stat_error); return isl_stat_ok; } /* Check that "node" is of type isl_ast_node_block. */ static isl_stat isl_ast_node_check_block(__isl_keep isl_ast_node *node) { return isl_ast_node_check_type(node, isl_ast_node_block, "not a block node"); } /* Check that "node" is of type isl_ast_node_if. */ static isl_stat isl_ast_node_check_if(__isl_keep isl_ast_node *node) { return isl_ast_node_check_type(node, isl_ast_node_if, "not an if node"); } /* Check that "node" is of type isl_ast_node_for. */ static isl_stat isl_ast_node_check_for(__isl_keep isl_ast_node *node) { return isl_ast_node_check_type(node, isl_ast_node_for, "not a for node"); } /* Check that "node" is of type isl_ast_node_mark. */ static isl_stat isl_ast_node_check_mark(__isl_keep isl_ast_node *node) { return isl_ast_node_check_type(node, isl_ast_node_mark, "not a mark node"); } /* Check that "node" is of type isl_ast_node_user. */ static isl_stat isl_ast_node_check_user(__isl_keep isl_ast_node *node) { return isl_ast_node_check_type(node, isl_ast_node_user, "not a user node"); } #undef NODE_TYPE #define NODE_TYPE for #undef FIELD_NAME #define FIELD_NAME init #undef FIELD_TYPE #define FIELD_TYPE isl_ast_expr #undef FIELD #define FIELD u.f.init #include "isl_ast_node_set_field_templ.c" #undef NODE_TYPE #define NODE_TYPE for #undef FIELD_NAME #define FIELD_NAME cond #undef FIELD_TYPE #define FIELD_TYPE isl_ast_expr #undef FIELD #define FIELD u.f.cond #include "isl_ast_node_set_field_templ.c" #undef NODE_TYPE #define NODE_TYPE for #undef FIELD_NAME #define FIELD_NAME inc #undef FIELD_TYPE #define FIELD_TYPE isl_ast_expr #undef FIELD #define FIELD u.f.inc #include "isl_ast_node_set_field_templ.c" #undef NODE_TYPE #define NODE_TYPE for #undef FIELD_NAME #define FIELD_NAME body #undef FIELD_TYPE #define FIELD_TYPE isl_ast_node #undef FIELD #define FIELD u.f.body #include "isl_ast_node_set_field_templ.c" /* Return the body of the for-node "node", * This may be either a copy or the body itself * if there is only one reference to "node". * This allows the body to be modified inplace * if both "node" and its body have only a single reference. * The caller is not allowed to modify "node" between this call and * the subsequent call to isl_ast_node_for_restore_body. * The only exception is that isl_ast_node_free can be called instead. */ static __isl_give isl_ast_node *isl_ast_node_for_take_body( __isl_keep isl_ast_node *node) { isl_ast_node *body; if (isl_ast_node_check_for(node) < 0) return NULL; if (node->ref != 1) return isl_ast_node_for_get_body(node); body = node->u.f.body; node->u.f.body = NULL; return body; } /* Set the body of the for-node "node" to "body", * where the body of "node" may be missing * due to a preceding call to isl_ast_node_for_take_body. * However, in this case, "node" only has a single reference. */ static __isl_give isl_ast_node *isl_ast_node_for_restore_body( __isl_take isl_ast_node *node, __isl_take isl_ast_node *body) { return isl_ast_node_for_set_body(node, body); } __isl_give isl_ast_node *isl_ast_node_for_get_body( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return NULL; return isl_ast_node_copy(node->u.f.body); } /* Mark the given for node as being degenerate. */ __isl_give isl_ast_node *isl_ast_node_for_mark_degenerate( __isl_take isl_ast_node *node) { node = isl_ast_node_cow(node); if (!node) return NULL; node->u.f.degenerate = 1; return node; } isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return isl_bool_error; return isl_bool_ok(node->u.f.degenerate); } __isl_give isl_ast_expr *isl_ast_node_for_get_iterator( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return NULL; return isl_ast_expr_copy(node->u.f.iterator); } __isl_give isl_ast_expr *isl_ast_node_for_get_init( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return NULL; return isl_ast_expr_copy(node->u.f.init); } /* Return the condition expression of the given for node. * * If the for node is degenerate, then the condition is not explicitly * stored in the node. Instead, it is constructed as * * iterator <= init */ __isl_give isl_ast_expr *isl_ast_node_for_get_cond( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return NULL; if (!node->u.f.degenerate) return isl_ast_expr_copy(node->u.f.cond); return isl_ast_expr_alloc_binary(isl_ast_expr_op_le, isl_ast_expr_copy(node->u.f.iterator), isl_ast_expr_copy(node->u.f.init)); } /* Return the increment of the given for node. * * If the for node is degenerate, then the increment is not explicitly * stored in the node. We simply return "1". */ __isl_give isl_ast_expr *isl_ast_node_for_get_inc( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_for(node) < 0) return NULL; if (!node->u.f.degenerate) return isl_ast_expr_copy(node->u.f.inc); return isl_ast_expr_alloc_int_si(isl_ast_node_get_ctx(node), 1); } #undef NODE_TYPE #define NODE_TYPE if #undef FIELD_NAME #define FIELD_NAME then #undef FIELD_TYPE #define FIELD_TYPE isl_ast_node #undef FIELD #define FIELD u.i.then #include "isl_ast_node_set_field_templ.c" /* Return the then-branch of the if-node "node", * This may be either a copy or the branch itself * if there is only one reference to "node". * This allows the branch to be modified inplace * if both "node" and its then-branch have only a single reference. * The caller is not allowed to modify "node" between this call and * the subsequent call to isl_ast_node_if_restore_then_node. * The only exception is that isl_ast_node_free can be called instead. */ static __isl_give isl_ast_node *isl_ast_node_if_take_then_node( __isl_keep isl_ast_node *node) { isl_ast_node *then_node; if (isl_ast_node_check_if(node) < 0) return NULL; if (node->ref != 1) return isl_ast_node_if_get_then_node(node); then_node = node->u.i.then; node->u.i.then = NULL; return then_node; } /* Set the then-branch of the if-node "node" to "child", * where the then-branch of "node" may be missing * due to a preceding call to isl_ast_node_if_take_then_node. * However, in this case, "node" only has a single reference. */ static __isl_give isl_ast_node *isl_ast_node_if_restore_then_node( __isl_take isl_ast_node *node, __isl_take isl_ast_node *child) { return isl_ast_node_if_set_then(node, child); } /* Return the then-node of the given if-node. */ __isl_give isl_ast_node *isl_ast_node_if_get_then_node( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_if(node) < 0) return NULL; return isl_ast_node_copy(node->u.i.then); } /* This is an alternative name for the function above. */ __isl_give isl_ast_node *isl_ast_node_if_get_then( __isl_keep isl_ast_node *node) { return isl_ast_node_if_get_then_node(node); } /* Does the given if-node have an else-node? */ isl_bool isl_ast_node_if_has_else_node(__isl_keep isl_ast_node *node) { if (isl_ast_node_check_if(node) < 0) return isl_bool_error; return isl_bool_ok(node->u.i.else_node != NULL); } /* This is an alternative name for the function above. */ isl_bool isl_ast_node_if_has_else(__isl_keep isl_ast_node *node) { return isl_ast_node_if_has_else_node(node); } /* Return the else-node of the given if-node, * assuming there is one. */ __isl_give isl_ast_node *isl_ast_node_if_get_else_node( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_if(node) < 0) return NULL; return isl_ast_node_copy(node->u.i.else_node); } /* This is an alternative name for the function above. */ __isl_give isl_ast_node *isl_ast_node_if_get_else( __isl_keep isl_ast_node *node) { return isl_ast_node_if_get_else_node(node); } #undef NODE_TYPE #define NODE_TYPE if #undef FIELD_NAME #define FIELD_NAME else_node #undef FIELD_TYPE #define FIELD_TYPE isl_ast_node #undef FIELD #define FIELD u.i.else_node static #include "isl_ast_node_set_field_templ.c" /* Return the else-branch of the if-node "node", * This may be either a copy or the branch itself * if there is only one reference to "node". * This allows the branch to be modified inplace * if both "node" and its else-branch have only a single reference. * The caller is not allowed to modify "node" between this call and * the subsequent call to isl_ast_node_if_restore_else_node. * The only exception is that isl_ast_node_free can be called instead. */ static __isl_give isl_ast_node *isl_ast_node_if_take_else_node( __isl_keep isl_ast_node *node) { isl_ast_node *else_node; if (isl_ast_node_check_if(node) < 0) return NULL; if (node->ref != 1) return isl_ast_node_if_get_else_node(node); else_node = node->u.i.else_node; node->u.i.else_node = NULL; return else_node; } /* Set the else-branch of the if-node "node" to "child", * where the else-branch of "node" may be missing * due to a preceding call to isl_ast_node_if_take_else_node. * However, in this case, "node" only has a single reference. */ static __isl_give isl_ast_node *isl_ast_node_if_restore_else_node( __isl_take isl_ast_node *node, __isl_take isl_ast_node *child) { return isl_ast_node_if_set_else_node(node, child); } __isl_give isl_ast_expr *isl_ast_node_if_get_cond( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_if(node) < 0) return NULL; return isl_ast_expr_copy(node->u.i.guard); } __isl_give isl_ast_node_list *isl_ast_node_block_get_children( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_block(node) < 0) return NULL; return isl_ast_node_list_copy(node->u.b.children); } #undef NODE_TYPE #define NODE_TYPE block #undef FIELD_NAME #define FIELD_NAME children #undef FIELD_TYPE #define FIELD_TYPE isl_ast_node_list #undef FIELD #define FIELD u.b.children static #include "isl_ast_node_set_field_templ.c" /* Return the children of the block-node "node", * This may be either a copy or the children themselves * if there is only one reference to "node". * This allows the children to be modified inplace * if both "node" and its children have only a single reference. * The caller is not allowed to modify "node" between this call and * the subsequent call to isl_ast_node_block_restore_children. * The only exception is that isl_ast_node_free can be called instead. */ static __isl_give isl_ast_node_list *isl_ast_node_block_take_children( __isl_keep isl_ast_node *node) { isl_ast_node_list *children; if (isl_ast_node_check_block(node) < 0) return NULL; if (node->ref != 1) return isl_ast_node_block_get_children(node); children = node->u.b.children; node->u.b.children = NULL; return children; } /* Set the children of the block-node "node" to "children", * where the children of "node" may be missing * due to a preceding call to isl_ast_node_block_take_children. * However, in this case, "node" only has a single reference. */ static __isl_give isl_ast_node *isl_ast_node_block_restore_children( __isl_take isl_ast_node *node, __isl_take isl_ast_node_list *children) { return isl_ast_node_block_set_children(node, children); } __isl_give isl_ast_expr *isl_ast_node_user_get_expr( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_user(node) < 0) return NULL; return isl_ast_expr_copy(node->u.e.expr); } /* Return the mark identifier of the mark node "node". */ __isl_give isl_id *isl_ast_node_mark_get_id(__isl_keep isl_ast_node *node) { if (isl_ast_node_check_mark(node) < 0) return NULL; return isl_id_copy(node->u.m.mark); } /* Return the node marked by mark node "node". */ __isl_give isl_ast_node *isl_ast_node_mark_get_node( __isl_keep isl_ast_node *node) { if (isl_ast_node_check_mark(node) < 0) return NULL; return isl_ast_node_copy(node->u.m.node); } #undef NODE_TYPE #define NODE_TYPE mark #undef FIELD_NAME #define FIELD_NAME node #undef FIELD_TYPE #define FIELD_TYPE isl_ast_node #undef FIELD #define FIELD u.m.node static #include "isl_ast_node_set_field_templ.c" /* Return the child of the mark-node "node", * This may be either a copy or the child itself * if there is only one reference to "node". * This allows the child to be modified inplace * if both "node" and its child have only a single reference. * The caller is not allowed to modify "node" between this call and * the subsequent call to isl_ast_node_mark_restore_node. * The only exception is that isl_ast_node_free can be called instead. */ static __isl_give isl_ast_node *isl_ast_node_mark_take_node( __isl_keep isl_ast_node *node) { isl_ast_node *child; if (isl_ast_node_check_mark(node) < 0) return NULL; if (node->ref != 1) return isl_ast_node_mark_get_node(node); child = node->u.m.node; node->u.m.node = NULL; return child; } /* Set the child of the mark-node "node" to "child", * where the child of "node" may be missing * due to a preceding call to isl_ast_node_mark_take_node. * However, in this case, "node" only has a single reference. */ static __isl_give isl_ast_node *isl_ast_node_mark_restore_node( __isl_take isl_ast_node *node, __isl_take isl_ast_node *child) { return isl_ast_node_mark_set_node(node, child); } __isl_give isl_id *isl_ast_node_get_annotation(__isl_keep isl_ast_node *node) { return node ? isl_id_copy(node->annotation) : NULL; } /* Check that "node" is of any type. * That is, simply check that it is a valid node. */ static isl_stat isl_ast_node_check_any(__isl_keep isl_ast_node *node) { return isl_stat_non_null(node); } #undef NODE_TYPE #define NODE_TYPE any #undef FIELD_NAME #define FIELD_NAME annotation #undef FIELD_TYPE #define FIELD_TYPE isl_id #undef FIELD #define FIELD annotation static #include "isl_ast_node_set_field_templ.c" /* Replace node->annotation by "annotation". */ __isl_give isl_ast_node *isl_ast_node_set_annotation( __isl_take isl_ast_node *node, __isl_take isl_id *annotation) { return isl_ast_node_any_set_annotation(node, annotation); } static __isl_give isl_ast_node *traverse(__isl_take isl_ast_node *node, __isl_give isl_ast_node *(*enter)(__isl_take isl_ast_node *node, int *more, void *user), __isl_give isl_ast_node *(*leave)(__isl_take isl_ast_node *node, void *user), void *user); /* Traverse the elements of "list" and all their descendants * in depth first preorder. Call "enter" whenever a node is entered and "leave" * whenever a node is left. * * Return the updated node. */ static __isl_give isl_ast_node_list *traverse_list( __isl_take isl_ast_node_list *list, __isl_give isl_ast_node *(*enter)(__isl_take isl_ast_node *node, int *more, void *user), __isl_give isl_ast_node *(*leave)(__isl_take isl_ast_node *node, void *user), void *user) { int i; isl_size n; n = isl_ast_node_list_size(list); if (n < 0) return isl_ast_node_list_free(list); for (i = 0; i < n; ++i) { isl_ast_node *node; node = isl_ast_node_list_get_at(list, i); node = traverse(node, enter, leave, user); list = isl_ast_node_list_set_at(list, i, node); } return list; } /* Traverse the descendants of "node" (including the node itself) * in depth first preorder. Call "enter" whenever a node is entered and "leave" * whenever a node is left. * * If "enter" sets the "more" argument to zero, then the subtree rooted * at the given node is skipped. * * Return the updated node. */ static __isl_give isl_ast_node *traverse(__isl_take isl_ast_node *node, __isl_give isl_ast_node *(*enter)(__isl_take isl_ast_node *node, int *more, void *user), __isl_give isl_ast_node *(*leave)(__isl_take isl_ast_node *node, void *user), void *user) { int more; isl_bool has_else; isl_ast_node *child; isl_ast_node_list *children; node = enter(node, &more, user); if (!node) return NULL; if (!more) return node; switch (node->type) { case isl_ast_node_for: child = isl_ast_node_for_take_body(node); child = traverse(child, enter, leave, user); node = isl_ast_node_for_restore_body(node, child); return leave(node, user); case isl_ast_node_if: child = isl_ast_node_if_take_then_node(node); child = traverse(child, enter, leave, user); node = isl_ast_node_if_restore_then_node(node, child); has_else = isl_ast_node_if_has_else_node(node); if (has_else < 0) return isl_ast_node_free(node); if (!has_else) return leave(node, user); child = isl_ast_node_if_take_else_node(node); child = traverse(child, enter, leave, user); node = isl_ast_node_if_restore_else_node(node, child); return leave(node, user); case isl_ast_node_block: children = isl_ast_node_block_take_children(node); children = traverse_list(children, enter, leave, user); node = isl_ast_node_block_restore_children(node, children); return leave(node, user); case isl_ast_node_mark: child = isl_ast_node_mark_take_node(node); child = traverse(child, enter, leave, user); node = isl_ast_node_mark_restore_node(node, child); return leave(node, user); case isl_ast_node_user: return leave(node, user); case isl_ast_node_error: return isl_ast_node_free(node); } return node; } /* Internal data structure storing the arguments of * isl_ast_node_foreach_descendant_top_down. */ struct isl_ast_node_preorder_data { isl_bool (*fn)(__isl_keep isl_ast_node *node, void *user); void *user; }; /* Enter "node" and set *more to continue traversing its descendants. * * In the case of a depth first preorder traversal, call data->fn and * let it decide whether to continue. */ static __isl_give isl_ast_node *preorder_enter(__isl_take isl_ast_node *node, int *more, void *user) { struct isl_ast_node_preorder_data *data = user; isl_bool m; if (!node) return NULL; m = data->fn(node, data->user); if (m < 0) return isl_ast_node_free(node); *more = m; return node; } /* Leave "node". * * In the case of a depth first preorder traversal, nothing needs to be done. */ static __isl_give isl_ast_node *preorder_leave(__isl_take isl_ast_node *node, void *user) { return node; } /* Traverse the descendants of "node" (including the node itself) * in depth first preorder. * * If "fn" returns isl_bool_error on any of the nodes, then the traversal * is aborted. * If "fn" returns isl_bool_false on any of the nodes, then the subtree rooted * at that node is skipped. * * Return isl_stat_ok on success and isl_stat_error on failure. */ isl_stat isl_ast_node_foreach_descendant_top_down( __isl_keep isl_ast_node *node, isl_bool (*fn)(__isl_keep isl_ast_node *node, void *user), void *user) { struct isl_ast_node_preorder_data data = { fn, user }; node = isl_ast_node_copy(node); node = traverse(node, &preorder_enter, &preorder_leave, &data); isl_ast_node_free(node); return isl_stat_non_null(node); } /* Internal data structure storing the arguments of * isl_ast_node_map_descendant_bottom_up. */ struct isl_ast_node_postorder_data { __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node, void *user); void *user; }; /* Enter "node" and set *more to continue traversing its descendants. * * In the case of a depth-first post-order traversal, * nothing needs to be done and traversal always continues. */ static __isl_give isl_ast_node *postorder_enter(__isl_take isl_ast_node *node, int *more, void *user) { *more = 1; return node; } /* Leave "node". * * In the case of a depth-first post-order traversal, call data->fn. */ static __isl_give isl_ast_node *postorder_leave(__isl_take isl_ast_node *node, void *user) { struct isl_ast_node_postorder_data *data = user; if (!node) return NULL; node = data->fn(node, data->user); return node; } /* Traverse the descendants of "node" (including the node itself) * in depth-first post-order, where the user callback is allowed to modify the * visited node. * * Return the updated node. */ __isl_give isl_ast_node *isl_ast_node_map_descendant_bottom_up( __isl_take isl_ast_node *node, __isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node, void *user), void *user) { struct isl_ast_node_postorder_data data = { fn, user }; return traverse(node, &postorder_enter, &postorder_leave, &data); } /* Textual C representation of the various operators. */ static char *op_str_c[] = { [isl_ast_expr_op_and] = "&&", [isl_ast_expr_op_and_then] = "&&", [isl_ast_expr_op_or] = "||", [isl_ast_expr_op_or_else] = "||", [isl_ast_expr_op_max] = "max", [isl_ast_expr_op_min] = "min", [isl_ast_expr_op_minus] = "-", [isl_ast_expr_op_add] = "+", [isl_ast_expr_op_sub] = "-", [isl_ast_expr_op_mul] = "*", [isl_ast_expr_op_fdiv_q] = "floord", [isl_ast_expr_op_pdiv_q] = "/", [isl_ast_expr_op_pdiv_r] = "%", [isl_ast_expr_op_zdiv_r] = "%", [isl_ast_expr_op_div] = "/", [isl_ast_expr_op_eq] = "==", [isl_ast_expr_op_le] = "<=", [isl_ast_expr_op_ge] = ">=", [isl_ast_expr_op_lt] = "<", [isl_ast_expr_op_gt] = ">", [isl_ast_expr_op_member] = ".", [isl_ast_expr_op_address_of] = "&" }; /* Precedence in C of the various operators. * Based on http://en.wikipedia.org/wiki/Operators_in_C_and_C++ * Lowest value means highest precedence. */ static int op_prec[] = { [isl_ast_expr_op_and] = 13, [isl_ast_expr_op_and_then] = 13, [isl_ast_expr_op_or] = 14, [isl_ast_expr_op_or_else] = 14, [isl_ast_expr_op_max] = 2, [isl_ast_expr_op_min] = 2, [isl_ast_expr_op_minus] = 3, [isl_ast_expr_op_add] = 6, [isl_ast_expr_op_sub] = 6, [isl_ast_expr_op_mul] = 5, [isl_ast_expr_op_div] = 5, [isl_ast_expr_op_fdiv_q] = 2, [isl_ast_expr_op_pdiv_q] = 5, [isl_ast_expr_op_pdiv_r] = 5, [isl_ast_expr_op_zdiv_r] = 5, [isl_ast_expr_op_cond] = 15, [isl_ast_expr_op_select] = 15, [isl_ast_expr_op_eq] = 9, [isl_ast_expr_op_le] = 8, [isl_ast_expr_op_ge] = 8, [isl_ast_expr_op_lt] = 8, [isl_ast_expr_op_gt] = 8, [isl_ast_expr_op_call] = 2, [isl_ast_expr_op_access] = 2, [isl_ast_expr_op_member] = 2, [isl_ast_expr_op_address_of] = 3 }; /* Is the operator left-to-right associative? */ static int op_left[] = { [isl_ast_expr_op_and] = 1, [isl_ast_expr_op_and_then] = 1, [isl_ast_expr_op_or] = 1, [isl_ast_expr_op_or_else] = 1, [isl_ast_expr_op_max] = 1, [isl_ast_expr_op_min] = 1, [isl_ast_expr_op_minus] = 0, [isl_ast_expr_op_add] = 1, [isl_ast_expr_op_sub] = 1, [isl_ast_expr_op_mul] = 1, [isl_ast_expr_op_div] = 1, [isl_ast_expr_op_fdiv_q] = 1, [isl_ast_expr_op_pdiv_q] = 1, [isl_ast_expr_op_pdiv_r] = 1, [isl_ast_expr_op_zdiv_r] = 1, [isl_ast_expr_op_cond] = 0, [isl_ast_expr_op_select] = 0, [isl_ast_expr_op_eq] = 1, [isl_ast_expr_op_le] = 1, [isl_ast_expr_op_ge] = 1, [isl_ast_expr_op_lt] = 1, [isl_ast_expr_op_gt] = 1, [isl_ast_expr_op_call] = 1, [isl_ast_expr_op_access] = 1, [isl_ast_expr_op_member] = 1, [isl_ast_expr_op_address_of] = 0 }; static int is_and(enum isl_ast_expr_op_type op) { return op == isl_ast_expr_op_and || op == isl_ast_expr_op_and_then; } static int is_or(enum isl_ast_expr_op_type op) { return op == isl_ast_expr_op_or || op == isl_ast_expr_op_or_else; } static int is_add_sub(enum isl_ast_expr_op_type op) { return op == isl_ast_expr_op_add || op == isl_ast_expr_op_sub; } static int is_div_mod(enum isl_ast_expr_op_type op) { return op == isl_ast_expr_op_div || op == isl_ast_expr_op_pdiv_r || op == isl_ast_expr_op_zdiv_r; } static __isl_give isl_printer *print_ast_expr_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr); /* Do we need/want parentheses around "expr" as a subexpression of * an "op" operation? If "left" is set, then "expr" is the left-most * operand. * * We only need parentheses if "expr" represents an operation. * * If op has a higher precedence than expr->u.op.op, then we need * parentheses. * If op and expr->u.op.op have the same precedence, but the operations * are performed in an order that is different from the associativity, * then we need parentheses. * * An and inside an or technically does not require parentheses, * but some compilers complain about that, so we add them anyway. * * Computations such as "a / b * c" and "a % b + c" can be somewhat * difficult to read, so we add parentheses for those as well. */ static int sub_expr_need_parens(enum isl_ast_expr_op_type op, __isl_keep isl_ast_expr *expr, int left) { if (expr->type != isl_ast_expr_op) return 0; if (op_prec[expr->u.op.op] > op_prec[op]) return 1; if (op_prec[expr->u.op.op] == op_prec[op] && left != op_left[op]) return 1; if (is_or(op) && is_and(expr->u.op.op)) return 1; if (op == isl_ast_expr_op_mul && expr->u.op.op != isl_ast_expr_op_mul && op_prec[expr->u.op.op] == op_prec[op]) return 1; if (is_add_sub(op) && is_div_mod(expr->u.op.op)) return 1; return 0; } /* Print the subexpression at position "pos" of operation expression "expr" * in C format. * If "left" is set, then "expr" is the left-most operand. */ static __isl_give isl_printer *print_sub_expr_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr, int pos, int left) { int need_parens; isl_ast_expr *arg; if (!expr) return isl_printer_free(p); arg = isl_ast_expr_list_get_at(expr->u.op.args, pos); need_parens = sub_expr_need_parens(expr->u.op.op, arg, left); if (need_parens) p = isl_printer_print_str(p, "("); p = print_ast_expr_c(p, arg); if (need_parens) p = isl_printer_print_str(p, ")"); isl_ast_expr_free(arg); return p; } #define isl_ast_expr_op_last isl_ast_expr_op_address_of /* Data structure that holds the user-specified textual * representations for the operators in C format. * The entries are either NULL or copies of strings. * A NULL entry means that the default name should be used. */ struct isl_ast_expr_op_names { char *op_str[isl_ast_expr_op_last + 1]; }; /* Create an empty struct isl_ast_expr_op_names. */ static void *create_names(isl_ctx *ctx) { return isl_calloc_type(ctx, struct isl_ast_expr_op_names); } /* Free a struct isl_ast_expr_op_names along with all memory * owned by the struct. */ static void free_names(void *user) { int i; struct isl_ast_expr_op_names *names = user; if (!user) return; for (i = 0; i <= isl_ast_expr_op_last; ++i) free(names->op_str[i]); free(user); } /* Create an identifier that is used to store * an isl_ast_expr_op_names note. */ static __isl_give isl_id *names_id(isl_ctx *ctx) { return isl_id_alloc(ctx, "isl_ast_expr_op_type_names", NULL); } /* Ensure that "p" has a note identified by "id". * If there is no such note yet, then it is created by "note_create" and * scheduled do be freed by "note_free". */ static __isl_give isl_printer *alloc_note(__isl_take isl_printer *p, __isl_keep isl_id *id, void *(*note_create)(isl_ctx *), void (*note_free)(void *)) { isl_ctx *ctx; isl_id *note_id; isl_bool has_note; void *note; has_note = isl_printer_has_note(p, id); if (has_note < 0) return isl_printer_free(p); if (has_note) return p; ctx = isl_printer_get_ctx(p); note = note_create(ctx); if (!note) return isl_printer_free(p); note_id = isl_id_alloc(ctx, NULL, note); if (!note_id) note_free(note); else note_id = isl_id_set_free_user(note_id, note_free); p = isl_printer_set_note(p, isl_id_copy(id), note_id); return p; } /* Ensure that "p" has an isl_ast_expr_op_names note identified by "id". */ static __isl_give isl_printer *alloc_names(__isl_take isl_printer *p, __isl_keep isl_id *id) { return alloc_note(p, id, &create_names, &free_names); } /* Retrieve the note identified by "id" from "p". * The note is assumed to exist. */ static void *get_note(__isl_keep isl_printer *p, __isl_keep isl_id *id) { void *note; id = isl_printer_get_note(p, isl_id_copy(id)); note = isl_id_get_user(id); isl_id_free(id); return note; } /* Use "name" to print operations of type "type" to "p". * * Store the name in an isl_ast_expr_op_names note attached to "p", such that * it can be retrieved by get_op_str. */ __isl_give isl_printer *isl_ast_expr_op_type_set_print_name( __isl_take isl_printer *p, enum isl_ast_expr_op_type type, __isl_keep const char *name) { isl_id *id; struct isl_ast_expr_op_names *names; if (!p) return NULL; if (type > isl_ast_expr_op_last) isl_die(isl_printer_get_ctx(p), isl_error_invalid, "invalid type", return isl_printer_free(p)); id = names_id(isl_printer_get_ctx(p)); p = alloc_names(p, id); names = get_note(p, id); isl_id_free(id); if (!names) return isl_printer_free(p); free(names->op_str[type]); names->op_str[type] = strdup(name); return p; } /* This is an alternative name for the function above. */ __isl_give isl_printer *isl_ast_op_type_set_print_name( __isl_take isl_printer *p, enum isl_ast_expr_op_type type, __isl_keep const char *name) { return isl_ast_expr_op_type_set_print_name(p, type, name); } /* Return the textual representation of "type" in C format. * * If there is a user-specified name in an isl_ast_expr_op_names note * associated to "p", then return that. * Otherwise, return the default name in op_str_c. */ static const char *get_op_str_c(__isl_keep isl_printer *p, enum isl_ast_expr_op_type type) { isl_id *id; isl_bool has_names; struct isl_ast_expr_op_names *names = NULL; id = names_id(isl_printer_get_ctx(p)); has_names = isl_printer_has_note(p, id); if (has_names >= 0 && has_names) names = get_note(p, id); isl_id_free(id); if (names && names->op_str[type]) return names->op_str[type]; return op_str_c[type]; } /* Print the expression at position "pos" in "list" in C format. */ static __isl_give isl_printer *print_at_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr_list *list, int pos) { isl_ast_expr *expr; expr = isl_ast_expr_list_get_at(list, pos); p = print_ast_expr_c(p, expr); isl_ast_expr_free(expr); return p; } /* Print a min or max reduction "expr" in C format. */ static __isl_give isl_printer *print_min_max_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { int i = 0; isl_size n; n = isl_ast_expr_list_size(expr->u.op.args); if (n < 0) return isl_printer_free(p); for (i = 1; i < n; ++i) { p = isl_printer_print_str(p, get_op_str_c(p, expr->u.op.op)); p = isl_printer_print_str(p, "("); } p = print_at_c(p, expr->u.op.args, 0); for (i = 1; i < n; ++i) { p = isl_printer_print_str(p, ", "); p = print_at_c(p, expr->u.op.args, i); p = isl_printer_print_str(p, ")"); } return p; } /* Print a function call "expr" in C format. * * The first argument represents the function to be called. */ static __isl_give isl_printer *print_call_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { int i = 0; isl_size n; n = isl_ast_expr_list_size(expr->u.op.args); if (n < 0) return isl_printer_free(p); p = print_at_c(p, expr->u.op.args, 0); p = isl_printer_print_str(p, "("); for (i = 1; i < n; ++i) { if (i != 1) p = isl_printer_print_str(p, ", "); p = print_at_c(p, expr->u.op.args, i); } p = isl_printer_print_str(p, ")"); return p; } /* Print an array access "expr" in C format. * * The first argument represents the array being accessed. */ static __isl_give isl_printer *print_access_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { int i = 0; isl_size n; n = isl_ast_expr_list_size(expr->u.op.args); if (n < 0) return isl_printer_free(p); p = print_at_c(p, expr->u.op.args, 0); for (i = 1; i < n; ++i) { p = isl_printer_print_str(p, "["); p = print_at_c(p, expr->u.op.args, i); p = isl_printer_print_str(p, "]"); } return p; } /* Print "expr" to "p" in C format. */ static __isl_give isl_printer *print_ast_expr_c(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { isl_size n; if (!p) return NULL; if (!expr) return isl_printer_free(p); switch (expr->type) { case isl_ast_expr_op: if (expr->u.op.op == isl_ast_expr_op_call) { p = print_call_c(p, expr); break; } if (expr->u.op.op == isl_ast_expr_op_access) { p = print_access_c(p, expr); break; } n = isl_ast_expr_list_size(expr->u.op.args); if (n < 0) return isl_printer_free(p); if (n == 1) { p = isl_printer_print_str(p, get_op_str_c(p, expr->u.op.op)); p = print_sub_expr_c(p, expr, 0, 0); break; } if (expr->u.op.op == isl_ast_expr_op_fdiv_q) { const char *name; name = get_op_str_c(p, isl_ast_expr_op_fdiv_q); p = isl_printer_print_str(p, name); p = isl_printer_print_str(p, "("); p = print_at_c(p, expr->u.op.args, 0); p = isl_printer_print_str(p, ", "); p = print_at_c(p, expr->u.op.args, 1); p = isl_printer_print_str(p, ")"); break; } if (expr->u.op.op == isl_ast_expr_op_max || expr->u.op.op == isl_ast_expr_op_min) { p = print_min_max_c(p, expr); break; } if (expr->u.op.op == isl_ast_expr_op_cond || expr->u.op.op == isl_ast_expr_op_select) { p = print_at_c(p, expr->u.op.args, 0); p = isl_printer_print_str(p, " ? "); p = print_at_c(p, expr->u.op.args, 1); p = isl_printer_print_str(p, " : "); p = print_at_c(p, expr->u.op.args, 2); break; } if (n != 2) isl_die(isl_printer_get_ctx(p), isl_error_internal, "operation should have two arguments", return isl_printer_free(p)); p = print_sub_expr_c(p, expr, 0, 1); if (expr->u.op.op != isl_ast_expr_op_member) p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, get_op_str_c(p, expr->u.op.op)); if (expr->u.op.op != isl_ast_expr_op_member) p = isl_printer_print_str(p, " "); p = print_sub_expr_c(p, expr, 1, 0); break; case isl_ast_expr_id: p = isl_printer_print_str(p, isl_id_get_name(expr->u.id)); break; case isl_ast_expr_int: p = isl_printer_print_val(p, expr->u.v); break; case isl_ast_expr_error: break; } return p; } /* Textual representation of the isl_ast_expr_op_type elements * for use in a YAML representation of an isl_ast_expr. */ static char *op_str[] = { [isl_ast_expr_op_and] = "and", [isl_ast_expr_op_and_then] = "and_then", [isl_ast_expr_op_or] = "or", [isl_ast_expr_op_or_else] = "or_else", [isl_ast_expr_op_max] = "max", [isl_ast_expr_op_min] = "min", [isl_ast_expr_op_minus] = "minus", [isl_ast_expr_op_add] = "add", [isl_ast_expr_op_sub] = "sub", [isl_ast_expr_op_mul] = "mul", [isl_ast_expr_op_div] = "div", [isl_ast_expr_op_fdiv_q] = "fdiv_q", [isl_ast_expr_op_pdiv_q] = "pdiv_q", [isl_ast_expr_op_pdiv_r] = "pdiv_r", [isl_ast_expr_op_zdiv_r] = "zdiv_r", [isl_ast_expr_op_cond] = "cond", [isl_ast_expr_op_select] = "select", [isl_ast_expr_op_eq] = "eq", [isl_ast_expr_op_le] = "le", [isl_ast_expr_op_lt] = "lt", [isl_ast_expr_op_ge] = "ge", [isl_ast_expr_op_gt] = "gt", [isl_ast_expr_op_call] = "call", [isl_ast_expr_op_access] = "access", [isl_ast_expr_op_member] = "member", [isl_ast_expr_op_address_of] = "address_of" }; static __isl_give isl_printer *print_ast_expr_isl(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr); /* Print the arguments of "expr" to "p" in isl format. * * If there are no arguments, then nothing needs to be printed. * Otherwise add an "args" key to the current mapping with as value * the list of arguments of "expr". */ static __isl_give isl_printer *print_arguments(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { int i; isl_size n; n = isl_ast_expr_get_op_n_arg(expr); if (n < 0) return isl_printer_free(p); if (n == 0) return p; p = isl_printer_print_str(p, "args"); p = isl_printer_yaml_next(p); p = isl_printer_yaml_start_sequence(p); for (i = 0; i < n; ++i) { isl_ast_expr *arg; arg = isl_ast_expr_get_op_arg(expr, i); p = print_ast_expr_isl(p, arg); isl_ast_expr_free(arg); p = isl_printer_yaml_next(p); } p = isl_printer_yaml_end_sequence(p); return p; } /* Textual representations of the YAML keys for an isl_ast_expr object. */ static char *expr_str[] = { [isl_ast_expr_op] = "op", [isl_ast_expr_id] = "id", [isl_ast_expr_int] = "val", }; /* Print "expr" to "p" in isl format. * * In particular, print the isl_ast_expr as a YAML document. */ static __isl_give isl_printer *print_ast_expr_isl(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { enum isl_ast_expr_type type; enum isl_ast_expr_op_type op; isl_id *id; isl_val *v; if (!expr) return isl_printer_free(p); p = isl_printer_yaml_start_mapping(p); type = isl_ast_expr_get_type(expr); switch (type) { case isl_ast_expr_error: return isl_printer_free(p); case isl_ast_expr_op: op = isl_ast_expr_get_op_type(expr); if (op == isl_ast_expr_op_error) return isl_printer_free(p); p = isl_printer_print_str(p, expr_str[type]); p = isl_printer_yaml_next(p); p = isl_printer_print_str(p, op_str[op]); p = isl_printer_yaml_next(p); p = print_arguments(p, expr); break; case isl_ast_expr_id: p = isl_printer_print_str(p, expr_str[type]); p = isl_printer_yaml_next(p); id = isl_ast_expr_get_id(expr); p = isl_printer_print_id(p, id); isl_id_free(id); break; case isl_ast_expr_int: p = isl_printer_print_str(p, expr_str[type]); p = isl_printer_yaml_next(p); v = isl_ast_expr_get_val(expr); p = isl_printer_print_val(p, v); isl_val_free(v); break; } p = isl_printer_yaml_end_mapping(p); return p; } /* Print "expr" to "p". * * Only an isl and a C format are supported. */ __isl_give isl_printer *isl_printer_print_ast_expr(__isl_take isl_printer *p, __isl_keep isl_ast_expr *expr) { int format; if (!p) return NULL; format = isl_printer_get_output_format(p); switch (format) { case ISL_FORMAT_ISL: p = print_ast_expr_isl(p, expr); break; case ISL_FORMAT_C: p = print_ast_expr_c(p, expr); break; default: isl_die(isl_printer_get_ctx(p), isl_error_unsupported, "output format not supported for ast_expr", return isl_printer_free(p)); } return p; } #undef KEY #define KEY enum isl_ast_expr_op_type #undef KEY_ERROR #define KEY_ERROR isl_ast_expr_op_error #undef KEY_END #define KEY_END (isl_ast_expr_op_address_of + 1) #undef KEY_STR #define KEY_STR op_str #undef KEY_EXTRACT #define KEY_EXTRACT extract_op_type #undef KEY_GET #define KEY_GET get_op_type #include "extract_key.c" /* Return the next token, which is assumed to be a key in a YAML mapping, * from "s" as a string. */ static __isl_give char *next_key(__isl_keep isl_stream *s) { struct isl_token *tok; char *str; isl_ctx *ctx; if (!s) return NULL; tok = isl_stream_next_token(s); if (!tok) { isl_stream_error(s, NULL, "unexpected EOF"); return NULL; } ctx = isl_stream_get_ctx(s); str = isl_token_get_str(ctx, tok); isl_token_free(tok); return str; } /* Remove the next token, which is assumed to be the key "expected" * in a YAML mapping, from "s" and move to the corresponding value. */ static isl_stat eat_key(__isl_keep isl_stream *s, const char *expected) { char *str; int ok; str = next_key(s); if (!str) return isl_stat_error; ok = !strcmp(str, expected); free(str); if (!ok) { isl_stream_error(s, NULL, "expecting different key"); return isl_stat_error; } if (isl_stream_yaml_next(s) < 0) return isl_stat_error; return isl_stat_ok; } #undef EL_BASE #define EL_BASE ast_expr #include /* Read an isl_ast_expr object of type isl_ast_expr_op from "s", * where the "op" key has already been read by the caller. * * Read the operation type and the arguments and * return the corresponding isl_ast_expr object. */ static __isl_give isl_ast_expr *read_op(__isl_keep isl_stream *s) { enum isl_ast_expr_op_type op; isl_ast_expr_list *list; op = get_op_type(s); if (op < 0) return NULL; if (isl_stream_yaml_next(s) < 0) return NULL; if (eat_key(s, "args") < 0) return NULL; list = isl_stream_yaml_read_ast_expr_list(s); return alloc_op(op, list); } /* Read an isl_ast_expr object of type isl_ast_expr_id from "s", * where the "id" key has already been read by the caller. */ static __isl_give isl_ast_expr *read_id(__isl_keep isl_stream *s) { return isl_ast_expr_from_id(isl_stream_read_id(s)); } /* Read an isl_ast_expr object of type isl_ast_expr_int from "s", * where the "val" key has already been read by the caller. */ static __isl_give isl_ast_expr *read_int(__isl_keep isl_stream *s) { return isl_ast_expr_from_val(isl_stream_read_val(s)); } #undef KEY #define KEY enum isl_ast_expr_type #undef KEY_ERROR #define KEY_ERROR isl_ast_expr_error #undef KEY_END #define KEY_END (isl_ast_expr_int + 1) #undef KEY_STR #define KEY_STR expr_str #undef KEY_EXTRACT #define KEY_EXTRACT extract_expr_type #undef KEY_GET #define KEY_GET get_expr_type #include "extract_key.c" /* Read an isl_ast_expr object from "s". * * The keys in the YAML mapping are assumed to appear * in the same order as the one in which they are printed * by print_ast_expr_isl. * In particular, the isl_ast_expr_op type, which is the only one * with more than one element, is identified by the "op" key and * not by the "args" key. */ __isl_give isl_ast_expr *isl_stream_read_ast_expr(__isl_keep isl_stream *s) { enum isl_ast_expr_type type; isl_bool more; isl_ast_expr *expr; if (isl_stream_yaml_read_start_mapping(s)) return NULL; more = isl_stream_yaml_next(s); if (more < 0) return NULL; if (!more) { isl_stream_error(s, NULL, "missing key"); return NULL; } type = get_expr_type(s); if (type < 0) return NULL; if (isl_stream_yaml_next(s) < 0) return NULL; switch (type) { case isl_ast_expr_op: expr = read_op(s); break; case isl_ast_expr_id: expr = read_id(s); break; case isl_ast_expr_int: expr = read_int(s); break; case isl_ast_expr_error: return NULL; } if (isl_stream_yaml_read_end_mapping(s) < 0) return isl_ast_expr_free(expr); return expr; } static __isl_give isl_printer *print_ast_node_isl(__isl_take isl_printer *p, __isl_keep isl_ast_node *node); /* Print a YAML sequence containing the entries in "list" to "p". */ static __isl_give isl_printer *print_ast_node_list(__isl_take isl_printer *p, __isl_keep isl_ast_node_list *list) { int i; isl_size n; n = isl_ast_node_list_n_ast_node(list); if (n < 0) return isl_printer_free(p); p = isl_printer_yaml_start_sequence(p); for (i = 0; i < n; ++i) { isl_ast_node *node; node = isl_ast_node_list_get_ast_node(list, i); p = print_ast_node_isl(p, node); isl_ast_node_free(node); p = isl_printer_yaml_next(p); } p = isl_printer_yaml_end_sequence(p); return p; } /* Print "node" to "p" in "isl format". * * In particular, print the isl_ast_node as a YAML document. */ static __isl_give isl_printer *print_ast_node_isl(__isl_take isl_printer *p, __isl_keep isl_ast_node *node) { switch (node->type) { case isl_ast_node_for: p = isl_printer_yaml_start_mapping(p); p = isl_printer_print_str(p, "iterator"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.f.iterator); p = isl_printer_yaml_next(p); if (node->u.f.degenerate) { p = isl_printer_print_str(p, "value"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.f.init); p = isl_printer_yaml_next(p); } else { p = isl_printer_print_str(p, "init"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.f.init); p = isl_printer_yaml_next(p); p = isl_printer_print_str(p, "cond"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.f.cond); p = isl_printer_yaml_next(p); p = isl_printer_print_str(p, "inc"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.f.inc); p = isl_printer_yaml_next(p); } if (node->u.f.body) { p = isl_printer_print_str(p, "body"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_node(p, node->u.f.body); p = isl_printer_yaml_next(p); } p = isl_printer_yaml_end_mapping(p); break; case isl_ast_node_mark: p = isl_printer_yaml_start_mapping(p); p = isl_printer_print_str(p, "mark"); p = isl_printer_yaml_next(p); p = isl_printer_print_id(p, node->u.m.mark); p = isl_printer_yaml_next(p); p = isl_printer_print_str(p, "node"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_node(p, node->u.m.node); p = isl_printer_yaml_end_mapping(p); break; case isl_ast_node_user: p = isl_printer_yaml_start_mapping(p); p = isl_printer_print_str(p, "user"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.e.expr); p = isl_printer_yaml_end_mapping(p); break; case isl_ast_node_if: p = isl_printer_yaml_start_mapping(p); p = isl_printer_print_str(p, "guard"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_expr(p, node->u.i.guard); p = isl_printer_yaml_next(p); if (node->u.i.then) { p = isl_printer_print_str(p, "then"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_node(p, node->u.i.then); p = isl_printer_yaml_next(p); } if (node->u.i.else_node) { p = isl_printer_print_str(p, "else"); p = isl_printer_yaml_next(p); p = isl_printer_print_ast_node(p, node->u.i.else_node); } p = isl_printer_yaml_end_mapping(p); break; case isl_ast_node_block: p = print_ast_node_list(p, node->u.b.children); break; case isl_ast_node_error: break; } return p; } /* Do we need to print a block around the body "node" of a for or if node? * * If the node is a block, then we need to print a block. * Also if the node is a degenerate for then we will print it as * an assignment followed by the body of the for loop, so we need a block * as well. * If the node is an if node with an else, then we print a block * to avoid spurious dangling else warnings emitted by some compilers. * If the node is a mark, then in principle, we would have to check * the child of the mark node. However, even if the child would not * require us to print a block, for readability it is probably best * to print a block anyway. * If the ast_always_print_block option has been set, then we print a block. */ static int need_block(__isl_keep isl_ast_node *node) { isl_ctx *ctx; if (node->type == isl_ast_node_block) return 1; if (node->type == isl_ast_node_for && node->u.f.degenerate) return 1; if (node->type == isl_ast_node_if && node->u.i.else_node) return 1; if (node->type == isl_ast_node_mark) return 1; ctx = isl_ast_node_get_ctx(node); return isl_options_get_ast_always_print_block(ctx); } static __isl_give isl_printer *print_ast_node_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int in_block, int in_list); static __isl_give isl_printer *print_if_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int new_line, int force_block); /* Print the body "node" of a for or if node. * If "else_node" is set, then it is printed as well. * If "force_block" is set, then print out the body as a block. * * We first check if we need to print out a block. * We always print out a block if there is an else node to make * sure that the else node is matched to the correct if node. * For consistency, the corresponding else node is also printed as a block. * * If the else node is itself an if, then we print it as * * } else if (..) { * } * * Otherwise the else node is printed as * * } else { * node * } */ static __isl_give isl_printer *print_body_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_node *else_node, __isl_keep isl_ast_print_options *options, int force_block) { if (!node) return isl_printer_free(p); if (!force_block && !else_node && !need_block(node)) { p = isl_printer_end_line(p); p = isl_printer_indent(p, 2); p = isl_ast_node_print(node, p, isl_ast_print_options_copy(options)); p = isl_printer_indent(p, -2); return p; } p = isl_printer_print_str(p, " {"); p = isl_printer_end_line(p); p = isl_printer_indent(p, 2); p = print_ast_node_c(p, node, options, 1, 0); p = isl_printer_indent(p, -2); p = isl_printer_start_line(p); p = isl_printer_print_str(p, "}"); if (else_node) { if (else_node->type == isl_ast_node_if) { p = isl_printer_print_str(p, " else "); p = print_if_c(p, else_node, options, 0, 1); } else { p = isl_printer_print_str(p, " else"); p = print_body_c(p, else_node, NULL, options, 1); } } else p = isl_printer_end_line(p); return p; } /* Print the start of a compound statement. */ static __isl_give isl_printer *start_block(__isl_take isl_printer *p) { p = isl_printer_start_line(p); p = isl_printer_print_str(p, "{"); p = isl_printer_end_line(p); p = isl_printer_indent(p, 2); return p; } /* Print the end of a compound statement. */ static __isl_give isl_printer *end_block(__isl_take isl_printer *p) { p = isl_printer_indent(p, -2); p = isl_printer_start_line(p); p = isl_printer_print_str(p, "}"); p = isl_printer_end_line(p); return p; } /* Print the for node "node". * * If the for node is degenerate, it is printed as * * type iterator = init; * body * * Otherwise, it is printed as * * for (type iterator = init; cond; iterator += inc) * body * * "in_block" is set if we are currently inside a block. * "in_list" is set if the current node is not alone in the block. * If we are not in a block or if the current not is not alone in the block * then we print a block around a degenerate for loop such that the variable * declaration will not conflict with any potential other declaration * of the same variable. */ static __isl_give isl_printer *print_for_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int in_block, int in_list) { isl_id *id; const char *name; const char *type; type = isl_options_get_ast_iterator_type(isl_printer_get_ctx(p)); if (!node->u.f.degenerate) { id = isl_ast_expr_get_id(node->u.f.iterator); name = isl_id_get_name(id); isl_id_free(id); p = isl_printer_start_line(p); p = isl_printer_print_str(p, "for ("); p = isl_printer_print_str(p, type); p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, name); p = isl_printer_print_str(p, " = "); p = isl_printer_print_ast_expr(p, node->u.f.init); p = isl_printer_print_str(p, "; "); p = isl_printer_print_ast_expr(p, node->u.f.cond); p = isl_printer_print_str(p, "; "); p = isl_printer_print_str(p, name); p = isl_printer_print_str(p, " += "); p = isl_printer_print_ast_expr(p, node->u.f.inc); p = isl_printer_print_str(p, ")"); p = print_body_c(p, node->u.f.body, NULL, options, 0); } else { id = isl_ast_expr_get_id(node->u.f.iterator); name = isl_id_get_name(id); isl_id_free(id); if (!in_block || in_list) p = start_block(p); p = isl_printer_start_line(p); p = isl_printer_print_str(p, type); p = isl_printer_print_str(p, " "); p = isl_printer_print_str(p, name); p = isl_printer_print_str(p, " = "); p = isl_printer_print_ast_expr(p, node->u.f.init); p = isl_printer_print_str(p, ";"); p = isl_printer_end_line(p); p = print_ast_node_c(p, node->u.f.body, options, 1, 0); if (!in_block || in_list) p = end_block(p); } return p; } /* Print the if node "node". * If "new_line" is set then the if node should be printed on a new line. * If "force_block" is set, then print out the body as a block. */ static __isl_give isl_printer *print_if_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int new_line, int force_block) { if (new_line) p = isl_printer_start_line(p); p = isl_printer_print_str(p, "if ("); p = isl_printer_print_ast_expr(p, node->u.i.guard); p = isl_printer_print_str(p, ")"); p = print_body_c(p, node->u.i.then, node->u.i.else_node, options, force_block); return p; } /* Print the "node" to "p". * * "in_block" is set if we are currently inside a block. * If so, we do not print a block around the children of a block node. * We do this to avoid an extra block around the body of a degenerate * for node. * * "in_list" is set if the current node is not alone in the block. */ static __isl_give isl_printer *print_ast_node_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int in_block, int in_list) { switch (node->type) { case isl_ast_node_for: if (options->print_for) return options->print_for(p, isl_ast_print_options_copy(options), node, options->print_for_user); p = print_for_c(p, node, options, in_block, in_list); break; case isl_ast_node_if: p = print_if_c(p, node, options, 1, 0); break; case isl_ast_node_block: if (!in_block) p = start_block(p); p = isl_ast_node_list_print(node->u.b.children, p, options); if (!in_block) p = end_block(p); break; case isl_ast_node_mark: p = isl_printer_start_line(p); p = isl_printer_print_str(p, "// "); p = isl_printer_print_str(p, isl_id_get_name(node->u.m.mark)); p = isl_printer_end_line(p); p = print_ast_node_c(p, node->u.m.node, options, 0, in_list); break; case isl_ast_node_user: if (options->print_user) return options->print_user(p, isl_ast_print_options_copy(options), node, options->print_user_user); p = isl_printer_start_line(p); p = isl_printer_print_ast_expr(p, node->u.e.expr); p = isl_printer_print_str(p, ";"); p = isl_printer_end_line(p); break; case isl_ast_node_error: break; } return p; } /* Print the for node "node" to "p". */ __isl_give isl_printer *isl_ast_node_for_print(__isl_keep isl_ast_node *node, __isl_take isl_printer *p, __isl_take isl_ast_print_options *options) { if (isl_ast_node_check_for(node) < 0 || !options) goto error; p = print_for_c(p, node, options, 0, 0); isl_ast_print_options_free(options); return p; error: isl_ast_print_options_free(options); isl_printer_free(p); return NULL; } /* Print the if node "node" to "p". */ __isl_give isl_printer *isl_ast_node_if_print(__isl_keep isl_ast_node *node, __isl_take isl_printer *p, __isl_take isl_ast_print_options *options) { if (isl_ast_node_check_if(node) < 0 || !options) goto error; p = print_if_c(p, node, options, 1, 0); isl_ast_print_options_free(options); return p; error: isl_ast_print_options_free(options); isl_printer_free(p); return NULL; } /* Print "node" to "p". * * "node" is assumed to be either the outermost node in an AST or * a node that is known not to be a block. * If "node" is a block (and is therefore outermost) and * if the ast_print_outermost_block options is not set, * then act as if the printing occurs inside a block, such * that no "extra" block will get printed. */ __isl_give isl_printer *isl_ast_node_print(__isl_keep isl_ast_node *node, __isl_take isl_printer *p, __isl_take isl_ast_print_options *options) { int in_block = 0; if (!options || !node) goto error; if (node->type == isl_ast_node_block) { isl_ctx *ctx; ctx = isl_ast_node_get_ctx(node); in_block = !isl_options_get_ast_print_outermost_block(ctx); } p = print_ast_node_c(p, node, options, in_block, 0); isl_ast_print_options_free(options); return p; error: isl_ast_print_options_free(options); isl_printer_free(p); return NULL; } /* Print "node" to "p". */ __isl_give isl_printer *isl_printer_print_ast_node(__isl_take isl_printer *p, __isl_keep isl_ast_node *node) { int format; isl_ast_print_options *options; if (!p) return NULL; format = isl_printer_get_output_format(p); switch (format) { case ISL_FORMAT_ISL: p = print_ast_node_isl(p, node); break; case ISL_FORMAT_C: options = isl_ast_print_options_alloc(isl_printer_get_ctx(p)); p = isl_ast_node_print(node, p, options); break; default: isl_die(isl_printer_get_ctx(p), isl_error_unsupported, "output format not supported for ast_node", return isl_printer_free(p)); } return p; } /* Print the list of nodes "list" to "p". */ __isl_give isl_printer *isl_ast_node_list_print( __isl_keep isl_ast_node_list *list, __isl_take isl_printer *p, __isl_keep isl_ast_print_options *options) { int i; if (!p || !list || !options) return isl_printer_free(p); for (i = 0; i < list->n; ++i) p = print_ast_node_c(p, list->p[i], options, 1, 1); return p; } /* Is the next token on "s" the start of a YAML sequence * (rather than a YAML mapping)? * * A YAML sequence starts with either a '[' or a '-', depending on the format. */ static isl_bool next_is_sequence(__isl_keep isl_stream *s) { struct isl_token *tok; int type; int seq; tok = isl_stream_next_token(s); if (!tok) return isl_bool_error; type = isl_token_get_type(tok); seq = type == '[' || type == '-'; isl_stream_push_token(s, tok); return isl_bool_ok(seq); } #undef EL_BASE #define EL_BASE ast_node #include /* Read an isl_ast_node object of type isl_ast_node_block from "s". */ static __isl_give isl_ast_node *read_block(__isl_keep isl_stream *s) { isl_ast_node_list *children; children = isl_stream_yaml_read_ast_node_list(s); return isl_ast_node_block_from_children(children); } /* Textual representation of the first YAML key used * while printing an isl_ast_node of a given type. * * An isl_ast_node of type isl_ast_node_block is not printed * as a YAML mapping and is therefore assigned a dummy key. */ static char *node_first_str[] = { [isl_ast_node_for] = "iterator", [isl_ast_node_mark] = "mark", [isl_ast_node_user] = "user", [isl_ast_node_if] = "guard", [isl_ast_node_block] = "", }; #undef KEY #define KEY enum isl_ast_node_type #undef KEY_ERROR #define KEY_ERROR isl_ast_node_error #undef KEY_END #define KEY_END (isl_ast_node_user + 1) #undef KEY_STR #define KEY_STR node_first_str #undef KEY_EXTRACT #define KEY_EXTRACT extract_node_type #undef KEY_GET #define KEY_GET get_node_type #include "extract_key.c" static __isl_give isl_ast_node *read_body(__isl_keep isl_stream *s, __isl_take isl_ast_node *node) { if (eat_key(s, "body") < 0) return isl_ast_node_free(node); node = isl_ast_node_for_set_body(node, isl_stream_read_ast_node(s)); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); return node; } /* Read an isl_ast_node object of type isl_ast_node_for from "s", * where the initial "iterator" key has already been read by the caller. * * If the initial value is printed as the value of the key "value", * then the for-loop is degenerate and can at most have * a further "body" element. * Otherwise, the for-loop also has "cond" and "inc" elements. */ static __isl_give isl_ast_node *read_for(__isl_keep isl_stream *s) { isl_id *id; isl_ast_expr *expr; isl_ast_node *node; char *key; isl_bool more; int is_value, is_init; expr = isl_stream_read_ast_expr(s); id = isl_ast_expr_id_get_id(expr); isl_ast_expr_free(expr); if (!id) return NULL; if (isl_stream_yaml_next(s) < 0) id = isl_id_free(id); node = isl_ast_node_alloc_for(id); key = next_key(s); if (!key) return isl_ast_node_free(node); is_value = !strcmp(key, "value"); is_init = !strcmp(key, "init"); free(key); if (!is_value && !is_init) isl_die(isl_stream_get_ctx(s), isl_error_invalid, "unexpected key", return isl_ast_node_free(node)); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); node = isl_ast_node_for_set_init(node, isl_stream_read_ast_expr(s)); if ((more = isl_stream_yaml_next(s)) < 0) return isl_ast_node_free(node); if (is_value) { node = isl_ast_node_for_mark_degenerate(node); if (more) node = read_body(s, node); return node; } if (eat_key(s, "cond") < 0) return isl_ast_node_free(node); node = isl_ast_node_for_set_cond(node, isl_stream_read_ast_expr(s)); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); if (eat_key(s, "inc") < 0) return isl_ast_node_free(node); node = isl_ast_node_for_set_inc(node, isl_stream_read_ast_expr(s)); if ((more = isl_stream_yaml_next(s)) < 0) return isl_ast_node_free(node); if (more) node = read_body(s, node); return node; } /* Read an isl_ast_node object of type isl_ast_node_mark from "s", * where the initial "mark" key has already been read by the caller. */ static __isl_give isl_ast_node *read_mark(__isl_keep isl_stream *s) { isl_id *id; isl_ast_node *node; id = isl_stream_read_id(s); if (!id) return NULL; if (isl_stream_yaml_next(s) < 0) goto error; if (eat_key(s, "node") < 0) goto error; node = isl_stream_read_ast_node(s); node = isl_ast_node_alloc_mark(id, node); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); return node; error: isl_id_free(id); return NULL; } /* Read an isl_ast_node object of type isl_ast_node_user from "s", * where the "user" key has already been read by the caller. */ static __isl_give isl_ast_node *read_user(__isl_keep isl_stream *s) { isl_ast_node *node; node = isl_ast_node_alloc_user(isl_stream_read_ast_expr(s)); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); return node; } /* Read an isl_ast_node object of type isl_ast_node_if from "s", * where the initial "guard" key has already been read by the caller. */ static __isl_give isl_ast_node *read_if(__isl_keep isl_stream *s) { isl_bool more; isl_ast_node *node; node = isl_ast_node_alloc_if(isl_stream_read_ast_expr(s)); if ((more = isl_stream_yaml_next(s)) < 0) return isl_ast_node_free(node); if (!more) return node; if (eat_key(s, "then") < 0) return isl_ast_node_free(node); node = isl_ast_node_if_set_then(node, isl_stream_read_ast_node(s)); if ((more = isl_stream_yaml_next(s)) < 0) return isl_ast_node_free(node); if (!more) return node; if (eat_key(s, "else") < 0) return isl_ast_node_free(node); node = isl_ast_node_if_set_else_node(node, isl_stream_read_ast_node(s)); if (isl_stream_yaml_next(s) < 0) return isl_ast_node_free(node); return node; } /* Read an isl_ast_node object from "s". * * A block node is printed as a YAML sequence by print_ast_node_isl. * Every other node type is printed as a YAML mapping. * * First check if the next element is a sequence and if so, * read a block node. * Otherwise, read a node based on the first mapping key * that is used to print a node type. * Note that the keys in the YAML mapping are assumed to appear * in the same order as the one in which they are printed * by print_ast_node_isl. */ __isl_give isl_ast_node *isl_stream_read_ast_node(__isl_keep isl_stream *s) { enum isl_ast_node_type type; isl_bool more; isl_bool seq; isl_ast_node *node; seq = next_is_sequence(s); if (seq < 0) return NULL; if (seq) return read_block(s); if (isl_stream_yaml_read_start_mapping(s)) return NULL; more = isl_stream_yaml_next(s); if (more < 0) return NULL; if (!more) { isl_stream_error(s, NULL, "missing key"); return NULL; } type = get_node_type(s); if (type < 0) return NULL; if (isl_stream_yaml_next(s) < 0) return NULL; switch (type) { case isl_ast_node_block: isl_die(isl_stream_get_ctx(s), isl_error_internal, "block cannot be detected as mapping", return NULL); case isl_ast_node_for: node = read_for(s); break; case isl_ast_node_mark: node = read_mark(s); break; case isl_ast_node_user: node = read_user(s); break; case isl_ast_node_if: node = read_if(s); break; case isl_ast_node_error: return NULL; } if (isl_stream_yaml_read_end_mapping(s) < 0) return isl_ast_node_free(node); return node; } #define ISL_AST_MACRO_FDIV_Q (1 << 0) #define ISL_AST_MACRO_MIN (1 << 1) #define ISL_AST_MACRO_MAX (1 << 2) #define ISL_AST_MACRO_ALL (ISL_AST_MACRO_FDIV_Q | \ ISL_AST_MACRO_MIN | \ ISL_AST_MACRO_MAX) static int ast_expr_required_macros(__isl_keep isl_ast_expr *expr, int macros); /* Wrapper around ast_expr_required_macros for use * as an isl_ast_expr_list_foreach callback. */ static isl_stat entry_required_macros(__isl_take isl_ast_expr *expr, void *user) { int *macros = user; *macros = ast_expr_required_macros(expr, *macros); isl_ast_expr_free(expr); return isl_stat_ok; } /* If "expr" contains an isl_ast_expr_op_min, isl_ast_expr_op_max or * isl_ast_expr_op_fdiv_q then set the corresponding bit in "macros". */ static int ast_expr_required_macros(__isl_keep isl_ast_expr *expr, int macros) { if (macros == ISL_AST_MACRO_ALL) return macros; if (expr->type != isl_ast_expr_op) return macros; if (expr->u.op.op == isl_ast_expr_op_min) macros |= ISL_AST_MACRO_MIN; if (expr->u.op.op == isl_ast_expr_op_max) macros |= ISL_AST_MACRO_MAX; if (expr->u.op.op == isl_ast_expr_op_fdiv_q) macros |= ISL_AST_MACRO_FDIV_Q; isl_ast_expr_list_foreach(expr->u.op.args, &entry_required_macros, ¯os); return macros; } static int ast_node_list_required_macros(__isl_keep isl_ast_node_list *list, int macros); /* If "node" contains an isl_ast_expr_op_min, isl_ast_expr_op_max or * isl_ast_expr_op_fdiv_q then set the corresponding bit in "macros". */ static int ast_node_required_macros(__isl_keep isl_ast_node *node, int macros) { if (macros == ISL_AST_MACRO_ALL) return macros; switch (node->type) { case isl_ast_node_for: macros = ast_expr_required_macros(node->u.f.init, macros); if (!node->u.f.degenerate) { macros = ast_expr_required_macros(node->u.f.cond, macros); macros = ast_expr_required_macros(node->u.f.inc, macros); } macros = ast_node_required_macros(node->u.f.body, macros); break; case isl_ast_node_if: macros = ast_expr_required_macros(node->u.i.guard, macros); macros = ast_node_required_macros(node->u.i.then, macros); if (node->u.i.else_node) macros = ast_node_required_macros(node->u.i.else_node, macros); break; case isl_ast_node_block: macros = ast_node_list_required_macros(node->u.b.children, macros); break; case isl_ast_node_mark: macros = ast_node_required_macros(node->u.m.node, macros); break; case isl_ast_node_user: macros = ast_expr_required_macros(node->u.e.expr, macros); break; case isl_ast_node_error: break; } return macros; } /* If "list" contains an isl_ast_expr_op_min, isl_ast_expr_op_max or * isl_ast_expr_op_fdiv_q then set the corresponding bit in "macros". */ static int ast_node_list_required_macros(__isl_keep isl_ast_node_list *list, int macros) { int i; for (i = 0; i < list->n; ++i) macros = ast_node_required_macros(list->p[i], macros); return macros; } /* Data structure for keeping track of whether a macro definition * for a given type has already been printed. * The value is zero if no definition has been printed and non-zero otherwise. */ struct isl_ast_expr_op_printed { char printed[isl_ast_expr_op_last + 1]; }; /* Create an empty struct isl_ast_expr_op_printed. */ static void *create_printed(isl_ctx *ctx) { return isl_calloc_type(ctx, struct isl_ast_expr_op_printed); } /* Free a struct isl_ast_expr_op_printed. */ static void free_printed(void *user) { free(user); } /* Ensure that "p" has an isl_ast_expr_op_printed note identified by "id". */ static __isl_give isl_printer *alloc_printed(__isl_take isl_printer *p, __isl_keep isl_id *id) { return alloc_note(p, id, &create_printed, &free_printed); } /* Create an identifier that is used to store * an isl_ast_expr_op_printed note. */ static __isl_give isl_id *printed_id(isl_ctx *ctx) { return isl_id_alloc(ctx, "isl_ast_expr_op_type_printed", NULL); } /* Did the user specify that a macro definition should only be * printed once and has a macro definition for "type" already * been printed to "p"? * If definitions should only be printed once, but a definition * for "p" has not yet been printed, then mark it as having been * printed so that it will not printed again. * The actual printing is taken care of by the caller. */ static isl_bool already_printed_once(__isl_keep isl_printer *p, enum isl_ast_expr_op_type type) { isl_ctx *ctx; isl_id *id; struct isl_ast_expr_op_printed *printed; if (!p) return isl_bool_error; ctx = isl_printer_get_ctx(p); if (!isl_options_get_ast_print_macro_once(ctx)) return isl_bool_false; if (type > isl_ast_expr_op_last) isl_die(isl_printer_get_ctx(p), isl_error_invalid, "invalid type", return isl_bool_error); id = printed_id(isl_printer_get_ctx(p)); p = alloc_printed(p, id); printed = get_note(p, id); isl_id_free(id); if (!printed) return isl_bool_error; if (printed->printed[type]) return isl_bool_true; printed->printed[type] = 1; return isl_bool_false; } /* Print a macro definition for the operator "type". * * If the user has specified that a macro definition should * only be printed once to any given printer and if the macro definition * has already been printed to "p", then do not print the definition. */ __isl_give isl_printer *isl_ast_expr_op_type_print_macro( enum isl_ast_expr_op_type type, __isl_take isl_printer *p) { isl_bool skip; skip = already_printed_once(p, type); if (skip < 0) return isl_printer_free(p); if (skip) return p; switch (type) { case isl_ast_expr_op_min: p = isl_printer_start_line(p); p = isl_printer_print_str(p, "#define "); p = isl_printer_print_str(p, get_op_str_c(p, type)); p = isl_printer_print_str(p, "(x,y) ((x) < (y) ? (x) : (y))"); p = isl_printer_end_line(p); break; case isl_ast_expr_op_max: p = isl_printer_start_line(p); p = isl_printer_print_str(p, "#define "); p = isl_printer_print_str(p, get_op_str_c(p, type)); p = isl_printer_print_str(p, "(x,y) ((x) > (y) ? (x) : (y))"); p = isl_printer_end_line(p); break; case isl_ast_expr_op_fdiv_q: p = isl_printer_start_line(p); p = isl_printer_print_str(p, "#define "); p = isl_printer_print_str(p, get_op_str_c(p, type)); p = isl_printer_print_str(p, "(n,d) " "(((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))"); p = isl_printer_end_line(p); break; default: break; } return p; } /* This is an alternative name for the function above. */ __isl_give isl_printer *isl_ast_op_type_print_macro( enum isl_ast_expr_op_type type, __isl_take isl_printer *p) { return isl_ast_expr_op_type_print_macro(type, p); } /* Call "fn" for each type of operation represented in the "macros" * bit vector. */ static isl_stat foreach_ast_expr_op_type(int macros, isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user) { if (macros & ISL_AST_MACRO_MIN && fn(isl_ast_expr_op_min, user) < 0) return isl_stat_error; if (macros & ISL_AST_MACRO_MAX && fn(isl_ast_expr_op_max, user) < 0) return isl_stat_error; if (macros & ISL_AST_MACRO_FDIV_Q && fn(isl_ast_expr_op_fdiv_q, user) < 0) return isl_stat_error; return isl_stat_ok; } /* Call "fn" for each type of operation that appears in "expr" * and that requires a macro definition. */ isl_stat isl_ast_expr_foreach_ast_expr_op_type(__isl_keep isl_ast_expr *expr, isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user) { int macros; if (!expr) return isl_stat_error; macros = ast_expr_required_macros(expr, 0); return foreach_ast_expr_op_type(macros, fn, user); } /* This is an alternative name for the function above. */ isl_stat isl_ast_expr_foreach_ast_op_type(__isl_keep isl_ast_expr *expr, isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user) { return isl_ast_expr_foreach_ast_expr_op_type(expr, fn, user); } /* Call "fn" for each type of operation that appears in "node" * and that requires a macro definition. */ isl_stat isl_ast_node_foreach_ast_expr_op_type(__isl_keep isl_ast_node *node, isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user) { int macros; if (!node) return isl_stat_error; macros = ast_node_required_macros(node, 0); return foreach_ast_expr_op_type(macros, fn, user); } /* This is an alternative name for the function above. */ isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user) { return isl_ast_node_foreach_ast_expr_op_type(node, fn, user); } static isl_stat ast_op_type_print_macro(enum isl_ast_expr_op_type type, void *user) { isl_printer **p = user; *p = isl_ast_expr_op_type_print_macro(type, *p); return isl_stat_ok; } /* Print macro definitions for all the macros used in the result * of printing "expr". */ __isl_give isl_printer *isl_ast_expr_print_macros( __isl_keep isl_ast_expr *expr, __isl_take isl_printer *p) { if (isl_ast_expr_foreach_ast_expr_op_type(expr, &ast_op_type_print_macro, &p) < 0) return isl_printer_free(p); return p; } /* Print macro definitions for all the macros used in the result * of printing "node". */ __isl_give isl_printer *isl_ast_node_print_macros( __isl_keep isl_ast_node *node, __isl_take isl_printer *p) { if (isl_ast_node_foreach_ast_expr_op_type(node, &ast_op_type_print_macro, &p) < 0) return isl_printer_free(p); return p; } /* Return a string containing C code representing this isl_ast_expr. */ __isl_give char *isl_ast_expr_to_C_str(__isl_keep isl_ast_expr *expr) { isl_printer *p; char *str; if (!expr) return NULL; p = isl_printer_to_str(isl_ast_expr_get_ctx(expr)); p = isl_printer_set_output_format(p, ISL_FORMAT_C); p = isl_printer_print_ast_expr(p, expr); str = isl_printer_get_str(p); isl_printer_free(p); return str; } /* Return a string containing C code representing this isl_ast_node. */ __isl_give char *isl_ast_node_to_C_str(__isl_keep isl_ast_node *node) { isl_printer *p; char *str; if (!node) return NULL; p = isl_printer_to_str(isl_ast_node_get_ctx(node)); p = isl_printer_set_output_format(p, ISL_FORMAT_C); p = isl_printer_print_ast_node(p, node); str = isl_printer_get_str(p); isl_printer_free(p); return str; } isl-0.28/isl_pw_split_dims_templ.c0000664000175000017500000000141315072740040016411 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France */ #include __isl_give PW *FN(PW,split_dims)(__isl_take PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_size n_piece; n_piece = FN(PW,n_piece)(pw); if (n_piece < 0) return FN(PW,free)(pw); if (n == 0) return pw; if (type == isl_dim_in) type = isl_dim_set; for (i = 0; i < n; ++i) { isl_set *domain; domain = FN(PW,take_domain_at)(pw, i); domain = isl_set_split_dims(domain, type, first, n); pw = FN(PW,restore_domain_at)(pw, i, domain); } return pw; } isl-0.28/isl_schedule_band.h0000664000175000017500000001262515072740040015127 0ustar00skimoskimo#ifndef ISL_SCHEDULE_BAND_H #define ISL_SCHEDULE_BAND_H #include #include #include /* Information about a band within a schedule. * * n is the number of scheduling dimensions within the band. * coincident is an array of length n, indicating whether a scheduling dimension * satisfies the coincidence constraints in the sense that * the corresponding dependence distances are zero. * permutable is set if the band is permutable. * mupa is the partial schedule corresponding to this band. The dimension * of mupa is equal to n. * loop_type contains the loop AST generation types for the members * in the band. It may be NULL, if all members are * of type isl_ast_loop_default. * isolate_loop_type contains the loop AST generation types for the members * in the band for the isolated part. It may be NULL, if all members are * of type isl_ast_loop_default. * ast_build_options are the remaining AST build options associated * to the band. * anchored is set if the node depends on its position in the schedule tree. * In particular, it is set if the AST build options include * an isolate option. */ struct isl_schedule_band { int ref; int n; int *coincident; int permutable; isl_multi_union_pw_aff *mupa; int anchored; isl_union_set *ast_build_options; enum isl_ast_loop_type *loop_type; enum isl_ast_loop_type *isolate_loop_type; }; typedef struct isl_schedule_band isl_schedule_band; __isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff( __isl_take isl_multi_union_pw_aff *mupa); __isl_give isl_schedule_band *isl_schedule_band_copy( __isl_keep isl_schedule_band *band); __isl_null isl_schedule_band *isl_schedule_band_free( __isl_take isl_schedule_band *band); isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band); isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, __isl_keep isl_schedule_band *band2); int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band); __isl_give isl_space *isl_schedule_band_get_space( __isl_keep isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_intersect_domain( __isl_take isl_schedule_band *band, __isl_take isl_union_set *domain); __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( __isl_keep isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_set_partial_schedule( __isl_take isl_schedule_band *band, __isl_take isl_multi_union_pw_aff *schedule); enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type( __isl_keep isl_schedule_band *band, int pos); __isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type( __isl_take isl_schedule_band *band, int pos, enum isl_ast_loop_type type); enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type( __isl_keep isl_schedule_band *band, int pos); __isl_give isl_schedule_band * isl_schedule_band_member_set_isolate_ast_loop_type( __isl_take isl_schedule_band *band, int pos, enum isl_ast_loop_type type); __isl_give isl_union_set *isl_schedule_band_get_ast_build_options( __isl_keep isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( __isl_take isl_schedule_band *band, __isl_take isl_union_set *options); __isl_give isl_set *isl_schedule_band_get_ast_isolate_option( __isl_keep isl_schedule_band *band, int depth); __isl_give isl_schedule_band *isl_schedule_band_replace_ast_build_option( __isl_take isl_schedule_band *band, __isl_take isl_set *drop, __isl_take isl_set *add); isl_size isl_schedule_band_n_member(__isl_keep isl_schedule_band *band); isl_bool isl_schedule_band_member_get_coincident( __isl_keep isl_schedule_band *band, int pos); __isl_give isl_schedule_band *isl_schedule_band_member_set_coincident( __isl_take isl_schedule_band *band, int pos, int coincident); isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_set_permutable( __isl_take isl_schedule_band *band, int permutable); __isl_give isl_schedule_band *isl_schedule_band_scale( __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv); __isl_give isl_schedule_band *isl_schedule_band_scale_down( __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv); __isl_give isl_schedule_band *isl_schedule_band_mod( __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv); __isl_give isl_schedule_band *isl_schedule_band_tile( __isl_take isl_schedule_band *band, __isl_take isl_multi_val *sizes); __isl_give isl_schedule_band *isl_schedule_band_point( __isl_take isl_schedule_band *band, __isl_keep isl_schedule_band *tile, __isl_take isl_multi_val *sizes); __isl_give isl_schedule_band *isl_schedule_band_shift( __isl_take isl_schedule_band *band, __isl_take isl_multi_union_pw_aff *shift); __isl_give isl_schedule_band *isl_schedule_band_drop( __isl_take isl_schedule_band *band, int pos, int n); __isl_give isl_schedule_band *isl_schedule_band_gist( __isl_take isl_schedule_band *band, __isl_take isl_union_set *context); __isl_give isl_schedule_band *isl_schedule_band_reset_user( __isl_take isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_align_params( __isl_take isl_schedule_band *band, __isl_take isl_space *space); __isl_give isl_schedule_band *isl_schedule_band_pullback_union_pw_multi_aff( __isl_take isl_schedule_band *band, __isl_take isl_union_pw_multi_aff *upma); #endif isl-0.28/isl_val_sioimath.c0000664000175000017500000000364615072740040015024 0ustar00skimoskimo#include /* Return a reference to an isl_val representing the unsigned * integer value stored in the "n" chunks of size "size" at "chunks". * The least significant chunk is assumed to be stored first. */ __isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx, size_t n, size_t size, const void *chunks) { isl_val *v; v = isl_val_alloc(ctx); if (!v) return NULL; impz_import(isl_sioimath_reinit_big(v->n), n, -1, size, 0, 0, chunks); isl_sioimath_try_demote(v->n); isl_int_set_si(v->d, 1); return v; } /* Store a representation of the absolute value of the numerator of "v" * in terms of chunks of size "size" at "chunks". * The least significant chunk is stored first. * The number of chunks in the result can be obtained by calling * isl_val_n_abs_num_chunks. The user is responsible for allocating * enough memory to store the results. * * In the special case of a zero value, isl_val_n_abs_num_chunks will * return one, while impz_export will not fill in any chunks. We therefore * do it ourselves. */ isl_stat isl_val_get_abs_num_chunks(__isl_keep isl_val *v, size_t size, void *chunks) { isl_sioimath_scratchspace_t scratch; if (!v || !chunks) return isl_stat_error; if (!isl_val_is_rat(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "expecting rational value", return isl_stat_error); impz_export(chunks, NULL, -1, size, 0, 0, isl_sioimath_bigarg_src(*v->n, &scratch)); if (isl_val_is_zero(v)) memset(chunks, 0, size); return isl_stat_ok; } /* Return the number of chunks of size "size" required to * store the absolute value of the numerator of "v". */ isl_size isl_val_n_abs_num_chunks(__isl_keep isl_val *v, size_t size) { if (!v) return isl_size_error; if (!isl_val_is_rat(v)) isl_die(isl_val_get_ctx(v), isl_error_invalid, "expecting rational value", return isl_size_error); size *= 8; return (isl_sioimath_sizeinbase(*v->n, 2) + size - 1) / size; } isl-0.28/isl_pw_add_constant_multi_val_templ.c0000664000175000017500000000043615072740040020763 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #undef VAL_BASE #define VAL_BASE multi_val #include isl-0.28/isl_aff.c0000664000175000017500000101641515215726270013110 0ustar00skimoskimo/* * Copyright 2011 INRIA Saclay * Copyright 2011 Sven Verdoolaege * Copyright 2012-2014 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * Copyright 2016 Sven Verdoolaege * Copyright 2018,2020 Cerebras Systems * Copyright 2021 Sven Verdoolaege * Copyright 2021-2022 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France * and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef EL_BASE #define EL_BASE aff #include #include #undef EL_BASE #define EL_BASE pw_aff #include #include #undef EL_BASE #define EL_BASE pw_multi_aff #include #include #undef EL_BASE #define EL_BASE union_pw_aff #include #include #undef EL_BASE #define EL_BASE union_pw_multi_aff #include /* Construct an isl_aff from the given domain local space "ls" and * coefficients "v", where the local space is known to be valid * for an affine expression. */ static __isl_give isl_aff *isl_aff_alloc_vec_validated( __isl_take isl_local_space *ls, __isl_take isl_vec *v) { isl_aff *aff; if (!ls || !v) goto error; aff = isl_calloc_type(v->ctx, struct isl_aff); if (!aff) goto error; aff->ref = 1; aff->ls = ls; aff->v = v; return aff; error: isl_local_space_free(ls); isl_vec_free(v); return NULL; } /* Construct an isl_aff from the given domain local space "ls" and * coefficients "v". * * First check that "ls" is a valid domain local space * for an affine expression. */ __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls, __isl_take isl_vec *v) { isl_ctx *ctx; if (!ls) return NULL; ctx = isl_local_space_get_ctx(ls); if (!isl_local_space_divs_known(ls)) isl_die(ctx, isl_error_invalid, "local space has unknown divs", goto error); if (!isl_local_space_is_set(ls)) isl_die(ctx, isl_error_invalid, "domain of affine expression should be a set", goto error); return isl_aff_alloc_vec_validated(ls, v); error: isl_local_space_free(ls); isl_vec_free(v); return NULL; } __isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls) { isl_ctx *ctx; isl_vec *v; isl_size total; if (!ls) return NULL; ctx = isl_local_space_get_ctx(ls); total = isl_local_space_dim(ls, isl_dim_all); if (total < 0) goto error; v = isl_vec_alloc(ctx, 1 + 1 + total); return isl_aff_alloc_vec(ls, v); error: isl_local_space_free(ls); return NULL; } __isl_give isl_aff *isl_aff_copy(__isl_keep isl_aff *aff) { if (!aff) return NULL; aff->ref++; return aff; } __isl_give isl_aff *isl_aff_dup(__isl_keep isl_aff *aff) { if (!aff) return NULL; return isl_aff_alloc_vec_validated(isl_local_space_copy(aff->ls), isl_vec_copy(aff->v)); } __isl_give isl_aff *isl_aff_cow(__isl_take isl_aff *aff) { if (!aff) return NULL; if (aff->ref == 1) return aff; aff->ref--; return isl_aff_dup(aff); } /* Return a copy of the rational affine expression of "aff". */ static __isl_give isl_vec *isl_aff_get_rat_aff(__isl_keep isl_aff *aff) { if (!aff) return NULL; return isl_vec_copy(aff->v); } #undef TYPE #define TYPE isl_aff #undef FIELD_TYPE #define FIELD_TYPE isl_vec #undef FIELD_NAME #define FIELD_NAME v #undef PROPERTY #define PROPERTY rat_aff static #include "isl_take_templ.c" static #include "isl_restore_templ.c" __isl_give isl_aff *isl_aff_zero_on_domain(__isl_take isl_local_space *ls) { isl_aff *aff; aff = isl_aff_alloc(ls); if (!aff) return NULL; isl_int_set_si(aff->v->el[0], 1); isl_seq_clr(aff->v->el + 1, aff->v->size - 1); return aff; } /* Return an affine expression that is equal to zero on domain space "space". */ __isl_give isl_aff *isl_aff_zero_on_domain_space(__isl_take isl_space *space) { return isl_aff_zero_on_domain(isl_local_space_from_space(space)); } /* This function performs the same operation as isl_aff_zero_on_domain_space, * but is considered as a function on an isl_space when exported. */ __isl_give isl_aff *isl_space_zero_aff_on_domain(__isl_take isl_space *space) { return isl_aff_zero_on_domain_space(space); } /* Return a piecewise affine expression defined on the specified domain * that is equal to zero. */ __isl_give isl_pw_aff *isl_pw_aff_zero_on_domain(__isl_take isl_local_space *ls) { return isl_pw_aff_from_aff(isl_aff_zero_on_domain(ls)); } /* Change "aff" into a NaN. * * Note that this function gets called from isl_aff_nan_on_domain, * so "aff" may not have been initialized yet. */ static __isl_give isl_aff *isl_aff_set_nan(__isl_take isl_aff *aff) { isl_vec *v; v = isl_aff_take_rat_aff(aff); v = isl_vec_clr(v); aff = isl_aff_restore_rat_aff(aff, v); return aff; } /* Return an affine expression defined on the specified domain * that represents NaN. */ __isl_give isl_aff *isl_aff_nan_on_domain(__isl_take isl_local_space *ls) { isl_aff *aff; aff = isl_aff_alloc(ls); return isl_aff_set_nan(aff); } /* Return an affine expression defined on the specified domain space * that represents NaN. */ __isl_give isl_aff *isl_aff_nan_on_domain_space(__isl_take isl_space *space) { return isl_aff_nan_on_domain(isl_local_space_from_space(space)); } /* Return a piecewise affine expression defined on the specified domain space * that represents NaN. */ __isl_give isl_pw_aff *isl_pw_aff_nan_on_domain_space( __isl_take isl_space *space) { return isl_pw_aff_from_aff(isl_aff_nan_on_domain_space(space)); } /* Return a piecewise affine expression defined on the specified domain * that represents NaN. */ __isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(__isl_take isl_local_space *ls) { return isl_pw_aff_from_aff(isl_aff_nan_on_domain(ls)); } /* Return an affine expression that is equal to "val" on * domain local space "ls". * * Note that the encoding for the special value NaN * is the same in isl_val and isl_aff, so this does not need * to be treated in any special way. */ __isl_give isl_aff *isl_aff_val_on_domain(__isl_take isl_local_space *ls, __isl_take isl_val *val) { isl_aff *aff; if (!ls || !val) goto error; if (!isl_val_is_rat(val) && !isl_val_is_nan(val)) isl_die(isl_val_get_ctx(val), isl_error_invalid, "expecting rational value or NaN", goto error); aff = isl_aff_alloc(isl_local_space_copy(ls)); if (!aff) goto error; isl_seq_clr(aff->v->el + 2, aff->v->size - 2); isl_int_set(aff->v->el[1], val->n); isl_int_set(aff->v->el[0], val->d); isl_local_space_free(ls); isl_val_free(val); return aff; error: isl_local_space_free(ls); isl_val_free(val); return NULL; } /* Return an affine expression that is equal to "val" on domain space "space". */ __isl_give isl_aff *isl_aff_val_on_domain_space(__isl_take isl_space *space, __isl_take isl_val *val) { return isl_aff_val_on_domain(isl_local_space_from_space(space), val); } /* Return an affine expression that is equal to the specified dimension * in "ls". */ __isl_give isl_aff *isl_aff_var_on_domain(__isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos) { isl_space *space; isl_aff *aff; if (!ls) return NULL; space = isl_local_space_get_space(ls); if (!space) goto error; if (isl_space_is_map(space)) isl_die(isl_space_get_ctx(space), isl_error_invalid, "expecting (parameter) set space", goto error); if (isl_local_space_check_range(ls, type, pos, 1) < 0) goto error; isl_space_free(space); aff = isl_aff_alloc(ls); if (!aff) return NULL; pos += isl_local_space_offset(aff->ls, type); isl_int_set_si(aff->v->el[0], 1); isl_seq_clr(aff->v->el + 1, aff->v->size - 1); isl_int_set_si(aff->v->el[1 + pos], 1); return aff; error: isl_local_space_free(ls); isl_space_free(space); return NULL; } /* Return a piecewise affine expression that is equal to * the specified dimension in "ls". */ __isl_give isl_pw_aff *isl_pw_aff_var_on_domain(__isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos) { return isl_pw_aff_from_aff(isl_aff_var_on_domain(ls, type, pos)); } /* Return an affine expression that is equal to the parameter * in the domain space "space" with identifier "id". */ __isl_give isl_aff *isl_aff_param_on_domain_space_id( __isl_take isl_space *space, __isl_take isl_id *id) { int pos; isl_local_space *ls; if (!space || !id) goto error; pos = isl_space_find_dim_by_id(space, isl_dim_param, id); if (pos < 0) isl_die(isl_space_get_ctx(space), isl_error_invalid, "parameter not found in space", goto error); isl_id_free(id); ls = isl_local_space_from_space(space); return isl_aff_var_on_domain(ls, isl_dim_param, pos); error: isl_space_free(space); isl_id_free(id); return NULL; } /* This function performs the same operation as * isl_aff_param_on_domain_space_id, * but is considered as a function on an isl_space when exported. */ __isl_give isl_aff *isl_space_param_aff_on_domain_id( __isl_take isl_space *space, __isl_take isl_id *id) { return isl_aff_param_on_domain_space_id(space, id); } __isl_null isl_aff *isl_aff_free(__isl_take isl_aff *aff) { if (!aff) return NULL; if (--aff->ref > 0) return NULL; isl_local_space_free(aff->ls); isl_vec_free(aff->v); free(aff); return NULL; } isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff) { return aff ? isl_local_space_get_ctx(aff->ls) : NULL; } /* Return a hash value that digests "aff". */ uint32_t isl_aff_get_hash(__isl_keep isl_aff *aff) { uint32_t hash, ls_hash, v_hash; if (!aff) return 0; hash = isl_hash_init(); ls_hash = isl_local_space_get_hash(aff->ls); isl_hash_hash(hash, ls_hash); v_hash = isl_vec_get_hash(aff->v); isl_hash_hash(hash, v_hash); return hash; } #undef TYPE #define TYPE isl_aff #undef FIELD_TYPE #define FIELD_TYPE isl_local_space #undef FIELD_NAME #define FIELD_NAME ls #undef PROPERTY #define PROPERTY domain_local_space static #include "isl_peek_templ.c" #include "isl_get_templ.c" /* Return the number of variables of the given type in the domain of "aff". */ isl_size isl_aff_domain_dim(__isl_keep isl_aff *aff, enum isl_dim_type type) { isl_local_space *ls; ls = isl_aff_peek_domain_local_space(aff); return isl_local_space_dim(ls, type); } /* Externally, an isl_aff has a map space, but internally, the * ls field corresponds to the domain of that space. */ isl_size isl_aff_dim(__isl_keep isl_aff *aff, enum isl_dim_type type) { if (!aff) return isl_size_error; if (type == isl_dim_out) return 1; if (type == isl_dim_in) type = isl_dim_set; return isl_aff_domain_dim(aff, type); } /* Return the offset of the first variable of type "type" within * the variables of the domain of "aff". */ static isl_size isl_aff_domain_var_offset(__isl_keep isl_aff *aff, enum isl_dim_type type) { isl_local_space *ls; ls = isl_aff_peek_domain_local_space(aff); return isl_local_space_var_offset(ls, type); } /* Return the offset of the first coefficient of type "type" in * the domain of "aff". */ isl_size isl_aff_domain_offset(__isl_keep isl_aff *aff, enum isl_dim_type type) { isl_size offset; offset = isl_aff_domain_var_offset(aff, type); if (offset < 0) return isl_size_error; return 1 + offset; } /* Return the position of the dimension of the given type and name * in "aff". * Return -1 if no such dimension can be found. */ int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, enum isl_dim_type type, const char *name) { if (!aff) return -1; if (type == isl_dim_out) return -1; if (type == isl_dim_in) type = isl_dim_set; return isl_local_space_find_dim_by_name(aff->ls, type, name); } /* Return the domain space of "aff". */ static __isl_keep isl_space *isl_aff_peek_domain_space(__isl_keep isl_aff *aff) { return aff ? isl_local_space_peek_space(aff->ls) : NULL; } __isl_give isl_space *isl_aff_get_domain_space(__isl_keep isl_aff *aff) { return isl_space_copy(isl_aff_peek_domain_space(aff)); } __isl_give isl_space *isl_aff_get_space(__isl_keep isl_aff *aff) { isl_space *space; if (!aff) return NULL; space = isl_local_space_get_space(aff->ls); space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, 1); return space; } __isl_give isl_local_space *isl_aff_get_local_space(__isl_keep isl_aff *aff) { isl_local_space *ls; if (!aff) return NULL; ls = isl_local_space_copy(aff->ls); ls = isl_local_space_from_domain(ls); ls = isl_local_space_add_dims(ls, isl_dim_out, 1); return ls; } #undef TYPE #define TYPE isl_aff #undef FIELD_TYPE #define FIELD_TYPE isl_local_space #undef FIELD_NAME #define FIELD_NAME ls #undef PROPERTY #define PROPERTY domain_local_space #include "isl_take_templ.c" #include "isl_restore_templ.c" /* Externally, an isl_aff has a map space, but internally, the * ls field corresponds to the domain of that space. */ const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned pos) { if (!aff) return NULL; if (type == isl_dim_out) return NULL; if (type == isl_dim_in) type = isl_dim_set; return isl_local_space_get_dim_name(aff->ls, type, pos); } __isl_give isl_aff *isl_aff_reset_domain_space(__isl_take isl_aff *aff, __isl_take isl_space *space) { aff = isl_aff_cow(aff); if (!aff || !space) goto error; aff->ls = isl_local_space_reset_space(aff->ls, space); if (!aff->ls) return isl_aff_free(aff); return aff; error: isl_aff_free(aff); isl_space_free(space); return NULL; } /* Reset the space of "aff". This function is called from isl_pw_templ.c * and doesn't know if the space of an element object is represented * directly or through its domain. It therefore passes along both. */ __isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff, __isl_take isl_space *space, __isl_take isl_space *domain) { isl_space_free(space); return isl_aff_reset_domain_space(aff, domain); } /* Reorder the dimensions of the domain of "aff" according * to the given reordering. */ __isl_give isl_aff *isl_aff_realign_domain(__isl_take isl_aff *aff, __isl_take isl_reordering *r) { aff = isl_aff_cow(aff); if (!aff) goto error; r = isl_reordering_extend(r, aff->ls->div->n_row); aff->v = isl_vec_reorder(aff->v, 2, isl_reordering_copy(r)); aff->ls = isl_local_space_realign(aff->ls, r); if (!aff->v || !aff->ls) return isl_aff_free(aff); return aff; error: isl_aff_free(aff); isl_reordering_free(r); return NULL; } __isl_give isl_aff *isl_aff_align_params(__isl_take isl_aff *aff, __isl_take isl_space *model) { isl_space *domain_space; isl_bool equal_params; domain_space = isl_aff_peek_domain_space(aff); equal_params = isl_space_has_equal_params(domain_space, model); if (equal_params < 0) goto error; if (!equal_params) { isl_reordering *exp; exp = isl_parameter_alignment_reordering(domain_space, model); aff = isl_aff_realign_domain(aff, exp); } isl_space_free(model); return aff; error: isl_space_free(model); isl_aff_free(aff); return NULL; } #undef TYPE #define TYPE isl_aff #include "isl_unbind_params_templ.c" /* Is "aff" obviously equal to zero? * * If the denominator is zero, then "aff" is not equal to zero. */ isl_bool isl_aff_plain_is_zero(__isl_keep isl_aff *aff) { int pos; if (!aff) return isl_bool_error; if (isl_int_is_zero(aff->v->el[0])) return isl_bool_false; pos = isl_seq_first_non_zero(aff->v->el + 1, aff->v->size - 1); return isl_bool_ok(pos < 0); } /* Does "aff" represent NaN? */ isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff) { if (!aff) return isl_bool_error; return isl_bool_ok(!isl_seq_any_non_zero(aff->v->el, 2)); } /* Are "aff1" and "aff2" obviously equal? * * NaN is not equal to anything, not even to another NaN. */ isl_bool isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2) { isl_bool equal; if (!aff1 || !aff2) return isl_bool_error; if (isl_aff_is_nan(aff1) || isl_aff_is_nan(aff2)) return isl_bool_false; equal = isl_local_space_is_equal(aff1->ls, aff2->ls); if (equal < 0 || !equal) return equal; return isl_vec_is_equal(aff1->v, aff2->v); } /* Return the common denominator of "aff" in "v". * * We cannot return anything meaningful in case of a NaN. */ isl_stat isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v) { if (!aff) return isl_stat_error; if (isl_aff_is_nan(aff)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot get denominator of NaN", return isl_stat_error); isl_int_set(*v, aff->v->el[0]); return isl_stat_ok; } /* Return the common denominator of "aff". */ __isl_give isl_val *isl_aff_get_denominator_val(__isl_keep isl_aff *aff) { isl_ctx *ctx; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); if (isl_aff_is_nan(aff)) return isl_val_nan(ctx); return isl_val_int_from_isl_int(ctx, aff->v->el[0]); } /* Return the constant term of "aff". */ __isl_give isl_val *isl_aff_get_constant_val(__isl_keep isl_aff *aff) { isl_ctx *ctx; isl_val *v; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); if (isl_aff_is_nan(aff)) return isl_val_nan(ctx); v = isl_val_rat_from_isl_int(ctx, aff->v->el[1], aff->v->el[0]); return isl_val_normalize(v); } /* Return the coefficient of the variable of type "type" at position "pos" * of "aff". */ __isl_give isl_val *isl_aff_get_coefficient_val(__isl_keep isl_aff *aff, enum isl_dim_type type, int pos) { isl_ctx *ctx; isl_val *v; if (!aff) return NULL; ctx = isl_aff_get_ctx(aff); if (type == isl_dim_out) isl_die(ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return NULL); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return NULL; if (isl_aff_is_nan(aff)) return isl_val_nan(ctx); pos += isl_local_space_offset(aff->ls, type); v = isl_val_rat_from_isl_int(ctx, aff->v->el[1 + pos], aff->v->el[0]); return isl_val_normalize(v); } /* Return the sign of the coefficient of the variable of type "type" * at position "pos" of "aff". */ int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff, enum isl_dim_type type, int pos) { isl_ctx *ctx; if (!aff) return 0; ctx = isl_aff_get_ctx(aff); if (type == isl_dim_out) isl_die(ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return 0); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return 0; pos += isl_local_space_offset(aff->ls, type); return isl_int_sgn(aff->v->el[1 + pos]); } /* Replace the numerator of the constant term of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v) { if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_set(aff->v->el[1], v); return aff; } /* Replace the constant term of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { if (!aff || !v) goto error; if (isl_aff_is_nan(aff)) { isl_val_free(v); return aff; } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); if (isl_int_eq(aff->v->el[1], v->n) && isl_int_eq(aff->v->el[0], v->d)) { isl_val_free(v); return aff; } aff = isl_aff_cow(aff); if (!aff) goto error; aff->v = isl_vec_cow(aff->v); if (!aff->v) goto error; if (isl_int_eq(aff->v->el[0], v->d)) { isl_int_set(aff->v->el[1], v->n); } else if (isl_int_is_one(v->d)) { isl_int_mul(aff->v->el[1], aff->v->el[0], v->n); } else { isl_seq_scale(aff->v->el + 1, aff->v->el + 1, v->d, aff->v->size - 1); isl_int_mul(aff->v->el[1], aff->v->el[0], v->n); isl_int_mul(aff->v->el[0], aff->v->el[0], v->d); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } /* Add "v" to the constant term of "aff". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v) { if (isl_int_is_zero(v)) return aff; if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_addmul(aff->v->el[1], aff->v->el[0], v); return aff; } /* Add "v" to the constant term of "aff", * in case "aff" is a rational expression. */ static __isl_give isl_aff *isl_aff_add_rat_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { aff = isl_aff_cow(aff); if (!aff) goto error; aff->v = isl_vec_cow(aff->v); if (!aff->v) goto error; if (isl_int_is_one(v->d)) { isl_int_addmul(aff->v->el[1], aff->v->el[0], v->n); } else if (isl_int_eq(aff->v->el[0], v->d)) { isl_int_add(aff->v->el[1], aff->v->el[1], v->n); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } else { isl_seq_scale(aff->v->el + 1, aff->v->el + 1, v->d, aff->v->size - 1); isl_int_addmul(aff->v->el[1], aff->v->el[0], v->n); isl_int_mul(aff->v->el[0], aff->v->el[0], v->d); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } /* Return the first argument and free the second. */ static __isl_give isl_aff *pick_free(__isl_take isl_aff *aff, __isl_take isl_val *v) { isl_val_free(v); return aff; } /* Replace the first argument by NaN and free the second argument. */ static __isl_give isl_aff *set_nan_free_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { isl_val_free(v); return isl_aff_set_nan(aff); } /* Add "v" to the constant term of "aff". * * A NaN is unaffected by this operation. * Conversely, adding a NaN turns "aff" into a NaN. */ __isl_give isl_aff *isl_aff_add_constant_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { isl_bool is_nan, is_zero, is_rat; is_nan = isl_aff_is_nan(aff); is_zero = isl_val_is_zero(v); if (is_nan < 0 || is_zero < 0) goto error; if (is_nan || is_zero) return pick_free(aff, v); is_nan = isl_val_is_nan(v); is_rat = isl_val_is_rat(v); if (is_nan < 0 || is_rat < 0) goto error; if (is_nan) return set_nan_free_val(aff, v); if (!is_rat) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value or NaN", goto error); return isl_aff_add_rat_constant_val(aff, v); error: isl_aff_free(aff); isl_val_free(v); return NULL; } __isl_give isl_aff *isl_aff_add_constant_si(__isl_take isl_aff *aff, int v) { isl_int t; isl_int_init(t); isl_int_set_si(t, v); aff = isl_aff_add_constant(aff, t); isl_int_clear(t); return aff; } /* Add "v" to the numerator of the constant term of "aff". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant_num(__isl_take isl_aff *aff, isl_int v) { if (isl_int_is_zero(v)) return aff; if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_add(aff->v->el[1], aff->v->el[1], v); return aff; } /* Add "v" to the numerator of the constant term of "aff". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_constant_num_si(__isl_take isl_aff *aff, int v) { isl_int t; if (v == 0) return aff; isl_int_init(t); isl_int_set_si(t, v); aff = isl_aff_add_constant_num(aff, t); isl_int_clear(t); return aff; } /* Replace the numerator of the constant term of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_constant_si(__isl_take isl_aff *aff, int v) { if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_set_si(aff->v->el[1], v); return aff; } /* Replace the numerator of the coefficient of the variable of type "type" * at position "pos" of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, isl_int v) { if (!aff) return NULL; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return isl_aff_free(aff); if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); pos += isl_local_space_offset(aff->ls, type); isl_int_set(aff->v->el[1 + pos], v); return aff; } /* Replace the numerator of the coefficient of the variable of type "type" * at position "pos" of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v) { if (!aff) return NULL; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return isl_aff_free(aff); if (isl_aff_is_nan(aff)) return aff; pos += isl_local_space_offset(aff->ls, type); if (isl_int_cmp_si(aff->v->el[1 + pos], v) == 0) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_set_si(aff->v->el[1 + pos], v); return aff; } /* Replace the coefficient of the variable of type "type" at position "pos" * of "aff" by "v". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_set_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v) { if (!aff || !v) goto error; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", goto error); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return isl_aff_free(aff); if (isl_aff_is_nan(aff)) { isl_val_free(v); return aff; } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); pos += isl_local_space_offset(aff->ls, type); if (isl_int_eq(aff->v->el[1 + pos], v->n) && isl_int_eq(aff->v->el[0], v->d)) { isl_val_free(v); return aff; } aff = isl_aff_cow(aff); if (!aff) goto error; aff->v = isl_vec_cow(aff->v); if (!aff->v) goto error; if (isl_int_eq(aff->v->el[0], v->d)) { isl_int_set(aff->v->el[1 + pos], v->n); } else if (isl_int_is_one(v->d)) { isl_int_mul(aff->v->el[1 + pos], aff->v->el[0], v->n); } else { isl_seq_scale(aff->v->el + 1, aff->v->el + 1, v->d, aff->v->size - 1); isl_int_mul(aff->v->el[1 + pos], aff->v->el[0], v->n); isl_int_mul(aff->v->el[0], aff->v->el[0], v->d); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } /* Add "v" to the coefficient of the variable of type "type" * at position "pos" of "aff". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_coefficient(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, isl_int v) { if (!aff) return NULL; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) return isl_aff_free(aff); if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); pos += isl_local_space_offset(aff->ls, type); isl_int_addmul(aff->v->el[1 + pos], aff->v->el[0], v); return aff; } /* Add "v" to the coefficient of the variable of type "type" * at position "pos" of "aff". * * A NaN is unaffected by this operation. */ __isl_give isl_aff *isl_aff_add_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v) { if (!aff || !v) goto error; if (isl_val_is_zero(v)) { isl_val_free(v); return aff; } if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "output/set dimension does not have a coefficient", goto error); if (type == isl_dim_in) type = isl_dim_set; if (isl_local_space_check_range(aff->ls, type, pos, 1) < 0) goto error; if (isl_aff_is_nan(aff)) { isl_val_free(v); return aff; } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational value", goto error); aff = isl_aff_cow(aff); if (!aff) goto error; aff->v = isl_vec_cow(aff->v); if (!aff->v) goto error; pos += isl_local_space_offset(aff->ls, type); if (isl_int_is_one(v->d)) { isl_int_addmul(aff->v->el[1 + pos], aff->v->el[0], v->n); } else if (isl_int_eq(aff->v->el[0], v->d)) { isl_int_add(aff->v->el[1 + pos], aff->v->el[1 + pos], v->n); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } else { isl_seq_scale(aff->v->el + 1, aff->v->el + 1, v->d, aff->v->size - 1); isl_int_addmul(aff->v->el[1 + pos], aff->v->el[0], v->n); isl_int_mul(aff->v->el[0], aff->v->el[0], v->d); aff->v = isl_vec_normalize(aff->v); if (!aff->v) goto error; } isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } __isl_give isl_aff *isl_aff_add_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v) { isl_int t; isl_int_init(t); isl_int_set_si(t, v); aff = isl_aff_add_coefficient(aff, type, pos, t); isl_int_clear(t); return aff; } __isl_give isl_aff *isl_aff_get_div(__isl_keep isl_aff *aff, int pos) { if (!aff) return NULL; return isl_local_space_get_div(aff->ls, pos); } /* Return the negation of "aff". * * As a special case, -NaN = NaN. */ __isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff) { if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_seq_neg(aff->v->el + 1, aff->v->el + 1, aff->v->size - 1); return aff; } /* Remove divs from the local space that do not appear in the affine * expression. * * First remove any unused local variables at the end. * Then look for other unused local variables. These need some extra care * because a local variable that does not appear in the affine expression * may still appear in the definition of some later local variable. */ __isl_give isl_aff *isl_aff_remove_unused_divs(__isl_take isl_aff *aff) { int pos; isl_size v_div; isl_size n; int *active; isl_local_space *ls; n = isl_aff_domain_dim(aff, isl_dim_div); v_div = isl_aff_domain_var_offset(aff, isl_dim_div); if (n < 0 || v_div < 0) return isl_aff_free(aff); pos = isl_seq_last_non_zero(aff->v->el + 1 + 1 + v_div, n) + 1; if (pos < n) aff = isl_aff_drop_dims(aff, isl_dim_div, pos, n - pos); if (pos <= 1 || !aff) return aff; ls = isl_aff_peek_domain_local_space(aff); active = isl_local_space_get_active(ls, aff->v->el + 2); if (!active) return isl_aff_free(aff); for (pos = pos - 2; pos >= 0; pos--) { if (active[v_div + pos]) continue; aff = isl_aff_drop_dims(aff, isl_dim_div, pos, 1); } free(active); return aff; } /* Look for any divs in the aff->ls with a denominator equal to one * and plug them into the affine expression and any subsequent divs * that may reference the div. */ static __isl_give isl_aff *plug_in_integral_divs(__isl_take isl_aff *aff) { int i; isl_size n; int len; isl_int v; isl_vec *vec; isl_local_space *ls; isl_size off; n = isl_aff_domain_dim(aff, isl_dim_div); off = isl_aff_domain_offset(aff, isl_dim_div); if (n < 0 || off < 0) return isl_aff_free(aff); len = aff->v->size; for (i = 0; i < n; ++i) { if (!isl_int_is_one(aff->ls->div->row[i][0])) continue; ls = isl_local_space_copy(aff->ls); ls = isl_local_space_substitute_seq(ls, isl_dim_div, i, aff->ls->div->row[i], len, i + 1, n - (i + 1)); vec = isl_vec_copy(aff->v); vec = isl_vec_cow(vec); if (!ls || !vec) goto error; isl_int_init(v); isl_seq_substitute(vec->el, off + i, aff->ls->div->row[i], len, len, v); isl_int_clear(v); isl_vec_free(aff->v); aff->v = vec; isl_local_space_free(aff->ls); aff->ls = ls; } return aff; error: isl_vec_free(vec); isl_local_space_free(ls); return isl_aff_free(aff); } /* Look for any divs j that appear with a unit coefficient inside * the definitions of other divs i and plug them into the definitions * of the divs i. * * In particular, an expression of the form * * floor((f(..) + floor(g(..)/n))/m) * * is simplified to * * floor((n * f(..) + g(..))/(n * m)) * * This simplification is correct because we can move the expression * f(..) into the inner floor in the original expression to obtain * * floor(floor((n * f(..) + g(..))/n)/m) * * from which we can derive the simplified expression. */ static __isl_give isl_aff *plug_in_unit_divs(__isl_take isl_aff *aff) { int i, j; isl_size n; isl_size off; n = isl_aff_domain_dim(aff, isl_dim_div); off = isl_aff_domain_offset(aff, isl_dim_div); if (n < 0 || off < 0) return isl_aff_free(aff); for (i = 1; i < n; ++i) { for (j = 0; j < i; ++j) { if (!isl_int_is_one(aff->ls->div->row[i][1 + off + j])) continue; aff->ls = isl_local_space_substitute_seq(aff->ls, isl_dim_div, j, aff->ls->div->row[j], aff->v->size, i, 1); if (!aff->ls) return isl_aff_free(aff); } } return aff; } /* Swap divs "a" and "b" in "aff", which is assumed to be non-NULL. * * Even though this function is only called on isl_affs with a single * reference, we are careful to only change aff->v and aff->ls together. */ static __isl_give isl_aff *swap_div(__isl_take isl_aff *aff, int a, int b) { isl_size off = isl_aff_domain_offset(aff, isl_dim_div); isl_local_space *ls; isl_vec *v; if (off < 0) return isl_aff_free(aff); ls = isl_local_space_copy(aff->ls); ls = isl_local_space_swap_div(ls, a, b); v = isl_vec_copy(aff->v); v = isl_vec_cow(v); if (!ls || !v) goto error; isl_int_swap(v->el[1 + off + a], v->el[1 + off + b]); isl_vec_free(aff->v); aff->v = v; isl_local_space_free(aff->ls); aff->ls = ls; return aff; error: isl_vec_free(v); isl_local_space_free(ls); return isl_aff_free(aff); } /* Merge divs "a" and "b" in "aff", which is assumed to be non-NULL. * * We currently do not actually remove div "b", but simply add its * coefficient to that of "a" and then zero it out. */ static __isl_give isl_aff *merge_divs(__isl_take isl_aff *aff, int a, int b) { isl_size off = isl_aff_domain_offset(aff, isl_dim_div); if (off < 0) return isl_aff_free(aff); if (isl_int_is_zero(aff->v->el[1 + off + b])) return aff; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_add(aff->v->el[1 + off + a], aff->v->el[1 + off + a], aff->v->el[1 + off + b]); isl_int_set_si(aff->v->el[1 + off + b], 0); return aff; } /* Sort the divs in the local space of "aff" according to * the comparison function "cmp_row" in isl_local_space.c, * combining the coefficients of identical divs. * * Reordering divs does not change the semantics of "aff", * so there is no need to call isl_aff_cow. * Moreover, this function is currently only called on isl_affs * with a single reference. */ static __isl_give isl_aff *sort_divs(__isl_take isl_aff *aff) { isl_size n; int i, j; n = isl_aff_dim(aff, isl_dim_div); if (n < 0) return isl_aff_free(aff); for (i = 1; i < n; ++i) { for (j = i - 1; j >= 0; --j) { int cmp = isl_mat_cmp_div(aff->ls->div, j, j + 1); if (cmp < 0) break; if (cmp == 0) aff = merge_divs(aff, j, j + 1); else aff = swap_div(aff, j, j + 1); if (!aff) return NULL; } } return aff; } /* Normalize the representation of "aff". * * This function should only be called on "new" isl_affs, i.e., * with only a single reference. We therefore do not need to * worry about affecting other instances. */ __isl_give isl_aff *isl_aff_normalize(__isl_take isl_aff *aff) { if (!aff) return NULL; aff->v = isl_vec_normalize(aff->v); if (!aff->v) return isl_aff_free(aff); aff = plug_in_integral_divs(aff); aff = plug_in_unit_divs(aff); aff = sort_divs(aff); aff = isl_aff_remove_unused_divs(aff); return aff; } /* Given f, return floor(f). * If f is an integer expression, then just return f. * If f is a constant, then return the constant floor(f). * Otherwise, if f = g/m, write g = q m + r, * create a new div d = [r/m] and return the expression q + d. * The coefficients in r are taken to lie between -m/2 and m/2. * * reduce_div_coefficients performs the same normalization. * * As a special case, floor(NaN) = NaN. */ __isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff) { int i; int size; isl_ctx *ctx; isl_vec *div; if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; if (isl_int_is_one(aff->v->el[0])) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); if (isl_aff_is_cst(aff)) { isl_int_fdiv_q(aff->v->el[1], aff->v->el[1], aff->v->el[0]); isl_int_set_si(aff->v->el[0], 1); return aff; } div = isl_vec_copy(aff->v); div = isl_vec_cow(div); if (!div) return isl_aff_free(aff); ctx = isl_aff_get_ctx(aff); isl_int_fdiv_q(aff->v->el[0], aff->v->el[0], ctx->two); for (i = 1; i < aff->v->size; ++i) { isl_int_fdiv_r(div->el[i], div->el[i], div->el[0]); isl_int_fdiv_q(aff->v->el[i], aff->v->el[i], div->el[0]); if (isl_int_gt(div->el[i], aff->v->el[0])) { isl_int_sub(div->el[i], div->el[i], div->el[0]); isl_int_add_ui(aff->v->el[i], aff->v->el[i], 1); } } aff->ls = isl_local_space_add_div(aff->ls, div); if (!aff->ls) return isl_aff_free(aff); size = aff->v->size; aff->v = isl_vec_extend(aff->v, size + 1); if (!aff->v) return isl_aff_free(aff); isl_int_set_si(aff->v->el[0], 1); isl_int_set_si(aff->v->el[size], 1); aff = isl_aff_normalize(aff); return aff; } /* Compute * * aff mod m = aff - m * floor(aff/m) * * with m an integer value. */ __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff, __isl_take isl_val *m) { isl_aff *res; if (!aff || !m) goto error; if (!isl_val_is_int(m)) isl_die(isl_val_get_ctx(m), isl_error_invalid, "expecting integer modulo", goto error); res = isl_aff_copy(aff); aff = isl_aff_scale_down_val(aff, isl_val_copy(m)); aff = isl_aff_floor(aff); aff = isl_aff_scale_val(aff, m); res = isl_aff_sub(res, aff); return res; error: isl_aff_free(aff); isl_val_free(m); return NULL; } /* Compute * * pwaff mod m = pwaff - m * floor(pwaff/m) */ __isl_give isl_pw_aff *isl_pw_aff_mod(__isl_take isl_pw_aff *pwaff, isl_int m) { isl_pw_aff *res; res = isl_pw_aff_copy(pwaff); pwaff = isl_pw_aff_scale_down(pwaff, m); pwaff = isl_pw_aff_floor(pwaff); pwaff = isl_pw_aff_scale(pwaff, m); res = isl_pw_aff_sub(res, pwaff); return res; } /* Compute * * pa mod m = pa - m * floor(pa/m) * * with m an integer value. */ __isl_give isl_pw_aff *isl_pw_aff_mod_val(__isl_take isl_pw_aff *pa, __isl_take isl_val *m) { if (!pa || !m) goto error; if (!isl_val_is_int(m)) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "expecting integer modulo", goto error); pa = isl_pw_aff_mod(pa, m->n); isl_val_free(m); return pa; error: isl_pw_aff_free(pa); isl_val_free(m); return NULL; } /* Given f, return ceil(f). * If f is an integer expression, then just return f. * Otherwise, let f be the expression * * e/m * * then return * * floor((e + m - 1)/m) * * As a special case, ceil(NaN) = NaN. */ __isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff) { if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; if (isl_int_is_one(aff->v->el[0])) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_add(aff->v->el[1], aff->v->el[1], aff->v->el[0]); isl_int_sub_ui(aff->v->el[1], aff->v->el[1], 1); aff = isl_aff_floor(aff); return aff; } /* Apply the expansion computed by isl_merge_divs. * The expansion itself is given by "exp" while the resulting * list of divs is given by "div". */ __isl_give isl_aff *isl_aff_expand_divs(__isl_take isl_aff *aff, __isl_take isl_mat *div, int *exp) { isl_size old_n_div; isl_size new_n_div; isl_size offset; aff = isl_aff_cow(aff); offset = isl_aff_domain_offset(aff, isl_dim_div); old_n_div = isl_aff_domain_dim(aff, isl_dim_div); new_n_div = isl_mat_rows(div); if (offset < 0 || old_n_div < 0 || new_n_div < 0) goto error; aff->v = isl_vec_expand(aff->v, 1 + offset, old_n_div, exp, new_n_div); aff->ls = isl_local_space_replace_divs(aff->ls, div); if (!aff->v || !aff->ls) return isl_aff_free(aff); return aff; error: isl_aff_free(aff); isl_mat_free(div); return NULL; } /* Add two affine expressions that live in the same local space. */ static __isl_give isl_aff *add_expanded(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_int gcd, f; aff1 = isl_aff_cow(aff1); if (!aff1 || !aff2) goto error; aff1->v = isl_vec_cow(aff1->v); if (!aff1->v) goto error; isl_int_init(gcd); isl_int_init(f); isl_int_gcd(gcd, aff1->v->el[0], aff2->v->el[0]); isl_int_divexact(f, aff2->v->el[0], gcd); isl_seq_scale(aff1->v->el + 1, aff1->v->el + 1, f, aff1->v->size - 1); isl_int_divexact(f, aff1->v->el[0], gcd); isl_seq_addmul(aff1->v->el + 1, f, aff2->v->el + 1, aff1->v->size - 1); isl_int_divexact(f, aff2->v->el[0], gcd); isl_int_mul(aff1->v->el[0], aff1->v->el[0], f); isl_int_clear(f); isl_int_clear(gcd); isl_aff_free(aff2); aff1 = isl_aff_normalize(aff1); return aff1; error: isl_aff_free(aff1); isl_aff_free(aff2); return NULL; } /* Replace one of the arguments by a NaN and free the other one. */ static __isl_give isl_aff *set_nan_free(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_aff_free(aff2); return isl_aff_set_nan(aff1); } /* Return the sum of "aff1" and "aff2". * * If either of the two is NaN, then the result is NaN. */ __isl_give isl_aff *isl_aff_add(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_ctx *ctx; int *exp1 = NULL; int *exp2 = NULL; isl_mat *div; isl_size n_div1, n_div2; if (!aff1 || !aff2) goto error; ctx = isl_aff_get_ctx(aff1); if (!isl_space_is_equal(aff1->ls->dim, aff2->ls->dim)) isl_die(ctx, isl_error_invalid, "spaces don't match", goto error); if (isl_aff_is_nan(aff1)) { isl_aff_free(aff2); return aff1; } if (isl_aff_is_nan(aff2)) { isl_aff_free(aff1); return aff2; } n_div1 = isl_aff_dim(aff1, isl_dim_div); n_div2 = isl_aff_dim(aff2, isl_dim_div); if (n_div1 < 0 || n_div2 < 0) goto error; if (n_div1 == 0 && n_div2 == 0) return add_expanded(aff1, aff2); exp1 = isl_alloc_array(ctx, int, n_div1); exp2 = isl_alloc_array(ctx, int, n_div2); if ((n_div1 && !exp1) || (n_div2 && !exp2)) goto error; div = isl_merge_divs(aff1->ls->div, aff2->ls->div, exp1, exp2); aff1 = isl_aff_expand_divs(aff1, isl_mat_copy(div), exp1); aff2 = isl_aff_expand_divs(aff2, div, exp2); free(exp1); free(exp2); return add_expanded(aff1, aff2); error: free(exp1); free(exp2); isl_aff_free(aff1); isl_aff_free(aff2); return NULL; } __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_aff_add(aff1, isl_aff_neg(aff2)); } /* Return the result of scaling "aff" by a factor of "f". * * As a special case, f * NaN = NaN. */ __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f) { isl_int gcd; if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; if (isl_int_is_one(f)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); if (isl_int_is_pos(f) && isl_int_is_divisible_by(aff->v->el[0], f)) { isl_int_divexact(aff->v->el[0], aff->v->el[0], f); return aff; } isl_int_init(gcd); isl_int_gcd(gcd, aff->v->el[0], f); isl_int_divexact(aff->v->el[0], aff->v->el[0], gcd); isl_int_divexact(gcd, f, gcd); isl_seq_scale(aff->v->el + 1, aff->v->el + 1, gcd, aff->v->size - 1); isl_int_clear(gcd); return aff; } /* Multiple "aff" by "v". */ __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { if (!aff || !v) goto error; if (isl_val_is_one(v)) { isl_val_free(v); return aff; } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational factor", goto error); aff = isl_aff_scale(aff, v->n); aff = isl_aff_scale_down(aff, v->d); isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } /* Return the result of scaling "aff" down by a factor of "f". * * As a special case, NaN/f = NaN. */ __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f) { isl_int gcd; if (!aff) return NULL; if (isl_aff_is_nan(aff)) return aff; if (isl_int_is_one(f)) return aff; aff = isl_aff_cow(aff); if (!aff) return NULL; if (isl_int_is_zero(f)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot scale down by zero", return isl_aff_free(aff)); aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); isl_int_init(gcd); isl_seq_gcd(aff->v->el + 1, aff->v->size - 1, &gcd); isl_int_gcd(gcd, gcd, f); isl_seq_scale_down(aff->v->el + 1, aff->v->el + 1, gcd, aff->v->size - 1); isl_int_divexact(gcd, f, gcd); isl_int_mul(aff->v->el[0], aff->v->el[0], gcd); isl_int_clear(gcd); return aff; } /* Divide "aff" by "v". */ __isl_give isl_aff *isl_aff_scale_down_val(__isl_take isl_aff *aff, __isl_take isl_val *v) { if (!aff || !v) goto error; if (isl_val_is_one(v)) { isl_val_free(v); return aff; } if (!isl_val_is_rat(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "expecting rational factor", goto error); if (!isl_val_is_pos(v)) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "factor needs to be positive", goto error); aff = isl_aff_scale(aff, v->d); aff = isl_aff_scale_down(aff, v->n); isl_val_free(v); return aff; error: isl_aff_free(aff); isl_val_free(v); return NULL; } __isl_give isl_aff *isl_aff_scale_down_ui(__isl_take isl_aff *aff, unsigned f) { isl_int v; if (f == 1) return aff; isl_int_init(v); isl_int_set_ui(v, f); aff = isl_aff_scale_down(aff, v); isl_int_clear(v); return aff; } __isl_give isl_aff *isl_aff_set_dim_name(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned pos, const char *s) { aff = isl_aff_cow(aff); if (!aff) return NULL; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "cannot set name of output/set dimension", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; aff->ls = isl_local_space_set_dim_name(aff->ls, type, pos, s); if (!aff->ls) return isl_aff_free(aff); return aff; } __isl_give isl_aff *isl_aff_set_dim_id(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id) { aff = isl_aff_cow(aff); if (!aff) goto error; if (type == isl_dim_out) isl_die(aff->v->ctx, isl_error_invalid, "cannot set name of output/set dimension", goto error); if (type == isl_dim_in) type = isl_dim_set; aff->ls = isl_local_space_set_dim_id(aff->ls, type, pos, id); if (!aff->ls) return isl_aff_free(aff); return aff; error: isl_id_free(id); isl_aff_free(aff); return NULL; } /* Replace the identifier of the input tuple of "aff" by "id". * type is currently required to be equal to isl_dim_in */ __isl_give isl_aff *isl_aff_set_tuple_id(__isl_take isl_aff *aff, enum isl_dim_type type, __isl_take isl_id *id) { aff = isl_aff_cow(aff); if (!aff) goto error; if (type != isl_dim_in) isl_die(aff->v->ctx, isl_error_invalid, "cannot only set id of input tuple", goto error); aff->ls = isl_local_space_set_tuple_id(aff->ls, isl_dim_set, id); if (!aff->ls) return isl_aff_free(aff); return aff; error: isl_id_free(id); isl_aff_free(aff); return NULL; } /* Exploit the equalities in "eq" to simplify the affine expression * and the expressions of the integer divisions in the local space. * The integer divisions in this local space are assumed to appear * as regular dimensions in "eq". */ static __isl_give isl_aff *isl_aff_substitute_equalities_lifted( __isl_take isl_aff *aff, __isl_take isl_basic_set *eq) { int i, j; unsigned o_div; unsigned n_div; if (!eq) goto error; if (eq->n_eq == 0) { isl_basic_set_free(eq); return aff; } aff = isl_aff_cow(aff); if (!aff) goto error; aff->ls = isl_local_space_substitute_equalities(aff->ls, isl_basic_set_copy(eq)); aff->v = isl_vec_cow(aff->v); if (!aff->ls || !aff->v) goto error; o_div = isl_basic_set_offset(eq, isl_dim_div); n_div = eq->n_div; for (i = 0; i < eq->n_eq; ++i) { j = isl_seq_last_non_zero(eq->eq[i], o_div + n_div); if (j < 0 || j == 0 || j >= o_div) continue; isl_seq_elim(aff->v->el + 1, eq->eq[i], j, o_div, &aff->v->el[0]); } isl_basic_set_free(eq); aff = isl_aff_normalize(aff); return aff; error: isl_basic_set_free(eq); isl_aff_free(aff); return NULL; } /* Exploit the equalities in "eq" to simplify the affine expression * and the expressions of the integer divisions in the local space. */ __isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff, __isl_take isl_basic_set *eq) { isl_size n_div; n_div = isl_aff_domain_dim(aff, isl_dim_div); if (n_div < 0) goto error; if (n_div > 0) eq = isl_basic_set_add_dims(eq, isl_dim_set, n_div); return isl_aff_substitute_equalities_lifted(aff, eq); error: isl_basic_set_free(eq); isl_aff_free(aff); return NULL; } /* Look for equalities among the variables shared by context and aff * and the integer divisions of aff, if any. * The equalities are then used to eliminate coefficients and/or integer * divisions from aff. */ __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff, __isl_take isl_set *context) { isl_local_space *ls; isl_basic_set *hull; ls = isl_aff_get_domain_local_space(aff); context = isl_local_space_lift_set(ls, context); hull = isl_set_affine_hull(context); return isl_aff_substitute_equalities_lifted(aff, hull); } __isl_give isl_aff *isl_aff_gist_params(__isl_take isl_aff *aff, __isl_take isl_set *context) { isl_set *dom_context = isl_set_universe(isl_aff_get_domain_space(aff)); dom_context = isl_set_intersect_params(dom_context, context); return isl_aff_gist(aff, dom_context); } /* Return a basic set containing those elements in the space * of aff where it is positive. "rational" should not be set. * * If "aff" is NaN, then it is not positive. */ static __isl_give isl_basic_set *aff_pos_basic_set(__isl_take isl_aff *aff, int rational, void *user) { isl_constraint *ineq; isl_basic_set *bset; isl_val *c; if (!aff) return NULL; if (isl_aff_is_nan(aff)) { isl_space *space = isl_aff_get_domain_space(aff); isl_aff_free(aff); return isl_basic_set_empty(space); } if (rational) isl_die(isl_aff_get_ctx(aff), isl_error_unsupported, "rational sets not supported", goto error); ineq = isl_inequality_from_aff(aff); c = isl_constraint_get_constant_val(ineq); c = isl_val_sub_ui(c, 1); ineq = isl_constraint_set_constant_val(ineq, c); bset = isl_basic_set_from_constraint(ineq); bset = isl_basic_set_simplify(bset); return bset; error: isl_aff_free(aff); return NULL; } /* Return a basic set containing those elements in the space * of aff where it is non-negative. * If "rational" is set, then return a rational basic set. * * If "aff" is NaN, then it is not non-negative (it's not negative either). */ static __isl_give isl_basic_set *aff_nonneg_basic_set( __isl_take isl_aff *aff, int rational, void *user) { isl_constraint *ineq; isl_basic_set *bset; if (!aff) return NULL; if (isl_aff_is_nan(aff)) { isl_space *space = isl_aff_get_domain_space(aff); isl_aff_free(aff); return isl_basic_set_empty(space); } ineq = isl_inequality_from_aff(aff); bset = isl_basic_set_from_constraint(ineq); if (rational) bset = isl_basic_set_set_rational(bset); bset = isl_basic_set_simplify(bset); return bset; } /* Return a basic set containing those elements in the space * of aff where it is non-negative. */ __isl_give isl_basic_set *isl_aff_nonneg_basic_set(__isl_take isl_aff *aff) { return aff_nonneg_basic_set(aff, 0, NULL); } /* Return a basic set containing those elements in the domain space * of "aff" where it is positive. */ __isl_give isl_basic_set *isl_aff_pos_basic_set(__isl_take isl_aff *aff) { aff = isl_aff_add_constant_num_si(aff, -1); return isl_aff_nonneg_basic_set(aff); } /* Return a basic set containing those elements in the domain space * of aff where it is negative. */ __isl_give isl_basic_set *isl_aff_neg_basic_set(__isl_take isl_aff *aff) { aff = isl_aff_neg(aff); return isl_aff_pos_basic_set(aff); } /* Return a basic set containing those elements in the space * of aff where it is zero. * If "rational" is set, then return a rational basic set. * * If "aff" is NaN, then it is not zero. */ static __isl_give isl_basic_set *aff_zero_basic_set(__isl_take isl_aff *aff, int rational, void *user) { isl_constraint *ineq; isl_basic_set *bset; if (!aff) return NULL; if (isl_aff_is_nan(aff)) { isl_space *space = isl_aff_get_domain_space(aff); isl_aff_free(aff); return isl_basic_set_empty(space); } ineq = isl_equality_from_aff(aff); bset = isl_basic_set_from_constraint(ineq); if (rational) bset = isl_basic_set_set_rational(bset); bset = isl_basic_set_simplify(bset); return bset; } /* Return a basic set containing those elements in the space * of aff where it is zero. */ __isl_give isl_basic_set *isl_aff_zero_basic_set(__isl_take isl_aff *aff) { return aff_zero_basic_set(aff, 0, NULL); } /* Return a basic set containing those elements in the shared space * of aff1 and aff2 where aff1 is greater than or equal to aff2. */ __isl_give isl_basic_set *isl_aff_ge_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { aff1 = isl_aff_sub(aff1, aff2); return isl_aff_nonneg_basic_set(aff1); } /* Return a basic set containing those elements in the shared domain space * of "aff1" and "aff2" where "aff1" is greater than "aff2". */ __isl_give isl_basic_set *isl_aff_gt_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { aff1 = isl_aff_sub(aff1, aff2); return isl_aff_pos_basic_set(aff1); } /* Return a set containing those elements in the shared space * of aff1 and aff2 where aff1 is greater than or equal to aff2. */ __isl_give isl_set *isl_aff_ge_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_set_from_basic_set(isl_aff_ge_basic_set(aff1, aff2)); } /* Return a set containing those elements in the shared domain space * of aff1 and aff2 where aff1 is greater than aff2. * * If either of the two inputs is NaN, then the result is empty, * as comparisons with NaN always return false. */ __isl_give isl_set *isl_aff_gt_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_set_from_basic_set(isl_aff_gt_basic_set(aff1, aff2)); } /* Return a basic set containing those elements in the shared space * of aff1 and aff2 where aff1 is smaller than or equal to aff2. */ __isl_give isl_basic_set *isl_aff_le_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_aff_ge_basic_set(aff2, aff1); } /* Return a basic set containing those elements in the shared domain space * of "aff1" and "aff2" where "aff1" is smaller than "aff2". */ __isl_give isl_basic_set *isl_aff_lt_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_aff_gt_basic_set(aff2, aff1); } /* Return a set containing those elements in the shared space * of aff1 and aff2 where aff1 is smaller than or equal to aff2. */ __isl_give isl_set *isl_aff_le_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_aff_ge_set(aff2, aff1); } /* Return a set containing those elements in the shared domain space * of "aff1" and "aff2" where "aff1" is smaller than "aff2". */ __isl_give isl_set *isl_aff_lt_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_set_from_basic_set(isl_aff_lt_basic_set(aff1, aff2)); } /* Return a basic set containing those elements in the shared space * of aff1 and aff2 where aff1 and aff2 are equal. */ __isl_give isl_basic_set *isl_aff_eq_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { aff1 = isl_aff_sub(aff1, aff2); return isl_aff_zero_basic_set(aff1); } /* Return a set containing those elements in the shared space * of aff1 and aff2 where aff1 and aff2 are equal. */ __isl_give isl_set *isl_aff_eq_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { return isl_set_from_basic_set(isl_aff_eq_basic_set(aff1, aff2)); } /* Return a set containing those elements in the shared domain space * of aff1 and aff2 where aff1 and aff2 are not equal. * * If either of the two inputs is NaN, then the result is empty, * as comparisons with NaN always return false. */ __isl_give isl_set *isl_aff_ne_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_set *set_lt, *set_gt; set_lt = isl_aff_lt_set(isl_aff_copy(aff1), isl_aff_copy(aff2)); set_gt = isl_aff_gt_set(aff1, aff2); return isl_set_union_disjoint(set_lt, set_gt); } __isl_give isl_aff *isl_aff_add_on_domain(__isl_keep isl_set *dom, __isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { aff1 = isl_aff_add(aff1, aff2); aff1 = isl_aff_gist(aff1, isl_set_copy(dom)); return aff1; } isl_bool isl_aff_is_empty(__isl_keep isl_aff *aff) { if (!aff) return isl_bool_error; return isl_bool_false; } #undef TYPE #define TYPE isl_aff static #include "check_type_range_templ.c" /* Check whether the given affine expression has non-zero coefficient * for any dimension in the given range or if any of these dimensions * appear with non-zero coefficients in any of the integer divisions * involved in the affine expression. */ isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n) { int i; int *active = NULL; isl_bool involves = isl_bool_false; if (!aff) return isl_bool_error; if (n == 0) return isl_bool_false; if (isl_aff_check_range(aff, type, first, n) < 0) return isl_bool_error; active = isl_local_space_get_active(aff->ls, aff->v->el + 2); if (!active) goto error; first += isl_local_space_offset(aff->ls, type) - 1; for (i = 0; i < n; ++i) if (active[first + i]) { involves = isl_bool_true; break; } free(active); return involves; error: free(active); return isl_bool_error; } /* Does "aff" involve any local variables, i.e., integer divisions? */ isl_bool isl_aff_involves_locals(__isl_keep isl_aff *aff) { isl_size n; n = isl_aff_dim(aff, isl_dim_div); if (n < 0) return isl_bool_error; return isl_bool_ok(n > 0); } __isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n) { if (!aff) return NULL; if (type == isl_dim_out) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot drop output/set dimension", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; if (n == 0 && !isl_local_space_is_named_or_nested(aff->ls, type)) return aff; if (isl_local_space_check_range(aff->ls, type, first, n) < 0) return isl_aff_free(aff); aff = isl_aff_cow(aff); if (!aff) return NULL; aff->ls = isl_local_space_drop_dims(aff->ls, type, first, n); if (!aff->ls) return isl_aff_free(aff); first += 1 + isl_local_space_offset(aff->ls, type); aff->v = isl_vec_drop_els(aff->v, first, n); if (!aff->v) return isl_aff_free(aff); return aff; } /* Is the domain of "aff" a product? */ static isl_bool isl_aff_domain_is_product(__isl_keep isl_aff *aff) { return isl_space_is_product(isl_aff_peek_domain_space(aff)); } #undef TYPE #define TYPE isl_aff #include /* Project the domain of the affine expression onto its parameter space. * The affine expression may not involve any of the domain dimensions. */ __isl_give isl_aff *isl_aff_project_domain_on_params(__isl_take isl_aff *aff) { isl_space *space; isl_size n; n = isl_aff_dim(aff, isl_dim_in); if (n < 0) return isl_aff_free(aff); aff = isl_aff_drop_domain(aff, 0, n); space = isl_aff_get_domain_space(aff); space = isl_space_params(space); aff = isl_aff_reset_domain_space(aff, space); return aff; } /* Convert an affine expression defined over a parameter domain * into one that is defined over a zero-dimensional set. */ __isl_give isl_aff *isl_aff_from_range(__isl_take isl_aff *aff) { isl_local_space *ls; ls = isl_aff_take_domain_local_space(aff); ls = isl_local_space_set_from_params(ls); aff = isl_aff_restore_domain_local_space(aff, ls); return aff; } __isl_give isl_aff *isl_aff_insert_dims(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n) { if (!aff) return NULL; if (type == isl_dim_out) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot insert output/set dimensions", return isl_aff_free(aff)); if (type == isl_dim_in) type = isl_dim_set; if (n == 0 && !isl_local_space_is_named_or_nested(aff->ls, type)) return aff; if (isl_local_space_check_range(aff->ls, type, first, 0) < 0) return isl_aff_free(aff); aff = isl_aff_cow(aff); if (!aff) return NULL; aff->ls = isl_local_space_insert_dims(aff->ls, type, first, n); if (!aff->ls) return isl_aff_free(aff); first += 1 + isl_local_space_offset(aff->ls, type); aff->v = isl_vec_insert_zero_els(aff->v, first, n); if (!aff->v) return isl_aff_free(aff); return aff; } __isl_give isl_aff *isl_aff_add_dims(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned n) { isl_size pos; pos = isl_aff_dim(aff, type); if (pos < 0) return isl_aff_free(aff); return isl_aff_insert_dims(aff, type, pos, n); } /* Move the "n" dimensions of "src_type" starting at "src_pos" of "aff" * to dimensions of "dst_type" at "dst_pos". * * We only support moving input dimensions to parameters and vice versa. */ __isl_give isl_aff *isl_aff_move_dims(__isl_take isl_aff *aff, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n) { unsigned g_dst_pos; unsigned g_src_pos; isl_size src_off, dst_off; if (!aff) return NULL; if (n == 0 && !isl_local_space_is_named_or_nested(aff->ls, src_type) && !isl_local_space_is_named_or_nested(aff->ls, dst_type)) return aff; if (dst_type == isl_dim_out || src_type == isl_dim_out) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot move output/set dimension", return isl_aff_free(aff)); if (dst_type == isl_dim_div || src_type == isl_dim_div) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot move divs", return isl_aff_free(aff)); if (dst_type == isl_dim_in) dst_type = isl_dim_set; if (src_type == isl_dim_in) src_type = isl_dim_set; if (isl_local_space_check_range(aff->ls, src_type, src_pos, n) < 0) return isl_aff_free(aff); if (dst_type == src_type) isl_die(isl_aff_get_ctx(aff), isl_error_unsupported, "moving dims within the same type not supported", return isl_aff_free(aff)); aff = isl_aff_cow(aff); src_off = isl_aff_domain_offset(aff, src_type); dst_off = isl_aff_domain_offset(aff, dst_type); if (src_off < 0 || dst_off < 0) return isl_aff_free(aff); g_src_pos = 1 + src_off + src_pos; g_dst_pos = 1 + dst_off + dst_pos; if (dst_type > src_type) g_dst_pos -= n; aff->v = isl_vec_move_els(aff->v, g_dst_pos, g_src_pos, n); aff->ls = isl_local_space_move_dims(aff->ls, dst_type, dst_pos, src_type, src_pos, n); if (!aff->v || !aff->ls) return isl_aff_free(aff); aff = sort_divs(aff); return aff; } /* Given an affine function on a domain (A -> B), * interchange A and B in the wrapped domain * to obtain a function on the domain (B -> A). * * Since this may change the position of some variables, * it may also change the normalized order of the local variables. * Restore this order. Since sort_divs assumes the input * has a single reference, an explicit isl_aff_cow is required. */ __isl_give isl_aff *isl_aff_domain_reverse(__isl_take isl_aff *aff) { isl_space *space; isl_local_space *ls; isl_vec *v; isl_size n_in, n_out; unsigned offset; space = isl_aff_peek_domain_space(aff); offset = isl_space_offset(space, isl_dim_set); n_in = isl_space_wrapped_dim(space, isl_dim_set, isl_dim_in); n_out = isl_space_wrapped_dim(space, isl_dim_set, isl_dim_out); if (offset < 0 || n_in < 0 || n_out < 0) return isl_aff_free(aff); v = isl_aff_take_rat_aff(aff); v = isl_vec_move_els(v, 1 + 1 + offset, 1 + 1 + offset + n_in, n_out); aff = isl_aff_restore_rat_aff(aff, v); ls = isl_aff_take_domain_local_space(aff); ls = isl_local_space_wrapped_reverse(ls); aff = isl_aff_restore_domain_local_space(aff, ls); aff = isl_aff_cow(aff); aff = sort_divs(aff); return aff; } /* Return a zero isl_aff in the given space. * * This is a helper function for isl_pw_*_as_* that ensures a uniform * interface over all piecewise types. */ static __isl_give isl_aff *isl_aff_zero_in_space(__isl_take isl_space *space) { isl_local_space *ls; ls = isl_local_space_from_space(isl_space_domain(space)); return isl_aff_zero_on_domain(ls); } #define isl_aff_involves_nan isl_aff_is_nan #undef PW #define PW isl_pw_aff #undef BASE #define BASE aff #undef EL_IS_ZERO #define EL_IS_ZERO is_empty #undef ZERO #define ZERO empty #undef IS_ZERO #define IS_ZERO is_empty #undef FIELD #define FIELD aff #undef DEFAULT_IS_ZERO #define DEFAULT_IS_ZERO 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef BASE #define BASE pw_aff #include #include #include #undef BASE #define BASE aff #include /* Compute a piecewise quasi-affine expression with a domain that * is the union of those of pwaff1 and pwaff2 and such that on each * cell, the quasi-affine expression is the maximum of those of pwaff1 * and pwaff2. If only one of pwaff1 or pwaff2 is defined on a given * cell, then the associated expression is the defined one. */ __isl_give isl_pw_aff *isl_pw_aff_union_max(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return isl_pw_aff_union_opt_cmp(pwaff1, pwaff2, &isl_aff_ge_set); } /* Compute a piecewise quasi-affine expression with a domain that * is the union of those of pwaff1 and pwaff2 and such that on each * cell, the quasi-affine expression is the minimum of those of pwaff1 * and pwaff2. If only one of pwaff1 or pwaff2 is defined on a given * cell, then the associated expression is the defined one. */ __isl_give isl_pw_aff *isl_pw_aff_union_min(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return isl_pw_aff_union_opt_cmp(pwaff1, pwaff2, &isl_aff_le_set); } __isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2, int max) { if (max) return isl_pw_aff_union_max(pwaff1, pwaff2); else return isl_pw_aff_union_min(pwaff1, pwaff2); } /* Is the domain of "pa" a product? */ static isl_bool isl_pw_aff_domain_is_product(__isl_keep isl_pw_aff *pa) { return isl_space_domain_is_wrapping(isl_pw_aff_peek_space(pa)); } #undef TYPE #define TYPE isl_pw_aff #include /* Return a set containing those elements in the domain * of "pwaff" where it satisfies "fn" (if complement is 0) or * does not satisfy "fn" (if complement is 1). * * The pieces with a NaN never belong to the result since * NaN does not satisfy any property. */ static __isl_give isl_set *pw_aff_locus(__isl_take isl_pw_aff *pwaff, __isl_give isl_basic_set *(*fn)(__isl_take isl_aff *aff, int rational, void *user), int complement, void *user) { int i; isl_set *set; if (!pwaff) return NULL; set = isl_set_empty(isl_pw_aff_get_domain_space(pwaff)); for (i = 0; i < pwaff->n; ++i) { isl_basic_set *bset; isl_set *set_i, *locus; isl_bool rational; if (isl_aff_is_nan(pwaff->p[i].aff)) continue; rational = isl_set_has_rational(pwaff->p[i].set); bset = fn(isl_aff_copy(pwaff->p[i].aff), rational, user); locus = isl_set_from_basic_set(bset); set_i = isl_set_copy(pwaff->p[i].set); if (complement) set_i = isl_set_subtract(set_i, locus); else set_i = isl_set_intersect(set_i, locus); set = isl_set_union_disjoint(set, set_i); } isl_pw_aff_free(pwaff); return set; } /* Return a set containing those elements in the domain * of "pa" where it is positive. */ __isl_give isl_set *isl_pw_aff_pos_set(__isl_take isl_pw_aff *pa) { return pw_aff_locus(pa, &aff_pos_basic_set, 0, NULL); } /* Return a set containing those elements in the domain * of pwaff where it is non-negative. */ __isl_give isl_set *isl_pw_aff_nonneg_set(__isl_take isl_pw_aff *pwaff) { return pw_aff_locus(pwaff, &aff_nonneg_basic_set, 0, NULL); } /* Return a set containing those elements in the domain * of pwaff where it is zero. */ __isl_give isl_set *isl_pw_aff_zero_set(__isl_take isl_pw_aff *pwaff) { return pw_aff_locus(pwaff, &aff_zero_basic_set, 0, NULL); } /* Return a set containing those elements in the domain * of pwaff where it is not zero. */ __isl_give isl_set *isl_pw_aff_non_zero_set(__isl_take isl_pw_aff *pwaff) { return pw_aff_locus(pwaff, &aff_zero_basic_set, 1, NULL); } /* Bind the affine function "aff" to the parameter "id", * returning the elements in the domain where the affine expression * is equal to the parameter. */ __isl_give isl_basic_set *isl_aff_bind_id(__isl_take isl_aff *aff, __isl_take isl_id *id) { isl_space *space; isl_aff *aff_id; space = isl_aff_get_domain_space(aff); space = isl_space_add_param_id(space, isl_id_copy(id)); aff = isl_aff_align_params(aff, isl_space_copy(space)); aff_id = isl_aff_param_on_domain_space_id(space, id); return isl_aff_eq_basic_set(aff, aff_id); } /* Wrapper around isl_aff_bind_id for use as pw_aff_locus callback. * "rational" should not be set. */ static __isl_give isl_basic_set *aff_bind_id(__isl_take isl_aff *aff, int rational, void *user) { isl_id *id = user; if (!aff) return NULL; if (rational) isl_die(isl_aff_get_ctx(aff), isl_error_unsupported, "rational binding not supported", goto error); return isl_aff_bind_id(aff, isl_id_copy(id)); error: isl_aff_free(aff); return NULL; } /* Bind the piecewise affine function "pa" to the parameter "id", * returning the elements in the domain where the expression * is equal to the parameter. */ __isl_give isl_set *isl_pw_aff_bind_id(__isl_take isl_pw_aff *pa, __isl_take isl_id *id) { isl_set *bound; bound = pw_aff_locus(pa, &aff_bind_id, 0, id); isl_id_free(id); return bound; } /* Return a set containing those elements in the shared domain * of pwaff1 and pwaff2 where pwaff1 is greater than (or equal) to pwaff2. * * We compute the difference on the shared domain and then construct * the set of values where this difference is non-negative. * If strict is set, we first subtract 1 from the difference. * If equal is set, we only return the elements where pwaff1 and pwaff2 * are equal. */ static __isl_give isl_set *pw_aff_gte_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2, int strict, int equal) { isl_set *set1, *set2; set1 = isl_pw_aff_domain(isl_pw_aff_copy(pwaff1)); set2 = isl_pw_aff_domain(isl_pw_aff_copy(pwaff2)); set1 = isl_set_intersect(set1, set2); pwaff1 = isl_pw_aff_intersect_domain(pwaff1, isl_set_copy(set1)); pwaff2 = isl_pw_aff_intersect_domain(pwaff2, isl_set_copy(set1)); pwaff1 = isl_pw_aff_add(pwaff1, isl_pw_aff_neg(pwaff2)); if (strict) { isl_space *space = isl_set_get_space(set1); isl_aff *aff; aff = isl_aff_zero_on_domain(isl_local_space_from_space(space)); aff = isl_aff_add_constant_si(aff, -1); pwaff1 = isl_pw_aff_add(pwaff1, isl_pw_aff_alloc(set1, aff)); } else isl_set_free(set1); if (equal) return isl_pw_aff_zero_set(pwaff1); return isl_pw_aff_nonneg_set(pwaff1); } /* Return a set containing those elements in the shared domain * of pwaff1 and pwaff2 where pwaff1 is equal to pwaff2. */ __isl_give isl_set *isl_pw_aff_eq_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return pw_aff_gte_set(pwaff1, pwaff2, 0, 1); } /* Return a set containing those elements in the shared domain * of pwaff1 and pwaff2 where pwaff1 is greater than or equal to pwaff2. */ __isl_give isl_set *isl_pw_aff_ge_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return pw_aff_gte_set(pwaff1, pwaff2, 0, 0); } /* Return a set containing those elements in the shared domain * of pwaff1 and pwaff2 where pwaff1 is strictly greater than pwaff2. */ __isl_give isl_set *isl_pw_aff_gt_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return pw_aff_gte_set(pwaff1, pwaff2, 1, 0); } __isl_give isl_set *isl_pw_aff_le_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { return isl_pw_aff_ge_set(pwaff2, pwaff1); } __isl_give isl_set *isl_pw_aff_lt_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { return isl_pw_aff_gt_set(pwaff2, pwaff1); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function values are ordered in the same way as "order", * which returns a set in the shared domain of its two arguments. * * Let "pa1" and "pa2" be defined on domains A and B respectively. * We first pull back the two functions such that they are defined on * the domain [A -> B]. Then we apply "order", resulting in a set * in the space [A -> B]. Finally, we unwrap this set to obtain * a map in the space A -> B. */ static __isl_give isl_map *isl_pw_aff_order_map( __isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2, __isl_give isl_set *(*order)(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2)) { isl_space *space1, *space2; isl_multi_aff *ma; isl_set *set; isl_pw_aff_align_params_bin(&pa1, &pa2); space1 = isl_space_domain(isl_pw_aff_get_space(pa1)); space2 = isl_space_domain(isl_pw_aff_get_space(pa2)); space1 = isl_space_map_from_domain_and_range(space1, space2); ma = isl_multi_aff_domain_map(isl_space_copy(space1)); pa1 = isl_pw_aff_pullback_multi_aff(pa1, ma); ma = isl_multi_aff_range_map(space1); pa2 = isl_pw_aff_pullback_multi_aff(pa2, ma); set = order(pa1, pa2); return isl_set_unwrap(set); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function values are equal. */ __isl_give isl_map *isl_pw_aff_eq_map(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { return isl_pw_aff_order_map(pa1, pa2, &isl_pw_aff_eq_set); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function value of "pa1" is less than or equal to * the function value of "pa2". */ __isl_give isl_map *isl_pw_aff_le_map(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { return isl_pw_aff_order_map(pa1, pa2, &isl_pw_aff_le_set); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function value of "pa1" is less than the function value of "pa2". */ __isl_give isl_map *isl_pw_aff_lt_map(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { return isl_pw_aff_order_map(pa1, pa2, &isl_pw_aff_lt_set); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function value of "pa1" is greater than or equal to * the function value of "pa2". */ __isl_give isl_map *isl_pw_aff_ge_map(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { return isl_pw_aff_order_map(pa1, pa2, &isl_pw_aff_ge_set); } /* Return a map containing pairs of elements in the domains of "pa1" and "pa2" * where the function value of "pa1" is greater than the function value * of "pa2". */ __isl_give isl_map *isl_pw_aff_gt_map(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { return isl_pw_aff_order_map(pa1, pa2, &isl_pw_aff_gt_set); } /* Return a set containing those elements in the shared domain * of the elements of list1 and list2 where each element in list1 * has the relation specified by "fn" with each element in list2. */ static __isl_give isl_set *pw_aff_list_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2, __isl_give isl_set *(*fn)(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2)) { int i, j; isl_ctx *ctx; isl_set *set; if (!list1 || !list2) goto error; ctx = isl_pw_aff_list_get_ctx(list1); if (list1->n < 1 || list2->n < 1) isl_die(ctx, isl_error_invalid, "list should contain at least one element", goto error); set = isl_set_universe(isl_pw_aff_get_domain_space(list1->p[0])); for (i = 0; i < list1->n; ++i) for (j = 0; j < list2->n; ++j) { isl_set *set_ij; set_ij = fn(isl_pw_aff_copy(list1->p[i]), isl_pw_aff_copy(list2->p[j])); set = isl_set_intersect(set, set_ij); } isl_pw_aff_list_free(list1); isl_pw_aff_list_free(list2); return set; error: isl_pw_aff_list_free(list1); isl_pw_aff_list_free(list2); return NULL; } /* Return a set containing those elements in the shared domain * of the elements of list1 and list2 where each element in list1 * is equal to each element in list2. */ __isl_give isl_set *isl_pw_aff_list_eq_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_eq_set); } __isl_give isl_set *isl_pw_aff_list_ne_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_ne_set); } /* Return a set containing those elements in the shared domain * of the elements of list1 and list2 where each element in list1 * is less than or equal to each element in list2. */ __isl_give isl_set *isl_pw_aff_list_le_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_le_set); } __isl_give isl_set *isl_pw_aff_list_lt_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_lt_set); } __isl_give isl_set *isl_pw_aff_list_ge_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_ge_set); } __isl_give isl_set *isl_pw_aff_list_gt_set(__isl_take isl_pw_aff_list *list1, __isl_take isl_pw_aff_list *list2) { return pw_aff_list_set(list1, list2, &isl_pw_aff_gt_set); } /* Return a set containing those elements in the shared domain * of pwaff1 and pwaff2 where pwaff1 is not equal to pwaff2. */ __isl_give isl_set *isl_pw_aff_ne_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_set *set_lt, *set_gt; isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); set_lt = isl_pw_aff_lt_set(isl_pw_aff_copy(pwaff1), isl_pw_aff_copy(pwaff2)); set_gt = isl_pw_aff_gt_set(pwaff1, pwaff2); return isl_set_union_disjoint(set_lt, set_gt); } __isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff, isl_int v) { int i; if (isl_int_is_one(v)) return pwaff; if (!isl_int_is_pos(v)) isl_die(isl_pw_aff_get_ctx(pwaff), isl_error_invalid, "factor needs to be positive", return isl_pw_aff_free(pwaff)); pwaff = isl_pw_aff_cow(pwaff); if (!pwaff) return NULL; if (pwaff->n == 0) return pwaff; for (i = 0; i < pwaff->n; ++i) { pwaff->p[i].aff = isl_aff_scale_down(pwaff->p[i].aff, v); if (!pwaff->p[i].aff) return isl_pw_aff_free(pwaff); } return pwaff; } __isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff) { struct isl_pw_aff_un_op_control control = { .fn_base = &isl_aff_floor }; return isl_pw_aff_un_op(pwaff, &control); } __isl_give isl_pw_aff *isl_pw_aff_ceil(__isl_take isl_pw_aff *pwaff) { struct isl_pw_aff_un_op_control control = { .fn_base = &isl_aff_ceil }; return isl_pw_aff_un_op(pwaff, &control); } /* Assuming that "cond1" and "cond2" are disjoint, * return an affine expression that is equal to pwaff1 on cond1 * and to pwaff2 on cond2. */ static __isl_give isl_pw_aff *isl_pw_aff_select( __isl_take isl_set *cond1, __isl_take isl_pw_aff *pwaff1, __isl_take isl_set *cond2, __isl_take isl_pw_aff *pwaff2) { pwaff1 = isl_pw_aff_intersect_domain(pwaff1, cond1); pwaff2 = isl_pw_aff_intersect_domain(pwaff2, cond2); return isl_pw_aff_add_disjoint(pwaff1, pwaff2); } /* Return an affine expression that is equal to pwaff_true for elements * where "cond" is non-zero and to pwaff_false for elements where "cond" * is zero. * That is, return cond ? pwaff_true : pwaff_false; * * If "cond" involves and NaN, then we conservatively return a NaN * on its entire domain. In principle, we could consider the pieces * where it is NaN separately from those where it is not. * * If "pwaff_true" and "pwaff_false" are obviously equal to each other, * then only use the domain of "cond" to restrict the domain. */ __isl_give isl_pw_aff *isl_pw_aff_cond(__isl_take isl_pw_aff *cond, __isl_take isl_pw_aff *pwaff_true, __isl_take isl_pw_aff *pwaff_false) { isl_set *cond_true, *cond_false; isl_bool equal; if (!cond) goto error; if (isl_pw_aff_involves_nan(cond)) { isl_space *space = isl_pw_aff_get_domain_space(cond); isl_local_space *ls = isl_local_space_from_space(space); isl_pw_aff_free(cond); isl_pw_aff_free(pwaff_true); isl_pw_aff_free(pwaff_false); return isl_pw_aff_nan_on_domain(ls); } pwaff_true = isl_pw_aff_align_params(pwaff_true, isl_pw_aff_get_space(pwaff_false)); pwaff_false = isl_pw_aff_align_params(pwaff_false, isl_pw_aff_get_space(pwaff_true)); equal = isl_pw_aff_plain_is_equal(pwaff_true, pwaff_false); if (equal < 0) goto error; if (equal) { isl_set *dom; dom = isl_set_coalesce(isl_pw_aff_domain(cond)); isl_pw_aff_free(pwaff_false); return isl_pw_aff_intersect_domain(pwaff_true, dom); } cond_true = isl_pw_aff_non_zero_set(isl_pw_aff_copy(cond)); cond_false = isl_pw_aff_zero_set(cond); return isl_pw_aff_select(cond_true, pwaff_true, cond_false, pwaff_false); error: isl_pw_aff_free(cond); isl_pw_aff_free(pwaff_true); isl_pw_aff_free(pwaff_false); return NULL; } isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff) { int pos; if (!aff) return isl_bool_error; pos = isl_seq_first_non_zero(aff->v->el + 2, aff->v->size - 2); return isl_bool_ok(pos == -1); } /* Check whether pwaff is a piecewise constant. */ isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff) { int i; if (!pwaff) return isl_bool_error; for (i = 0; i < pwaff->n; ++i) { isl_bool is_cst = isl_aff_is_cst(pwaff->p[i].aff); if (is_cst < 0 || !is_cst) return is_cst; } return isl_bool_true; } /* Return the product of "aff1" and "aff2". * * If either of the two is NaN, then the result is NaN. * * Otherwise, at least one of "aff1" or "aff2" needs to be a constant. */ __isl_give isl_aff *isl_aff_mul(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { if (!aff1 || !aff2) goto error; if (isl_aff_is_nan(aff1)) { isl_aff_free(aff2); return aff1; } if (isl_aff_is_nan(aff2)) { isl_aff_free(aff1); return aff2; } if (!isl_aff_is_cst(aff2) && isl_aff_is_cst(aff1)) return isl_aff_mul(aff2, aff1); if (!isl_aff_is_cst(aff2)) isl_die(isl_aff_get_ctx(aff1), isl_error_invalid, "at least one affine expression should be constant", goto error); aff1 = isl_aff_cow(aff1); if (!aff1 || !aff2) goto error; aff1 = isl_aff_scale(aff1, aff2->v->el[1]); aff1 = isl_aff_scale_down(aff1, aff2->v->el[0]); isl_aff_free(aff2); return aff1; error: isl_aff_free(aff1); isl_aff_free(aff2); return NULL; } /* Divide "aff1" by "aff2", assuming "aff2" is a constant. * * If either of the two is NaN, then the result is NaN. * A division by zero also results in NaN. */ __isl_give isl_aff *isl_aff_div(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_bool is_cst, is_zero; int neg; if (!aff1 || !aff2) goto error; if (isl_aff_is_nan(aff1)) { isl_aff_free(aff2); return aff1; } if (isl_aff_is_nan(aff2)) { isl_aff_free(aff1); return aff2; } is_cst = isl_aff_is_cst(aff2); if (is_cst < 0) goto error; if (!is_cst) isl_die(isl_aff_get_ctx(aff2), isl_error_invalid, "second argument should be a constant", goto error); is_zero = isl_aff_plain_is_zero(aff2); if (is_zero < 0) goto error; if (is_zero) return set_nan_free(aff1, aff2); neg = isl_int_is_neg(aff2->v->el[1]); if (neg) { isl_int_neg(aff2->v->el[0], aff2->v->el[0]); isl_int_neg(aff2->v->el[1], aff2->v->el[1]); } aff1 = isl_aff_scale(aff1, aff2->v->el[0]); aff1 = isl_aff_scale_down(aff1, aff2->v->el[1]); if (neg) { isl_int_neg(aff2->v->el[0], aff2->v->el[0]); isl_int_neg(aff2->v->el[1], aff2->v->el[1]); } isl_aff_free(aff2); return aff1; error: isl_aff_free(aff1); isl_aff_free(aff2); return NULL; } __isl_give isl_pw_aff *isl_pw_aff_add(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return isl_pw_aff_on_shared_domain(pwaff1, pwaff2, &isl_aff_add); } __isl_give isl_pw_aff *isl_pw_aff_mul(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_pw_aff_align_params_bin(&pwaff1, &pwaff2); return isl_pw_aff_on_shared_domain(pwaff1, pwaff2, &isl_aff_mul); } /* Divide "pa1" by "pa2", assuming "pa2" is a piecewise constant. */ __isl_give isl_pw_aff *isl_pw_aff_div(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { int is_cst; is_cst = isl_pw_aff_is_cst(pa2); if (is_cst < 0) goto error; if (!is_cst) isl_die(isl_pw_aff_get_ctx(pa2), isl_error_invalid, "second argument should be a piecewise constant", goto error); isl_pw_aff_align_params_bin(&pa1, &pa2); return isl_pw_aff_on_shared_domain(pa1, pa2, &isl_aff_div); error: isl_pw_aff_free(pa1); isl_pw_aff_free(pa2); return NULL; } /* Compute the quotient of the integer division of "pa1" by "pa2" * with rounding towards zero. * "pa2" is assumed to be a piecewise constant. * * In particular, return * * pa1 >= 0 ? floor(pa1/pa2) : ceil(pa1/pa2) * */ __isl_give isl_pw_aff *isl_pw_aff_tdiv_q(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { int is_cst; isl_set *cond; isl_pw_aff *f, *c; is_cst = isl_pw_aff_is_cst(pa2); if (is_cst < 0) goto error; if (!is_cst) isl_die(isl_pw_aff_get_ctx(pa2), isl_error_invalid, "second argument should be a piecewise constant", goto error); pa1 = isl_pw_aff_div(pa1, pa2); cond = isl_pw_aff_nonneg_set(isl_pw_aff_copy(pa1)); f = isl_pw_aff_floor(isl_pw_aff_copy(pa1)); c = isl_pw_aff_ceil(pa1); return isl_pw_aff_cond(isl_set_indicator_function(cond), f, c); error: isl_pw_aff_free(pa1); isl_pw_aff_free(pa2); return NULL; } /* Compute the remainder of the integer division of "pa1" by "pa2" * with rounding towards zero. * "pa2" is assumed to be a piecewise constant. * * In particular, return * * pa1 - pa2 * (pa1 >= 0 ? floor(pa1/pa2) : ceil(pa1/pa2)) * */ __isl_give isl_pw_aff *isl_pw_aff_tdiv_r(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { int is_cst; isl_pw_aff *res; is_cst = isl_pw_aff_is_cst(pa2); if (is_cst < 0) goto error; if (!is_cst) isl_die(isl_pw_aff_get_ctx(pa2), isl_error_invalid, "second argument should be a piecewise constant", goto error); res = isl_pw_aff_tdiv_q(isl_pw_aff_copy(pa1), isl_pw_aff_copy(pa2)); res = isl_pw_aff_mul(pa2, res); res = isl_pw_aff_sub(pa1, res); return res; error: isl_pw_aff_free(pa1); isl_pw_aff_free(pa2); return NULL; } /* Does either of "pa1" or "pa2" involve any NaN? */ static isl_bool either_involves_nan(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2) { isl_bool has_nan; has_nan = isl_pw_aff_involves_nan(pa1); if (has_nan < 0 || has_nan) return has_nan; return isl_pw_aff_involves_nan(pa2); } /* Return a piecewise affine expression defined on the specified domain * that represents NaN. */ static __isl_give isl_pw_aff *nan_on_domain_set(__isl_take isl_set *dom) { isl_local_space *ls; isl_pw_aff *pa; ls = isl_local_space_from_space(isl_set_get_space(dom)); pa = isl_pw_aff_nan_on_domain(ls); pa = isl_pw_aff_intersect_domain(pa, dom); return pa; } /* Replace "pa1" and "pa2" (at least one of which involves a NaN) * by a NaN on their shared domain. * * In principle, the result could be refined to only being NaN * on the parts of this domain where at least one of "pa1" or "pa2" is NaN. */ static __isl_give isl_pw_aff *replace_by_nan(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2) { isl_set *dom; dom = isl_set_intersect(isl_pw_aff_domain(pa1), isl_pw_aff_domain(pa2)); return nan_on_domain_set(dom); } static __isl_give isl_pw_aff *pw_aff_min(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_set *le; isl_set *dom; dom = isl_set_intersect(isl_pw_aff_domain(isl_pw_aff_copy(pwaff1)), isl_pw_aff_domain(isl_pw_aff_copy(pwaff2))); le = isl_pw_aff_le_set(isl_pw_aff_copy(pwaff1), isl_pw_aff_copy(pwaff2)); dom = isl_set_subtract(dom, isl_set_copy(le)); return isl_pw_aff_select(le, pwaff1, dom, pwaff2); } static __isl_give isl_pw_aff *pw_aff_max(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { isl_set *ge; isl_set *dom; dom = isl_set_intersect(isl_pw_aff_domain(isl_pw_aff_copy(pwaff1)), isl_pw_aff_domain(isl_pw_aff_copy(pwaff2))); ge = isl_pw_aff_ge_set(isl_pw_aff_copy(pwaff1), isl_pw_aff_copy(pwaff2)); dom = isl_set_subtract(dom, isl_set_copy(ge)); return isl_pw_aff_select(ge, pwaff1, dom, pwaff2); } /* Return an expression for the minimum (if "max" is not set) or * the maximum (if "max" is set) of "pa1" and "pa2". * If either expression involves any NaN, then return a NaN * on the shared domain as result. */ static __isl_give isl_pw_aff *pw_aff_min_max(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2, int max) { isl_bool has_nan; has_nan = either_involves_nan(pa1, pa2); if (has_nan < 0) pa1 = isl_pw_aff_free(pa1); else if (has_nan) return replace_by_nan(pa1, pa2); isl_pw_aff_align_params_bin(&pa1, &pa2); if (max) return pw_aff_max(pa1, pa2); else return pw_aff_min(pa1, pa2); } /* Return an expression for the minimum of "pwaff1" and "pwaff2". */ __isl_give isl_pw_aff *isl_pw_aff_min(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { return pw_aff_min_max(pwaff1, pwaff2, 0); } /* Return an expression for the maximum of "pwaff1" and "pwaff2". */ __isl_give isl_pw_aff *isl_pw_aff_max(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2) { return pw_aff_min_max(pwaff1, pwaff2, 1); } /* Does "pa" not involve any NaN? */ static isl_bool pw_aff_no_nan(__isl_keep isl_pw_aff *pa, void *user) { return isl_bool_not(isl_pw_aff_involves_nan(pa)); } /* Does any element of "list" involve any NaN? * * That is, is it not the case that every element does not involve any NaN? */ static isl_bool isl_pw_aff_list_involves_nan(__isl_keep isl_pw_aff_list *list) { return isl_bool_not(isl_pw_aff_list_every(list, &pw_aff_no_nan, NULL)); } /* Replace "list" (consisting of "n" elements, of which * at least one element involves a NaN) * by a NaN on the shared domain of the elements. * * In principle, the result could be refined to only being NaN * on the parts of this domain where at least one of the elements is NaN. */ static __isl_give isl_pw_aff *replace_list_by_nan( __isl_take isl_pw_aff_list *list, int n) { int i; isl_set *dom; dom = isl_pw_aff_domain(isl_pw_aff_list_get_at(list, 0)); for (i = 1; i < n; ++i) { isl_set *dom_i; dom_i = isl_pw_aff_domain(isl_pw_aff_list_get_at(list, i)); dom = isl_set_intersect(dom, dom_i); } isl_pw_aff_list_free(list); return nan_on_domain_set(dom); } /* Return the set where the element at "pos1" of "list" is less than or * equal to the element at "pos2". * Equality is only allowed if "pos1" is smaller than "pos2". */ static __isl_give isl_set *less(__isl_keep isl_pw_aff_list *list, int pos1, int pos2) { isl_pw_aff *pa1, *pa2; pa1 = isl_pw_aff_list_get_at(list, pos1); pa2 = isl_pw_aff_list_get_at(list, pos2); if (pos1 < pos2) return isl_pw_aff_le_set(pa1, pa2); else return isl_pw_aff_lt_set(pa1, pa2); } /* Return an isl_pw_aff that maps each element in the intersection of the * domains of the piecewise affine expressions in "list" * to the maximal (if "max" is set) or minimal (if "max" is not set) * expression in "list" at that element. * If any expression involves any NaN, then return a NaN * on the shared domain as result. * * If "list" has n elements, then the result consists of n pieces, * where, in the case of a minimum, each piece has as value expression * the value expression of one of the elements and as domain * the set of elements where that value expression * is less than (or equal) to the other value expressions. * In the case of a maximum, the condition is * that all the other value expressions are less than (or equal) * to the given value expression. * * In order to produce disjoint pieces, a pair of elements * in the original domain is only allowed to be equal to each other * on exactly one of the two pieces corresponding to the two elements. * The position in the list is used to break ties. * In particular, in the case of a minimum, * in the piece corresponding to a given element, * this element is allowed to be equal to any later element in the list, * but not to any earlier element in the list. */ static __isl_give isl_pw_aff *isl_pw_aff_list_opt( __isl_take isl_pw_aff_list *list, int max) { int i, j; isl_bool has_nan; isl_size n; isl_space *space; isl_pw_aff *pa, *res; n = isl_pw_aff_list_size(list); if (n < 0) goto error; if (n < 1) isl_die(isl_pw_aff_list_get_ctx(list), isl_error_invalid, "list should contain at least one element", goto error); has_nan = isl_pw_aff_list_involves_nan(list); if (has_nan < 0) goto error; if (has_nan) return replace_list_by_nan(list, n); pa = isl_pw_aff_list_get_at(list, 0); space = isl_pw_aff_get_space(pa); isl_pw_aff_free(pa); res = isl_pw_aff_empty(space); for (i = 0; i < n; ++i) { pa = isl_pw_aff_list_get_at(list, i); for (j = 0; j < n; ++j) { isl_set *dom; if (j == i) continue; if (max) dom = less(list, j, i); else dom = less(list, i, j); pa = isl_pw_aff_intersect_domain(pa, dom); } res = isl_pw_aff_add_disjoint(res, pa); } isl_pw_aff_list_free(list); return res; error: isl_pw_aff_list_free(list); return NULL; } /* Return an isl_pw_aff that maps each element in the intersection of the * domains of the elements of list to the minimal corresponding affine * expression. */ __isl_give isl_pw_aff *isl_pw_aff_list_min(__isl_take isl_pw_aff_list *list) { return isl_pw_aff_list_opt(list, 0); } /* Return an isl_pw_aff that maps each element in the intersection of the * domains of the elements of list to the maximal corresponding affine * expression. */ __isl_give isl_pw_aff *isl_pw_aff_list_max(__isl_take isl_pw_aff_list *list) { return isl_pw_aff_list_opt(list, 1); } /* Mark the domains of "pwaff" as rational. */ __isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff) { int i; pwaff = isl_pw_aff_cow(pwaff); if (!pwaff) return NULL; if (pwaff->n == 0) return pwaff; for (i = 0; i < pwaff->n; ++i) { pwaff->p[i].set = isl_set_set_rational(pwaff->p[i].set); if (!pwaff->p[i].set) return isl_pw_aff_free(pwaff); } return pwaff; } /* Mark the domains of the elements of "list" as rational. */ __isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational( __isl_take isl_pw_aff_list *list) { int i, n; if (!list) return NULL; if (list->n == 0) return list; n = list->n; for (i = 0; i < n; ++i) { isl_pw_aff *pa; pa = isl_pw_aff_list_get_pw_aff(list, i); pa = isl_pw_aff_set_rational(pa); list = isl_pw_aff_list_set_pw_aff(list, i, pa); } return list; } /* Do the parameters of "aff" match those of "space"? */ isl_bool isl_aff_matching_params(__isl_keep isl_aff *aff, __isl_keep isl_space *space) { isl_space *aff_space; isl_bool match; if (!aff || !space) return isl_bool_error; aff_space = isl_aff_get_domain_space(aff); match = isl_space_has_equal_params(space, aff_space); isl_space_free(aff_space); return match; } /* Check that the domain space of "aff" matches "space". */ isl_stat isl_aff_check_match_domain_space(__isl_keep isl_aff *aff, __isl_keep isl_space *space) { isl_space *aff_space; isl_bool match; if (!aff || !space) return isl_stat_error; aff_space = isl_aff_get_domain_space(aff); match = isl_space_has_equal_params(space, aff_space); if (match < 0) goto error; if (!match) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "parameters don't match", goto error); match = isl_space_tuple_is_equal(space, isl_dim_in, aff_space, isl_dim_set); if (match < 0) goto error; if (!match) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "domains don't match", goto error); isl_space_free(aff_space); return isl_stat_ok; error: isl_space_free(aff_space); return isl_stat_error; } /* Return the shared (universe) domain of the elements of "ma". * * Since an isl_multi_aff (and an isl_aff) is always total, * the domain is always the universe set in its domain space. * This is a helper function for use in the generic isl_multi_*_bind. */ static __isl_give isl_basic_set *isl_multi_aff_domain( __isl_take isl_multi_aff *ma) { isl_space *space; space = isl_multi_aff_get_space(ma); isl_multi_aff_free(ma); return isl_basic_set_universe(isl_space_domain(space)); } #undef BASE #define BASE aff #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef DOMBASE #define DOMBASE set #include #include #include #undef DOMBASE #define DOMBASE basic_set #include /* Construct an isl_multi_aff living in "space" that corresponds * to the affine transformation matrix "mat". */ __isl_give isl_multi_aff *isl_multi_aff_from_aff_mat( __isl_take isl_space *space, __isl_take isl_mat *mat) { isl_ctx *ctx; isl_local_space *ls = NULL; isl_multi_aff *ma = NULL; isl_size n_row, n_col, n_out, total; int i; if (!space || !mat) goto error; ctx = isl_mat_get_ctx(mat); n_row = isl_mat_rows(mat); n_col = isl_mat_cols(mat); n_out = isl_space_dim(space, isl_dim_out); total = isl_space_dim(space, isl_dim_all); if (n_row < 0 || n_col < 0 || n_out < 0 || total < 0) goto error; if (n_row < 1) isl_die(ctx, isl_error_invalid, "insufficient number of rows", goto error); if (n_col < 1) isl_die(ctx, isl_error_invalid, "insufficient number of columns", goto error); if (1 + n_out != n_row || 2 + total != n_row + n_col) isl_die(ctx, isl_error_invalid, "dimension mismatch", goto error); ma = isl_multi_aff_zero(isl_space_copy(space)); space = isl_space_domain(space); ls = isl_local_space_from_space(isl_space_copy(space)); for (i = 0; i < n_row - 1; ++i) { isl_vec *v; isl_aff *aff; v = isl_vec_alloc(ctx, 1 + n_col); if (!v) goto error; isl_int_set(v->el[0], mat->row[0][0]); isl_seq_cpy(v->el + 1, mat->row[1 + i], n_col); v = isl_vec_normalize(v); aff = isl_aff_alloc_vec_validated(isl_local_space_copy(ls), v); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_space_free(space); isl_local_space_free(ls); isl_mat_free(mat); return ma; error: isl_space_free(space); isl_local_space_free(ls); isl_mat_free(mat); isl_multi_aff_free(ma); return NULL; } /* Return the constant terms of the affine expressions of "ma". */ __isl_give isl_multi_val *isl_multi_aff_get_constant_multi_val( __isl_keep isl_multi_aff *ma) { int i; isl_size n; isl_space *space; isl_multi_val *mv; n = isl_multi_aff_size(ma); if (n < 0) return NULL; space = isl_space_range(isl_multi_aff_get_space(ma)); space = isl_space_drop_all_params(space); mv = isl_multi_val_zero(space); for (i = 0; i < n; ++i) { isl_aff *aff; isl_val *val; aff = isl_multi_aff_get_at(ma, i); val = isl_aff_get_constant_val(aff); isl_aff_free(aff); mv = isl_multi_val_set_at(mv, i, val); } return mv; } /* Remove any internal structure of the domain of "ma". * If there is any such internal structure in the input, * then the name of the corresponding space is also removed. */ __isl_give isl_multi_aff *isl_multi_aff_flatten_domain( __isl_take isl_multi_aff *ma) { isl_space *space; if (!ma) return NULL; if (!ma->space->nested[0]) return ma; space = isl_multi_aff_get_space(ma); space = isl_space_flatten_domain(space); ma = isl_multi_aff_reset_space(ma, space); return ma; } /* Given a map space, return an isl_multi_aff that maps a wrapped copy * of the space to its domain. */ __isl_give isl_multi_aff *isl_multi_aff_domain_map(__isl_take isl_space *space) { int i; isl_size n_in; isl_local_space *ls; isl_multi_aff *ma; if (!space) return NULL; if (!isl_space_is_map(space)) isl_die(isl_space_get_ctx(space), isl_error_invalid, "not a map space", goto error); n_in = isl_space_dim(space, isl_dim_in); if (n_in < 0) goto error; space = isl_space_domain_map(space); ma = isl_multi_aff_alloc(isl_space_copy(space)); if (n_in == 0) { isl_space_free(space); return ma; } space = isl_space_domain(space); ls = isl_local_space_from_space(space); for (i = 0; i < n_in; ++i) { isl_aff *aff; aff = isl_aff_var_on_domain(isl_local_space_copy(ls), isl_dim_set, i); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_local_space_free(ls); return ma; error: isl_space_free(space); return NULL; } /* This function performs the same operation as isl_multi_aff_domain_map, * but is considered as a function on an isl_space when exported. */ __isl_give isl_multi_aff *isl_space_domain_map_multi_aff( __isl_take isl_space *space) { return isl_multi_aff_domain_map(space); } /* Given a map space, return an isl_multi_aff that maps a wrapped copy * of the space to its range. */ __isl_give isl_multi_aff *isl_multi_aff_range_map(__isl_take isl_space *space) { int i; isl_size n_in, n_out; isl_local_space *ls; isl_multi_aff *ma; if (!space) return NULL; if (!isl_space_is_map(space)) isl_die(isl_space_get_ctx(space), isl_error_invalid, "not a map space", goto error); n_in = isl_space_dim(space, isl_dim_in); n_out = isl_space_dim(space, isl_dim_out); if (n_in < 0 || n_out < 0) goto error; space = isl_space_range_map(space); ma = isl_multi_aff_alloc(isl_space_copy(space)); if (n_out == 0) { isl_space_free(space); return ma; } space = isl_space_domain(space); ls = isl_local_space_from_space(space); for (i = 0; i < n_out; ++i) { isl_aff *aff; aff = isl_aff_var_on_domain(isl_local_space_copy(ls), isl_dim_set, n_in + i); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_local_space_free(ls); return ma; error: isl_space_free(space); return NULL; } /* This function performs the same operation as isl_multi_aff_range_map, * but is considered as a function on an isl_space when exported. */ __isl_give isl_multi_aff *isl_space_range_map_multi_aff( __isl_take isl_space *space) { return isl_multi_aff_range_map(space); } /* Given a map space, return an isl_pw_multi_aff that maps a wrapped copy * of the space to its domain. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_domain_map( __isl_take isl_space *space) { return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_domain_map(space)); } /* This function performs the same operation as isl_pw_multi_aff_domain_map, * but is considered as a function on an isl_space when exported. */ __isl_give isl_pw_multi_aff *isl_space_domain_map_pw_multi_aff( __isl_take isl_space *space) { return isl_pw_multi_aff_domain_map(space); } /* Given a map space, return an isl_pw_multi_aff that maps a wrapped copy * of the space to its range. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map( __isl_take isl_space *space) { return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_range_map(space)); } /* This function performs the same operation as isl_pw_multi_aff_range_map, * but is considered as a function on an isl_space when exported. */ __isl_give isl_pw_multi_aff *isl_space_range_map_pw_multi_aff( __isl_take isl_space *space) { return isl_pw_multi_aff_range_map(space); } /* Given the space of a set and a range of set dimensions, * construct an isl_multi_aff that projects out those dimensions. */ __isl_give isl_multi_aff *isl_multi_aff_project_out_map( __isl_take isl_space *space, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_size dim; isl_local_space *ls; isl_multi_aff *ma; if (!space) return NULL; if (!isl_space_is_set(space)) isl_die(isl_space_get_ctx(space), isl_error_unsupported, "expecting set space", goto error); if (type != isl_dim_set) isl_die(isl_space_get_ctx(space), isl_error_invalid, "only set dimensions can be projected out", goto error); if (isl_space_check_range(space, type, first, n) < 0) goto error; dim = isl_space_dim(space, isl_dim_set); if (dim < 0) goto error; space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, dim - n); if (dim == n) return isl_multi_aff_alloc(space); ma = isl_multi_aff_alloc(isl_space_copy(space)); space = isl_space_domain(space); ls = isl_local_space_from_space(space); for (i = 0; i < first; ++i) { isl_aff *aff; aff = isl_aff_var_on_domain(isl_local_space_copy(ls), isl_dim_set, i); ma = isl_multi_aff_set_aff(ma, i, aff); } for (i = 0; i < dim - (first + n); ++i) { isl_aff *aff; aff = isl_aff_var_on_domain(isl_local_space_copy(ls), isl_dim_set, first + n + i); ma = isl_multi_aff_set_aff(ma, first + i, aff); } isl_local_space_free(ls); return ma; error: isl_space_free(space); return NULL; } /* Given the space of a set and a range of set dimensions, * construct an isl_pw_multi_aff that projects out those dimensions. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out_map( __isl_take isl_space *space, enum isl_dim_type type, unsigned first, unsigned n) { isl_multi_aff *ma; ma = isl_multi_aff_project_out_map(space, type, first, n); return isl_pw_multi_aff_from_multi_aff(ma); } /* This function performs the same operation as isl_pw_multi_aff_from_multi_aff, * but is considered as a function on an isl_multi_aff when exported. */ __isl_give isl_pw_multi_aff *isl_multi_aff_to_pw_multi_aff( __isl_take isl_multi_aff *ma) { return isl_pw_multi_aff_from_multi_aff(ma); } /* Create a piecewise multi-affine expression in the given space that maps each * input dimension to the corresponding output dimension. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity( __isl_take isl_space *space) { return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_identity(space)); } /* Create a piecewise multi expression that maps elements in the given space * to themselves. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity_on_domain_space( __isl_take isl_space *space) { isl_multi_aff *ma; ma = isl_multi_aff_identity_on_domain_space(space); return isl_pw_multi_aff_from_multi_aff(ma); } /* This function performs the same operation as * isl_pw_multi_aff_identity_on_domain_space, * but is considered as a function on an isl_space when exported. */ __isl_give isl_pw_multi_aff *isl_space_identity_pw_multi_aff_on_domain( __isl_take isl_space *space) { return isl_pw_multi_aff_identity_on_domain_space(space); } /* Exploit the equalities in "eq" to simplify the affine expressions. */ static __isl_give isl_multi_aff *isl_multi_aff_substitute_equalities( __isl_take isl_multi_aff *maff, __isl_take isl_basic_set *eq) { isl_size n; int i; n = isl_multi_aff_size(maff); if (n < 0 || !eq) goto error; for (i = 0; i < n; ++i) { isl_aff *aff; aff = isl_multi_aff_take_at(maff, i); aff = isl_aff_substitute_equalities(aff, isl_basic_set_copy(eq)); maff = isl_multi_aff_restore_at(maff, i, aff); } isl_basic_set_free(eq); return maff; error: isl_basic_set_free(eq); isl_multi_aff_free(maff); return NULL; } __isl_give isl_multi_aff *isl_multi_aff_scale(__isl_take isl_multi_aff *maff, isl_int f) { isl_size n; int i; n = isl_multi_aff_size(maff); if (n < 0) return isl_multi_aff_free(maff); for (i = 0; i < n; ++i) { isl_aff *aff; aff = isl_multi_aff_take_at(maff, i); aff = isl_aff_scale(aff, f); maff = isl_multi_aff_restore_at(maff, i, aff); } return maff; } __isl_give isl_multi_aff *isl_multi_aff_add_on_domain(__isl_keep isl_set *dom, __isl_take isl_multi_aff *maff1, __isl_take isl_multi_aff *maff2) { maff1 = isl_multi_aff_add(maff1, maff2); maff1 = isl_multi_aff_gist(maff1, isl_set_copy(dom)); return maff1; } isl_bool isl_multi_aff_is_empty(__isl_keep isl_multi_aff *maff) { if (!maff) return isl_bool_error; return isl_bool_false; } /* Return the set of domain elements where "ma1" is lexicographically * smaller than or equal to "ma2". */ __isl_give isl_set *isl_multi_aff_lex_le_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { return isl_multi_aff_lex_ge_set(ma2, ma1); } /* Return the set of domain elements where "ma1" is lexicographically * smaller than "ma2". */ __isl_give isl_set *isl_multi_aff_lex_lt_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { return isl_multi_aff_lex_gt_set(ma2, ma1); } /* Return the set of domain elements where "ma1" is lexicographically * greater than to "ma2". If "equal" is set, then include the domain * elements where they are equal. * Do this for the case where there are no entries. * In this case, "ma1" cannot be greater than "ma2", * but it is (greater than or) equal to "ma2". */ static __isl_give isl_set *isl_multi_aff_lex_gte_set_0d( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2, int equal) { isl_space *space; space = isl_multi_aff_get_domain_space(ma1); isl_multi_aff_free(ma1); isl_multi_aff_free(ma2); if (equal) return isl_set_universe(space); else return isl_set_empty(space); } /* Return the set where entry "i" of "ma1" and "ma2" * satisfy the relation prescribed by "cmp". */ static __isl_give isl_set *isl_multi_aff_order_at(__isl_keep isl_multi_aff *ma1, __isl_keep isl_multi_aff *ma2, int i, __isl_give isl_set *(*cmp)(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2)) { isl_aff *aff1, *aff2; aff1 = isl_multi_aff_get_at(ma1, i); aff2 = isl_multi_aff_get_at(ma2, i); return cmp(aff1, aff2); } /* Return the set of domain elements where "ma1" is lexicographically * greater than to "ma2". If "equal" is set, then include the domain * elements where they are equal. * * In particular, for all but the final entry, * include the set of elements where this entry is strictly greater in "ma1" * and all previous entries are equal. * The final entry is also allowed to be equal in the two functions * if "equal" is set. * * The case where there are no entries is handled separately. */ static __isl_give isl_set *isl_multi_aff_lex_gte_set( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2, int equal) { int i; isl_size n; isl_space *space; isl_set *res; isl_set *equal_set; isl_set *gte; if (isl_multi_aff_check_equal_space(ma1, ma2) < 0) goto error; n = isl_multi_aff_size(ma1); if (n < 0) goto error; if (n == 0) return isl_multi_aff_lex_gte_set_0d(ma1, ma2, equal); space = isl_multi_aff_get_domain_space(ma1); res = isl_set_empty(isl_space_copy(space)); equal_set = isl_set_universe(space); for (i = 0; i + 1 < n; ++i) { isl_bool empty; isl_set *gt, *eq; gt = isl_multi_aff_order_at(ma1, ma2, i, &isl_aff_gt_set); gt = isl_set_intersect(gt, isl_set_copy(equal_set)); res = isl_set_union(res, gt); eq = isl_multi_aff_order_at(ma1, ma2, i, &isl_aff_eq_set); equal_set = isl_set_intersect(equal_set, eq); empty = isl_set_is_empty(equal_set); if (empty >= 0 && empty) break; } if (equal) gte = isl_multi_aff_order_at(ma1, ma2, n - 1, &isl_aff_ge_set); else gte = isl_multi_aff_order_at(ma1, ma2, n - 1, &isl_aff_gt_set); isl_multi_aff_free(ma1); isl_multi_aff_free(ma2); gte = isl_set_intersect(gte, equal_set); return isl_set_union(res, gte); error: isl_multi_aff_free(ma1); isl_multi_aff_free(ma2); return NULL; } /* Return the set of domain elements where "ma1" is lexicographically * greater than or equal to "ma2". */ __isl_give isl_set *isl_multi_aff_lex_ge_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { return isl_multi_aff_lex_gte_set(ma1, ma2, 1); } /* Return the set of domain elements where "ma1" is lexicographically * greater than "ma2". */ __isl_give isl_set *isl_multi_aff_lex_gt_set(__isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { return isl_multi_aff_lex_gte_set(ma1, ma2, 0); } #define isl_multi_aff_zero_in_space isl_multi_aff_zero #undef PW #define PW isl_pw_multi_aff #undef BASE #define BASE multi_aff #undef EL_IS_ZERO #define EL_IS_ZERO is_empty #undef ZERO #define ZERO empty #undef IS_ZERO #define IS_ZERO is_empty #undef FIELD #define FIELD maff #undef DEFAULT_IS_ZERO #define DEFAULT_IS_ZERO 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef BASE #define BASE pw_multi_aff #include #include "isl_union_locals_templ.c" #include #include #undef BASE #define BASE multi_aff #include /* Generic function for extracting a factor from a product "pma". * "check_space" checks that the space is that of the right kind of product. * "space_factor" extracts the factor from the space. * "multi_aff_factor" extracts the factor from the constituent functions. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_factor( __isl_take isl_pw_multi_aff *pma, isl_stat (*check_space)(__isl_keep isl_pw_multi_aff *pma), __isl_give isl_space *(*space_factor)(__isl_take isl_space *space), __isl_give isl_multi_aff *(*multi_aff_factor)( __isl_take isl_multi_aff *ma)) { int i; isl_space *space; if (check_space(pma) < 0) return isl_pw_multi_aff_free(pma); space = isl_pw_multi_aff_take_space(pma); space = space_factor(space); for (i = 0; pma && i < pma->n; ++i) { isl_multi_aff *ma; ma = isl_pw_multi_aff_take_base_at(pma, i); ma = multi_aff_factor(ma); pma = isl_pw_multi_aff_restore_base_at(pma, i, ma); } pma = isl_pw_multi_aff_restore_space(pma, space); return pma; } /* Is the range of "pma" a wrapped relation? */ static isl_bool isl_pw_multi_aff_range_is_wrapping( __isl_keep isl_pw_multi_aff *pma) { return isl_space_range_is_wrapping(isl_pw_multi_aff_peek_space(pma)); } /* Check that the range of "pma" is a product. */ static isl_stat pw_multi_aff_check_range_product( __isl_keep isl_pw_multi_aff *pma) { isl_bool wraps; wraps = isl_pw_multi_aff_range_is_wrapping(pma); if (wraps < 0) return isl_stat_error; if (!wraps) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "range is not a product", return isl_stat_error); return isl_stat_ok; } /* Given a function A -> [B -> C], extract the function A -> B. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_factor_domain( __isl_take isl_pw_multi_aff *pma) { return pw_multi_aff_factor(pma, &pw_multi_aff_check_range_product, &isl_space_range_factor_domain, &isl_multi_aff_range_factor_domain); } /* Given a function A -> [B -> C], extract the function A -> C. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_factor_range( __isl_take isl_pw_multi_aff *pma) { return pw_multi_aff_factor(pma, &pw_multi_aff_check_range_product, &isl_space_range_factor_range, &isl_multi_aff_range_factor_range); } /* Given two piecewise multi affine expressions, return a piecewise * multi-affine expression defined on the union of the definition domains * of the inputs that is equal to the lexicographic maximum of the two * inputs on each cell. If only one of the two inputs is defined on * a given cell, then it is considered to be the maximum. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmax( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_pw_multi_aff_align_params_bin(&pma1, &pma2); return isl_pw_multi_aff_union_opt_cmp(pma1, pma2, &isl_multi_aff_lex_ge_set); } /* Given two piecewise multi affine expressions, return a piecewise * multi-affine expression defined on the union of the definition domains * of the inputs that is equal to the lexicographic minimum of the two * inputs on each cell. If only one of the two inputs is defined on * a given cell, then it is considered to be the minimum. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_pw_multi_aff_align_params_bin(&pma1, &pma2); return isl_pw_multi_aff_union_opt_cmp(pma1, pma2, &isl_multi_aff_lex_le_set); } __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_pw_multi_aff_align_params_bin(&pma1, &pma2); return isl_pw_multi_aff_on_shared_domain(pma1, pma2, &isl_multi_aff_add); } /* Subtract "pma2" from "pma1" and return the result. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_pw_multi_aff_align_params_bin(&pma1, &pma2); return isl_pw_multi_aff_on_shared_domain(pma1, pma2, &isl_multi_aff_sub); } /* Given two piecewise multi-affine expressions A -> B and C -> D, * construct a piecewise multi-affine expression [A -> C] -> [B -> D]. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_product( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { int i, j, n; isl_space *space; isl_pw_multi_aff *res; if (isl_pw_multi_aff_align_params_bin(&pma1, &pma2) < 0) goto error; n = pma1->n * pma2->n; space = isl_space_product(isl_space_copy(pma1->dim), isl_space_copy(pma2->dim)); res = isl_pw_multi_aff_alloc_size(space, n); for (i = 0; i < pma1->n; ++i) { for (j = 0; j < pma2->n; ++j) { isl_set *domain; isl_multi_aff *ma; domain = isl_set_product(isl_set_copy(pma1->p[i].set), isl_set_copy(pma2->p[j].set)); ma = isl_multi_aff_product( isl_multi_aff_copy(pma1->p[i].maff), isl_multi_aff_copy(pma2->p[j].maff)); res = isl_pw_multi_aff_add_piece(res, domain, ma); } } isl_pw_multi_aff_free(pma1); isl_pw_multi_aff_free(pma2); return res; error: isl_pw_multi_aff_free(pma1); isl_pw_multi_aff_free(pma2); return NULL; } /* Subtract the initial "n" elements in "ma" with coefficients in "c" and * denominator "denom". * "denom" is allowed to be negative, in which case the actual denominator * is -denom and the expressions are added instead. */ static __isl_give isl_aff *subtract_initial(__isl_take isl_aff *aff, __isl_keep isl_multi_aff *ma, int n, isl_int *c, isl_int denom) { int i, first; int sign; isl_int d; first = isl_seq_first_non_zero(c, n); if (first == -1) return aff; sign = isl_int_sgn(denom); isl_int_init(d); isl_int_abs(d, denom); for (i = first; i < n; ++i) { isl_aff *aff_i; if (isl_int_is_zero(c[i])) continue; aff_i = isl_multi_aff_get_aff(ma, i); aff_i = isl_aff_scale(aff_i, c[i]); aff_i = isl_aff_scale_down(aff_i, d); if (sign >= 0) aff = isl_aff_sub(aff, aff_i); else aff = isl_aff_add(aff, aff_i); } isl_int_clear(d); return aff; } /* Extract an affine expression that expresses the output dimension "pos" * of "bmap" in terms of the parameters and input dimensions from * equality "eq". * Note that this expression may involve integer divisions defined * in terms of parameters and input dimensions. * The equality may also involve references to earlier (but not later) * output dimensions. These are replaced by the corresponding elements * in "ma". * * If the equality is of the form * * f(i) + h(j) + a x + g(i) = 0, * * with f(i) a linear combinations of the parameters and input dimensions, * g(i) a linear combination of integer divisions defined in terms of the same * and h(j) a linear combinations of earlier output dimensions, * then the affine expression is * * (-f(i) - g(i))/a - h(j)/a * * If the equality is of the form * * f(i) + h(j) - a x + g(i) = 0, * * then the affine expression is * * (f(i) + g(i))/a - h(j)/(-a) * * * If "div" refers to an integer division (i.e., it is smaller than * the number of integer divisions), then the equality constraint * does involve an integer division (the one at position "div") that * is defined in terms of output dimensions. However, this integer * division can be eliminated by exploiting a pair of constraints * x >= l and x <= l + n, with n smaller than the coefficient of "div" * in the equality constraint. "ineq" refers to inequality x >= l, i.e., * -l + x >= 0. * In particular, let * * x = e(i) + m floor(...) * * with e(i) the expression derived above and floor(...) the integer * division involving output dimensions. * From * * l <= x <= l + n, * * we have * * 0 <= x - l <= n * * This means * * e(i) + m floor(...) - l = (e(i) + m floor(...) - l) mod m * = (e(i) - l) mod m * * Therefore, * * x - l = (e(i) - l) mod m * * or * * x = ((e(i) - l) mod m) + l * * The variable "shift" below contains the expression -l, which may * also involve a linear combination of earlier output dimensions. */ static __isl_give isl_aff *extract_aff_from_equality( __isl_keep isl_basic_map *bmap, int pos, int eq, int div, int ineq, __isl_keep isl_multi_aff *ma) { unsigned o_out; isl_size n_div, n_out; isl_ctx *ctx; isl_local_space *ls; isl_aff *aff, *shift; isl_val *mod; ctx = isl_basic_map_get_ctx(bmap); ls = isl_basic_map_get_local_space(bmap); ls = isl_local_space_domain(ls); aff = isl_aff_alloc(isl_local_space_copy(ls)); if (!aff) goto error; o_out = isl_basic_map_offset(bmap, isl_dim_out); n_out = isl_basic_map_dim(bmap, isl_dim_out); n_div = isl_basic_map_dim(bmap, isl_dim_div); if (n_out < 0 || n_div < 0) goto error; if (isl_int_is_neg(bmap->eq[eq][o_out + pos])) { isl_seq_cpy(aff->v->el + 1, bmap->eq[eq], o_out); isl_seq_cpy(aff->v->el + 1 + o_out, bmap->eq[eq] + o_out + n_out, n_div); } else { isl_seq_neg(aff->v->el + 1, bmap->eq[eq], o_out); isl_seq_neg(aff->v->el + 1 + o_out, bmap->eq[eq] + o_out + n_out, n_div); } if (div < n_div) isl_int_set_si(aff->v->el[1 + o_out + div], 0); isl_int_abs(aff->v->el[0], bmap->eq[eq][o_out + pos]); aff = subtract_initial(aff, ma, pos, bmap->eq[eq] + o_out, bmap->eq[eq][o_out + pos]); if (div < n_div) { shift = isl_aff_alloc(isl_local_space_copy(ls)); if (!shift) goto error; isl_seq_cpy(shift->v->el + 1, bmap->ineq[ineq], o_out); isl_seq_cpy(shift->v->el + 1 + o_out, bmap->ineq[ineq] + o_out + n_out, n_div); isl_int_set_si(shift->v->el[0], 1); shift = subtract_initial(shift, ma, pos, bmap->ineq[ineq] + o_out, ctx->negone); aff = isl_aff_add(aff, isl_aff_copy(shift)); mod = isl_val_int_from_isl_int(ctx, bmap->eq[eq][o_out + n_out + div]); mod = isl_val_abs(mod); aff = isl_aff_mod_val(aff, mod); aff = isl_aff_sub(aff, shift); } isl_local_space_free(ls); return aff; error: isl_local_space_free(ls); isl_aff_free(aff); return NULL; } /* Given a basic map with output dimensions defined * in terms of the parameters input dimensions and earlier * output dimensions using an equality (and possibly a pair on inequalities), * extract an isl_aff that expresses output dimension "pos" in terms * of the parameters and input dimensions. * Note that this expression may involve integer divisions defined * in terms of parameters and input dimensions. * "ma" contains the expressions corresponding to earlier output dimensions. * * This function shares some similarities with * isl_basic_map_has_defining_equality and isl_constraint_get_bound. */ static __isl_give isl_aff *extract_isl_aff_from_basic_map( __isl_keep isl_basic_map *bmap, int pos, __isl_keep isl_multi_aff *ma) { int eq, div, ineq; isl_aff *aff; if (!bmap) return NULL; eq = isl_basic_map_output_defining_equality(bmap, pos, &div, &ineq); if (eq >= bmap->n_eq) isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, "unable to find suitable equality", return NULL); aff = extract_aff_from_equality(bmap, pos, eq, div, ineq, ma); aff = isl_aff_remove_unused_divs(aff); return aff; } /* Given a basic map where each output dimension is defined * in terms of the parameters and input dimensions using an equality, * extract an isl_multi_aff that expresses the output dimensions in terms * of the parameters and input dimensions. */ static __isl_give isl_multi_aff *extract_isl_multi_aff_from_basic_map( __isl_take isl_basic_map *bmap) { int i; isl_size n_out; isl_multi_aff *ma; if (!bmap) return NULL; ma = isl_multi_aff_alloc(isl_basic_map_get_space(bmap)); n_out = isl_basic_map_dim(bmap, isl_dim_out); if (n_out < 0) ma = isl_multi_aff_free(ma); for (i = 0; i < n_out; ++i) { isl_aff *aff; aff = extract_isl_aff_from_basic_map(bmap, i, ma); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_basic_map_free(bmap); return ma; } /* Given a basic set where each set dimension is defined * in terms of the parameters using an equality, * extract an isl_multi_aff that expresses the set dimensions in terms * of the parameters. */ __isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities( __isl_take isl_basic_set *bset) { return extract_isl_multi_aff_from_basic_map(bset); } /* Create an isl_pw_multi_aff that is equivalent to * isl_map_intersect_domain(isl_map_from_basic_map(bmap), domain). * The given basic map is such that each output dimension is defined * in terms of the parameters and input dimensions using an equality. * * Since some applications expect the result of isl_pw_multi_aff_from_map * to only contain integer affine expressions, we compute the floor * of the expression before returning. * * Remove all constraints involving local variables without * an explicit representation (resulting in the removal of those * local variables) prior to the actual extraction to ensure * that the local spaces in which the resulting affine expressions * are created do not contain any unknown local variables. * Removing such constraints is safe because constraints involving * unknown local variables are not used to determine whether * a basic map is obviously single-valued. */ static __isl_give isl_pw_multi_aff *plain_pw_multi_aff_from_map( __isl_take isl_set *domain, __isl_take isl_basic_map *bmap) { isl_multi_aff *ma; bmap = isl_basic_map_drop_constraints_involving_unknown_divs(bmap); ma = extract_isl_multi_aff_from_basic_map(bmap); ma = isl_multi_aff_floor(ma); return isl_pw_multi_aff_alloc(domain, ma); } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map. * This obviously only works if the input "map" is single-valued. * If so, we compute the lexicographic minimum of the image in the form * of an isl_pw_multi_aff. Since the image is unique, it is equal * to its lexicographic minimum. * If the input is not single-valued, we produce an error. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_base( __isl_take isl_map *map) { int i; int sv; isl_pw_multi_aff *pma; sv = isl_map_is_single_valued(map); if (sv < 0) goto error; if (!sv) isl_die(isl_map_get_ctx(map), isl_error_invalid, "map is not single-valued", goto error); map = isl_map_make_disjoint(map); if (!map) return NULL; pma = isl_pw_multi_aff_empty(isl_map_get_space(map)); for (i = 0; i < map->n; ++i) { isl_pw_multi_aff *pma_i; isl_basic_map *bmap; bmap = isl_basic_map_copy(map->p[i]); pma_i = isl_basic_map_lexmin_pw_multi_aff(bmap); pma = isl_pw_multi_aff_add_disjoint(pma, pma_i); } isl_map_free(map); return pma; error: isl_map_free(map); return NULL; } /* Given an affine expression "aff", return an extended multi-affine expression * that also includes an identity on the domain. * In other words, the returned expression can be used to extend the domain * with an extra dimension corresponding to "aff". * * That is, if "aff" is of the form * * A -> f * * then return * * A -> [A -> f] * * However, if "aff" is of the form * * f * * i.e., "aff" lives in a set space rather than a map space, * then simply return * * f */ __isl_give isl_multi_aff *isl_aff_as_domain_extension(__isl_take isl_aff *aff) { isl_bool is_set; isl_multi_aff *ma; is_set = isl_space_is_params(isl_aff_peek_domain_space(aff)); if (is_set < 0) return isl_multi_aff_from_aff(isl_aff_free(aff)); if (is_set) { ma = isl_multi_aff_from_aff(aff); } else { isl_space *space; isl_multi_aff *id; space = isl_aff_get_domain_space(aff); id = isl_multi_aff_identity(isl_space_map_from_set(space)); ma = isl_multi_aff_from_aff(aff); ma = isl_multi_aff_range_product(id, ma); } return ma; } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map, * taking into account that the output dimension at position "d" * is equal to some expression f in the parameters and input dimensions * represented by "aff". * * Let "map" be of the form * * A -> B * * Construct a mapping * * A -> [A -> x = f] * * apply that to the map, obtaining * * [A -> x = f] -> B * * and equate dimension "d" to x. * An isl_pw_multi_aff representation of this map is then computed and * the above expression is plugged in in the result. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_plug_in( __isl_take isl_map *map, int d, __isl_take isl_aff *aff) { isl_multi_aff *ma; isl_map *insert; isl_size n_in; isl_pw_multi_aff *pma; n_in = isl_aff_dim(aff, isl_dim_in); if (n_in < 0) goto error; ma = isl_aff_as_domain_extension(aff); insert = isl_map_from_multi_aff_internal(isl_multi_aff_copy(ma)); map = isl_map_apply_domain(map, insert); map = isl_map_equate(map, isl_dim_in, n_in, isl_dim_out, d); pma = isl_pw_multi_aff_from_map(map); pma = isl_pw_multi_aff_pullback_multi_aff(pma, ma); return pma; error: isl_map_free(map); isl_aff_free(aff); return NULL; } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map. * * As a special case, we first check if there is any pair of constraints, * shared by all the basic maps in "map" that force a given dimension * to be equal to the floor or modulo of some affine combination * of the input dimensions. * * Sort the constraints first to make it easier to find such pairs * of constraints. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_check_div_mod( __isl_take isl_map *map) { int d; isl_basic_map *hull; isl_maybe_isl_aff sub; hull = isl_map_unshifted_simple_hull(isl_map_copy(map)); hull = isl_basic_map_sort_constraints(hull); sub = isl_basic_map_try_find_any_output_div_mod(hull, &d); isl_basic_map_free(hull); if (sub.valid < 0) goto error; if (sub.valid) return pw_multi_aff_from_map_plug_in(map, d, sub.value); return pw_multi_aff_from_map_base(map); error: isl_map_free(map); return NULL; } /* Given an affine expression * * [A -> B] -> f(A,B) * * construct an isl_multi_aff * * [A -> B] -> B' * * such that dimension "d" in B' is set to "aff" and the remaining * dimensions are set equal to the corresponding dimensions in B. * "n_in" is the dimension of the space A. * "n_out" is the dimension of the space B. * * If "is_set" is set, then the affine expression is of the form * * [B] -> f(B) * * and we construct an isl_multi_aff * * B -> B' */ static __isl_give isl_multi_aff *range_map(__isl_take isl_aff *aff, int d, unsigned n_in, unsigned n_out, int is_set) { int i; isl_multi_aff *ma; isl_space *space, *space2; isl_local_space *ls; space = isl_aff_get_domain_space(aff); ls = isl_local_space_from_space(isl_space_copy(space)); space2 = isl_space_copy(space); if (!is_set) space2 = isl_space_range(isl_space_unwrap(space2)); space = isl_space_map_from_domain_and_range(space, space2); ma = isl_multi_aff_alloc(space); ma = isl_multi_aff_set_aff(ma, d, aff); for (i = 0; i < n_out; ++i) { if (i == d) continue; aff = isl_aff_var_on_domain(isl_local_space_copy(ls), isl_dim_set, n_in + i); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_local_space_free(ls); return ma; } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map, * taking into account that the dimension at position "d" can be written as * * x = m a + f(..) (1) * * where m is equal to "gcd". * "i" is the index of the equality in "hull" that defines f(..). * In particular, the equality is of the form * * f(..) - x + m g(existentials) = 0 * * or * * -f(..) + x + m g(existentials) = 0 * * We basically plug (1) into "map", resulting in a map with "a" * in the range instead of "x". The corresponding isl_pw_multi_aff * defining "a" is then plugged back into (1) to obtain a definition for "x". * * Specifically, given the input map * * A -> B * * We first wrap it into a set * * [A -> B] * * and define (1) on top of the corresponding space, resulting in "aff". * We use this to create an isl_multi_aff that maps the output position "d" * from "a" to "x", leaving all other (intput and output) dimensions unchanged. * We plug this into the wrapped map, unwrap the result and compute the * corresponding isl_pw_multi_aff. * The result is an expression * * A -> T(A) * * We adjust that to * * A -> [A -> T(A)] * * so that we can plug that into "aff", after extending the latter to * a mapping * * [A -> B] -> B' * * * If "map" is actually a set, then there is no "A" space, meaning * that we do not need to perform any wrapping, and that the result * of the recursive call is of the form * * [T] * * which is plugged into a mapping of the form * * B -> B' */ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_stride( __isl_take isl_map *map, __isl_take isl_basic_map *hull, int d, int i, isl_int gcd) { isl_set *set; isl_space *space; isl_local_space *ls; isl_aff *aff; isl_multi_aff *ma; isl_pw_multi_aff *pma, *id; isl_size n_in; unsigned o_out; isl_size n_out; isl_bool is_set; is_set = isl_map_is_set(map); if (is_set < 0) goto error; n_in = isl_basic_map_dim(hull, isl_dim_in); n_out = isl_basic_map_dim(hull, isl_dim_out); if (n_in < 0 || n_out < 0) goto error; o_out = isl_basic_map_offset(hull, isl_dim_out); if (is_set) set = map; else set = isl_map_wrap(map); space = isl_space_map_from_set(isl_set_get_space(set)); ma = isl_multi_aff_identity(space); ls = isl_local_space_from_space(isl_set_get_space(set)); aff = isl_aff_alloc(ls); if (aff) { isl_int_set_si(aff->v->el[0], 1); if (isl_int_is_one(hull->eq[i][o_out + d])) isl_seq_neg(aff->v->el + 1, hull->eq[i], aff->v->size - 1); else isl_seq_cpy(aff->v->el + 1, hull->eq[i], aff->v->size - 1); isl_int_set(aff->v->el[1 + o_out + d], gcd); } ma = isl_multi_aff_set_aff(ma, n_in + d, isl_aff_copy(aff)); set = isl_set_preimage_multi_aff(set, ma); ma = range_map(aff, d, n_in, n_out, is_set); if (is_set) map = set; else map = isl_set_unwrap(set); pma = isl_pw_multi_aff_from_map(map); if (!is_set) { space = isl_pw_multi_aff_get_domain_space(pma); space = isl_space_map_from_set(space); id = isl_pw_multi_aff_identity(space); pma = isl_pw_multi_aff_range_product(id, pma); } id = isl_pw_multi_aff_from_multi_aff(ma); pma = isl_pw_multi_aff_pullback_pw_multi_aff(id, pma); isl_basic_map_free(hull); return pma; error: isl_map_free(map); isl_basic_map_free(hull); return NULL; } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map. * "hull" contains the equalities valid for "map". * * Check if any of the output dimensions is "strided". * That is, we check if it can be written as * * x = m a + f(..) * * with m greater than 1, a some combination of existentially quantified * variables and f an expression in the parameters and input dimensions. * If so, we remove the stride in pw_multi_aff_from_map_stride. * * Otherwise, we continue with pw_multi_aff_from_map_check_div_mod for a further * special case. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_check_strides( __isl_take isl_map *map, __isl_take isl_basic_map *hull) { int i, j; isl_size n_out; unsigned o_out; isl_size n_div; unsigned o_div; isl_int gcd; n_div = isl_basic_map_dim(hull, isl_dim_div); n_out = isl_basic_map_dim(hull, isl_dim_out); if (n_div < 0 || n_out < 0) goto error; if (n_div == 0) { isl_basic_map_free(hull); return pw_multi_aff_from_map_check_div_mod(map); } isl_int_init(gcd); o_div = isl_basic_map_offset(hull, isl_dim_div); o_out = isl_basic_map_offset(hull, isl_dim_out); for (i = 0; i < n_out; ++i) { for (j = 0; j < hull->n_eq; ++j) { isl_int *eq = hull->eq[j]; isl_pw_multi_aff *res; if (!isl_int_is_one(eq[o_out + i]) && !isl_int_is_negone(eq[o_out + i])) continue; if (isl_seq_any_non_zero(eq + o_out, i)) continue; if (isl_seq_any_non_zero(eq + o_out + i + 1, n_out - (i + 1))) continue; isl_seq_gcd(eq + o_div, n_div, &gcd); if (isl_int_is_zero(gcd)) continue; if (isl_int_is_one(gcd)) continue; res = pw_multi_aff_from_map_stride(map, hull, i, j, gcd); isl_int_clear(gcd); return res; } } isl_int_clear(gcd); isl_basic_map_free(hull); return pw_multi_aff_from_map_check_div_mod(map); error: isl_map_free(map); isl_basic_map_free(hull); return NULL; } /* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map. * * As a special case, we first check if all output dimensions are uniquely * defined in terms of the parameters and input dimensions over the entire * domain. If so, we extract the desired isl_pw_multi_aff directly * from the affine hull of "map" and its domain. * * Otherwise, continue with pw_multi_aff_from_map_check_strides for more * special cases. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(__isl_take isl_map *map) { isl_bool sv; isl_size n; isl_basic_map *hull; n = isl_map_n_basic_map(map); if (n < 0) goto error; if (n == 1) { hull = isl_map_unshifted_simple_hull(isl_map_copy(map)); hull = isl_basic_map_plain_affine_hull(hull); sv = isl_basic_map_plain_is_single_valued(hull); if (sv >= 0 && sv) return plain_pw_multi_aff_from_map(isl_map_domain(map), hull); isl_basic_map_free(hull); } map = isl_map_detect_equalities(map); hull = isl_map_unshifted_simple_hull(isl_map_copy(map)); sv = isl_basic_map_plain_is_single_valued(hull); if (sv >= 0 && sv) return plain_pw_multi_aff_from_map(isl_map_domain(map), hull); if (sv >= 0) return pw_multi_aff_from_map_check_strides(map, hull); isl_basic_map_free(hull); error: isl_map_free(map); return NULL; } /* This function performs the same operation as isl_pw_multi_aff_from_map, * but is considered as a function on an isl_map when exported. */ __isl_give isl_pw_multi_aff *isl_map_as_pw_multi_aff(__isl_take isl_map *map) { return isl_pw_multi_aff_from_map(map); } __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(__isl_take isl_set *set) { return isl_pw_multi_aff_from_map(set); } /* This function performs the same operation as isl_pw_multi_aff_from_set, * but is considered as a function on an isl_set when exported. */ __isl_give isl_pw_multi_aff *isl_set_as_pw_multi_aff(__isl_take isl_set *set) { return isl_pw_multi_aff_from_set(set); } /* Convert "map" into an isl_pw_multi_aff (if possible) and * add it to *user. */ static isl_stat pw_multi_aff_from_map(__isl_take isl_map *map, void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; pma = isl_pw_multi_aff_from_map(map); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); return *upma ? isl_stat_ok : isl_stat_error; } /* Create an isl_union_pw_multi_aff with the given isl_aff on a universe * domain. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_aff( __isl_take isl_aff *aff) { isl_multi_aff *ma; isl_pw_multi_aff *pma; ma = isl_multi_aff_from_aff(aff); pma = isl_pw_multi_aff_from_multi_aff(ma); return isl_union_pw_multi_aff_from_pw_multi_aff(pma); } /* Try and create an isl_union_pw_multi_aff that is equivalent * to the given isl_union_map. * The isl_union_map is required to be single-valued in each space. * Otherwise, an error is produced. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_map( __isl_take isl_union_map *umap) { isl_space *space; isl_union_pw_multi_aff *upma; space = isl_union_map_get_space(umap); upma = isl_union_pw_multi_aff_empty(space); if (isl_union_map_foreach_map(umap, &pw_multi_aff_from_map, &upma) < 0) upma = isl_union_pw_multi_aff_free(upma); isl_union_map_free(umap); return upma; } /* This function performs the same operation as * isl_union_pw_multi_aff_from_union_map, * but is considered as a function on an isl_union_map when exported. */ __isl_give isl_union_pw_multi_aff *isl_union_map_as_union_pw_multi_aff( __isl_take isl_union_map *umap) { return isl_union_pw_multi_aff_from_union_map(umap); } /* Try and create an isl_union_pw_multi_aff that is equivalent * to the given isl_union_set. * The isl_union_set is required to be a singleton in each space. * Otherwise, an error is produced. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_set( __isl_take isl_union_set *uset) { return isl_union_pw_multi_aff_from_union_map(uset); } /* Return the piecewise affine expression "set ? 1 : 0". */ __isl_give isl_pw_aff *isl_set_indicator_function(__isl_take isl_set *set) { isl_pw_aff *pa; isl_space *space = isl_set_get_space(set); isl_local_space *ls = isl_local_space_from_space(space); isl_aff *zero = isl_aff_zero_on_domain(isl_local_space_copy(ls)); isl_aff *one = isl_aff_zero_on_domain(ls); one = isl_aff_add_constant_si(one, 1); pa = isl_pw_aff_alloc(isl_set_copy(set), one); set = isl_set_complement(set); pa = isl_pw_aff_add_disjoint(pa, isl_pw_aff_alloc(set, zero)); return pa; } /* Plug in "subs" for dimension "type", "pos" of "aff". * * Let i be the dimension to replace and let "subs" be of the form * * f/d * * and "aff" of the form * * (a i + g)/m * * The result is * * (a f + d g')/(m d) * * where g' is the result of plugging in "subs" in each of the integer * divisions in g. */ __isl_give isl_aff *isl_aff_substitute(__isl_take isl_aff *aff, enum isl_dim_type type, unsigned pos, __isl_keep isl_aff *subs) { isl_ctx *ctx; isl_int v; isl_size n_div; aff = isl_aff_cow(aff); if (!aff || !subs) return isl_aff_free(aff); ctx = isl_aff_get_ctx(aff); if (!isl_space_is_equal(aff->ls->dim, subs->ls->dim)) isl_die(ctx, isl_error_invalid, "spaces don't match", return isl_aff_free(aff)); n_div = isl_aff_domain_dim(subs, isl_dim_div); if (n_div < 0) return isl_aff_free(aff); if (n_div != 0) isl_die(ctx, isl_error_unsupported, "cannot handle divs yet", return isl_aff_free(aff)); aff->ls = isl_local_space_substitute(aff->ls, type, pos, subs); if (!aff->ls) return isl_aff_free(aff); aff->v = isl_vec_cow(aff->v); if (!aff->v) return isl_aff_free(aff); pos += isl_local_space_offset(aff->ls, type); isl_int_init(v); isl_seq_substitute(aff->v->el, pos, subs->v->el, aff->v->size, subs->v->size, v); isl_int_clear(v); return aff; } /* Plug in "subs" for dimension "type", "pos" in each of the affine * expressions in "maff". */ __isl_give isl_multi_aff *isl_multi_aff_substitute( __isl_take isl_multi_aff *maff, enum isl_dim_type type, unsigned pos, __isl_keep isl_aff *subs) { isl_size n; int i; n = isl_multi_aff_size(maff); if (n < 0 || !subs) return isl_multi_aff_free(maff); if (type == isl_dim_in) type = isl_dim_set; for (i = 0; i < n; ++i) { isl_aff *aff; aff = isl_multi_aff_take_at(maff, i); aff = isl_aff_substitute(aff, type, pos, subs); maff = isl_multi_aff_restore_at(maff, i, aff); } return maff; } /* Plug in "subs" for input dimension "pos" of "pma". * * pma is of the form * * A_i(v) -> M_i(v) * * while subs is of the form * * v' = B_j(v) -> S_j * * Each pair i,j such that C_ij = A_i \cap B_i is non-empty * has a contribution in the result, in particular * * C_ij(S_j) -> M_i(S_j) * * Note that plugging in S_j in C_ij may also result in an empty set * and this contribution should simply be discarded. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute( __isl_take isl_pw_multi_aff *pma, unsigned pos, __isl_keep isl_pw_aff *subs) { int i, j, n; isl_pw_multi_aff *res; if (!pma || !subs) return isl_pw_multi_aff_free(pma); n = pma->n * subs->n; res = isl_pw_multi_aff_alloc_size(isl_space_copy(pma->dim), n); for (i = 0; i < pma->n; ++i) { for (j = 0; j < subs->n; ++j) { isl_set *common; isl_multi_aff *res_ij; int empty; common = isl_set_intersect( isl_set_copy(pma->p[i].set), isl_set_copy(subs->p[j].set)); common = isl_set_substitute(common, pos, subs->p[j].aff); empty = isl_set_plain_is_empty(common); if (empty < 0 || empty) { isl_set_free(common); if (empty < 0) goto error; continue; } res_ij = isl_multi_aff_substitute( isl_multi_aff_copy(pma->p[i].maff), isl_dim_in, pos, subs->p[j].aff); res = isl_pw_multi_aff_add_piece(res, common, res_ij); } } isl_pw_multi_aff_free(pma); return res; error: isl_pw_multi_aff_free(pma); isl_pw_multi_aff_free(res); return NULL; } /* Compute the preimage of a range of dimensions in the affine expression "src" * under "ma" and put the result in "dst". The number of dimensions in "src" * that precede the range is given by "n_before". The number of dimensions * in the range is given by the number of output dimensions of "ma". * The number of dimensions that follow the range is given by "n_after". * If "has_denom" is set (to one), * then "src" and "dst" have an extra initial denominator. * "n_div_ma" is the number of existentials in "ma" * "n_div_bset" is the number of existentials in "src" * The resulting "dst" (which is assumed to have been allocated by * the caller) contains coefficients for both sets of existentials, * first those in "ma" and then those in "src". * f, c1, c2 and g are temporary objects that have been initialized * by the caller. * * Let src represent the expression * * (a(p) + f_u u + b v + f_w w + c(divs))/d * * and let ma represent the expressions * * v_i = (r_i(p) + s_i(y) + t_i(divs'))/m_i * * We start out with the following expression for dst: * * (a(p) + f_u u + 0 y + f_w w + 0 divs' + c(divs) + f \sum_i b_i v_i)/d * * with the multiplication factor f initially equal to 1 * and f \sum_i b_i v_i kept separately. * For each x_i that we substitute, we multiply the numerator * (and denominator) of dst by c_1 = m_i and add the numerator * of the x_i expression multiplied by c_2 = f b_i, * after removing the common factors of c_1 and c_2. * The multiplication factor f also needs to be multiplied by c_1 * for the next x_j, j > i. */ isl_stat isl_seq_preimage(isl_int *dst, isl_int *src, __isl_keep isl_multi_aff *ma, int n_before, int n_after, int n_div_ma, int n_div_bmap, isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom) { int i; isl_size n_param, n_in, n_out; int o_dst, o_src; n_param = isl_multi_aff_dim(ma, isl_dim_param); n_in = isl_multi_aff_dim(ma, isl_dim_in); n_out = isl_multi_aff_dim(ma, isl_dim_out); if (n_param < 0 || n_in < 0 || n_out < 0) return isl_stat_error; isl_seq_cpy(dst, src, has_denom + 1 + n_param + n_before); o_dst = o_src = has_denom + 1 + n_param + n_before; isl_seq_clr(dst + o_dst, n_in); o_dst += n_in; o_src += n_out; isl_seq_cpy(dst + o_dst, src + o_src, n_after); o_dst += n_after; o_src += n_after; isl_seq_clr(dst + o_dst, n_div_ma); o_dst += n_div_ma; isl_seq_cpy(dst + o_dst, src + o_src, n_div_bmap); isl_int_set_si(f, 1); for (i = 0; i < n_out; ++i) { int offset = has_denom + 1 + n_param + n_before + i; if (isl_int_is_zero(src[offset])) continue; isl_int_set(c1, ma->u.p[i]->v->el[0]); isl_int_mul(c2, f, src[offset]); isl_int_gcd(g, c1, c2); isl_int_divexact(c1, c1, g); isl_int_divexact(c2, c2, g); isl_int_mul(f, f, c1); o_dst = has_denom; o_src = 1; isl_seq_combine(dst + o_dst, c1, dst + o_dst, c2, ma->u.p[i]->v->el + o_src, 1 + n_param); o_dst += 1 + n_param; o_src += 1 + n_param; isl_seq_scale(dst + o_dst, dst + o_dst, c1, n_before); o_dst += n_before; isl_seq_combine(dst + o_dst, c1, dst + o_dst, c2, ma->u.p[i]->v->el + o_src, n_in); o_dst += n_in; o_src += n_in; isl_seq_scale(dst + o_dst, dst + o_dst, c1, n_after); o_dst += n_after; isl_seq_combine(dst + o_dst, c1, dst + o_dst, c2, ma->u.p[i]->v->el + o_src, n_div_ma); o_dst += n_div_ma; o_src += n_div_ma; isl_seq_scale(dst + o_dst, dst + o_dst, c1, n_div_bmap); if (has_denom) isl_int_mul(dst[0], dst[0], c1); } return isl_stat_ok; } /* Compute the pullback of "aff" by the function represented by "ma". * In other words, plug in "ma" in "aff". The result is an affine expression * defined over the domain space of "ma". * * If "aff" is represented by * * (a(p) + b x + c(divs))/d * * and ma is represented by * * x = D(p) + F(y) + G(divs') * * then the result is * * (a(p) + b D(p) + b F(y) + b G(divs') + c(divs))/d * * The divs in the local space of the input are similarly adjusted * through a call to isl_local_space_preimage_multi_aff. */ __isl_give isl_aff *isl_aff_pullback_multi_aff(__isl_take isl_aff *aff, __isl_take isl_multi_aff *ma) { isl_aff *res = NULL; isl_local_space *ls; isl_size n_div_aff, n_div_ma; isl_int f, c1, c2, g; ma = isl_multi_aff_align_divs(ma); if (!aff || !ma) goto error; n_div_aff = isl_aff_dim(aff, isl_dim_div); n_div_ma = ma->n ? isl_aff_dim(ma->u.p[0], isl_dim_div) : 0; if (n_div_aff < 0 || n_div_ma < 0) goto error; ls = isl_aff_get_domain_local_space(aff); ls = isl_local_space_preimage_multi_aff(ls, isl_multi_aff_copy(ma)); res = isl_aff_alloc(ls); if (!res) goto error; isl_int_init(f); isl_int_init(c1); isl_int_init(c2); isl_int_init(g); if (isl_seq_preimage(res->v->el, aff->v->el, ma, 0, 0, n_div_ma, n_div_aff, f, c1, c2, g, 1) < 0) res = isl_aff_free(res); isl_int_clear(f); isl_int_clear(c1); isl_int_clear(c2); isl_int_clear(g); isl_aff_free(aff); isl_multi_aff_free(ma); res = isl_aff_normalize(res); return res; error: isl_aff_free(aff); isl_multi_aff_free(ma); isl_aff_free(res); return NULL; } /* Compute the pullback of "aff1" by the function represented by "aff2". * In other words, plug in "aff2" in "aff1". The result is an affine expression * defined over the domain space of "aff1". * * The domain of "aff1" should match the range of "aff2", which means * that it should be single-dimensional. */ __isl_give isl_aff *isl_aff_pullback_aff(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { isl_multi_aff *ma; ma = isl_multi_aff_from_aff(aff2); return isl_aff_pullback_multi_aff(aff1, ma); } /* Compute the pullback of "ma1" by the function represented by "ma2". * In other words, plug in "ma2" in "ma1". */ __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2) { int i; isl_size n; isl_space *space = NULL; isl_multi_aff_align_params_bin(&ma1, &ma2); ma2 = isl_multi_aff_align_divs(ma2); n = isl_multi_aff_size(ma1); if (n < 0 || !ma2) goto error; space = isl_space_join(isl_multi_aff_get_space(ma2), isl_multi_aff_get_space(ma1)); for (i = 0; i < n; ++i) { isl_aff *aff; aff = isl_multi_aff_take_at(ma1, i); aff = isl_aff_pullback_multi_aff(aff, isl_multi_aff_copy(ma2)); ma1 = isl_multi_aff_restore_at(ma1, i, aff); } ma1 = isl_multi_aff_reset_space(ma1, space); isl_multi_aff_free(ma2); return ma1; error: isl_space_free(space); isl_multi_aff_free(ma2); isl_multi_aff_free(ma1); return NULL; } /* Extend the local space of "dst" to include the divs * in the local space of "src". * * If "src" does not have any divs or if the local spaces of "dst" and * "src" are the same, then no extension is required. */ __isl_give isl_aff *isl_aff_align_divs(__isl_take isl_aff *dst, __isl_keep isl_aff *src) { isl_ctx *ctx; isl_size src_n_div, dst_n_div; int *exp1 = NULL; int *exp2 = NULL; isl_bool equal; isl_mat *div; if (!src || !dst) return isl_aff_free(dst); ctx = isl_aff_get_ctx(src); equal = isl_local_space_has_equal_space(src->ls, dst->ls); if (equal < 0) return isl_aff_free(dst); if (!equal) isl_die(ctx, isl_error_invalid, "spaces don't match", goto error); src_n_div = isl_aff_domain_dim(src, isl_dim_div); dst_n_div = isl_aff_domain_dim(dst, isl_dim_div); if (src_n_div == 0) return dst; equal = isl_local_space_is_equal(src->ls, dst->ls); if (equal < 0 || src_n_div < 0 || dst_n_div < 0) return isl_aff_free(dst); if (equal) return dst; exp1 = isl_alloc_array(ctx, int, src_n_div); exp2 = isl_alloc_array(ctx, int, dst_n_div); if (!exp1 || (dst_n_div && !exp2)) goto error; div = isl_merge_divs(src->ls->div, dst->ls->div, exp1, exp2); dst = isl_aff_expand_divs(dst, div, exp2); free(exp1); free(exp2); return dst; error: free(exp1); free(exp2); return isl_aff_free(dst); } /* Adjust the local spaces of the affine expressions in "maff" * such that they all have the save divs. */ __isl_give isl_multi_aff *isl_multi_aff_align_divs( __isl_take isl_multi_aff *maff) { isl_aff *aff_0; isl_size n; int i; n = isl_multi_aff_size(maff); if (n < 0) return isl_multi_aff_free(maff); if (n <= 1) return maff; aff_0 = isl_multi_aff_take_at(maff, 0); for (i = 1; i < n; ++i) { isl_aff *aff_i; aff_i = isl_multi_aff_peek_at(maff, i); aff_0 = isl_aff_align_divs(aff_0, aff_i); } maff = isl_multi_aff_restore_at(maff, 0, aff_0); aff_0 = isl_multi_aff_peek_at(maff, 0); for (i = 1; i < n; ++i) { isl_aff *aff_i; aff_i = isl_multi_aff_take_at(maff, i); aff_i = isl_aff_align_divs(aff_i, aff_0); maff = isl_multi_aff_restore_at(maff, i, aff_i); } return maff; } __isl_give isl_aff *isl_aff_lift(__isl_take isl_aff *aff) { aff = isl_aff_cow(aff); if (!aff) return NULL; aff->ls = isl_local_space_lift(aff->ls); if (!aff->ls) return isl_aff_free(aff); return aff; } /* Lift "maff" to a space with extra dimensions such that the result * has no more existentially quantified variables. * If "ls" is not NULL, then *ls is assigned the local space that lies * at the basis of the lifting applied to "maff". */ __isl_give isl_multi_aff *isl_multi_aff_lift(__isl_take isl_multi_aff *maff, __isl_give isl_local_space **ls) { int i; isl_space *space; isl_aff *aff; isl_size n, n_div; if (ls) *ls = NULL; n = isl_multi_aff_size(maff); if (n < 0) return isl_multi_aff_free(maff); if (n == 0) { if (ls) { isl_space *space = isl_multi_aff_get_domain_space(maff); *ls = isl_local_space_from_space(space); if (!*ls) return isl_multi_aff_free(maff); } return maff; } maff = isl_multi_aff_align_divs(maff); aff = isl_multi_aff_peek_at(maff, 0); n_div = isl_aff_dim(aff, isl_dim_div); if (n_div < 0) return isl_multi_aff_free(maff); space = isl_multi_aff_get_space(maff); space = isl_space_lift(isl_space_domain(space), n_div); space = isl_space_extend_domain_with_range(space, isl_multi_aff_get_space(maff)); maff = isl_multi_aff_restore_space(maff, space); if (ls) { aff = isl_multi_aff_peek_at(maff, 0); *ls = isl_aff_get_domain_local_space(aff); if (!*ls) return isl_multi_aff_free(maff); } for (i = 0; i < n; ++i) { aff = isl_multi_aff_take_at(maff, i); aff = isl_aff_lift(aff); maff = isl_multi_aff_restore_at(maff, i, aff); } return maff; } #undef TYPE #define TYPE isl_pw_multi_aff static #include "check_type_range_templ.c" /* Extract an isl_pw_aff corresponding to output dimension "pos" of "pma". */ __isl_give isl_pw_aff *isl_pw_multi_aff_get_at( __isl_keep isl_pw_multi_aff *pma, int pos) { int i; isl_size n_out; isl_space *space; isl_pw_aff *pa; if (isl_pw_multi_aff_check_range(pma, isl_dim_out, pos, 1) < 0) return NULL; n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); if (n_out < 0) return NULL; space = isl_pw_multi_aff_get_space(pma); space = isl_space_drop_dims(space, isl_dim_out, pos + 1, n_out - pos - 1); space = isl_space_drop_dims(space, isl_dim_out, 0, pos); pa = isl_pw_aff_alloc_size(space, pma->n); for (i = 0; i < pma->n; ++i) { isl_aff *aff; aff = isl_multi_aff_get_aff(pma->p[i].maff, pos); pa = isl_pw_aff_add_piece(pa, isl_set_copy(pma->p[i].set), aff); } return pa; } /* This is an alternative name for the function above. */ __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff( __isl_keep isl_pw_multi_aff *pma, int pos) { return isl_pw_multi_aff_get_at(pma, pos); } /* Return an isl_pw_multi_aff with the given "set" as domain and * an unnamed zero-dimensional range. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain( __isl_take isl_set *set) { isl_multi_aff *ma; isl_space *space; space = isl_set_get_space(set); space = isl_space_from_domain(space); ma = isl_multi_aff_zero(space); return isl_pw_multi_aff_alloc(set, ma); } /* Add an isl_pw_multi_aff with the given "set" as domain and * an unnamed zero-dimensional range to *user. */ static isl_stat add_pw_multi_aff_from_domain(__isl_take isl_set *set, void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; pma = isl_pw_multi_aff_from_domain(set); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); return isl_stat_ok; } /* Return an isl_union_pw_multi_aff with the given "uset" as domain and * an unnamed zero-dimensional range. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_domain( __isl_take isl_union_set *uset) { isl_space *space; isl_union_pw_multi_aff *upma; if (!uset) return NULL; space = isl_union_set_get_space(uset); upma = isl_union_pw_multi_aff_empty(space); if (isl_union_set_foreach_set(uset, &add_pw_multi_aff_from_domain, &upma) < 0) goto error; isl_union_set_free(uset); return upma; error: isl_union_set_free(uset); isl_union_pw_multi_aff_free(upma); return NULL; } /* Local data for bin_entry and the callback "fn". */ struct isl_union_pw_multi_aff_bin_data { isl_union_pw_multi_aff *upma2; isl_union_pw_multi_aff *res; isl_pw_multi_aff *pma; isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user); }; /* Given an isl_pw_multi_aff from upma1, store it in data->pma * and call data->fn for each isl_pw_multi_aff in data->upma2. */ static isl_stat bin_entry(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_stat r; data->pma = pma; r = isl_union_pw_multi_aff_foreach_pw_multi_aff(data->upma2, data->fn, data); isl_pw_multi_aff_free(pma); return r; } /* Call "fn" on each pair of isl_pw_multi_affs in "upma1" and "upma2". * The isl_pw_multi_aff from upma1 is stored in data->pma (where data is * passed as user field) and the isl_pw_multi_aff from upma2 is available * as *entry. The callback should adjust data->res if desired. */ static __isl_give isl_union_pw_multi_aff *bin_op( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2, isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user)) { isl_space *space; struct isl_union_pw_multi_aff_bin_data data = { NULL, NULL, NULL, fn }; space = isl_union_pw_multi_aff_get_space(upma2); upma1 = isl_union_pw_multi_aff_align_params(upma1, space); space = isl_union_pw_multi_aff_get_space(upma1); upma2 = isl_union_pw_multi_aff_align_params(upma2, space); if (!upma1 || !upma2) goto error; data.upma2 = upma2; data.res = isl_union_pw_multi_aff_alloc_same_size(upma1); if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma1, &bin_entry, &data) < 0) goto error; isl_union_pw_multi_aff_free(upma1); isl_union_pw_multi_aff_free(upma2); return data.res; error: isl_union_pw_multi_aff_free(upma1); isl_union_pw_multi_aff_free(upma2); isl_union_pw_multi_aff_free(data.res); return NULL; } /* Given two isl_pw_multi_affs A -> B and C -> D, * construct an isl_pw_multi_aff (A * C) -> [B -> D]. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_product( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_space *space; isl_pw_multi_aff_align_params_bin(&pma1, &pma2); space = isl_space_range_product(isl_pw_multi_aff_get_space(pma1), isl_pw_multi_aff_get_space(pma2)); return isl_pw_multi_aff_on_shared_domain_in(pma1, pma2, space, &isl_multi_aff_range_product); } /* Given two isl_pw_multi_affs A -> B and C -> D, * construct an isl_pw_multi_aff (A * C) -> (B, D). */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_flat_range_product( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_space *space; isl_pw_multi_aff_align_params_bin(&pma1, &pma2); space = isl_space_range_product(isl_pw_multi_aff_get_space(pma1), isl_pw_multi_aff_get_space(pma2)); space = isl_space_flatten_range(space); return isl_pw_multi_aff_on_shared_domain_in(pma1, pma2, space, &isl_multi_aff_flat_range_product); } /* If data->pma and "pma2" have the same domain space, then use "range_product" * to compute some form of range product and add the result to data->res. */ static isl_stat gen_range_product_entry(__isl_take isl_pw_multi_aff *pma2, __isl_give isl_pw_multi_aff *(*range_product)( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2), void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_bool match; isl_space *space1, *space2; space1 = isl_pw_multi_aff_peek_space(data->pma); space2 = isl_pw_multi_aff_peek_space(pma2); match = isl_space_tuple_is_equal(space1, isl_dim_in, space2, isl_dim_in); if (match < 0 || !match) { isl_pw_multi_aff_free(pma2); return match < 0 ? isl_stat_error : isl_stat_ok; } pma2 = range_product(isl_pw_multi_aff_copy(data->pma), pma2); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); return isl_stat_ok; } /* If data->pma and "pma2" have the same domain space, then compute * their flat range product and add the result to data->res. */ static isl_stat flat_range_product_entry(__isl_take isl_pw_multi_aff *pma2, void *user) { return gen_range_product_entry(pma2, &isl_pw_multi_aff_flat_range_product, user); } /* Given two isl_union_pw_multi_affs A -> B and C -> D, * construct an isl_union_pw_multi_aff (A * C) -> (B, D). */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_flat_range_product( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2) { return bin_op(upma1, upma2, &flat_range_product_entry); } /* If data->pma and "pma2" have the same domain space, then compute * their range product and add the result to data->res. */ static isl_stat range_product_entry(__isl_take isl_pw_multi_aff *pma2, void *user) { return gen_range_product_entry(pma2, &isl_pw_multi_aff_range_product, user); } /* Given two isl_union_pw_multi_affs A -> B and C -> D, * construct an isl_union_pw_multi_aff (A * C) -> [B -> D]. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_range_product( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2) { return bin_op(upma1, upma2, &range_product_entry); } /* Replace the affine expressions at position "pos" in "pma" by "pa". * The parameters are assumed to have been aligned. * * The implementation essentially performs an isl_pw_*_on_shared_domain, * except that it works on two different isl_pw_* types. */ static __isl_give isl_pw_multi_aff *pw_multi_aff_set_pw_aff( __isl_take isl_pw_multi_aff *pma, unsigned pos, __isl_take isl_pw_aff *pa) { int i, j, n; isl_pw_multi_aff *res = NULL; if (!pma || !pa) goto error; if (!isl_space_tuple_is_equal(pma->dim, isl_dim_in, pa->dim, isl_dim_in)) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "domains don't match", goto error); if (isl_pw_multi_aff_check_range(pma, isl_dim_out, pos, 1) < 0) goto error; n = pma->n * pa->n; res = isl_pw_multi_aff_alloc_size(isl_pw_multi_aff_get_space(pma), n); for (i = 0; i < pma->n; ++i) { for (j = 0; j < pa->n; ++j) { isl_set *common; isl_multi_aff *res_ij; int empty; common = isl_set_intersect(isl_set_copy(pma->p[i].set), isl_set_copy(pa->p[j].set)); empty = isl_set_plain_is_empty(common); if (empty < 0 || empty) { isl_set_free(common); if (empty < 0) goto error; continue; } res_ij = isl_multi_aff_set_aff( isl_multi_aff_copy(pma->p[i].maff), pos, isl_aff_copy(pa->p[j].aff)); res_ij = isl_multi_aff_gist(res_ij, isl_set_copy(common)); res = isl_pw_multi_aff_add_piece(res, common, res_ij); } } isl_pw_multi_aff_free(pma); isl_pw_aff_free(pa); return res; error: isl_pw_multi_aff_free(pma); isl_pw_aff_free(pa); return isl_pw_multi_aff_free(res); } /* Replace the affine expressions at position "pos" in "pma" by "pa". */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff( __isl_take isl_pw_multi_aff *pma, unsigned pos, __isl_take isl_pw_aff *pa) { isl_bool equal_params; if (!pma || !pa) goto error; equal_params = isl_space_has_equal_params(pma->dim, pa->dim); if (equal_params < 0) goto error; if (equal_params) return pw_multi_aff_set_pw_aff(pma, pos, pa); if (isl_pw_multi_aff_check_named_params(pma) < 0 || isl_pw_aff_check_named_params(pa) < 0) goto error; pma = isl_pw_multi_aff_align_params(pma, isl_pw_aff_get_space(pa)); pa = isl_pw_aff_align_params(pa, isl_pw_multi_aff_get_space(pma)); return pw_multi_aff_set_pw_aff(pma, pos, pa); error: isl_pw_multi_aff_free(pma); isl_pw_aff_free(pa); return NULL; } /* Do the parameters of "pa" match those of "space"? */ isl_bool isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa, __isl_keep isl_space *space) { isl_space *pa_space; isl_bool match; if (!pa || !space) return isl_bool_error; pa_space = isl_pw_aff_get_space(pa); match = isl_space_has_equal_params(space, pa_space); isl_space_free(pa_space); return match; } /* Check that the domain space of "pa" matches "space". */ isl_stat isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff *pa, __isl_keep isl_space *space) { isl_space *pa_space; isl_bool match; if (!pa || !space) return isl_stat_error; pa_space = isl_pw_aff_get_space(pa); match = isl_space_has_equal_params(space, pa_space); if (match < 0) goto error; if (!match) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "parameters don't match", goto error); match = isl_space_tuple_is_equal(space, isl_dim_in, pa_space, isl_dim_in); if (match < 0) goto error; if (!match) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "domains don't match", goto error); isl_space_free(pa_space); return isl_stat_ok; error: isl_space_free(pa_space); return isl_stat_error; } #undef BASE #define BASE pw_aff #undef DOMBASE #define DOMBASE set #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Is every element of "mpa" defined over a single universe domain? */ isl_bool isl_multi_pw_aff_isa_multi_aff(__isl_keep isl_multi_pw_aff *mpa) { return isl_multi_pw_aff_every(mpa, &isl_pw_aff_isa_aff); } /* Given that every element of "mpa" is defined over a single universe domain, * return the corresponding base expressions. */ __isl_give isl_multi_aff *isl_multi_pw_aff_as_multi_aff( __isl_take isl_multi_pw_aff *mpa) { int i; isl_size n; isl_multi_aff *ma; n = isl_multi_pw_aff_size(mpa); if (n < 0) mpa = isl_multi_pw_aff_free(mpa); ma = isl_multi_aff_alloc(isl_multi_pw_aff_get_space(mpa)); for (i = 0; i < n; ++i) { isl_aff *aff; aff = isl_pw_aff_as_aff(isl_multi_pw_aff_get_at(mpa, i)); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_multi_pw_aff_free(mpa); return ma; } /* If "mpa" has an explicit domain, then intersect the domain of "map" * with this explicit domain. */ __isl_give isl_map *isl_map_intersect_multi_pw_aff_explicit_domain( __isl_take isl_map *map, __isl_keep isl_multi_pw_aff *mpa) { isl_set *dom; if (!isl_multi_pw_aff_has_explicit_domain(mpa)) return map; dom = isl_multi_pw_aff_domain(isl_multi_pw_aff_copy(mpa)); map = isl_map_intersect_domain(map, dom); return map; } /* Are all elements of "mpa" piecewise constants? */ isl_bool isl_multi_pw_aff_is_cst(__isl_keep isl_multi_pw_aff *mpa) { return isl_multi_pw_aff_every(mpa, &isl_pw_aff_is_cst); } /* Does "mpa" have a non-trivial explicit domain? * * The explicit domain, if present, is trivial if it represents * an (obviously) universe set. */ isl_bool isl_multi_pw_aff_has_non_trivial_domain( __isl_keep isl_multi_pw_aff *mpa) { if (!mpa) return isl_bool_error; if (!isl_multi_pw_aff_has_explicit_domain(mpa)) return isl_bool_false; return isl_bool_not(isl_set_plain_is_universe(mpa->u.dom)); } #undef BASE #define BASE set #include "isl_opt_mpa_templ.c" /* Compute the minima of the set dimensions as a function of the * parameters, but independently of the other set dimensions. */ __isl_give isl_multi_pw_aff *isl_set_min_multi_pw_aff(__isl_take isl_set *set) { return set_opt_mpa(set, &isl_set_dim_min); } /* Compute the maxima of the set dimensions as a function of the * parameters, but independently of the other set dimensions. */ __isl_give isl_multi_pw_aff *isl_set_max_multi_pw_aff(__isl_take isl_set *set) { return set_opt_mpa(set, &isl_set_dim_max); } #undef BASE #define BASE map #include "isl_opt_mpa_templ.c" /* Compute the minima of the output dimensions as a function of the * parameters and input dimensions, but independently of * the other output dimensions. */ __isl_give isl_multi_pw_aff *isl_map_min_multi_pw_aff(__isl_take isl_map *map) { return map_opt_mpa(map, &isl_map_dim_min); } /* Compute the maxima of the output dimensions as a function of the * parameters and input dimensions, but independently of * the other output dimensions. */ __isl_give isl_multi_pw_aff *isl_map_max_multi_pw_aff(__isl_take isl_map *map) { return map_opt_mpa(map, &isl_map_dim_max); } #undef TYPE #define TYPE isl_pw_multi_aff #include "isl_type_check_match_range_multi_val.c" /* Apply "fn" to the base expressions of "pma" and "mv". */ static __isl_give isl_pw_multi_aff *isl_pw_multi_aff_op_multi_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv, __isl_give isl_multi_aff *(*fn)(__isl_take isl_multi_aff *ma, __isl_take isl_multi_val *mv)) { int i; isl_size n; if (isl_pw_multi_aff_check_match_range_multi_val(pma, mv) < 0) goto error; n = isl_pw_multi_aff_n_piece(pma); if (n < 0) goto error; for (i = 0; i < n; ++i) { isl_multi_aff *ma; ma = isl_pw_multi_aff_take_base_at(pma, i); ma = fn(ma, isl_multi_val_copy(mv)); pma = isl_pw_multi_aff_restore_base_at(pma, i, ma); } isl_multi_val_free(mv); return pma; error: isl_multi_val_free(mv); isl_pw_multi_aff_free(pma); return NULL; } /* Scale the elements of "pma" by the corresponding elements of "mv". */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_multi_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv) { return isl_pw_multi_aff_op_multi_val(pma, mv, &isl_multi_aff_scale_multi_val); } /* Scale the elements of "pma" down by the corresponding elements of "mv". */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_multi_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv) { return isl_pw_multi_aff_op_multi_val(pma, mv, &isl_multi_aff_scale_down_multi_val); } /* This function is called for each entry of an isl_union_pw_multi_aff. * If the space of the entry matches that of data->mv, * then apply isl_pw_multi_aff_scale_multi_val and return the result. * Otherwise, return an empty isl_pw_multi_aff. */ static __isl_give isl_pw_multi_aff *union_pw_multi_aff_scale_multi_val_entry( __isl_take isl_pw_multi_aff *pma, void *user) { isl_bool equal; isl_multi_val *mv = user; equal = isl_pw_multi_aff_match_range_multi_val(pma, mv); if (equal < 0) return isl_pw_multi_aff_free(pma); if (!equal) { isl_space *space = isl_pw_multi_aff_get_space(pma); isl_pw_multi_aff_free(pma); return isl_pw_multi_aff_empty(space); } return isl_pw_multi_aff_scale_multi_val(pma, isl_multi_val_copy(mv)); } /* Scale the elements of "upma" by the corresponding elements of "mv", * for those entries that match the space of "mv". */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_multi_val( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_multi_val *mv) { struct isl_union_pw_multi_aff_transform_control control = { .fn = &union_pw_multi_aff_scale_multi_val_entry, .fn_user = mv, }; upma = isl_union_pw_multi_aff_align_params(upma, isl_multi_val_get_space(mv)); mv = isl_multi_val_align_params(mv, isl_union_pw_multi_aff_get_space(upma)); if (!upma || !mv) goto error; return isl_union_pw_multi_aff_transform(upma, &control); isl_multi_val_free(mv); return upma; error: isl_multi_val_free(mv); isl_union_pw_multi_aff_free(upma); return NULL; } /* Construct and return a piecewise multi affine expression * in the given space with value zero in each of the output dimensions and * a universe domain. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(__isl_take isl_space *space) { return isl_pw_multi_aff_from_multi_aff(isl_multi_aff_zero(space)); } /* Construct and return a piecewise multi affine expression * that is equal to the given piecewise affine expression. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff( __isl_take isl_pw_aff *pa) { int i; isl_space *space; isl_pw_multi_aff *pma; if (!pa) return NULL; space = isl_pw_aff_get_space(pa); pma = isl_pw_multi_aff_alloc_size(space, pa->n); for (i = 0; i < pa->n; ++i) { isl_set *set; isl_multi_aff *ma; set = isl_set_copy(pa->p[i].set); ma = isl_multi_aff_from_aff(isl_aff_copy(pa->p[i].aff)); pma = isl_pw_multi_aff_add_piece(pma, set, ma); } isl_pw_aff_free(pa); return pma; } /* Construct and return a piecewise multi affine expression * that is equal to the given multi piecewise affine expression * on the shared domain of the piecewise affine expressions, * in the special case of a 0D multi piecewise affine expression. * * Create a piecewise multi affine expression with the explicit domain of * the 0D multi piecewise affine expression as domain. */ static __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff_0D( __isl_take isl_multi_pw_aff *mpa) { isl_space *space; isl_set *dom; isl_multi_aff *ma; space = isl_multi_pw_aff_get_space(mpa); dom = isl_multi_pw_aff_get_explicit_domain(mpa); isl_multi_pw_aff_free(mpa); ma = isl_multi_aff_zero(space); return isl_pw_multi_aff_alloc(dom, ma); } /* Construct and return a piecewise multi affine expression * that is equal to the given multi piecewise affine expression * on the shared domain of the piecewise affine expressions. */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa) { int i; isl_space *space; isl_pw_aff *pa; isl_pw_multi_aff *pma; if (!mpa) return NULL; if (mpa->n == 0) return isl_pw_multi_aff_from_multi_pw_aff_0D(mpa); space = isl_multi_pw_aff_get_space(mpa); pa = isl_multi_pw_aff_get_pw_aff(mpa, 0); pma = isl_pw_multi_aff_from_pw_aff(pa); for (i = 1; i < mpa->n; ++i) { isl_pw_multi_aff *pma_i; pa = isl_multi_pw_aff_get_pw_aff(mpa, i); pma_i = isl_pw_multi_aff_from_pw_aff(pa); pma = isl_pw_multi_aff_range_product(pma, pma_i); } pma = isl_pw_multi_aff_reset_space(pma, space); isl_multi_pw_aff_free(mpa); return pma; } /* Convenience function that constructs an isl_multi_pw_aff * directly from an isl_aff. */ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_aff(__isl_take isl_aff *aff) { return isl_multi_pw_aff_from_pw_aff(isl_pw_aff_from_aff(aff)); } /* Construct and return a multi piecewise affine expression * that is equal to the given multi affine expression. */ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_multi_aff( __isl_take isl_multi_aff *ma) { int i; isl_size n; isl_multi_pw_aff *mpa; n = isl_multi_aff_dim(ma, isl_dim_out); if (n < 0) ma = isl_multi_aff_free(ma); if (!ma) return NULL; mpa = isl_multi_pw_aff_alloc(isl_multi_aff_get_space(ma)); for (i = 0; i < n; ++i) { isl_pw_aff *pa; pa = isl_pw_aff_from_aff(isl_multi_aff_get_aff(ma, i)); mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); } isl_multi_aff_free(ma); return mpa; } /* This function performs the same operation as isl_multi_pw_aff_from_multi_aff, * but is considered as a function on an isl_multi_aff when exported. */ __isl_give isl_multi_pw_aff *isl_multi_aff_to_multi_pw_aff( __isl_take isl_multi_aff *ma) { return isl_multi_pw_aff_from_multi_aff(ma); } /* Construct and return a multi piecewise affine expression * that is equal to the given piecewise multi affine expression. * * If the resulting multi piecewise affine expression has * an explicit domain, then assign it the domain of the input. * In other cases, the domain is stored in the individual elements. */ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_multi_aff( __isl_take isl_pw_multi_aff *pma) { int i; isl_size n; isl_space *space; isl_multi_pw_aff *mpa; n = isl_pw_multi_aff_dim(pma, isl_dim_out); if (n < 0) pma = isl_pw_multi_aff_free(pma); space = isl_pw_multi_aff_get_space(pma); mpa = isl_multi_pw_aff_alloc(space); for (i = 0; i < n; ++i) { isl_pw_aff *pa; pa = isl_pw_multi_aff_get_pw_aff(pma, i); mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); } if (isl_multi_pw_aff_has_explicit_domain(mpa)) { isl_set *dom; dom = isl_pw_multi_aff_domain(isl_pw_multi_aff_copy(pma)); mpa = isl_multi_pw_aff_intersect_domain(mpa, dom); } isl_pw_multi_aff_free(pma); return mpa; } /* This function performs the same operation as * isl_multi_pw_aff_from_pw_multi_aff, * but is considered as a function on an isl_pw_multi_aff when exported. */ __isl_give isl_multi_pw_aff *isl_pw_multi_aff_to_multi_pw_aff( __isl_take isl_pw_multi_aff *pma) { return isl_multi_pw_aff_from_pw_multi_aff(pma); } /* Do "pa1" and "pa2" represent the same function? * * We first check if they are obviously equal. * If not, we convert them to maps and check if those are equal. * * If "pa1" or "pa2" contain any NaNs, then they are considered * not to be the same. A NaN is not equal to anything, not even * to another NaN. */ isl_bool isl_pw_aff_is_equal(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2) { isl_bool equal; isl_bool has_nan; isl_map *map1, *map2; if (!pa1 || !pa2) return isl_bool_error; equal = isl_pw_aff_plain_is_equal(pa1, pa2); if (equal < 0 || equal) return equal; has_nan = either_involves_nan(pa1, pa2); if (has_nan < 0) return isl_bool_error; if (has_nan) return isl_bool_false; map1 = isl_map_from_pw_aff_internal(isl_pw_aff_copy(pa1)); map2 = isl_map_from_pw_aff_internal(isl_pw_aff_copy(pa2)); equal = isl_map_is_equal(map1, map2); isl_map_free(map1); isl_map_free(map2); return equal; } /* Do "mpa1" and "mpa2" represent the same function? * * Note that we cannot convert the entire isl_multi_pw_aff * to a map because the domains of the piecewise affine expressions * may not be the same. */ isl_bool isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2) { int i; isl_bool equal, equal_params; if (!mpa1 || !mpa2) return isl_bool_error; equal_params = isl_space_has_equal_params(mpa1->space, mpa2->space); if (equal_params < 0) return isl_bool_error; if (!equal_params) { if (!isl_space_has_named_params(mpa1->space)) return isl_bool_false; if (!isl_space_has_named_params(mpa2->space)) return isl_bool_false; mpa1 = isl_multi_pw_aff_copy(mpa1); mpa2 = isl_multi_pw_aff_copy(mpa2); mpa1 = isl_multi_pw_aff_align_params(mpa1, isl_multi_pw_aff_get_space(mpa2)); mpa2 = isl_multi_pw_aff_align_params(mpa2, isl_multi_pw_aff_get_space(mpa1)); equal = isl_multi_pw_aff_is_equal(mpa1, mpa2); isl_multi_pw_aff_free(mpa1); isl_multi_pw_aff_free(mpa2); return equal; } equal = isl_space_is_equal(mpa1->space, mpa2->space); if (equal < 0 || !equal) return equal; for (i = 0; i < mpa1->n; ++i) { equal = isl_pw_aff_is_equal(mpa1->u.p[i], mpa2->u.p[i]); if (equal < 0 || !equal) return equal; } return isl_bool_true; } /* Do "pma1" and "pma2" represent the same function? * * First check if they are obviously equal. * If not, then convert them to maps and check if those are equal. * * If "pa1" or "pa2" contain any NaNs, then they are considered * not to be the same. A NaN is not equal to anything, not even * to another NaN. */ isl_bool isl_pw_multi_aff_is_equal(__isl_keep isl_pw_multi_aff *pma1, __isl_keep isl_pw_multi_aff *pma2) { isl_bool equal; isl_bool has_nan; isl_map *map1, *map2; if (!pma1 || !pma2) return isl_bool_error; equal = isl_pw_multi_aff_plain_is_equal(pma1, pma2); if (equal < 0 || equal) return equal; has_nan = isl_pw_multi_aff_involves_nan(pma1); if (has_nan >= 0 && !has_nan) has_nan = isl_pw_multi_aff_involves_nan(pma2); if (has_nan < 0 || has_nan) return isl_bool_not(has_nan); map1 = isl_map_from_pw_multi_aff_internal(isl_pw_multi_aff_copy(pma1)); map2 = isl_map_from_pw_multi_aff_internal(isl_pw_multi_aff_copy(pma2)); equal = isl_map_is_equal(map1, map2); isl_map_free(map1); isl_map_free(map2); return equal; } #undef BASE #define BASE multi_aff #include "isl_multi_pw_aff_pullback_templ.c" #undef BASE #define BASE pw_multi_aff #include "isl_multi_pw_aff_pullback_templ.c" /* Apply "aff" to "mpa". The range of "mpa" needs to be compatible * with the domain of "aff". The domain of the result is the same * as that of "mpa". * "mpa" and "aff" are assumed to have been aligned. * * We first extract the parametric constant from "aff", defined * over the correct domain. * Then we add the appropriate combinations of the members of "mpa". * Finally, we add the integer divisions through recursive calls. */ static __isl_give isl_pw_aff *isl_multi_pw_aff_apply_aff_aligned( __isl_take isl_multi_pw_aff *mpa, __isl_take isl_aff *aff) { int i; isl_size n_in, n_div, n_mpa_in; isl_space *space; isl_val *v; isl_pw_aff *pa; isl_aff *tmp; n_in = isl_aff_dim(aff, isl_dim_in); n_div = isl_aff_dim(aff, isl_dim_div); n_mpa_in = isl_multi_pw_aff_dim(mpa, isl_dim_in); if (n_in < 0 || n_div < 0 || n_mpa_in < 0) goto error; space = isl_space_domain(isl_multi_pw_aff_get_space(mpa)); tmp = isl_aff_copy(aff); tmp = isl_aff_drop_dims(tmp, isl_dim_div, 0, n_div); tmp = isl_aff_drop_dims(tmp, isl_dim_in, 0, n_in); tmp = isl_aff_add_dims(tmp, isl_dim_in, n_mpa_in); tmp = isl_aff_reset_domain_space(tmp, space); pa = isl_pw_aff_from_aff(tmp); for (i = 0; i < n_in; ++i) { isl_pw_aff *pa_i; if (!isl_aff_involves_dims(aff, isl_dim_in, i, 1)) continue; v = isl_aff_get_coefficient_val(aff, isl_dim_in, i); pa_i = isl_multi_pw_aff_get_pw_aff(mpa, i); pa_i = isl_pw_aff_scale_val(pa_i, v); pa = isl_pw_aff_add(pa, pa_i); } for (i = 0; i < n_div; ++i) { isl_aff *div; isl_pw_aff *pa_i; if (!isl_aff_involves_dims(aff, isl_dim_div, i, 1)) continue; div = isl_aff_get_div(aff, i); pa_i = isl_multi_pw_aff_apply_aff_aligned( isl_multi_pw_aff_copy(mpa), div); pa_i = isl_pw_aff_floor(pa_i); v = isl_aff_get_coefficient_val(aff, isl_dim_div, i); pa_i = isl_pw_aff_scale_val(pa_i, v); pa = isl_pw_aff_add(pa, pa_i); } isl_multi_pw_aff_free(mpa); isl_aff_free(aff); return pa; error: isl_multi_pw_aff_free(mpa); isl_aff_free(aff); return NULL; } /* Apply "aff" to "mpa". The range of "mpa" needs to be compatible * with the domain of "aff". The domain of the result is the same * as that of "mpa". */ __isl_give isl_pw_aff *isl_multi_pw_aff_apply_aff( __isl_take isl_multi_pw_aff *mpa, __isl_take isl_aff *aff) { isl_bool equal_params; if (!aff || !mpa) goto error; equal_params = isl_space_has_equal_params(aff->ls->dim, mpa->space); if (equal_params < 0) goto error; if (equal_params) return isl_multi_pw_aff_apply_aff_aligned(mpa, aff); aff = isl_aff_align_params(aff, isl_multi_pw_aff_get_space(mpa)); mpa = isl_multi_pw_aff_align_params(mpa, isl_aff_get_space(aff)); return isl_multi_pw_aff_apply_aff_aligned(mpa, aff); error: isl_aff_free(aff); isl_multi_pw_aff_free(mpa); return NULL; } /* Apply "pa" to "mpa". The range of "mpa" needs to be compatible * with the domain of "pa". The domain of the result is the same * as that of "mpa". * "mpa" and "pa" are assumed to have been aligned. * * We consider each piece in turn. Note that the domains of the * pieces are assumed to be disjoint and they remain disjoint * after taking the preimage (over the same function). */ static __isl_give isl_pw_aff *isl_multi_pw_aff_apply_pw_aff_aligned( __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_aff *pa) { isl_space *space; isl_pw_aff *res; int i; if (!mpa || !pa) goto error; space = isl_space_join(isl_multi_pw_aff_get_space(mpa), isl_pw_aff_get_space(pa)); res = isl_pw_aff_empty(space); for (i = 0; i < pa->n; ++i) { isl_pw_aff *pa_i; isl_set *domain; pa_i = isl_multi_pw_aff_apply_aff_aligned( isl_multi_pw_aff_copy(mpa), isl_aff_copy(pa->p[i].aff)); domain = isl_set_copy(pa->p[i].set); domain = isl_set_preimage_multi_pw_aff(domain, isl_multi_pw_aff_copy(mpa)); pa_i = isl_pw_aff_intersect_domain(pa_i, domain); res = isl_pw_aff_add_disjoint(res, pa_i); } isl_pw_aff_free(pa); isl_multi_pw_aff_free(mpa); return res; error: isl_pw_aff_free(pa); isl_multi_pw_aff_free(mpa); return NULL; } /* Apply "pa" to "mpa". The range of "mpa" needs to be compatible * with the domain of "pa". The domain of the result is the same * as that of "mpa". */ __isl_give isl_pw_aff *isl_multi_pw_aff_apply_pw_aff( __isl_take isl_multi_pw_aff *mpa, __isl_take isl_pw_aff *pa) { isl_bool equal_params; if (!pa || !mpa) goto error; equal_params = isl_space_has_equal_params(pa->dim, mpa->space); if (equal_params < 0) goto error; if (equal_params) return isl_multi_pw_aff_apply_pw_aff_aligned(mpa, pa); pa = isl_pw_aff_align_params(pa, isl_multi_pw_aff_get_space(mpa)); mpa = isl_multi_pw_aff_align_params(mpa, isl_pw_aff_get_space(pa)); return isl_multi_pw_aff_apply_pw_aff_aligned(mpa, pa); error: isl_pw_aff_free(pa); isl_multi_pw_aff_free(mpa); return NULL; } /* Compute the pullback of "pa" by the function represented by "mpa". * In other words, plug in "mpa" in "pa". * * The pullback is computed by applying "pa" to "mpa". */ __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff( __isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa) { return isl_multi_pw_aff_apply_pw_aff(mpa, pa); } #undef BASE #define BASE multi_pw_aff #include "isl_multi_pw_aff_pullback_templ.c" /* Align the parameters of "mpa1" and "mpa2", check that the ranges * of "mpa1" and "mpa2" live in the same space, construct map space * between the domain spaces of "mpa1" and "mpa2" and call "order" * with this map space as extract argument. */ static __isl_give isl_map *isl_multi_pw_aff_order_map( __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, __isl_give isl_map *(*order)(__isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space)) { int match; isl_space *space1, *space2; isl_map *res; mpa1 = isl_multi_pw_aff_align_params(mpa1, isl_multi_pw_aff_get_space(mpa2)); mpa2 = isl_multi_pw_aff_align_params(mpa2, isl_multi_pw_aff_get_space(mpa1)); if (!mpa1 || !mpa2) goto error; match = isl_space_tuple_is_equal(mpa1->space, isl_dim_out, mpa2->space, isl_dim_out); if (match < 0) goto error; if (!match) isl_die(isl_multi_pw_aff_get_ctx(mpa1), isl_error_invalid, "range spaces don't match", goto error); space1 = isl_space_domain(isl_multi_pw_aff_get_space(mpa1)); space2 = isl_space_domain(isl_multi_pw_aff_get_space(mpa2)); space1 = isl_space_map_from_domain_and_range(space1, space2); res = order(mpa1, mpa2, space1); isl_multi_pw_aff_free(mpa1); isl_multi_pw_aff_free(mpa2); return res; error: isl_multi_pw_aff_free(mpa1); isl_multi_pw_aff_free(mpa2); return NULL; } /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" * where the function values are equal. "space" is the space of the result. * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. * * "mpa1" and "mpa2" are equal when each of the pairs of elements * in the sequences are equal. */ static __isl_give isl_map *isl_multi_pw_aff_eq_map_on_space( __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space) { int i; isl_size n; isl_map *res; n = isl_multi_pw_aff_dim(mpa1, isl_dim_out); if (n < 0) space = isl_space_free(space); res = isl_map_universe(space); for (i = 0; i < n; ++i) { isl_pw_aff *pa1, *pa2; isl_map *map; pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); map = isl_pw_aff_eq_map(pa1, pa2); res = isl_map_intersect(res, map); } return res; } /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" * where the function values are equal. */ __isl_give isl_map *isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) { return isl_multi_pw_aff_order_map(mpa1, mpa2, &isl_multi_pw_aff_eq_map_on_space); } /* Intersect "map" with the result of applying "order" * on two copies of "mpa". */ static __isl_give isl_map *isl_map_order_at_multi_pw_aff( __isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa, __isl_give isl_map *(*order)(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2)) { return isl_map_intersect(map, order(mpa, isl_multi_pw_aff_copy(mpa))); } /* Return the subset of "map" where the domain and the range * have equal "mpa" values. */ __isl_give isl_map *isl_map_eq_at_multi_pw_aff(__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa) { return isl_map_order_at_multi_pw_aff(map, mpa, &isl_multi_pw_aff_eq_map); } /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" * where the function values of "mpa1" lexicographically satisfies * "strict_base"/"base" compared to that of "mpa2". * "space" is the space of the result. * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. * * "mpa1" lexicographically satisfies "strict_base"/"base" compared to "mpa2" * if, for some i, the i-th element of "mpa1" satisfies "strict_base"/"base" * when compared to the i-th element of "mpa2" while all previous elements are * pairwise equal. * In particular, if i corresponds to the final elements * then they need to satisfy "base", while "strict_base" needs to be satisfied * for other values of i. * If "base" is a strict order, then "base" and "strict_base" are the same. */ static __isl_give isl_map *isl_multi_pw_aff_lex_map_on_space( __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_give isl_map *(*strict_base)(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2), __isl_give isl_map *(*base)(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2), __isl_take isl_space *space) { int i; isl_size n; isl_map *res, *rest; n = isl_multi_pw_aff_dim(mpa1, isl_dim_out); if (n < 0) space = isl_space_free(space); res = isl_map_empty(isl_space_copy(space)); rest = isl_map_universe(space); for (i = 0; i < n; ++i) { int last; isl_pw_aff *pa1, *pa2; isl_map *map; last = i == n - 1; pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); map = last ? base(pa1, pa2) : strict_base(pa1, pa2); map = isl_map_intersect(map, isl_map_copy(rest)); res = isl_map_union(res, map); if (last) continue; pa1 = isl_multi_pw_aff_get_pw_aff(mpa1, i); pa2 = isl_multi_pw_aff_get_pw_aff(mpa2, i); map = isl_pw_aff_eq_map(pa1, pa2); rest = isl_map_intersect(rest, map); } isl_map_free(rest); return res; } #undef ORDER #define ORDER le #undef STRICT_ORDER #define STRICT_ORDER lt #include "isl_aff_lex_templ.c" #undef ORDER #define ORDER lt #undef STRICT_ORDER #define STRICT_ORDER lt #include "isl_aff_lex_templ.c" #undef ORDER #define ORDER ge #undef STRICT_ORDER #define STRICT_ORDER gt #include "isl_aff_lex_templ.c" #undef ORDER #define ORDER gt #undef STRICT_ORDER #define STRICT_ORDER gt #include "isl_aff_lex_templ.c" /* Compare two isl_affs. * * Return -1 if "aff1" is "smaller" than "aff2", 1 if "aff1" is "greater" * than "aff2" and 0 if they are equal. * * The order is fairly arbitrary. We do consider expressions that only involve * earlier dimensions as "smaller". */ int isl_aff_plain_cmp(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2) { int cmp; int last1, last2; if (aff1 == aff2) return 0; if (!aff1) return -1; if (!aff2) return 1; cmp = isl_local_space_cmp(aff1->ls, aff2->ls); if (cmp != 0) return cmp; last1 = isl_seq_last_non_zero(aff1->v->el + 1, aff1->v->size - 1); last2 = isl_seq_last_non_zero(aff2->v->el + 1, aff1->v->size - 1); if (last1 != last2) return last1 - last2; return isl_seq_cmp(aff1->v->el, aff2->v->el, aff1->v->size); } /* Compare two isl_pw_affs. * * Return -1 if "pa1" is "smaller" than "pa2", 1 if "pa1" is "greater" * than "pa2" and 0 if they are equal. * * The order is fairly arbitrary. We do consider expressions that only involve * earlier dimensions as "smaller". */ int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2) { int i; int cmp; if (pa1 == pa2) return 0; if (!pa1) return -1; if (!pa2) return 1; cmp = isl_space_cmp(pa1->dim, pa2->dim); if (cmp != 0) return cmp; if (pa1->n != pa2->n) return pa1->n - pa2->n; for (i = 0; i < pa1->n; ++i) { cmp = isl_set_plain_cmp(pa1->p[i].set, pa2->p[i].set); if (cmp != 0) return cmp; cmp = isl_aff_plain_cmp(pa1->p[i].aff, pa2->p[i].aff); if (cmp != 0) return cmp; } return 0; } /* Return a piecewise affine expression that is equal to "v" on "domain". */ __isl_give isl_pw_aff *isl_pw_aff_val_on_domain(__isl_take isl_set *domain, __isl_take isl_val *v) { isl_space *space; isl_local_space *ls; isl_aff *aff; space = isl_set_get_space(domain); ls = isl_local_space_from_space(space); aff = isl_aff_val_on_domain(ls, v); return isl_pw_aff_alloc(domain, aff); } /* This function performs the same operation as isl_pw_aff_val_on_domain, * but is considered as a function on an isl_set when exported. */ __isl_give isl_pw_aff *isl_set_pw_aff_on_domain_val(__isl_take isl_set *domain, __isl_take isl_val *v) { return isl_pw_aff_val_on_domain(domain, v); } /* Return a piecewise affine expression that is equal to the parameter * with identifier "id" on "domain". */ __isl_give isl_pw_aff *isl_pw_aff_param_on_domain_id( __isl_take isl_set *domain, __isl_take isl_id *id) { isl_space *space; isl_aff *aff; space = isl_set_get_space(domain); space = isl_space_add_param_id(space, isl_id_copy(id)); domain = isl_set_align_params(domain, isl_space_copy(space)); aff = isl_aff_param_on_domain_space_id(space, id); return isl_pw_aff_alloc(domain, aff); } /* This function performs the same operation as * isl_pw_aff_param_on_domain_id, * but is considered as a function on an isl_set when exported. */ __isl_give isl_pw_aff *isl_set_param_pw_aff_on_domain_id( __isl_take isl_set *domain, __isl_take isl_id *id) { return isl_pw_aff_param_on_domain_id(domain, id); } /* Return a multi affine expression that is equal to "mv" on domain * space "space". */ __isl_give isl_multi_aff *isl_multi_aff_multi_val_on_domain_space( __isl_take isl_space *space, __isl_take isl_multi_val *mv) { int i; isl_size n; isl_space *space2; isl_local_space *ls; isl_multi_aff *ma; n = isl_multi_val_dim(mv, isl_dim_set); if (!space || n < 0) goto error; space2 = isl_multi_val_get_space(mv); space2 = isl_space_align_params(space2, isl_space_copy(space)); space = isl_space_align_params(space, isl_space_copy(space2)); space = isl_space_map_from_domain_and_range(space, space2); ma = isl_multi_aff_alloc(isl_space_copy(space)); ls = isl_local_space_from_space(isl_space_domain(space)); for (i = 0; i < n; ++i) { isl_val *v; isl_aff *aff; v = isl_multi_val_get_val(mv, i); aff = isl_aff_val_on_domain(isl_local_space_copy(ls), v); ma = isl_multi_aff_set_aff(ma, i, aff); } isl_local_space_free(ls); isl_multi_val_free(mv); return ma; error: isl_space_free(space); isl_multi_val_free(mv); return NULL; } /* This is an alternative name for the function above. */ __isl_give isl_multi_aff *isl_multi_aff_multi_val_on_space( __isl_take isl_space *space, __isl_take isl_multi_val *mv) { return isl_multi_aff_multi_val_on_domain_space(space, mv); } /* This function performs the same operation as * isl_multi_aff_multi_val_on_domain_space, * but is considered as a function on an isl_space when exported. */ __isl_give isl_multi_aff *isl_space_multi_aff_on_domain_multi_val( __isl_take isl_space *space, __isl_take isl_multi_val *mv) { return isl_multi_aff_multi_val_on_domain_space(space, mv); } /* Return a piecewise multi-affine expression * that is equal to "mv" on "domain". */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_multi_val_on_domain( __isl_take isl_set *domain, __isl_take isl_multi_val *mv) { isl_space *space; isl_multi_aff *ma; space = isl_set_get_space(domain); ma = isl_multi_aff_multi_val_on_space(space, mv); return isl_pw_multi_aff_alloc(domain, ma); } /* This function performs the same operation as * isl_pw_multi_aff_multi_val_on_domain, * but is considered as a function on an isl_set when exported. */ __isl_give isl_pw_multi_aff *isl_set_pw_multi_aff_on_domain_multi_val( __isl_take isl_set *domain, __isl_take isl_multi_val *mv) { return isl_pw_multi_aff_multi_val_on_domain(domain, mv); } /* Internal data structure for isl_union_pw_multi_aff_multi_val_on_domain. * mv is the value that should be attained on each domain set * res collects the results */ struct isl_union_pw_multi_aff_multi_val_on_domain_data { isl_multi_val *mv; isl_union_pw_multi_aff *res; }; /* Create an isl_pw_multi_aff equal to data->mv on "domain" * and add it to data->res. */ static isl_stat pw_multi_aff_multi_val_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_multi_aff_multi_val_on_domain_data *data = user; isl_pw_multi_aff *pma; isl_multi_val *mv; mv = isl_multi_val_copy(data->mv); pma = isl_pw_multi_aff_multi_val_on_domain(domain, mv); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); return data->res ? isl_stat_ok : isl_stat_error; } /* Return a union piecewise multi-affine expression * that is equal to "mv" on "domain". */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_multi_val_on_domain( __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) { struct isl_union_pw_multi_aff_multi_val_on_domain_data data; isl_space *space; space = isl_union_set_get_space(domain); data.res = isl_union_pw_multi_aff_empty(space); data.mv = mv; if (isl_union_set_foreach_set(domain, &pw_multi_aff_multi_val_on_domain, &data) < 0) data.res = isl_union_pw_multi_aff_free(data.res); isl_union_set_free(domain); isl_multi_val_free(mv); return data.res; } /* Compute the pullback of data->pma by the function represented by "pma2", * provided the spaces match, and add the results to data->res. */ static isl_stat pullback_entry(__isl_take isl_pw_multi_aff *pma2, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; if (!isl_space_tuple_is_equal(data->pma->dim, isl_dim_in, pma2->dim, isl_dim_out)) { isl_pw_multi_aff_free(pma2); return isl_stat_ok; } pma2 = isl_pw_multi_aff_pullback_pw_multi_aff( isl_pw_multi_aff_copy(data->pma), pma2); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); if (!data->res) return isl_stat_error; return isl_stat_ok; } /* Compute the pullback of "upma1" by the function represented by "upma2". */ __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_pullback_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2) { return bin_op(upma1, upma2, &pullback_entry); } /* Apply "upma2" to "upma1". * * That is, compute the pullback of "upma2" by "upma1". */ __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_apply_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2) { return isl_union_pw_multi_aff_pullback_union_pw_multi_aff(upma2, upma1); } #undef BASE #define BASE pw_multi_aff static #include "isl_copy_tuple_id_templ.c" /* Given a function "pma1" of the form A[B -> C] -> D and * a function "pma2" of the form E -> B, * replace the domain of the wrapped relation inside the domain of "pma1" * by the preimage with respect to "pma2". * In other words, plug in "pma2" in this nested domain. * The result is of the form A[E -> C] -> D. * * In particular, extend E -> B to A[E -> C] -> A[B -> C] and * plug that into "pma1". */ __isl_give isl_pw_multi_aff * isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2) { isl_space *pma1_space, *pma2_space; isl_space *space; isl_pw_multi_aff *id; pma1_space = isl_pw_multi_aff_peek_space(pma1); pma2_space = isl_pw_multi_aff_peek_space(pma2); if (isl_space_check_domain_is_wrapping(pma1_space) < 0) goto error; if (isl_space_check_wrapped_tuple_is_equal(pma1_space, isl_dim_in, isl_dim_in, pma2_space, isl_dim_out) < 0) goto error; space = isl_space_domain(isl_space_copy(pma1_space)); space = isl_space_range(isl_space_unwrap(space)); id = isl_pw_multi_aff_identity_on_domain_space(space); pma2 = isl_pw_multi_aff_product(pma2, id); pma2 = isl_pw_multi_aff_copy_tuple_id(pma2, isl_dim_in, pma1_space, isl_dim_in); pma2 = isl_pw_multi_aff_copy_tuple_id(pma2, isl_dim_out, pma1_space, isl_dim_in); return isl_pw_multi_aff_pullback_pw_multi_aff(pma1, pma2); error: isl_pw_multi_aff_free(pma1); isl_pw_multi_aff_free(pma2); return NULL; } /* If data->pma and "pma2" are such that * data->pma is of the form A[B -> C] -> D and * "pma2" is of the form E -> B, * then replace the domain of the wrapped relation * inside the domain of data->pma by the preimage with respect to "pma2" and * add the result to data->res. */ static isl_stat preimage_domain_wrapped_domain_entry( __isl_take isl_pw_multi_aff *pma2, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_space *pma1_space, *pma2_space; isl_bool match; pma1_space = isl_pw_multi_aff_peek_space(data->pma); pma2_space = isl_pw_multi_aff_peek_space(pma2); match = isl_space_domain_is_wrapping(pma1_space); if (match >= 0 && match) match = isl_space_wrapped_tuple_is_equal(pma1_space, isl_dim_in, isl_dim_in, pma2_space, isl_dim_out); if (match < 0 || !match) { isl_pw_multi_aff_free(pma2); return match < 0 ? isl_stat_error : isl_stat_ok; } pma2 = isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff( isl_pw_multi_aff_copy(data->pma), pma2); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); return isl_stat_non_null(data->res); } /* For each pair of functions A[B -> C] -> D in "upma1" and * E -> B in "upma2", * replace the domain of the wrapped relation inside the domain of the first * by the preimage with respect to the second and collect the results. * In other words, plug in the second function in this nested domain. * The results are of the form A[E -> C] -> D. */ __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2) { return bin_op(upma1, upma2, &preimage_domain_wrapped_domain_entry); } /* Check that the domain space of "upa" matches "space". * * This function is called from isl_multi_union_pw_aff_set_union_pw_aff and * can in principle never fail since the space "space" is that * of the isl_multi_union_pw_aff and is a set space such that * there is no domain space to match. * * We check the parameters and double-check that "space" is * indeed that of a set. */ static isl_stat isl_union_pw_aff_check_match_domain_space( __isl_keep isl_union_pw_aff *upa, __isl_keep isl_space *space) { isl_space *upa_space; isl_bool match; if (!upa || !space) return isl_stat_error; match = isl_space_is_set(space); if (match < 0) return isl_stat_error; if (!match) isl_die(isl_space_get_ctx(space), isl_error_invalid, "expecting set space", return isl_stat_error); upa_space = isl_union_pw_aff_get_space(upa); match = isl_space_has_equal_params(space, upa_space); if (match < 0) goto error; if (!match) isl_die(isl_space_get_ctx(space), isl_error_invalid, "parameters don't match", goto error); isl_space_free(upa_space); return isl_stat_ok; error: isl_space_free(upa_space); return isl_stat_error; } /* Do the parameters of "upa" match those of "space"? */ static isl_bool isl_union_pw_aff_matching_params( __isl_keep isl_union_pw_aff *upa, __isl_keep isl_space *space) { isl_space *upa_space; isl_bool match; if (!upa || !space) return isl_bool_error; upa_space = isl_union_pw_aff_get_space(upa); match = isl_space_has_equal_params(space, upa_space); isl_space_free(upa_space); return match; } /* Internal data structure for isl_union_pw_aff_reset_domain_space. * space represents the new parameters. * res collects the results. */ struct isl_union_pw_aff_reset_params_data { isl_space *space; isl_union_pw_aff *res; }; /* Replace the parameters of "pa" by data->space and * add the result to data->res. */ static isl_stat reset_params(__isl_take isl_pw_aff *pa, void *user) { struct isl_union_pw_aff_reset_params_data *data = user; isl_space *space; space = isl_pw_aff_get_space(pa); space = isl_space_replace_params(space, data->space); pa = isl_pw_aff_reset_space(pa, space); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); return data->res ? isl_stat_ok : isl_stat_error; } /* Replace the domain space of "upa" by "space". * Since a union expression does not have a (single) domain space, * "space" is necessarily a parameter space. * * Since the order and the names of the parameters determine * the hash value, we need to create a new hash table. */ static __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_domain_space( __isl_take isl_union_pw_aff *upa, __isl_take isl_space *space) { struct isl_union_pw_aff_reset_params_data data = { space }; isl_bool match; match = isl_union_pw_aff_matching_params(upa, space); if (match < 0) upa = isl_union_pw_aff_free(upa); else if (match) { isl_space_free(space); return upa; } data.res = isl_union_pw_aff_empty(isl_space_copy(space)); if (isl_union_pw_aff_foreach_pw_aff(upa, &reset_params, &data) < 0) data.res = isl_union_pw_aff_free(data.res); isl_union_pw_aff_free(upa); isl_space_free(space); return data.res; } /* Return the floor of "pa". */ static __isl_give isl_pw_aff *floor_entry(__isl_take isl_pw_aff *pa, void *user) { return isl_pw_aff_floor(pa); } /* Given f, return floor(f). */ __isl_give isl_union_pw_aff *isl_union_pw_aff_floor( __isl_take isl_union_pw_aff *upa) { return isl_union_pw_aff_transform_inplace(upa, &floor_entry, NULL); } /* Compute * * upa mod m = upa - m * floor(upa/m) * * with m an integer value. */ __isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val( __isl_take isl_union_pw_aff *upa, __isl_take isl_val *m) { isl_union_pw_aff *res; if (!upa || !m) goto error; if (!isl_val_is_int(m)) isl_die(isl_val_get_ctx(m), isl_error_invalid, "expecting integer modulo", goto error); if (!isl_val_is_pos(m)) isl_die(isl_val_get_ctx(m), isl_error_invalid, "expecting positive modulo", goto error); res = isl_union_pw_aff_copy(upa); upa = isl_union_pw_aff_scale_down_val(upa, isl_val_copy(m)); upa = isl_union_pw_aff_floor(upa); upa = isl_union_pw_aff_scale_val(upa, m); res = isl_union_pw_aff_sub(res, upa); return res; error: isl_val_free(m); isl_union_pw_aff_free(upa); return NULL; } /* Internal data structure for isl_union_pw_multi_aff_get_union_pw_aff. * pos is the output position that needs to be extracted. * res collects the results. */ struct isl_union_pw_multi_aff_get_union_pw_aff_data { int pos; isl_union_pw_aff *res; }; /* Extract an isl_pw_aff corresponding to output dimension "pos" of "pma" * (assuming it has such a dimension) and add it to data->res. */ static isl_stat get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_get_union_pw_aff_data *data = user; isl_size n_out; isl_pw_aff *pa; n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); if (n_out < 0) return isl_stat_error; if (data->pos >= n_out) { isl_pw_multi_aff_free(pma); return isl_stat_ok; } pa = isl_pw_multi_aff_get_pw_aff(pma, data->pos); isl_pw_multi_aff_free(pma); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); return data->res ? isl_stat_ok : isl_stat_error; } /* Extract an isl_union_pw_aff corresponding to * output dimension "pos" of "upma". */ __isl_give isl_union_pw_aff *isl_union_pw_multi_aff_get_union_pw_aff( __isl_keep isl_union_pw_multi_aff *upma, int pos) { struct isl_union_pw_multi_aff_get_union_pw_aff_data data; isl_space *space; if (!upma) return NULL; if (pos < 0) isl_die(isl_union_pw_multi_aff_get_ctx(upma), isl_error_invalid, "cannot extract at negative position", return NULL); space = isl_union_pw_multi_aff_get_space(upma); data.res = isl_union_pw_aff_empty(space); data.pos = pos; if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, &get_union_pw_aff, &data) < 0) data.res = isl_union_pw_aff_free(data.res); return data.res; } /* Return a union piecewise affine expression * that is equal to "aff" on "domain". */ __isl_give isl_union_pw_aff *isl_union_pw_aff_aff_on_domain( __isl_take isl_union_set *domain, __isl_take isl_aff *aff) { isl_pw_aff *pa; pa = isl_pw_aff_from_aff(aff); return isl_union_pw_aff_pw_aff_on_domain(domain, pa); } /* Return a union piecewise affine expression * that is equal to the parameter identified by "id" on "domain". * * Make sure the parameter appears in the space passed to * isl_aff_param_on_domain_space_id. */ __isl_give isl_union_pw_aff *isl_union_pw_aff_param_on_domain_id( __isl_take isl_union_set *domain, __isl_take isl_id *id) { isl_space *space; isl_aff *aff; space = isl_union_set_get_space(domain); space = isl_space_add_param_id(space, isl_id_copy(id)); aff = isl_aff_param_on_domain_space_id(space, id); return isl_union_pw_aff_aff_on_domain(domain, aff); } /* Internal data structure for isl_union_pw_aff_pw_aff_on_domain. * "pa" is the piecewise symbolic value that the resulting isl_union_pw_aff * needs to attain. * "res" collects the results. */ struct isl_union_pw_aff_pw_aff_on_domain_data { isl_pw_aff *pa; isl_union_pw_aff *res; }; /* Construct a piecewise affine expression that is equal to data->pa * on "domain" and add the result to data->res. */ static isl_stat pw_aff_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_aff_pw_aff_on_domain_data *data = user; isl_pw_aff *pa; isl_size dim; pa = isl_pw_aff_copy(data->pa); dim = isl_set_dim(domain, isl_dim_set); if (dim < 0) pa = isl_pw_aff_free(pa); pa = isl_pw_aff_from_range(pa); pa = isl_pw_aff_add_dims(pa, isl_dim_in, dim); pa = isl_pw_aff_reset_domain_space(pa, isl_set_get_space(domain)); pa = isl_pw_aff_intersect_domain(pa, domain); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); return data->res ? isl_stat_ok : isl_stat_error; } /* Return a union piecewise affine expression * that is equal to "pa" on "domain", assuming "domain" and "pa" * have been aligned. * * Construct an isl_pw_aff on each of the sets in "domain" and * collect the results. */ static __isl_give isl_union_pw_aff *isl_union_pw_aff_pw_aff_on_domain_aligned( __isl_take isl_union_set *domain, __isl_take isl_pw_aff *pa) { struct isl_union_pw_aff_pw_aff_on_domain_data data; isl_space *space; space = isl_union_set_get_space(domain); data.res = isl_union_pw_aff_empty(space); data.pa = pa; if (isl_union_set_foreach_set(domain, &pw_aff_on_domain, &data) < 0) data.res = isl_union_pw_aff_free(data.res); isl_union_set_free(domain); isl_pw_aff_free(pa); return data.res; } /* Return a union piecewise affine expression * that is equal to "pa" on "domain". * * Check that "pa" is a parametric expression, * align the parameters if needed and call * isl_union_pw_aff_pw_aff_on_domain_aligned. */ __isl_give isl_union_pw_aff *isl_union_pw_aff_pw_aff_on_domain( __isl_take isl_union_set *domain, __isl_take isl_pw_aff *pa) { isl_bool is_set; isl_bool equal_params; isl_space *domain_space, *pa_space; pa_space = isl_pw_aff_peek_space(pa); is_set = isl_space_is_set(pa_space); if (is_set < 0) goto error; if (!is_set) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "expecting parametric expression", goto error); domain_space = isl_union_set_get_space(domain); pa_space = isl_pw_aff_get_space(pa); equal_params = isl_space_has_equal_params(domain_space, pa_space); if (equal_params >= 0 && !equal_params) { isl_space *space; space = isl_space_align_params(domain_space, pa_space); pa = isl_pw_aff_align_params(pa, isl_space_copy(space)); domain = isl_union_set_align_params(domain, space); } else { isl_space_free(domain_space); isl_space_free(pa_space); } if (equal_params < 0) goto error; return isl_union_pw_aff_pw_aff_on_domain_aligned(domain, pa); error: isl_union_set_free(domain); isl_pw_aff_free(pa); return NULL; } /* Internal data structure for isl_union_pw_aff_val_on_domain. * "v" is the value that the resulting isl_union_pw_aff needs to attain. * "res" collects the results. */ struct isl_union_pw_aff_val_on_domain_data { isl_val *v; isl_union_pw_aff *res; }; /* Construct a piecewise affine expression that is equal to data->v * on "domain" and add the result to data->res. */ static isl_stat pw_aff_val_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_aff_val_on_domain_data *data = user; isl_pw_aff *pa; isl_val *v; v = isl_val_copy(data->v); pa = isl_pw_aff_val_on_domain(domain, v); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); return data->res ? isl_stat_ok : isl_stat_error; } /* Return a union piecewise affine expression * that is equal to "v" on "domain". * * Construct an isl_pw_aff on each of the sets in "domain" and * collect the results. */ __isl_give isl_union_pw_aff *isl_union_pw_aff_val_on_domain( __isl_take isl_union_set *domain, __isl_take isl_val *v) { struct isl_union_pw_aff_val_on_domain_data data; isl_space *space; space = isl_union_set_get_space(domain); data.res = isl_union_pw_aff_empty(space); data.v = v; if (isl_union_set_foreach_set(domain, &pw_aff_val_on_domain, &data) < 0) data.res = isl_union_pw_aff_free(data.res); isl_union_set_free(domain); isl_val_free(v); return data.res; } /* Construct a piecewise multi affine expression * that is equal to "pa" and add it to upma. */ static isl_stat pw_multi_aff_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; pma = isl_pw_multi_aff_from_pw_aff(pa); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); return *upma ? isl_stat_ok : isl_stat_error; } /* Construct and return a union piecewise multi affine expression * that is equal to the given union piecewise affine expression. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff( __isl_take isl_union_pw_aff *upa) { isl_space *space; isl_union_pw_multi_aff *upma; if (!upa) return NULL; space = isl_union_pw_aff_get_space(upa); upma = isl_union_pw_multi_aff_empty(space); if (isl_union_pw_aff_foreach_pw_aff(upa, &pw_multi_aff_from_pw_aff_entry, &upma) < 0) upma = isl_union_pw_multi_aff_free(upma); isl_union_pw_aff_free(upa); return upma; } /* Compute the set of elements in the domain of "pa" where it is zero and * add this set to "uset". */ static isl_stat zero_union_set(__isl_take isl_pw_aff *pa, void *user) { isl_union_set **uset = (isl_union_set **)user; *uset = isl_union_set_add_set(*uset, isl_pw_aff_zero_set(pa)); return *uset ? isl_stat_ok : isl_stat_error; } /* Return a union set containing those elements in the domain * of "upa" where it is zero. */ __isl_give isl_union_set *isl_union_pw_aff_zero_union_set( __isl_take isl_union_pw_aff *upa) { isl_union_set *zero; zero = isl_union_set_empty(isl_union_pw_aff_get_space(upa)); if (isl_union_pw_aff_foreach_pw_aff(upa, &zero_union_set, &zero) < 0) zero = isl_union_set_free(zero); isl_union_pw_aff_free(upa); return zero; } /* Internal data structure for isl_union_pw_aff_bind_id, * storing the parameter that needs to be bound and * the accumulated results. */ struct isl_bind_id_data { isl_id *id; isl_union_set *bound; }; /* Bind the piecewise affine function "pa" to the parameter data->id, * adding the resulting elements in the domain where the expression * is equal to the parameter to data->bound. */ static isl_stat bind_id(__isl_take isl_pw_aff *pa, void *user) { struct isl_bind_id_data *data = user; isl_set *bound; bound = isl_pw_aff_bind_id(pa, isl_id_copy(data->id)); data->bound = isl_union_set_add_set(data->bound, bound); return data->bound ? isl_stat_ok : isl_stat_error; } /* Bind the union piecewise affine function "upa" to the parameter "id", * returning the elements in the domain where the expression * is equal to the parameter. */ __isl_give isl_union_set *isl_union_pw_aff_bind_id( __isl_take isl_union_pw_aff *upa, __isl_take isl_id *id) { struct isl_bind_id_data data = { id }; data.bound = isl_union_set_empty(isl_union_pw_aff_get_space(upa)); if (isl_union_pw_aff_foreach_pw_aff(upa, &bind_id, &data) < 0) data.bound = isl_union_set_free(data.bound); isl_union_pw_aff_free(upa); isl_id_free(id); return data.bound; } /* Internal data structure for isl_union_pw_aff_pullback_union_pw_multi_aff. * upma is the function that is plugged in. * pa is the current part of the function in which upma is plugged in. * res collects the results. */ struct isl_union_pw_aff_pullback_upma_data { isl_union_pw_multi_aff *upma; isl_pw_aff *pa; isl_union_pw_aff *res; }; /* Check if "pma" can be plugged into data->pa. * If so, perform the pullback and add the result to data->res. */ static isl_stat pa_pb_pma(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_aff_pullback_upma_data *data = user; isl_pw_aff *pa; if (!isl_space_tuple_is_equal(data->pa->dim, isl_dim_in, pma->dim, isl_dim_out)) { isl_pw_multi_aff_free(pma); return isl_stat_ok; } pa = isl_pw_aff_copy(data->pa); pa = isl_pw_aff_pullback_pw_multi_aff(pa, pma); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); return data->res ? isl_stat_ok : isl_stat_error; } /* Check if any of the elements of data->upma can be plugged into pa, * add if so add the result to data->res. */ static isl_stat upa_pb_upma(__isl_take isl_pw_aff *pa, void *user) { struct isl_union_pw_aff_pullback_upma_data *data = user; isl_stat r; data->pa = pa; r = isl_union_pw_multi_aff_foreach_pw_multi_aff(data->upma, &pa_pb_pma, data); isl_pw_aff_free(pa); return r; } /* Compute the pullback of "upa" by the function represented by "upma". * In other words, plug in "upma" in "upa". The result contains * expressions defined over the domain space of "upma". * * Run over all pairs of elements in "upa" and "upma", perform * the pullback when appropriate and collect the results. * If the hash value were based on the domain space rather than * the function space, then we could run through all elements * of "upma" and directly pick out the corresponding element of "upa". */ __isl_give isl_union_pw_aff *isl_union_pw_aff_pullback_union_pw_multi_aff( __isl_take isl_union_pw_aff *upa, __isl_take isl_union_pw_multi_aff *upma) { struct isl_union_pw_aff_pullback_upma_data data = { NULL, NULL }; isl_space *space; space = isl_union_pw_multi_aff_get_space(upma); upa = isl_union_pw_aff_align_params(upa, space); space = isl_union_pw_aff_get_space(upa); upma = isl_union_pw_multi_aff_align_params(upma, space); if (!upa || !upma) goto error; data.upma = upma; data.res = isl_union_pw_aff_alloc_same_size(upa); if (isl_union_pw_aff_foreach_pw_aff(upa, &upa_pb_upma, &data) < 0) data.res = isl_union_pw_aff_free(data.res); isl_union_pw_aff_free(upa); isl_union_pw_multi_aff_free(upma); return data.res; error: isl_union_pw_aff_free(upa); isl_union_pw_multi_aff_free(upma); return NULL; } #undef BASE #define BASE union_pw_aff #undef DOMBASE #define DOMBASE union_set #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Does "mupa" have a non-trivial explicit domain? * * The explicit domain, if present, is trivial if it represents * an (obviously) universe parameter set. */ isl_bool isl_multi_union_pw_aff_has_non_trivial_domain( __isl_keep isl_multi_union_pw_aff *mupa) { isl_bool is_params, trivial; isl_set *set; if (!mupa) return isl_bool_error; if (!isl_multi_union_pw_aff_has_explicit_domain(mupa)) return isl_bool_false; is_params = isl_union_set_is_params(mupa->u.dom); if (is_params < 0 || !is_params) return isl_bool_not(is_params); set = isl_set_from_union_set(isl_union_set_copy(mupa->u.dom)); trivial = isl_set_plain_is_universe(set); isl_set_free(set); return isl_bool_not(trivial); } /* Construct a multiple union piecewise affine expression * in the given space with value zero in each of the output dimensions. * * Since there is no canonical zero value for * a union piecewise affine expression, we can only construct * a zero-dimensional "zero" value. */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_zero( __isl_take isl_space *space) { isl_size dim; if (isl_space_check_is_proper_set(space) < 0) goto error; dim = isl_space_dim(space, isl_dim_set); if (dim < 0) goto error; if (dim != 0) isl_die(isl_space_get_ctx(space), isl_error_invalid, "expecting 0D space", goto error); return isl_multi_union_pw_aff_alloc(space); error: isl_space_free(space); return NULL; } /* Construct and return a multi union piecewise affine expression * that is equal to the given multi affine expression. */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_aff( __isl_take isl_multi_aff *ma) { isl_multi_pw_aff *mpa; mpa = isl_multi_pw_aff_from_multi_aff(ma); return isl_multi_union_pw_aff_from_multi_pw_aff(mpa); } /* This function performs the same operation as * isl_multi_union_pw_aff_from_multi_aff, but is considered as a function on an * isl_multi_aff when exported. */ __isl_give isl_multi_union_pw_aff *isl_multi_aff_to_multi_union_pw_aff( __isl_take isl_multi_aff *ma) { return isl_multi_union_pw_aff_from_multi_aff(ma); } /* Construct and return a multi union piecewise affine expression * that is equal to the given multi piecewise affine expression. * * If the resulting multi union piecewise affine expression has * an explicit domain, then assign it the domain of the input. * In other cases, the domain is stored in the individual elements. */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa) { int i; isl_size n; isl_space *space; isl_multi_union_pw_aff *mupa; n = isl_multi_pw_aff_dim(mpa, isl_dim_out); if (n < 0) mpa = isl_multi_pw_aff_free(mpa); if (!mpa) return NULL; space = isl_multi_pw_aff_get_space(mpa); space = isl_space_range(space); mupa = isl_multi_union_pw_aff_alloc(space); for (i = 0; i < n; ++i) { isl_pw_aff *pa; isl_union_pw_aff *upa; pa = isl_multi_pw_aff_get_pw_aff(mpa, i); upa = isl_union_pw_aff_from_pw_aff(pa); mupa = isl_multi_union_pw_aff_restore_check_space(mupa, i, upa); } if (isl_multi_union_pw_aff_has_explicit_domain(mupa)) { isl_union_set *dom; isl_multi_pw_aff *copy; copy = isl_multi_pw_aff_copy(mpa); dom = isl_union_set_from_set(isl_multi_pw_aff_domain(copy)); mupa = isl_multi_union_pw_aff_intersect_domain(mupa, dom); } isl_multi_pw_aff_free(mpa); return mupa; } /* Extract the range space of "pma" and assign it to *space. * If *space has already been set (through a previous call to this function), * then check that the range space is the same. */ static isl_stat extract_space(__isl_take isl_pw_multi_aff *pma, void *user) { isl_space **space = user; isl_space *pma_space; isl_bool equal; pma_space = isl_space_range(isl_pw_multi_aff_get_space(pma)); isl_pw_multi_aff_free(pma); if (!pma_space) return isl_stat_error; if (!*space) { *space = pma_space; return isl_stat_ok; } equal = isl_space_is_equal(pma_space, *space); isl_space_free(pma_space); if (equal < 0) return isl_stat_error; if (!equal) isl_die(isl_space_get_ctx(*space), isl_error_invalid, "range spaces not the same", return isl_stat_error); return isl_stat_ok; } /* Construct and return a multi union piecewise affine expression * that is equal to the given union piecewise multi affine expression. * * In order to be able to perform the conversion, the input * needs to be non-empty and may only involve a single range space. * * If the resulting multi union piecewise affine expression has * an explicit domain, then assign it the domain of the input. * In other cases, the domain is stored in the individual elements. */ __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_from_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma) { isl_space *space = NULL; isl_multi_union_pw_aff *mupa; int i; isl_size n; n = isl_union_pw_multi_aff_n_pw_multi_aff(upma); if (n < 0) goto error; if (n == 0) isl_die(isl_union_pw_multi_aff_get_ctx(upma), isl_error_invalid, "cannot extract range space from empty input", goto error); if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, &extract_space, &space) < 0) goto error; if (!space) goto error; n = isl_space_dim(space, isl_dim_set); if (n < 0) space = isl_space_free(space); mupa = isl_multi_union_pw_aff_alloc(space); for (i = 0; i < n; ++i) { isl_union_pw_aff *upa; upa = isl_union_pw_multi_aff_get_union_pw_aff(upma, i); mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); } if (isl_multi_union_pw_aff_has_explicit_domain(mupa)) { isl_union_set *dom; isl_union_pw_multi_aff *copy; copy = isl_union_pw_multi_aff_copy(upma); dom = isl_union_pw_multi_aff_domain(copy); mupa = isl_multi_union_pw_aff_intersect_domain(mupa, dom); } isl_union_pw_multi_aff_free(upma); return mupa; error: isl_space_free(space); isl_union_pw_multi_aff_free(upma); return NULL; } /* This function performs the same operation as * isl_multi_union_pw_aff_from_union_pw_multi_aff, * but is considered as a function on an isl_union_pw_multi_aff when exported. */ __isl_give isl_multi_union_pw_aff * isl_union_pw_multi_aff_as_multi_union_pw_aff( __isl_take isl_union_pw_multi_aff *upma) { return isl_multi_union_pw_aff_from_union_pw_multi_aff(upma); } /* Try and create an isl_multi_union_pw_aff that is equivalent * to the given isl_union_map. * The isl_union_map is required to be single-valued in each space. * Moreover, it cannot be empty and all range spaces need to be the same. * Otherwise, an error is produced. */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_map( __isl_take isl_union_map *umap) { isl_union_pw_multi_aff *upma; upma = isl_union_pw_multi_aff_from_union_map(umap); return isl_multi_union_pw_aff_from_union_pw_multi_aff(upma); } /* This function performs the same operation as * isl_multi_union_pw_aff_from_union_map, * but is considered as a function on an isl_union_map when exported. */ __isl_give isl_multi_union_pw_aff *isl_union_map_as_multi_union_pw_aff( __isl_take isl_union_map *umap) { return isl_multi_union_pw_aff_from_union_map(umap); } /* Return a multiple union piecewise affine expression * that is equal to "mv" on "domain", assuming "domain" and "mv" * have been aligned. * * If the resulting multi union piecewise affine expression has * an explicit domain, then assign it the input domain. * In other cases, the domain is stored in the individual elements. */ static __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_multi_val_on_domain_aligned( __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) { int i; isl_size n; isl_space *space; isl_multi_union_pw_aff *mupa; n = isl_multi_val_dim(mv, isl_dim_set); if (!domain || n < 0) goto error; space = isl_multi_val_get_space(mv); mupa = isl_multi_union_pw_aff_alloc(space); for (i = 0; i < n; ++i) { isl_val *v; isl_union_pw_aff *upa; v = isl_multi_val_get_val(mv, i); upa = isl_union_pw_aff_val_on_domain(isl_union_set_copy(domain), v); mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); } if (isl_multi_union_pw_aff_has_explicit_domain(mupa)) mupa = isl_multi_union_pw_aff_intersect_domain(mupa, isl_union_set_copy(domain)); isl_union_set_free(domain); isl_multi_val_free(mv); return mupa; error: isl_union_set_free(domain); isl_multi_val_free(mv); return NULL; } /* Return a multiple union piecewise affine expression * that is equal to "mv" on "domain". */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_val_on_domain( __isl_take isl_union_set *domain, __isl_take isl_multi_val *mv) { isl_bool equal_params; if (!domain || !mv) goto error; equal_params = isl_space_has_equal_params(domain->dim, mv->space); if (equal_params < 0) goto error; if (equal_params) return isl_multi_union_pw_aff_multi_val_on_domain_aligned( domain, mv); domain = isl_union_set_align_params(domain, isl_multi_val_get_space(mv)); mv = isl_multi_val_align_params(mv, isl_union_set_get_space(domain)); return isl_multi_union_pw_aff_multi_val_on_domain_aligned(domain, mv); error: isl_union_set_free(domain); isl_multi_val_free(mv); return NULL; } /* Return a multiple union piecewise affine expression * that is equal to "ma" on "domain". */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_multi_aff_on_domain( __isl_take isl_union_set *domain, __isl_take isl_multi_aff *ma) { isl_pw_multi_aff *pma; pma = isl_pw_multi_aff_from_multi_aff(ma); return isl_multi_union_pw_aff_pw_multi_aff_on_domain(domain, pma); } /* Return a multiple union piecewise affine expression * that is equal to "pma" on "domain", assuming "domain" and "pma" * have been aligned. * * If the resulting multi union piecewise affine expression has * an explicit domain, then assign it the input domain. * In other cases, the domain is stored in the individual elements. */ static __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_pw_multi_aff_on_domain_aligned( __isl_take isl_union_set *domain, __isl_take isl_pw_multi_aff *pma) { int i; isl_size n; isl_space *space; isl_multi_union_pw_aff *mupa; n = isl_pw_multi_aff_dim(pma, isl_dim_set); if (!domain || n < 0) goto error; space = isl_pw_multi_aff_get_space(pma); mupa = isl_multi_union_pw_aff_alloc(space); for (i = 0; i < n; ++i) { isl_pw_aff *pa; isl_union_pw_aff *upa; pa = isl_pw_multi_aff_get_pw_aff(pma, i); upa = isl_union_pw_aff_pw_aff_on_domain( isl_union_set_copy(domain), pa); mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); } if (isl_multi_union_pw_aff_has_explicit_domain(mupa)) mupa = isl_multi_union_pw_aff_intersect_domain(mupa, isl_union_set_copy(domain)); isl_union_set_free(domain); isl_pw_multi_aff_free(pma); return mupa; error: isl_union_set_free(domain); isl_pw_multi_aff_free(pma); return NULL; } /* Return a multiple union piecewise affine expression * that is equal to "pma" on "domain". */ __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_pw_multi_aff_on_domain(__isl_take isl_union_set *domain, __isl_take isl_pw_multi_aff *pma) { isl_bool equal_params; isl_space *space; space = isl_pw_multi_aff_peek_space(pma); equal_params = isl_union_set_space_has_equal_params(domain, space); if (equal_params < 0) goto error; if (equal_params) return isl_multi_union_pw_aff_pw_multi_aff_on_domain_aligned( domain, pma); domain = isl_union_set_align_params(domain, isl_pw_multi_aff_get_space(pma)); pma = isl_pw_multi_aff_align_params(pma, isl_union_set_get_space(domain)); return isl_multi_union_pw_aff_pw_multi_aff_on_domain_aligned(domain, pma); error: isl_union_set_free(domain); isl_pw_multi_aff_free(pma); return NULL; } /* Return a union set containing those elements in the domains * of the elements of "mupa" where they are all zero. * * If there are no elements, then simply return the entire domain. */ __isl_give isl_union_set *isl_multi_union_pw_aff_zero_union_set( __isl_take isl_multi_union_pw_aff *mupa) { int i; isl_size n; isl_union_pw_aff *upa; isl_union_set *zero; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0) mupa = isl_multi_union_pw_aff_free(mupa); if (!mupa) return NULL; if (n == 0) return isl_multi_union_pw_aff_domain(mupa); upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); zero = isl_union_pw_aff_zero_union_set(upa); for (i = 1; i < n; ++i) { isl_union_set *zero_i; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); zero_i = isl_union_pw_aff_zero_union_set(upa); zero = isl_union_set_intersect(zero, zero_i); } isl_multi_union_pw_aff_free(mupa); return zero; } /* Construct a union map mapping the shared domain * of the union piecewise affine expressions to the range of "mupa" * in the special case of a 0D multi union piecewise affine expression. * * Construct a map between the explicit domain of "mupa" and * the range space. * Note that this assumes that the domain consists of explicit elements. */ static __isl_give isl_union_map *isl_union_map_from_multi_union_pw_aff_0D( __isl_take isl_multi_union_pw_aff *mupa) { isl_bool is_params; isl_space *space; isl_union_set *dom, *ran; space = isl_multi_union_pw_aff_get_space(mupa); dom = isl_multi_union_pw_aff_domain(mupa); ran = isl_union_set_from_set(isl_set_universe(space)); is_params = isl_union_set_is_params(dom); if (is_params < 0) dom = isl_union_set_free(dom); else if (is_params) isl_die(isl_union_set_get_ctx(dom), isl_error_invalid, "cannot create union map from expression without " "explicit domain elements", dom = isl_union_set_free(dom)); return isl_union_map_from_domain_and_range(dom, ran); } /* Construct a union map mapping the shared domain * of the union piecewise affine expressions to the range of "mupa" * with each dimension in the range equated to the * corresponding union piecewise affine expression. * * If the input is zero-dimensional, then construct a mapping * from its explicit domain. */ __isl_give isl_union_map *isl_union_map_from_multi_union_pw_aff( __isl_take isl_multi_union_pw_aff *mupa) { int i; isl_size n; isl_space *space; isl_union_map *umap; isl_union_pw_aff *upa; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0) mupa = isl_multi_union_pw_aff_free(mupa); if (!mupa) return NULL; if (n == 0) return isl_union_map_from_multi_union_pw_aff_0D(mupa); upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); umap = isl_union_map_from_union_pw_aff(upa); for (i = 1; i < n; ++i) { isl_union_map *umap_i; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); umap_i = isl_union_map_from_union_pw_aff(upa); umap = isl_union_map_flat_range_product(umap, umap_i); } space = isl_multi_union_pw_aff_get_space(mupa); umap = isl_union_map_reset_range_space(umap, space); isl_multi_union_pw_aff_free(mupa); return umap; } /* Internal data structure for isl_union_pw_multi_aff_reset_range_space. * "range" is the space from which to set the range space. * "res" collects the results. */ struct isl_union_pw_multi_aff_reset_range_space_data { isl_space *range; isl_union_pw_multi_aff *res; }; /* Replace the range space of "pma" by the range space of data->range and * add the result to data->res. */ static isl_stat reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_reset_range_space_data *data = user; isl_space *space; space = isl_pw_multi_aff_get_space(pma); space = isl_space_domain(space); space = isl_space_extend_domain_with_range(space, isl_space_copy(data->range)); pma = isl_pw_multi_aff_reset_space(pma, space); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); return data->res ? isl_stat_ok : isl_stat_error; } /* Replace the range space of all the piecewise affine expressions in "upma" by * the range space of "space". * * This assumes that all these expressions have the same output dimension. * * Since the spaces of the expressions change, so do their hash values. * We therefore need to create a new isl_union_pw_multi_aff. * Note that the hash value is currently computed based on the entire * space even though there can only be a single expression with a given * domain space. */ static __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_reset_range_space( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_space *space) { struct isl_union_pw_multi_aff_reset_range_space_data data = { space }; isl_space *space_upma; space_upma = isl_union_pw_multi_aff_get_space(upma); data.res = isl_union_pw_multi_aff_empty(space_upma); if (isl_union_pw_multi_aff_foreach_pw_multi_aff(upma, &reset_range_space, &data) < 0) data.res = isl_union_pw_multi_aff_free(data.res); isl_space_free(space); isl_union_pw_multi_aff_free(upma); return data.res; } /* Construct and return a union piecewise multi affine expression * that is equal to the given multi union piecewise affine expression, * in the special case of a 0D multi union piecewise affine expression. * * Construct a union piecewise multi affine expression * on top of the explicit domain of the input. */ __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_from_multi_union_pw_aff_0D( __isl_take isl_multi_union_pw_aff *mupa) { isl_space *space; isl_multi_val *mv; isl_union_set *domain; space = isl_multi_union_pw_aff_get_space(mupa); mv = isl_multi_val_zero(space); domain = isl_multi_union_pw_aff_domain(mupa); return isl_union_pw_multi_aff_multi_val_on_domain(domain, mv); } /* Construct and return a union piecewise multi affine expression * that is equal to the given multi union piecewise affine expression. * * If the input is zero-dimensional, then * construct a union piecewise multi affine expression * on top of the explicit domain of the input. */ __isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_from_multi_union_pw_aff( __isl_take isl_multi_union_pw_aff *mupa) { int i; isl_size n; isl_space *space; isl_union_pw_multi_aff *upma; isl_union_pw_aff *upa; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0) mupa = isl_multi_union_pw_aff_free(mupa); if (!mupa) return NULL; if (n == 0) return isl_union_pw_multi_aff_from_multi_union_pw_aff_0D(mupa); space = isl_multi_union_pw_aff_get_space(mupa); upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); upma = isl_union_pw_multi_aff_from_union_pw_aff(upa); for (i = 1; i < n; ++i) { isl_union_pw_multi_aff *upma_i; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); upma_i = isl_union_pw_multi_aff_from_union_pw_aff(upa); upma = isl_union_pw_multi_aff_flat_range_product(upma, upma_i); } upma = isl_union_pw_multi_aff_reset_range_space(upma, space); isl_multi_union_pw_aff_free(mupa); return upma; } /* Intersect the range of "mupa" with "range", * in the special case where "mupa" is 0D. * * Intersect the domain of "mupa" with the constraints on the parameters * of "range". */ static __isl_give isl_multi_union_pw_aff *mupa_intersect_range_0D( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *range) { range = isl_set_params(range); mupa = isl_multi_union_pw_aff_intersect_params(mupa, range); return mupa; } /* Intersect the range of "mupa" with "range". * That is, keep only those domain elements that have a function value * in "range". */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_range( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *range) { isl_union_pw_multi_aff *upma; isl_union_set *domain; isl_space *space; isl_size n; int match; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0 || !range) goto error; space = isl_set_get_space(range); match = isl_space_tuple_is_equal(mupa->space, isl_dim_set, space, isl_dim_set); isl_space_free(space); if (match < 0) goto error; if (!match) isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid, "space don't match", goto error); if (n == 0) return mupa_intersect_range_0D(mupa, range); upma = isl_union_pw_multi_aff_from_multi_union_pw_aff( isl_multi_union_pw_aff_copy(mupa)); domain = isl_union_set_from_set(range); domain = isl_union_set_preimage_union_pw_multi_aff(domain, upma); mupa = isl_multi_union_pw_aff_intersect_domain(mupa, domain); return mupa; error: isl_multi_union_pw_aff_free(mupa); isl_set_free(range); return NULL; } /* Return the shared domain of the elements of "mupa", * in the special case where "mupa" is zero-dimensional. * * Return the explicit domain of "mupa". * Note that this domain may be a parameter set, either * because "mupa" is meant to live in a set space or * because no explicit domain has been set. */ __isl_give isl_union_set *isl_multi_union_pw_aff_domain_0D( __isl_take isl_multi_union_pw_aff *mupa) { isl_union_set *dom; dom = isl_multi_union_pw_aff_get_explicit_domain(mupa); isl_multi_union_pw_aff_free(mupa); return dom; } /* Return the shared domain of the elements of "mupa". * * If "mupa" is zero-dimensional, then return its explicit domain. */ __isl_give isl_union_set *isl_multi_union_pw_aff_domain( __isl_take isl_multi_union_pw_aff *mupa) { int i; isl_size n; isl_union_pw_aff *upa; isl_union_set *dom; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0) mupa = isl_multi_union_pw_aff_free(mupa); if (!mupa) return NULL; if (n == 0) return isl_multi_union_pw_aff_domain_0D(mupa); upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, 0); dom = isl_union_pw_aff_domain(upa); for (i = 1; i < n; ++i) { isl_union_set *dom_i; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); dom_i = isl_union_pw_aff_domain(upa); dom = isl_union_set_intersect(dom, dom_i); } isl_multi_union_pw_aff_free(mupa); return dom; } /* Apply "aff" to "mupa". The space of "mupa" is equal to the domain of "aff". * In particular, the spaces have been aligned. * The result is defined over the shared domain of the elements of "mupa" * * We first extract the parametric constant part of "aff" and * define that over the shared domain. * Then we iterate over all input dimensions of "aff" and add the corresponding * multiples of the elements of "mupa". * Finally, we consider the integer divisions, calling the function * recursively to obtain an isl_union_pw_aff corresponding to the * integer division argument. */ static __isl_give isl_union_pw_aff *multi_union_pw_aff_apply_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff) { int i; isl_size n_in, n_div; isl_union_pw_aff *upa; isl_union_set *uset; isl_val *v; isl_aff *cst; n_in = isl_aff_dim(aff, isl_dim_in); n_div = isl_aff_dim(aff, isl_dim_div); if (n_in < 0 || n_div < 0) goto error; uset = isl_multi_union_pw_aff_domain(isl_multi_union_pw_aff_copy(mupa)); cst = isl_aff_copy(aff); cst = isl_aff_drop_dims(cst, isl_dim_div, 0, n_div); cst = isl_aff_drop_dims(cst, isl_dim_in, 0, n_in); cst = isl_aff_project_domain_on_params(cst); upa = isl_union_pw_aff_aff_on_domain(uset, cst); for (i = 0; i < n_in; ++i) { isl_union_pw_aff *upa_i; if (!isl_aff_involves_dims(aff, isl_dim_in, i, 1)) continue; v = isl_aff_get_coefficient_val(aff, isl_dim_in, i); upa_i = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); upa_i = isl_union_pw_aff_scale_val(upa_i, v); upa = isl_union_pw_aff_add(upa, upa_i); } for (i = 0; i < n_div; ++i) { isl_aff *div; isl_union_pw_aff *upa_i; if (!isl_aff_involves_dims(aff, isl_dim_div, i, 1)) continue; div = isl_aff_get_div(aff, i); upa_i = multi_union_pw_aff_apply_aff( isl_multi_union_pw_aff_copy(mupa), div); upa_i = isl_union_pw_aff_floor(upa_i); v = isl_aff_get_coefficient_val(aff, isl_dim_div, i); upa_i = isl_union_pw_aff_scale_val(upa_i, v); upa = isl_union_pw_aff_add(upa, upa_i); } isl_multi_union_pw_aff_free(mupa); isl_aff_free(aff); return upa; error: isl_multi_union_pw_aff_free(mupa); isl_aff_free(aff); return NULL; } /* Apply "aff" to "mupa". The space of "mupa" needs to be compatible * with the domain of "aff". * Furthermore, the dimension of this space needs to be greater than zero. * The result is defined over the shared domain of the elements of "mupa" * * We perform these checks and then hand over control to * multi_union_pw_aff_apply_aff. */ __isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff) { isl_size dim; isl_space *space1, *space2; isl_bool equal; mupa = isl_multi_union_pw_aff_align_params(mupa, isl_aff_get_space(aff)); aff = isl_aff_align_params(aff, isl_multi_union_pw_aff_get_space(mupa)); if (!mupa || !aff) goto error; space1 = isl_multi_union_pw_aff_get_space(mupa); space2 = isl_aff_get_domain_space(aff); equal = isl_space_is_equal(space1, space2); isl_space_free(space1); isl_space_free(space2); if (equal < 0) goto error; if (!equal) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "spaces don't match", goto error); dim = isl_aff_dim(aff, isl_dim_in); if (dim < 0) goto error; if (dim == 0) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "cannot determine domains", goto error); return multi_union_pw_aff_apply_aff(mupa, aff); error: isl_multi_union_pw_aff_free(mupa); isl_aff_free(aff); return NULL; } /* Apply "ma" to "mupa", in the special case where "mupa" is 0D. * The space of "mupa" is known to be compatible with the domain of "ma". * * Construct an isl_multi_union_pw_aff that is equal to "ma" * on the domain of "mupa". */ static __isl_give isl_multi_union_pw_aff *mupa_apply_multi_aff_0D( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_multi_aff *ma) { isl_union_set *dom; dom = isl_multi_union_pw_aff_domain(mupa); ma = isl_multi_aff_project_domain_on_params(ma); return isl_multi_union_pw_aff_multi_aff_on_domain(dom, ma); } /* Apply "ma" to "mupa". The space of "mupa" needs to be compatible * with the domain of "ma". * The result is defined over the shared domain of the elements of "mupa" */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_multi_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_multi_aff *ma) { isl_space *space1, *space2; isl_multi_union_pw_aff *res; isl_bool equal; int i; isl_size n_in, n_out; mupa = isl_multi_union_pw_aff_align_params(mupa, isl_multi_aff_get_space(ma)); ma = isl_multi_aff_align_params(ma, isl_multi_union_pw_aff_get_space(mupa)); n_in = isl_multi_aff_dim(ma, isl_dim_in); n_out = isl_multi_aff_dim(ma, isl_dim_out); if (!mupa || n_in < 0 || n_out < 0) goto error; space1 = isl_multi_union_pw_aff_get_space(mupa); space2 = isl_multi_aff_get_domain_space(ma); equal = isl_space_is_equal(space1, space2); isl_space_free(space1); isl_space_free(space2); if (equal < 0) goto error; if (!equal) isl_die(isl_multi_aff_get_ctx(ma), isl_error_invalid, "spaces don't match", goto error); if (n_in == 0) return mupa_apply_multi_aff_0D(mupa, ma); space1 = isl_space_range(isl_multi_aff_get_space(ma)); res = isl_multi_union_pw_aff_alloc(space1); for (i = 0; i < n_out; ++i) { isl_aff *aff; isl_union_pw_aff *upa; aff = isl_multi_aff_get_aff(ma, i); upa = multi_union_pw_aff_apply_aff( isl_multi_union_pw_aff_copy(mupa), aff); res = isl_multi_union_pw_aff_set_union_pw_aff(res, i, upa); } isl_multi_aff_free(ma); isl_multi_union_pw_aff_free(mupa); return res; error: isl_multi_union_pw_aff_free(mupa); isl_multi_aff_free(ma); return NULL; } /* Apply "pa" to "mupa", in the special case where "mupa" is 0D. * The space of "mupa" is known to be compatible with the domain of "pa". * * Construct an isl_multi_union_pw_aff that is equal to "pa" * on the domain of "mupa". */ static __isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_pw_aff_0D( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_pw_aff *pa) { isl_union_set *dom; dom = isl_multi_union_pw_aff_domain(mupa); pa = isl_pw_aff_project_domain_on_params(pa); return isl_union_pw_aff_pw_aff_on_domain(dom, pa); } /* Apply "pa" to "mupa". The space of "mupa" needs to be compatible * with the domain of "pa". * Furthermore, the dimension of this space needs to be greater than zero. * The result is defined over the shared domain of the elements of "mupa" */ __isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_pw_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_pw_aff *pa) { int i; isl_bool equal; isl_size n_in; isl_space *space, *space2; isl_union_pw_aff *upa; mupa = isl_multi_union_pw_aff_align_params(mupa, isl_pw_aff_get_space(pa)); pa = isl_pw_aff_align_params(pa, isl_multi_union_pw_aff_get_space(mupa)); if (!mupa || !pa) goto error; space = isl_multi_union_pw_aff_get_space(mupa); space2 = isl_pw_aff_get_domain_space(pa); equal = isl_space_is_equal(space, space2); isl_space_free(space); isl_space_free(space2); if (equal < 0) goto error; if (!equal) isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid, "spaces don't match", goto error); n_in = isl_pw_aff_dim(pa, isl_dim_in); if (n_in < 0) goto error; if (n_in == 0) return isl_multi_union_pw_aff_apply_pw_aff_0D(mupa, pa); space = isl_space_params(isl_multi_union_pw_aff_get_space(mupa)); upa = isl_union_pw_aff_empty(space); for (i = 0; i < pa->n; ++i) { isl_aff *aff; isl_set *domain; isl_multi_union_pw_aff *mupa_i; isl_union_pw_aff *upa_i; mupa_i = isl_multi_union_pw_aff_copy(mupa); domain = isl_set_copy(pa->p[i].set); mupa_i = isl_multi_union_pw_aff_intersect_range(mupa_i, domain); aff = isl_aff_copy(pa->p[i].aff); upa_i = multi_union_pw_aff_apply_aff(mupa_i, aff); upa = isl_union_pw_aff_union_add(upa, upa_i); } isl_multi_union_pw_aff_free(mupa); isl_pw_aff_free(pa); return upa; error: isl_multi_union_pw_aff_free(mupa); isl_pw_aff_free(pa); return NULL; } /* Apply "pma" to "mupa", in the special case where "mupa" is 0D. * The space of "mupa" is known to be compatible with the domain of "pma". * * Construct an isl_multi_union_pw_aff that is equal to "pma" * on the domain of "mupa". */ static __isl_give isl_multi_union_pw_aff *mupa_apply_pw_multi_aff_0D( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_pw_multi_aff *pma) { isl_union_set *dom; dom = isl_multi_union_pw_aff_domain(mupa); pma = isl_pw_multi_aff_project_domain_on_params(pma); return isl_multi_union_pw_aff_pw_multi_aff_on_domain(dom, pma); } /* Apply "pma" to "mupa". The space of "mupa" needs to be compatible * with the domain of "pma". * The result is defined over the shared domain of the elements of "mupa" */ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_apply_pw_multi_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_pw_multi_aff *pma) { isl_space *space1, *space2; isl_multi_union_pw_aff *res; isl_bool equal; int i; isl_size n_in, n_out; mupa = isl_multi_union_pw_aff_align_params(mupa, isl_pw_multi_aff_get_space(pma)); pma = isl_pw_multi_aff_align_params(pma, isl_multi_union_pw_aff_get_space(mupa)); if (!mupa || !pma) goto error; space1 = isl_multi_union_pw_aff_get_space(mupa); space2 = isl_pw_multi_aff_get_domain_space(pma); equal = isl_space_is_equal(space1, space2); isl_space_free(space1); isl_space_free(space2); if (equal < 0) goto error; if (!equal) isl_die(isl_pw_multi_aff_get_ctx(pma), isl_error_invalid, "spaces don't match", goto error); n_in = isl_pw_multi_aff_dim(pma, isl_dim_in); n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); if (n_in < 0 || n_out < 0) goto error; if (n_in == 0) return mupa_apply_pw_multi_aff_0D(mupa, pma); space1 = isl_space_range(isl_pw_multi_aff_get_space(pma)); res = isl_multi_union_pw_aff_alloc(space1); for (i = 0; i < n_out; ++i) { isl_pw_aff *pa; isl_union_pw_aff *upa; pa = isl_pw_multi_aff_get_pw_aff(pma, i); upa = isl_multi_union_pw_aff_apply_pw_aff( isl_multi_union_pw_aff_copy(mupa), pa); res = isl_multi_union_pw_aff_set_union_pw_aff(res, i, upa); } isl_pw_multi_aff_free(pma); isl_multi_union_pw_aff_free(mupa); return res; error: isl_multi_union_pw_aff_free(mupa); isl_pw_multi_aff_free(pma); return NULL; } /* Replace the explicit domain of "mupa" by its preimage under "upma". * If the explicit domain only keeps track of constraints on the parameters, * then only update those constraints. */ static __isl_give isl_multi_union_pw_aff *preimage_explicit_domain( __isl_take isl_multi_union_pw_aff *mupa, __isl_keep isl_union_pw_multi_aff *upma) { isl_bool is_params; if (isl_multi_union_pw_aff_check_has_explicit_domain(mupa) < 0) return isl_multi_union_pw_aff_free(mupa); mupa = isl_multi_union_pw_aff_cow(mupa); if (!mupa) return NULL; is_params = isl_union_set_is_params(mupa->u.dom); if (is_params < 0) return isl_multi_union_pw_aff_free(mupa); upma = isl_union_pw_multi_aff_copy(upma); if (is_params) mupa->u.dom = isl_union_set_intersect_params(mupa->u.dom, isl_union_set_params(isl_union_pw_multi_aff_domain(upma))); else mupa->u.dom = isl_union_set_preimage_union_pw_multi_aff( mupa->u.dom, upma); if (!mupa->u.dom) return isl_multi_union_pw_aff_free(mupa); return mupa; } /* Compute the pullback of "mupa" by the function represented by "upma". * In other words, plug in "upma" in "mupa". The result contains * expressions defined over the domain space of "upma". * * Run over all elements of "mupa" and plug in "upma" in each of them. * * If "mupa" has an explicit domain, then it is this domain * that needs to undergo a pullback instead, i.e., a preimage. */ __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_pullback_union_pw_multi_aff( __isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_union_pw_multi_aff *upma) { int i; isl_size n; mupa = isl_multi_union_pw_aff_align_params(mupa, isl_union_pw_multi_aff_get_space(upma)); upma = isl_union_pw_multi_aff_align_params(upma, isl_multi_union_pw_aff_get_space(mupa)); mupa = isl_multi_union_pw_aff_cow(mupa); n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0 || !upma) goto error; for (i = 0; i < n; ++i) { isl_union_pw_aff *upa; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); upa = isl_union_pw_aff_pullback_union_pw_multi_aff(upa, isl_union_pw_multi_aff_copy(upma)); mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa); } if (isl_multi_union_pw_aff_has_explicit_domain(mupa)) mupa = preimage_explicit_domain(mupa, upma); isl_union_pw_multi_aff_free(upma); return mupa; error: isl_multi_union_pw_aff_free(mupa); isl_union_pw_multi_aff_free(upma); return NULL; } /* Extract the sequence of elements in "mupa" with domain space "space" * (ignoring parameters). * * For the elements of "mupa" that are not defined on the specified space, * the corresponding element in the result is empty. */ __isl_give isl_multi_pw_aff *isl_multi_union_pw_aff_extract_multi_pw_aff( __isl_keep isl_multi_union_pw_aff *mupa, __isl_take isl_space *space) { int i; isl_size n; isl_space *space_mpa; isl_multi_pw_aff *mpa; n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); if (n < 0 || !space) goto error; space_mpa = isl_multi_union_pw_aff_get_space(mupa); space = isl_space_replace_params(space, space_mpa); space_mpa = isl_space_map_from_domain_and_range(isl_space_copy(space), space_mpa); mpa = isl_multi_pw_aff_alloc(space_mpa); space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, 1); for (i = 0; i < n; ++i) { isl_union_pw_aff *upa; isl_pw_aff *pa; upa = isl_multi_union_pw_aff_get_union_pw_aff(mupa, i); pa = isl_union_pw_aff_extract_pw_aff(upa, isl_space_copy(space)); mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa); isl_union_pw_aff_free(upa); } isl_space_free(space); return mpa; error: isl_space_free(space); return NULL; } /* Data structure that specifies how isl_union_pw_multi_aff_un_op * should modify the base expressions in the input. * * If "filter" is not NULL, then only the base expressions that satisfy "filter" * are taken into account. * "fn" is applied to each entry in the input. */ struct isl_union_pw_multi_aff_un_op_control { isl_bool (*filter)(__isl_keep isl_pw_multi_aff *part); __isl_give isl_pw_multi_aff *(*fn)(__isl_take isl_pw_multi_aff *pma); }; /* Wrapper for isl_union_pw_multi_aff_un_op filter functions (which do not take * a second argument) for use as an isl_union_pw_multi_aff_transform * filter function (which does take a second argument). * Simply call control->filter without the second argument. */ static isl_bool isl_union_pw_multi_aff_un_op_filter_drop_user( __isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_un_op_control *control = user; return control->filter(pma); } /* Wrapper for isl_union_pw_multi_aff_un_op base functions (which do not take * a second argument) for use as an isl_union_pw_multi_aff_transform * base function (which does take a second argument). * Simply call control->fn without the second argument. */ static __isl_give isl_pw_multi_aff *isl_union_pw_multi_aff_un_op_drop_user( __isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_un_op_control *control = user; return control->fn(pma); } /* Construct an isl_union_pw_multi_aff that is obtained by * modifying "upma" according to "control". * * isl_union_pw_multi_aff_transform performs essentially * the same operation, but takes a filter and a callback function * of a different form (with an extra argument). * Call isl_union_pw_multi_aff_transform with wrappers * that remove this extra argument. */ static __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_un_op( __isl_take isl_union_pw_multi_aff *upma, struct isl_union_pw_multi_aff_un_op_control *control) { struct isl_union_pw_multi_aff_transform_control t_control = { .filter = &isl_union_pw_multi_aff_un_op_filter_drop_user, .filter_user = control, .fn = &isl_union_pw_multi_aff_un_op_drop_user, .fn_user = control, }; return isl_union_pw_multi_aff_transform(upma, &t_control); } /* For each function in "upma" of the form A -> [B -> C], * extract the function A -> B and collect the results. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_range_factor_domain( __isl_take isl_union_pw_multi_aff *upma) { struct isl_union_pw_multi_aff_un_op_control control = { .filter = &isl_pw_multi_aff_range_is_wrapping, .fn = &isl_pw_multi_aff_range_factor_domain, }; return isl_union_pw_multi_aff_un_op(upma, &control); } /* For each function in "upma" of the form A -> [B -> C], * extract the function A -> C and collect the results. */ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_range_factor_range( __isl_take isl_union_pw_multi_aff *upma) { struct isl_union_pw_multi_aff_un_op_control control = { .filter = &isl_pw_multi_aff_range_is_wrapping, .fn = &isl_pw_multi_aff_range_factor_range, }; return isl_union_pw_multi_aff_un_op(upma, &control); } /* Evaluate the affine function "aff" in the void point "pnt". * In particular, return the value NaN. */ static __isl_give isl_val *eval_void(__isl_take isl_aff *aff, __isl_take isl_point *pnt) { isl_ctx *ctx; ctx = isl_point_get_ctx(pnt); isl_aff_free(aff); isl_point_free(pnt); return isl_val_nan(ctx); } /* Evaluate the affine expression "aff" * in the coordinates (with denominator) "pnt". */ static __isl_give isl_val *eval(__isl_keep isl_vec *aff, __isl_keep isl_vec *pnt) { isl_int n, d; isl_ctx *ctx; isl_val *v; if (!aff || !pnt) return NULL; ctx = isl_vec_get_ctx(aff); isl_int_init(n); isl_int_init(d); isl_seq_inner_product(aff->el + 1, pnt->el, pnt->size, &n); isl_int_mul(d, aff->el[0], pnt->el[0]); v = isl_val_rat_from_isl_int(ctx, n, d); v = isl_val_normalize(v); isl_int_clear(n); isl_int_clear(d); return v; } /* Check that the domain space of "aff" is equal to "space". */ static isl_stat isl_aff_check_has_domain_space(__isl_keep isl_aff *aff, __isl_keep isl_space *space) { isl_bool ok; ok = isl_space_is_equal(isl_aff_peek_domain_space(aff), space); if (ok < 0) return isl_stat_error; if (!ok) isl_die(isl_aff_get_ctx(aff), isl_error_invalid, "incompatible spaces", return isl_stat_error); return isl_stat_ok; } /* Evaluate the affine function "aff" in "pnt". */ __isl_give isl_val *isl_aff_eval(__isl_take isl_aff *aff, __isl_take isl_point *pnt) { isl_bool is_void; isl_val *v; isl_local_space *ls; if (isl_aff_check_has_domain_space(aff, isl_point_peek_space(pnt)) < 0) goto error; is_void = isl_point_is_void(pnt); if (is_void < 0) goto error; if (is_void) return eval_void(aff, pnt); ls = isl_aff_get_domain_local_space(aff); pnt = isl_local_space_lift_point(ls, pnt); v = eval(aff->v, isl_point_peek_vec(pnt)); isl_aff_free(aff); isl_point_free(pnt); return v; error: isl_aff_free(aff); isl_point_free(pnt); return NULL; } isl-0.28/isl_schedule.c0000664000175000017500000005015115215726270014142 0ustar00skimoskimo/* * Copyright 2011 INRIA Saclay * Copyright 2012-2014 Ecole Normale Superieure * Copyright 2016 Sven Verdoolaege * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include #include #include #include #include #include #include #include #include #include #include /* Return a schedule encapsulating the given schedule tree. * * We currently only allow schedule trees with a domain or extension as root. * * The leaf field is initialized as a leaf node so that it can be * used to represent leaves in the constructed schedule. * The reference count is set to -1 since the isl_schedule_tree * should never be freed. It is up to the (internal) users of * these leaves to ensure that they are only used while the schedule * is still alive. */ __isl_give isl_schedule *isl_schedule_from_schedule_tree(isl_ctx *ctx, __isl_take isl_schedule_tree *tree) { enum isl_schedule_node_type type; isl_schedule *schedule; if (!tree) return NULL; type = isl_schedule_tree_get_type(tree); if (type != isl_schedule_node_domain && type != isl_schedule_node_extension) isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported, "root of schedule tree should be a domain or extension", goto error); schedule = isl_calloc_type(ctx, isl_schedule); if (!schedule) goto error; schedule->ref = 1; schedule->root = tree; schedule->leaf = isl_schedule_tree_leaf(ctx); if (!schedule->leaf) return isl_schedule_free(schedule); return schedule; error: isl_schedule_tree_free(tree); return NULL; } /* Return a pointer to a schedule with as single node * a domain node with the given domain. */ __isl_give isl_schedule *isl_schedule_from_domain( __isl_take isl_union_set *domain) { isl_ctx *ctx; isl_schedule_tree *tree; ctx = isl_union_set_get_ctx(domain); tree = isl_schedule_tree_from_domain(domain); return isl_schedule_from_schedule_tree(ctx, tree); } /* Return a pointer to a schedule with as single node * a domain node with an empty domain. */ __isl_give isl_schedule *isl_schedule_empty(__isl_take isl_space *space) { return isl_schedule_from_domain(isl_union_set_empty(space)); } /* Return a new reference to "sched". */ __isl_give isl_schedule *isl_schedule_copy(__isl_keep isl_schedule *sched) { if (!sched) return NULL; sched->ref++; return sched; } /* Return an isl_schedule that is equal to "schedule" and that has only * a single reference. */ __isl_give isl_schedule *isl_schedule_cow(__isl_take isl_schedule *schedule) { isl_ctx *ctx; isl_schedule_tree *tree; if (!schedule) return NULL; if (schedule->ref == 1) return schedule; ctx = isl_schedule_get_ctx(schedule); schedule->ref--; tree = isl_schedule_tree_copy(schedule->root); return isl_schedule_from_schedule_tree(ctx, tree); } __isl_null isl_schedule *isl_schedule_free(__isl_take isl_schedule *sched) { if (!sched) return NULL; if (--sched->ref > 0) return NULL; isl_schedule_tree_free(sched->root); isl_schedule_tree_free(sched->leaf); free(sched); return NULL; } /* Replace the root of "schedule" by "tree". */ __isl_give isl_schedule *isl_schedule_set_root( __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree) { if (!schedule || !tree) goto error; if (schedule->root == tree) { isl_schedule_tree_free(tree); return schedule; } schedule = isl_schedule_cow(schedule); if (!schedule) goto error; isl_schedule_tree_free(schedule->root); schedule->root = tree; return schedule; error: isl_schedule_free(schedule); isl_schedule_tree_free(tree); return NULL; } isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *schedule) { return schedule ? isl_schedule_tree_get_ctx(schedule->leaf) : NULL; } #undef TYPE #define TYPE isl_schedule #undef FIELD_TYPE #define FIELD_TYPE isl_schedule_tree #undef FIELD_NAME #define FIELD_NAME leaf #undef PROPERTY #define PROPERTY leaf #include "isl_peek_templ.c" /* Are "schedule1" and "schedule2" obviously equal to each other? */ isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, __isl_keep isl_schedule *schedule2) { if (!schedule1 || !schedule2) return isl_bool_error; if (schedule1 == schedule2) return isl_bool_true; return isl_schedule_tree_plain_is_equal(schedule1->root, schedule2->root); } /* Return the (parameter) space of the schedule, i.e., the space * of the root domain. */ __isl_give isl_space *isl_schedule_get_space( __isl_keep isl_schedule *schedule) { enum isl_schedule_node_type type; isl_space *space; isl_union_set *domain; if (!schedule) return NULL; type = isl_schedule_tree_get_type(schedule->root); if (type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(schedule), isl_error_internal, "root node not a domain node", return NULL); domain = isl_schedule_tree_domain_get_domain(schedule->root); space = isl_union_set_get_space(domain); isl_union_set_free(domain); return space; } /* Return a pointer to the root of "schedule". */ __isl_give isl_schedule_node *isl_schedule_get_root( __isl_keep isl_schedule *schedule) { isl_ctx *ctx; isl_schedule_tree *tree; isl_schedule_tree_list *ancestors; if (!schedule) return NULL; ctx = isl_schedule_get_ctx(schedule); tree = isl_schedule_tree_copy(schedule->root); schedule = isl_schedule_copy(schedule); ancestors = isl_schedule_tree_list_alloc(ctx, 0); return isl_schedule_node_alloc(schedule, tree, ancestors, NULL); } /* Return the domain of the root domain node of "schedule". */ __isl_give isl_union_set *isl_schedule_get_domain( __isl_keep isl_schedule *schedule) { if (!schedule) return NULL; return isl_schedule_tree_domain_get_domain(schedule->root); } /* Traverse all nodes of "sched" in depth first preorder. * * If "fn" returns -1 on any of the nodes, then the traversal is aborted. * If "fn" returns 0 on any of the nodes, then the subtree rooted * at that node is skipped. * * Return 0 on success and -1 on failure. */ isl_stat isl_schedule_foreach_schedule_node_top_down( __isl_keep isl_schedule *sched, isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user) { isl_schedule_node *node; isl_stat r; if (!sched) return isl_stat_error; node = isl_schedule_get_root(sched); r = isl_schedule_node_foreach_descendant_top_down(node, fn, user); isl_schedule_node_free(node); return r; } /* Traverse the node of "sched" in depth first postorder, * allowing the user to modify the visited node. * The traversal continues from the node returned by the callback function. * It is the responsibility of the user to ensure that this does not * lead to an infinite loop. It is safest to always return a pointer * to the same position (same ancestors and child positions) as the input node. */ __isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up( __isl_take isl_schedule *schedule, __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, void *user), void *user) { isl_schedule_node *node; node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_map_descendant_bottom_up(node, fn, user); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; } /* Wrapper around isl_schedule_node_reset_user for use as * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *reset_user( __isl_take isl_schedule_node *node, void *user) { return isl_schedule_node_reset_user(node); } /* Reset the user pointer on all identifiers of parameters and tuples * in the schedule "schedule". */ __isl_give isl_schedule *isl_schedule_reset_user( __isl_take isl_schedule *schedule) { return isl_schedule_map_schedule_node_bottom_up(schedule, &reset_user, NULL); } /* Wrapper around isl_schedule_node_align_params for use as * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *align_params( __isl_take isl_schedule_node *node, void *user) { isl_space *space = user; return isl_schedule_node_align_params(node, isl_space_copy(space)); } /* Align the parameters of all nodes in schedule "schedule" * to those of "space". */ __isl_give isl_schedule *isl_schedule_align_params( __isl_take isl_schedule *schedule, __isl_take isl_space *space) { schedule = isl_schedule_map_schedule_node_bottom_up(schedule, &align_params, space); isl_space_free(space); return schedule; } /* Wrapper around isl_schedule_node_pullback_union_pw_multi_aff for use as * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *pullback_upma( __isl_take isl_schedule_node *node, void *user) { isl_union_pw_multi_aff *upma = user; return isl_schedule_node_pullback_union_pw_multi_aff(node, isl_union_pw_multi_aff_copy(upma)); } /* Compute the pullback of "schedule" by the function represented by "upma". * In other words, plug in "upma" in the iteration domains of "schedule". * * The schedule tree is not allowed to contain any expansion nodes. */ __isl_give isl_schedule *isl_schedule_pullback_union_pw_multi_aff( __isl_take isl_schedule *schedule, __isl_take isl_union_pw_multi_aff *upma) { schedule = isl_schedule_map_schedule_node_bottom_up(schedule, &pullback_upma, upma); isl_union_pw_multi_aff_free(upma); return schedule; } /* Expand the schedule "schedule" by extending all leaves * with an expansion node with as subtree the tree of "expansion". * The expansion of the expansion node is determined by "contraction" * and the domain of "expansion". That is, the domain of "expansion" * is contracted according to "contraction". * * Call isl_schedule_node_expand after extracting the required * information from "expansion". */ __isl_give isl_schedule *isl_schedule_expand(__isl_take isl_schedule *schedule, __isl_take isl_union_pw_multi_aff *contraction, __isl_take isl_schedule *expansion) { isl_union_set *domain; isl_schedule_node *node; isl_schedule_tree *tree; domain = isl_schedule_get_domain(expansion); node = isl_schedule_get_root(expansion); node = isl_schedule_node_child(node, 0); tree = isl_schedule_node_get_tree(node); isl_schedule_node_free(node); isl_schedule_free(expansion); node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_expand(node, contraction, domain, tree); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; } /* Intersect the domain of the schedule "schedule" with "domain". * The root of "schedule" is required to be a domain node. */ __isl_give isl_schedule *isl_schedule_intersect_domain( __isl_take isl_schedule *schedule, __isl_take isl_union_set *domain) { enum isl_schedule_node_type root_type; isl_schedule_node *node; if (!schedule || !domain) goto error; root_type = isl_schedule_tree_get_type(schedule->root); if (root_type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, "root node must be a domain node", goto error); node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_domain_intersect_domain(node, domain); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; error: isl_schedule_free(schedule); isl_union_set_free(domain); return NULL; } /* Replace the domain of the schedule "schedule" with the gist * of the original domain with respect to the parameter domain "context". */ __isl_give isl_schedule *isl_schedule_gist_domain_params( __isl_take isl_schedule *schedule, __isl_take isl_set *context) { enum isl_schedule_node_type root_type; isl_schedule_node *node; if (!schedule || !context) goto error; root_type = isl_schedule_tree_get_type(schedule->root); if (root_type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, "root node must be a domain node", goto error); node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_domain_gist_params(node, context); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; error: isl_schedule_free(schedule); isl_set_free(context); return NULL; } /* Return an isl_union_map representation of the schedule. In particular, * return an isl_union_map corresponding to the subtree schedule of the child * of the root domain node. That is, we do not intersect the domain * of the returned isl_union_map with the domain constraints. */ __isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched) { enum isl_schedule_node_type type; isl_schedule_node *node; isl_union_map *umap; if (!sched) return NULL; type = isl_schedule_tree_get_type(sched->root); if (type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(sched), isl_error_internal, "root node not a domain node", return NULL); node = isl_schedule_get_root(sched); node = isl_schedule_node_child(node, 0); umap = isl_schedule_node_get_subtree_schedule_union_map(node); isl_schedule_node_free(node); return umap; } /* Insert a band node with partial schedule "partial" between the domain * root node of "schedule" and its single child. * Return a pointer to the updated schedule. * * If any of the nodes in the tree depend on the set of outer band nodes * then we refuse to insert the band node. */ __isl_give isl_schedule *isl_schedule_insert_partial_schedule( __isl_take isl_schedule *schedule, __isl_take isl_multi_union_pw_aff *partial) { isl_schedule_node *node; int anchored; node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); if (!node) goto error; if (isl_schedule_node_get_type(node) != isl_schedule_node_domain) isl_die(isl_schedule_node_get_ctx(node), isl_error_internal, "root node not a domain node", goto error); node = isl_schedule_node_child(node, 0); anchored = isl_schedule_node_is_subtree_anchored(node); if (anchored < 0) goto error; if (anchored) isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, "cannot insert band node in anchored subtree", goto error); node = isl_schedule_node_insert_partial_schedule(node, partial); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; error: isl_schedule_node_free(node); isl_multi_union_pw_aff_free(partial); return NULL; } /* Insert a context node with constraints "context" between the domain * root node of "schedule" and its single child. * Return a pointer to the updated schedule. */ __isl_give isl_schedule *isl_schedule_insert_context( __isl_take isl_schedule *schedule, __isl_take isl_set *context) { isl_schedule_node *node; node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_child(node, 0); node = isl_schedule_node_insert_context(node, context); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; } /* Insert a guard node with constraints "guard" between the domain * root node of "schedule" and its single child. * Return a pointer to the updated schedule. */ __isl_give isl_schedule *isl_schedule_insert_guard( __isl_take isl_schedule *schedule, __isl_take isl_set *guard) { isl_schedule_node *node; node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); node = isl_schedule_node_child(node, 0); node = isl_schedule_node_insert_guard(node, guard); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); return schedule; } /* Return a tree with as top-level node a filter corresponding to "filter" and * as child, the (single) child of "tree". * However, if this single child is of type "type", then the filter is inserted * in the children of this single child instead. */ static __isl_give isl_schedule_tree *insert_filter_in_child_of_type( __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *filter, enum isl_schedule_node_type type) { if (!isl_schedule_tree_has_children(tree)) { isl_schedule_tree_free(tree); return isl_schedule_tree_from_filter(filter); } else { tree = isl_schedule_tree_child(tree, 0); } if (isl_schedule_tree_get_type(tree) == type) tree = isl_schedule_tree_children_insert_filter(tree, filter); else tree = isl_schedule_tree_insert_filter(tree, filter); return tree; } /* Construct a schedule that combines the schedules "schedule1" and "schedule2" * with a top-level node (underneath the domain node) of type "type", * either isl_schedule_node_sequence or isl_schedule_node_set. * The domains of the two schedules are assumed to be disjoint. * * The new schedule has as domain the union of the domains of the two * schedules. The child of the domain node is a node of type "type" * with two filters corresponding to the domains of the input schedules. * If one (or both) of the top-level nodes of the two schedules is itself * of type "type", then the filter is pushed into the children of that * node and the sequence or set is flattened. */ __isl_give isl_schedule *isl_schedule_pair(enum isl_schedule_node_type type, __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) { int disjoint; isl_ctx *ctx; enum isl_schedule_node_type root_type; isl_schedule_tree *tree1, *tree2; isl_union_set *filter1, *filter2, *domain; if (!schedule1 || !schedule2) goto error; root_type = isl_schedule_tree_get_type(schedule1->root); if (root_type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(schedule1), isl_error_internal, "root node not a domain node", goto error); root_type = isl_schedule_tree_get_type(schedule2->root); if (root_type != isl_schedule_node_domain) isl_die(isl_schedule_get_ctx(schedule1), isl_error_internal, "root node not a domain node", goto error); ctx = isl_schedule_get_ctx(schedule1); tree1 = isl_schedule_tree_copy(schedule1->root); filter1 = isl_schedule_tree_domain_get_domain(tree1); tree2 = isl_schedule_tree_copy(schedule2->root); filter2 = isl_schedule_tree_domain_get_domain(tree2); isl_schedule_free(schedule1); isl_schedule_free(schedule2); disjoint = isl_union_set_is_disjoint(filter1, filter2); if (disjoint < 0) filter1 = isl_union_set_free(filter1); if (!disjoint) isl_die(ctx, isl_error_invalid, "schedule domains not disjoint", filter1 = isl_union_set_free(filter1)); domain = isl_union_set_union(isl_union_set_copy(filter1), isl_union_set_copy(filter2)); filter1 = isl_union_set_gist(filter1, isl_union_set_copy(domain)); filter2 = isl_union_set_gist(filter2, isl_union_set_copy(domain)); tree1 = insert_filter_in_child_of_type(tree1, filter1, type); tree2 = insert_filter_in_child_of_type(tree2, filter2, type); tree1 = isl_schedule_tree_from_pair(type, tree1, tree2); tree1 = isl_schedule_tree_insert_domain(tree1, domain); return isl_schedule_from_schedule_tree(ctx, tree1); error: isl_schedule_free(schedule1); isl_schedule_free(schedule2); return NULL; } /* Construct a schedule that combines the schedules "schedule1" and "schedule2" * through a sequence node. * The domains of the input schedules are assumed to be disjoint. */ __isl_give isl_schedule *isl_schedule_sequence( __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) { return isl_schedule_pair(isl_schedule_node_sequence, schedule1, schedule2); } /* Construct a schedule that combines the schedules "schedule1" and "schedule2" * through a set node. * The domains of the input schedules are assumed to be disjoint. */ __isl_give isl_schedule *isl_schedule_set( __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2) { return isl_schedule_pair(isl_schedule_node_set, schedule1, schedule2); } /* Print "schedule" to "p". */ __isl_give isl_printer *isl_printer_print_schedule(__isl_take isl_printer *p, __isl_keep isl_schedule *schedule) { if (!schedule) return isl_printer_free(p); return isl_printer_print_schedule_tree(p, schedule->root); } #undef BASE #define BASE schedule #include isl-0.28/isl_test2.cc0000664000175000017500000010525415217777707013574 0ustar00skimoskimo/* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2012-2013 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * Copyright 2021-2022 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include #include #include #include #include #include #include #include #include #include #include /* A binary isl function that appears in the C++ bindings * as a unary method in a class T, taking an extra argument * of type A1 and returning an object of type R. */ template using binary_fn = R (T::*)(A1) const; /* A function for selecting an overload of a pointer to a unary C++ method * based on the single argument type. * The object type and the return type are meant to be deduced. */ template static binary_fn const arg(const binary_fn &fn) { return fn; } /* A ternary isl function that appears in the C++ bindings * as a binary method in a class T, taking extra arguments * of type A1 and A2 and returning an object of type R. */ template using ternary_fn = R (T::*)(A1, A2) const; /* A function for selecting an overload of a pointer to a binary C++ method * based on the (first) argument type(s). * The object type and the return type are meant to be deduced. */ template static ternary_fn const arg(const ternary_fn &fn) { return fn; } /* A description of the input and the output of a unary property. */ struct unary_prop { const char *arg; bool res; }; /* A description of the input and the output of a unary operation. */ struct unary { const char *arg; const char *res; }; /* The type used to represent type T in a test. * By default, this is "const char *". * However, a bool is represented by itself. */ template struct input { using type = const char *; }; template <> struct input { using type = bool; }; /* A description of the inputs and the output of a binary operation. */ template struct binary { const char *arg1; const char *arg2; R res; }; /* A description of the inputs and the output of a ternary operation. */ struct ternary { const char *arg1; const char *arg2; const char *arg3; const char *res; }; /* A template function for checking whether two objects * of the same (isl) type are (obviously) equal. * The spelling depends on the isl type and * in particular on whether an equality method is available or * whether only obvious equality can be tested. * * Since isl::multi_val has both an is_equal and a plain_is_equal, * use a specific overload for isl::multi_val that calls is_equal. * * If the objects are boolean values, then compare them directly. */ template ().is_equal(std::declval()))>::type = true> static bool is_equal(const T &a, const T &b) { return a.is_equal(b); } template ().plain_is_equal(std::declval()))>::type = true> static bool is_equal(const T &a, const T &b) { return a.plain_is_equal(b); } static bool is_equal(const isl::multi_val &a, const isl::multi_val &b) { return a.is_equal(b); } static bool is_equal(bool a, bool b) { return a == b; } /* A helper macro for throwing an isl::exception_invalid with message "msg". */ #define THROW_INVALID(msg) \ isl::exception::throw_error(isl_error_invalid, msg, __FILE__, __LINE__) /* Run a sequence of tests of function "fn" with stringification "name" and * with input and output described by "tests", * throwing an exception when an unexpected result is produced. */ template static void test(isl::ctx ctx, bool fn(const T &), const std::string &name, const std::vector &tests) { for (const auto &test : tests) { T obj(ctx, test.arg); bool res = fn(obj); std::ostringstream ss; if (test.res == res) continue; ss << name << "(" << test.arg << ") = " << std::boolalpha << res << "\n" << "expecting: " << test.res; THROW_INVALID(ss.str().c_str()); } } /* Run a sequence of tests of method "fn" with stringification "name" and * with input and output described by "test", * throwing an exception when an unexpected result is produced. */ template static void test(isl::ctx ctx, R (T::*fn)() const, const std::string &name, const std::vector &tests) { for (const auto &test : tests) { T obj(ctx, test.arg); R expected(ctx, test.res); const auto &res = (obj.*fn)(); std::ostringstream ss; if (is_equal(expected, res)) continue; ss << name << "(" << test.arg << ") =\n" << res << "\n" << "expecting:\n" << expected; THROW_INVALID(ss.str().c_str()); } } /* Create an object of type "T" from representation "arg". * This usually creates an isl object from a string representation, * but if the representation is a boolean then the object * is simply that boolean value. */ template T create(isl::ctx ctx, I arg) { return T(ctx, arg); } template <> bool create(isl::ctx ctx, bool arg) { return arg; } /* Run a sequence of tests of method "fn" with stringification "name" and * with inputs and output described by "test", * throwing an exception when an unexpected result is produced. */ template static void test(isl::ctx ctx, R (T::*fn)(A1) const, const std::string &name, const std::vector::type>> &tests) { for (const auto &test : tests) { T obj(ctx, test.arg1); typename std::remove_reference::type arg1(ctx, test.arg2); auto expected = create(ctx, test.res); const auto &res = (obj.*fn)(arg1); std::ostringstream ss; if (is_equal(expected, res)) continue; ss << name << "(" << test.arg1 << ", " << test.arg2 << ") =\n" << std::boolalpha << res << "\n" << "expecting:\n" << expected; THROW_INVALID(ss.str().c_str()); } } /* Run a sequence of tests of function "fn" with stringification "name" and * with inputs and output described by "tests", * throwing an exception when an unexpected result is produced. */ template static void test_ternary(isl::ctx ctx, const F &fn, const std::string &name, const std::vector &tests) { for (const auto &test : tests) { T obj(ctx, test.arg1); A1 arg1(ctx, test.arg2); A2 arg2(ctx, test.arg3); R expected(ctx, test.res); const auto &res = fn(obj, arg1, arg2); std::ostringstream ss; if (is_equal(expected, res)) continue; ss << name << "(" << test.arg1 << ", " << test.arg2 << ", " << test.arg3 << ") =\n" << res << "\n" << "expecting:\n" << expected; THROW_INVALID(ss.str().c_str()); } } /* Run a sequence of tests of function "fn" with stringification "name" and * with inputs and output described by "tests", * throwing an exception when an unexpected result is produced. * * Simply call test_ternary. */ template static void test(isl::ctx ctx, R fn(const T&, const A1&, const A2&), const std::string &name, const std::vector &tests) { test_ternary(ctx, fn, name, tests); } /* Run a sequence of tests of method "fn" with stringification "name" and * with inputs and output described by "tests", * throwing an exception when an unexpected result is produced. * * Wrap the method pointer into a function taking an object reference and * call test_ternary. */ template static void test(isl::ctx ctx, R (T::*fn)(A1, A2) const, const std::string &name, const std::vector &tests) { const auto &wrap = [&] (const T &o, const A1 &arg1, const A2 &arg2) { return (o.*fn)(arg1, arg2); }; test_ternary(ctx, wrap, name, tests); } /* A helper macro that calls test with as implicit initial argument "ctx" and * as extra argument a stringification of "FN". */ #define C(FN, ...) test(ctx, FN, #FN, __VA_ARGS__) /* Perform some basic isl::space tests. */ static void test_space(isl::ctx ctx) { C(&isl::space::domain, { { "{ A[] -> B[] }", "{ A[] }" }, { "{ A[C[] -> D[]] -> B[E[] -> F[]] }", "{ A[C[] -> D[]] }" }, }); C(&isl::space::range, { { "{ A[] -> B[] }", "{ B[] }" }, { "{ A[C[] -> D[]] -> B[E[] -> F[]] }", "{ B[E[] -> F[]] }" }, }); C(&isl::space::params, { { "{ A[] -> B[] }", "{ : }" }, { "{ A[C[] -> D[]] -> B[E[] -> F[]] }", "{ : }" }, }); } /* Is "fn" an expression defined over a single cell? */ static bool has_single_cell(const isl::pw_multi_aff &fn) { const auto &domain = fn.domain(); return fn.gist(domain).isa_multi_aff(); } /* Does the conversion of "obj" to an isl_pw_multi_aff * result in an expression defined over a single cell? */ template static bool has_single_cell_pma(const T &obj) { return has_single_cell(obj.as_pw_multi_aff()); } /* Perform some basic conversion tests. * * In particular, check that a map with an output dimension * that is equal to some integer division over a domain involving * a local variable without a known integer division expression or * to some linear combination of integer divisions * can be converted to a function expressed in the same way. * * Also, check that a nested modulo expression can be extracted * from a set or binary relation representation, or at least * that a conversion to a function does not result in multiple cells. */ static void test_conversion(isl::ctx ctx) { C(&isl::set::as_pw_multi_aff, { { "[N=0:] -> { [] }", "[N=0:] -> { [] }" }, }); C(&isl::multi_pw_aff::as_set, { { "[n] -> { [] : n >= 0 } ", "[n] -> { [] : n >= 0 } " }, }); C(&isl::map::as_pw_multi_aff, { { "{ [a] -> [a//2] : " "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }", "{ [a] -> [a//2] : " "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }" }, { "{ [a, b] -> [(2*floor((a)/8) + floor((b)/6))] }", "{ [a, b] -> [(2*floor((a)/8) + floor((b)/6))] }" }, }); C(&has_single_cell_pma, { { "[s=0:23] -> { A[(s//4)%3, s%4, s//12] }", true }, }); C(&has_single_cell_pma, { { "{ [a] -> [a//2] : " "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }", true }, { "{ [s=0:23, t] -> B[((s+1+2t)//4)%3, 2+(s+1+2t)%4, (s+1+2t)//12] }", true }, { "{ [a=0:31] -> [b=0:3, c] : 4c = 28 - a + b }", true }, }); } /* Perform some basic preimage tests. */ static void test_preimage(isl::ctx ctx) { C(arg(&isl::set::preimage), { { "{ B[i,j] : 0 <= i < 10 and 0 <= j < 100 }", "{ A[j,i] -> B[i,j] }", "{ A[j,i] : 0 <= i < 10 and 0 <= j < 100 }" }, { "{ rat: B[i,j] : 0 <= i, j and 3 i + 5 j <= 100 }", "{ A[a,b] -> B[a/2,b/6] }", "{ rat: A[a,b] : 0 <= a, b and 9 a + 5 b <= 600 }" }, { "{ B[i,j] : 0 <= i, j and 3 i + 5 j <= 100 }", "{ A[a,b] -> B[a/2,b/6] }", "{ A[a,b] : 0 <= a, b and 9 a + 5 b <= 600 and " "exists i,j : a = 2 i and b = 6 j }" }, { "[n] -> { S[i] : 0 <= i <= 100 }", "[n] -> { S[n] }", "[n] -> { : 0 <= n <= 100 }" }, { "{ B[i] : 0 <= i < 100 and exists a : i = 4 a }", "{ A[a] -> B[2a] }", "{ A[a] : 0 <= a < 50 and exists b : a = 2 b }" }, { "{ B[i] : 0 <= i < 100 and exists a : i = 4 a }", "{ A[a] -> B[([a/2])] }", "{ A[a] : 0 <= a < 200 and exists b : [a/2] = 4 b }" }, { "{ B[i,j,k] : 0 <= i,j,k <= 100 }", "{ A[a] -> B[a,a,a/3] }", "{ A[a] : 0 <= a <= 100 and exists b : a = 3 b }" }, { "{ B[i,j] : j = [(i)/2] } ", "{ A[i,j] -> B[i/3,j] }", "{ A[i,j] : j = [(i)/6] and exists a : i = 3 a }" }, }); C(arg(&isl::set::preimage), { { "{ B[i,j] : 0 <= i < 10 and 0 <= j < 100 }", "{ A[j,i] -> B[i,j] : false }", "{ A[j,i] : false }" }, }); C(arg(&isl::union_map::preimage_domain), { { "{ B[i,j] -> C[2i + 3j] : 0 <= i < 10 and 0 <= j < 100 }", "{ A[j,i] -> B[i,j] }", "{ A[j,i] -> C[2i + 3j] : 0 <= i < 10 and 0 <= j < 100 }" }, { "{ B[i] -> C[i]; D[i] -> E[i] }", "{ A[i] -> B[i + 1] }", "{ A[i] -> C[i + 1] }" }, { "{ B[i] -> C[i]; B[i] -> E[i] }", "{ A[i] -> B[i + 1] }", "{ A[i] -> C[i + 1]; A[i] -> E[i + 1] }" }, { "{ B[i] -> C[([i/2])] }", "{ A[i] -> B[2i] }", "{ A[i] -> C[i] }" }, { "{ B[i,j] -> C[([i/2]), ([(i+j)/3])] }", "{ A[i] -> B[([i/5]), ([i/7])] }", "{ A[i] -> C[([([i/5])/2]), ([(([i/5])+([i/7]))/3])] }" }, { "[N] -> { B[i] -> C[([N/2]), i, ([N/3])] }", "[N] -> { A[] -> B[([N/5])] }", "[N] -> { A[] -> C[([N/2]), ([N/5]), ([N/3])] }" }, { "{ B[i] -> C[i] : exists a : i = 5 a }", "{ A[i] -> B[2i] }", "{ A[i] -> C[2i] : exists a : 2i = 5 a }" }, { "{ B[i] -> C[i] : exists a : i = 2 a; " "B[i] -> D[i] : exists a : i = 2 a + 1 }", "{ A[i] -> B[2i] }", "{ A[i] -> C[2i] }" }, { "{ A[i] -> B[i] }", "{ C[i] -> A[(i + floor(i/3))/2] }", "{ C[i] -> B[j] : 2j = i + floor(i/3) }" }, }); C(arg(&isl::union_map::preimage_range), { { "[M] -> { A[a] -> B[a] }", "[M] -> { C[] -> B[floor(M/2)] }", "[M] -> { A[floor(M/2)] -> C[] }" }, }); } /* Perform some basic fixed power tests. */ static void test_fixed_power(isl::ctx ctx) { C(arg(&isl::map::fixed_power), { { "{ [i] -> [i + 1] }", "23", "{ [i] -> [i + 23] }" }, { "{ [a = 0:1, b = 0:15, c = 0:1, d = 0:1, 0] -> [a, b, c, d, 1]; " "[a = 0:1, b = 0:15, c = 0:1, 0, 1] -> [a, b, c, 1, 0]; " "[a = 0:1, b = 0:15, 0, 1, 1] -> [a, b, 1, 0, 0]; " "[a = 0:1, b = 0:14, 1, 1, 1] -> [a, 1 + b, 0, 0, 0]; " "[0, 15, 1, 1, 1] -> [1, 0, 0, 0, 0] }", "128", "{ [0, b = 0:15, c = 0:1, d = 0:1, e = 0:1] -> [1, b, c, d, e] }" }, }); } /* Perform basic simple fixed box hull tests. */ static void test_box_hull(isl::ctx ctx) { C(&isl::set::simple_fixed_box_hull, { { "{ S[x, y] : 0 <= x, y < 10 }", "{ offset: { S[0, 0] }, size: { S[10, 10] } }" }, { "[N] -> { S[x, y] : N <= x, y < N + 10 }", "{ offset: [N] -> { S[(N), (N)] }, size: { S[10, 10] } }" }, { "{ S[x, y] : 0 <= x + y, x - y < 10 }", "{ offset: { S[0, -4] }, size: { S[10, 9] } }" }, { "{ [i=0:10] : exists (e0, e1: 3e1 >= 1 + 2e0 and " "8e1 <= -1 + 5i - 5e0 and 2e1 >= 1 + 2i - 5e0) }", "{ offset: { [3] }, size: { [8] } }" }, { "[N] -> { [w = 0:17] : exists (e0: w < 2N and " "-1 + w <= e0 <= w and 2e0 >= N + w and w <= 2e0 <= 15 + w) }", "{ offset: [N] -> { [N] }, size: { [9] } }" }, { "[N] -> { [N//2:N//2+4] }", "{ offset: [N] -> { [N//2] }, size: { [5] } }" }, { "[N] -> { [N//2+N//3:N//2+N//3+4] }", "{ offset: [N] -> { [N//2+N//3] }, size: { [5] } }" }, { "[N] -> { [a=0:59, b=0:1] : 15N - a <= 60b <= 59 + 15N - a and " "-22 + 20b <= 20*floor((-1 + 15N - a)/60) < 20b and " "60*floor((-1 + 15N - a)/60) <= -46 + 15N - a }", "{ offset: [N] -> { [(15*((N) mod 4)), (floor((N)/4))] }, " "size: { [15, 1] } }" }, { "{ [i=-3:7] : i mod 4 = 0 }", "{ offset: { [(0)] }, size: { [5] } }" }, { "[N] -> { [i, N - 4i] : -14 + N <= 16i <= 1 + N }", "{ offset: [N] -> { [(floor((1 + N)/16)), " "(4 + N + 4*floor((-2 - N)/16))] }, " "size: { [1, 1] } }" }, }); C(&isl::map::range_simple_fixed_box_hull, { { "{ [N] -> [i, N - 4i] : -14 + N <= 16i <= 1 + N }", "{ offset: { [N] -> [(floor((1 + N)/16)), " "(4 + N + 4*floor((-2 - N)/16))] }, " "size: { [1, 1] } }" }, { "{ [N] -> [i, j] : 4j = N - i and -1 + 3N <= 4i <= 14 + 3N }", "{ offset: { [N] -> [(4 + N + 4*floor((-2 - N)/16)), " "(floor((1 + N)/16))] }, " "size: { [1, 1] } }" }, }); } /* Perform some coalescing tests. */ static void test_coalesce(isl::ctx ctx) { /* The following sequence can result in the same basic set * appearing multiple times in the coalesced set. * Check that the presence of such duplicates * does not cause internal errors. */ isl::set a(ctx, "[g, t] -> { [i] : " "(exists (e0 = floor((1 + g)/2): 2e0 = 1 + g and 0 < i <= -t)) " "or (exists (e0 = floor((1 + g)/2): i = 0 and 2e0 = 1 + g)) }"); a = a.coalesce(); isl::set b (ctx, "[g, t] -> { [i] : " "(exists (e0 = floor((g)/2): 2e0 = g and 0 < i <= -t)) or " "(exists (e0 = floor((g)/2): i = 0 and 2e0 = g)) }"); b.unite(a).unite(a).coalesce(); } /* Perform some basic intersection tests. */ static void test_intersect(isl::ctx ctx) { C(arg(&isl::basic_map::intersect_params), { { "[n] -> { A[x] -> B[y] }", "[n] -> { : n >= 0 }", "[n] -> { A[x] -> B[y] : n >= 0 }" }, }); C(&isl::union_map::intersect_domain_wrapped_domain, { { "{ [A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }", "{ A[0] }", "{ [A[0] -> B[y]] -> C[z] }" }, { "{ C[z] -> [A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }", "{ A[0] }", "{ }" }, { "{ T[A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }", "{ A[0] }", "{ T[A[0] -> B[y]] -> C[z] }" }, }); C(&isl::union_map::intersect_range_wrapped_domain, { { "{ [A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }", "{ A[0] }", "{ }" }, { "{ C[z] -> [A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }", "{ A[0] }", "{ C[z] -> [A[0] -> B[y]] }" }, { "{ C[z] -> T[A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }", "{ A[0] }", "{ C[z] -> T[A[0] -> B[y]] }" }, }); } /* Is the expression for the lexicographic minimum of "obj" * defined over a single cell? */ template static bool lexmin_has_single_cell(const T &obj) { return has_single_cell(obj.lexmin_pw_multi_aff()); } /* Perform some basic lexicographic minimization tests. */ static void test_lexmin(isl::ctx ctx) { C(&lexmin_has_single_cell, { /* The following two inputs represent the same binary relation, * the second with extra redundant constraints. * The lexicographic minimum of both should consist of a single cell. */ { "{ [a=0:11] -> [b] : -1 + b <= 2*floor((a)/6) <= b }", true }, { "{ [a=0:11] -> [b=0:3] : -1 + b <= 2*floor((a)/6) <= b }", true }, { "{ [a = 0:2, b = 0:1] -> [c = 0:9, d = (-a + b) mod 3] : " "10a + 5b - 3c <= 5d <= 12 + 10a + 5b - 3c }", true }, { "{ [a=0:71] -> [(a//3)%8] }", true }, { "{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }", true }, { "{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 20 }", false }, { "{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 22 }", true }, { "{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 21 }", true }, { "{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 20 }", false }, { "{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 22 }", true }, }); C(&isl::map::lexmin_pw_multi_aff, { /* The following two inputs represent the same binary relation, * the second with some redundant constraints removed. * The lexicographic minimum of both should consist of a single cell. */ { "{ [a=0:3] -> [b=a//2] : 0 <= b <= 1 }", "{ [a=0:3] -> [(floor((a)/2))] }" }, { "{ [a] -> [b=a//2] : 0 <= b <= 1 }", "{ [a=0:3] -> [(floor((a)/2))] }" }, { "{ [a = 0:2, b = 0:1] -> [c = 0:9, d = (-a + b) mod 3] : " "10a + 5b - 3c <= 5d <= 12 + 10a + 5b - 3c }", "{ [a = 0:2, b = 0:1] -> [5*(2a + b)//3, (2a + b) mod 3] }" }, { "{ [a=0:71] -> [(a//3)%8] }", "{ [a=0:71] -> [(a//3)%8] }" }, { "{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }", "{ [a=0:71] -> [(a//3)%8] }" }, { "{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 22 }", "{ [a=0:71] -> [(a//3)%8] : a % 3 > 0 }" }, { "{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 21 }", "{ [a=0:71] -> [(-7 + (-1 - floor((a)/3)) mod 8)] }" }, }); C(&isl::set::lexmin_pw_multi_aff, { { "[a] -> { [b=a//2] : 0 <= b <= 1 }", "[a=0:3] -> { [(floor((a)/2))] }" }, { "[a=0:71] -> { [(a//3)%8] }", "[a=0:71] -> { [(a//3)%8] }" }, { "[a=0:71] -> { [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }", "[a=0:71] -> { [(a//3)%8] }" }, }); } /* Compute the gist of "obj" with respect to "context", * with "copy" an independent copy of "obj", * but also check that applying the gist operation does * not modify the input set (an earlier version of isl would do that) and * that the test case is consistent, i.e., that the gist has the same * intersection with the context as the input set. */ template T gist(const T &obj, const T ©, const T &context) { const auto &res = obj.gist(context); if (!is_equal(obj, copy)) { std::ostringstream ss; ss << "gist changed " << copy << " into " << obj; THROW_INVALID(ss.str().c_str()); } if (!is_equal(obj.intersect(context), res.intersect(context))) { std::ostringstream ss; ss << "inconsistent " << obj << " % " << context << " = " << res; THROW_INVALID(ss.str().c_str()); } return res; } /* A helper macro for producing two instances of "x". */ #define TWO(x) (x), (x) /* Perform some basic gist tests. * * The gist() function is given two identical inputs so that * it can check that the input to the call to the gist method * is not modified. */ static void test_gist(isl::ctx ctx) { C(&gist , { { TWO("{ [i=100:] }"), "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }", "{ [i=100:] }" }, { TWO("{ [i=0:] }"), "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }", "{ [i] }" }, { TWO("{ [i] : exists (e0, e1: 3e1 >= 1 + 2e0 and " "8e1 <= -1 + 5i - 5e0 and 2e1 >= 1 + 2i - 5e0) }"), "{ [i] : i >= 0 }", "{ [i] : exists (e0, e1: 3e1 >= 1 + 2e0 and " "8e1 <= -1 + 5i - 5e0 and 2e1 >= 1 + 2i - 5e0) }" }, { TWO("{ [i=0:10] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }"), "{ [i=0:10] }", "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }" }, }); C(&gist , { { TWO("{ [1, -1, 3] }"), "{ [1, b, 2 - b] : -1 <= b <= 2 }", "{ [a, -1, c] }" }, { TWO("{ [a, b, c] : a <= 15 and a >= 1 }"), "{ [a, b, c] : exists (e0 = floor((-1 + a)/16): a >= 1 and " "c <= 30 and 32e0 >= -62 + 2a + 2b - c and b >= 0) }", "{ [a, b, c] : a <= 15 }" }, { TWO("{ : }"), "{ : 1 = 0 }", "{ : }" }, { TWO("{ : 1 = 0 }"), "{ : 1 = 0 }", "{ : }" }, { TWO("[M] -> { [x] : exists (e0 = floor((-2 + x)/3): 3e0 = -2 + x) }"), "[M] -> { [3M] }" , "[M] -> { [x] : 1 = 0 }" }, { TWO("{ [m, n, a, b] : a <= 2147 + n }"), "{ [m, n, a, b] : (m >= 1 and n >= 1 and a <= 2148 - m and " "b <= 2148 - n and b >= 0 and b >= 2149 - n - a) or " "(n >= 1 and a >= 0 and b <= 2148 - n - a and " "b >= 0) }", "{ [m, n, ku, kl] }" }, { TWO("{ [a, a, b] : a >= 10 }"), "{ [a, b, c] : c >= a and c <= b and c >= 2 }", "{ [a, a, b] : a >= 10 }" }, { TWO("{ [i, j] : i >= 0 and i + j >= 0 }"), "{ [i, j] : i <= 0 }", "{ [0, j] : j >= 0 }" }, /* Check that no constraints on i6 are introduced in the gist */ { TWO("[t1] -> { [i4, i6] : exists (e0 = floor((1530 - 4t1 - 5i4)/20): " "20e0 <= 1530 - 4t1 - 5i4 and 20e0 >= 1511 - 4t1 - 5i4 and " "5e0 <= 381 - t1 and i4 <= 1) }"), "[t1] -> { [i4, i6] : exists (e0 = floor((-t1 + i6)/5): " "5e0 = -t1 + i6 and i6 <= 6 and i6 >= 3) }", "[t1] -> { [i4, i6] : exists (e0 = floor((1530 - 4t1 - 5i4)/20): " "i4 <= 1 and 5e0 <= 381 - t1 and 20e0 <= 1530 - 4t1 - 5i4 and " "20e0 >= 1511 - 4t1 - 5i4) }" }, /* Check that no constraints on i6 are introduced in the gist */ { TWO("[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((1 + i4)/2), " "e1 = floor((1530 - 4t1 - 5i4)/20), " "e2 = floor((-4t1 - 5i4 + 10*floor((1 + i4)/2))/20), " "e3 = floor((-1 + i4)/2): t2 = 0 and 2e3 = -1 + i4 and " "20e2 >= -19 - 4t1 - 5i4 + 10e0 and 5e2 <= 1 - t1 and " "2e0 <= 1 + i4 and 2e0 >= i4 and " "20e1 <= 1530 - 4t1 - 5i4 and " "20e1 >= 1511 - 4t1 - 5i4 and i4 <= 1 and " "5e1 <= 381 - t1 and 20e2 <= -4t1 - 5i4 + 10e0) }"), "[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((-17 + i4)/2), " "e1 = floor((-t1 + i6)/5): 5e1 = -t1 + i6 and " "2e0 <= -17 + i4 and 2e0 >= -18 + i4 and " "10e0 <= -91 + 5i4 + 4i6 and " "10e0 >= -105 + 5i4 + 4i6) }", "[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((381 - t1)/5), " "e1 = floor((-1 + i4)/2): t2 = 0 and 2e1 = -1 + i4 and " "i4 <= 1 and 5e0 <= 381 - t1 and 20e0 >= 1511 - 4t1 - 5i4) }" }, { TWO("{ [0, 0, q, p] : -5 <= q <= 5 and p >= 0 }"), "{ [a, b, q, p] : b >= 1 + a }", "{ [a, b, q, p] : false }" }, { TWO("[n] -> { [x] : x = n && x mod 32 = 0 }"), "[n] -> { [x] : x mod 32 = 0 }", "[n] -> { [x = n] }" }, { TWO("{ [x] : x mod 6 = 0 }"), "{ [x] : x mod 3 = 0 }", "{ [x] : x mod 2 = 0 }" }, { TWO("{ [x] : x mod 3200 = 0 }"), "{ [x] : x mod 10000 = 0 }", "{ [x] : x mod 128 = 0 }" }, { TWO("{ [x] : x mod 3200 = 0 }"), "{ [x] : x mod 10 = 0 }", "{ [x] : x mod 3200 = 0 }" }, { TWO("{ [a, b, c] : a mod 2 = 0 and a = c }"), "{ [a, b, c] : b mod 2 = 0 and b = c }", "{ [a, b, c = a] }" }, { TWO("{ [a, b, c] : a mod 6 = 0 and a = c }"), "{ [a, b, c] : b mod 2 = 0 and b = c }", "{ [a, b, c = a] : a mod 3 = 0 }" }, { TWO("{ [x] : 0 <= x <= 4 or 6 <= x <= 9 }"), "{ [x] : 1 <= x <= 3 or 7 <= x <= 8 }", "{ [x] }" }, { TWO("{ [x,y] : x < 0 and 0 <= y <= 4 or " "x >= -2 and -x <= y <= 10 + x }"), "{ [x,y] : 1 <= y <= 3 }", "{ [x,y] }" }, }); C(arg(&isl::pw_aff::gist), { { "{ [x] -> [x] : x != 0 }", "{ [x] : x < -1 or x > 1 }", "{ [x] -> [x] }" }, }); C(&isl::pw_aff::gist_params, { { "[N] -> { D[x] -> [x] : N >= 0; D[x] -> [0] : N < 0 }", "[N] -> { : N >= 0 }", "[N] -> { D[x] -> [x] }" }, }); C(arg(&isl::multi_aff::gist), { { "{ A[i] -> B[i, i] }", "{ A[0] }", "{ A[i] -> B[0, 0] }" }, { "[N] -> { A[i] -> B[i, N] }", "[N] -> { A[0] : N = 5 }", "[N] -> { A[i] -> B[0, 5] }" }, { "[N] -> { B[N + 1, N] }", "[N] -> { : N = 5 }", "[N] -> { B[6, 5] }" }, { "[N] -> { A[i] -> B[] }", "[N] -> { A[0] : N = 5 }", "[N] -> { A[i] -> B[] }" }, { "[N] -> { B[] }", "[N] -> { : N = 5 }", "[N] -> { B[] }" }, }); C(&isl::multi_aff::gist_params, { { "[N] -> { A[i] -> B[i, N] }", "[N] -> { : N = 5 }", "[N] -> { A[i] -> B[i, 5] }" }, { "[N] -> { B[N + 1, N] }", "[N] -> { : N = 5 }", "[N] -> { B[6, 5] }" }, { "[N] -> { A[i] -> B[] }", "[N] -> { : N = 5 }", "[N] -> { A[i] -> B[] }" }, { "[N] -> { B[] }", "[N] -> { : N = 5 }", "[N] -> { B[] }" }, }); C(arg(&isl::multi_pw_aff::gist), { { "{ A[i] -> B[i, i] : i >= 0 }", "{ A[0] }", "{ A[i] -> B[0, 0] }" }, { "[N] -> { A[i] -> B[i, N] : N >= 0 }", "[N] -> { A[0] : N = 5 }", "[N] -> { A[i] -> B[0, 5] }" }, { "[N] -> { B[N + 1, N] }", "[N] -> { : N = 5 }", "[N] -> { B[6, 5] }" }, { "[N] -> { A[i] -> B[] }", "[N] -> { A[0] : N = 5 }", "[N] -> { A[i] -> B[] }" }, { "[N] -> { B[] }", "[N] -> { : N = 5 }", "[N] -> { B[] }" }, { "{ A[i=0:10] -> B[i] }", "{ A[5] }", "{ A[i] -> B[5] }" }, { "{ A[0:10] -> B[] }", "{ A[0:10] }", "{ A[i] -> B[] }" }, { "[N] -> { A[i] -> B[] : N >= 0 }", "[N] -> { A[0] : N = 5 }", "[N] -> { A[i] -> B[] }" }, { "[N] -> { B[] : N >= 0 }", "[N] -> { : N = 5 }", "[N] -> { B[] }" }, { "[N] -> { B[] : N = 5 }", "[N] -> { : N >= 0 }", "[N] -> { B[] : N = 5 }" }, }); C(&isl::multi_pw_aff::gist_params, { { "[N] -> { A[i] -> B[i, N] : N >= 0 }", "[N] -> { : N = 5 }", "[N] -> { A[i] -> B[i, 5] }" }, { "[N] -> { B[N + 1, N] }", "[N] -> { : N = 5 }", "[N] -> { B[6, 5] }" }, { "[N] -> { A[i] -> B[] : N >= 0 }", "[N] -> { : N = 5 }", "[N] -> { A[i] -> B[] }" }, { "[N] -> { B[] : N >= 0 }", "[N] -> { : N = 5 }", "[N] -> { B[] }" }, { "[N] -> { B[] : N >= 5 }", "[N] -> { : N >= 0 }", "[N] -> { B[] : N >= 5 }" }, }); C(&isl::multi_union_pw_aff::gist, { { "C[{ B[i,i] -> [3i] }]", "{ B[i,i] }", "C[{ B[i,j] -> [3i] }]" }, { "(C[] : { B[i,i] })", "{ B[i,i] }", "(C[] : { B[i,j] })" }, { "[N] -> (C[] : { B[N,N] })", "[N] -> { B[N,N] }", "[N] -> (C[] : { B[i,j] })" }, { "C[]", "{ B[i,i] }", "C[]" }, { "[N] -> (C[] : { B[i,i] : N >= 0 })", "{ B[i,i] }", "[N] -> (C[] : { B[i,j] : N >= 0 })" }, { "[N] -> (C[] : { : N >= 0 })", "{ B[i,i] }", "[N] -> (C[] : { : N >= 0 })" }, { "[N] -> (C[] : { : N >= 0 })", "[N] -> { B[i,i] : N >= 0 }", "[N] -> C[]" }, }); C(&isl::multi_union_pw_aff::gist_params, { { "[N] -> C[{ B[i,i] -> [3i + N] }]", "[N] -> { : N = 1 }", "[N] -> C[{ B[i,i] -> [3i + 1] }]" }, { "C[{ B[i,i] -> [3i] }]", "[N] -> { : N >= 0 }", "[N] -> C[{ B[i,i] -> [3i] }]" }, { "[N] -> C[{ B[i,i] -> [3i] : N >= 0 }]", "[N] -> { : N >= 0 }", "[N] -> C[{ B[i,i] -> [3i] }]" }, { "[N] -> C[{ B[i,i] -> [3i] : N >= 1 }]", "[N] -> { : N >= 0 }", "[N] -> C[{ B[i,i] -> [3i] : N >= 1 }]" }, { "[N] -> (C[] : { B[i,i] : N >= 0 })", "[N] -> { : N >= 0 }", "[N] -> (C[] : { B[i,i] })" }, { "[N] -> (C[] : { : N >= 0 })", "[N] -> { : N >= 0 }", "[N] -> C[]" }, { "C[{ B[i,i] -> [3i] }]", "[N] -> { : N >= 0 }", "[N] -> C[{ B[i,i] -> [3i] }]" }, }); } /* Perform tests that project out parameters. */ static void test_project(isl::ctx ctx) { C(arg(&isl::union_map::project_out_param), { { "[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }", "N", "{ D[i] -> A[0:]; D[i] -> B[i] }" }, { "[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }", "M", "[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }" }, }); C(arg(&isl::union_map::project_out_param), { { "[M, N, O] -> { D[i] -> A[j] : i <= j < M, N, O }", "(M, N)", "[O] -> { D[i] -> A[j] : i <= j < O }" }, }); } /* Perform some basic reverse tests. */ static void test_reverse(isl::ctx ctx) { C(&isl::aff::domain_reverse, { { "{ T[A[] -> B[*]] -> [0] }", "{ [B[*] -> A[]] -> [0] }" }, { "{ T[A[] -> A[]] -> [0] }", "{ T[A[] -> A[]] -> [0] }" }, { "{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }", "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" }, }); C(&isl::multi_aff::domain_reverse, { { "{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }", "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" }, { "{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3), 0] }", "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3), 0] }" }, }); C(&isl::set::wrapped_reverse, { { "{ T[A[] -> B[*]] }", "{ [B[*] -> A[]] }" }, { "{ T[A[] -> A[]] }", "{ T[A[] -> A[]] }" }, { "{ [A[x] -> B[2x]] }", "{ [B[y] -> A[x]] : y = 2x }" }, }); C(&isl::pw_aff::domain_reverse, { { "{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }", "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" }, { "{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] : x > y }", "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] : x > y }" }, { "{ [A[i] -> B[i + 1]] -> [i + 2] }", "{ [B[i] -> A[i - 1]] -> [i + 1] }" }, }); C(&isl::pw_multi_aff::domain_reverse, { { "{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3), 0] : x > y }", "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3), 0] : x > y }" }, { "{ [A[i] -> B[i + 1]] -> T[0, i + 2] }", "{ [B[i] -> A[i - 1]] -> T[0, i + 1] }" }, }); C(&isl::multi_pw_aff::domain_reverse, { { "{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3) : x > y, 0] }", "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3) : x > y, 0] }" }, }); C(&isl::map::domain_reverse, { { "{ [A[] -> B[]] -> [C[] -> D[]] }", "{ [B[] -> A[]] -> [C[] -> D[]] }" }, { "{ N[B[] -> C[]] -> A[] }", "{ [C[] -> B[]] -> A[] }" }, { "{ N[B[x] -> B[y]] -> A[] }", "{ N[B[*] -> B[*]] -> A[] }" }, }); C(&isl::union_map::domain_reverse, { { "{ [A[] -> B[]] -> [C[] -> D[]] }", "{ [B[] -> A[]] -> [C[] -> D[]] }" }, { "{ A[] -> [B[] -> C[]]; A[] -> B[]; A[0] -> N[B[1] -> B[2]] }", "{ }" }, { "{ N[B[] -> C[]] -> A[] }", "{ [C[] -> B[]] -> A[] }" }, { "{ N[B[x] -> B[y]] -> A[] }", "{ N[B[*] -> B[*]] -> A[] }" }, }); C(&isl::union_map::range_reverse, { { "{ A[] -> [B[] -> C[]]; A[] -> B[]; A[0] -> N[B[1] -> B[2]] }", "{ A[] -> [C[] -> B[]]; A[0] -> N[B[2] -> B[1]] }" }, { "{ A[] -> N[B[] -> C[]] }", "{ A[] -> [C[] -> B[]] }" }, { "{ A[] -> N[B[x] -> B[y]] }", "{ A[] -> N[B[*] -> B[*]] }" }, }); } /* Perform some basic scaling tests. */ static void test_scale(isl::ctx ctx) { C(arg(&isl::pw_multi_aff::scale), { { "{ A[a] -> B[a, a + 1, a - 1] : a >= 0 }", "{ B[2, 7, 0] }", "{ A[a] -> B[2a, 7a + 7, 0] : a >= 0 }" }, }); C(arg(&isl::pw_multi_aff::scale), { { "{ A[a] -> B[1, a - 1] : a >= 0 }", "{ B[1/2, 7] }", "{ A[a] -> B[1/2, 7a - 7] : a >= 0 }" }, }); C(arg(&isl::pw_multi_aff::scale_down), { { "{ A[a] -> B[a, a + 1] : a >= 0 }", "{ B[2, 7] }", "{ A[a] -> B[a/2, (a + 1)/7] : a >= 0 }" }, }); C(arg(&isl::pw_multi_aff::scale_down), { { "{ A[a] -> B[a, a - 1] : a >= 0 }", "{ B[2, 1/7] }", "{ A[a] -> B[a/2, 7a - 7] : a >= 0 }" }, }); } /* Perform some basic isl::id_to_id tests. */ static void test_id_to_id(isl::ctx ctx) { C((arg(&isl::id_to_id::set)), { { "{ }", "a", "b", "{ a: b }" }, { "{ a: b }", "a", "b", "{ a: b }" }, { "{ a: c }", "a", "b", "{ a: b }" }, { "{ a: b }", "b", "a", "{ a: b, b: a }" }, { "{ a: b }", "b", "a", "{ b: a, a: b }" }, }); } /* Perform some basic isl::id_set tests. */ static void test_id_set(isl::ctx ctx) { C(&isl::id_set::is_equal, { { "{ }", "{ }", true }, { "{ }", "{ a }", false }, { "{ a }", "{ }", false }, { "{ a, b }", "{ b, a }", true }, { "{ a, b }", "{ a }", false }, { "{ a, b }", "{ b }", false }, { "{ a, b }", "{ a, c }", false }, }); C((arg(&isl::id_set::insert)), { { "{ }", "a", "{ a }" }, { "{ a }", "a", "{ a }" }, { "{ a, c }", "a", "{ a, c }" }, { "{ b }", "a", "{ a, b }" }, }); C((arg(&isl::id_set::drop)), { { "{ }", "a", "{ }" }, { "{ a }", "a", "{ }" }, { "{ b }", "a", "{ b }" }, { "{ a, b }", "a", "{ b }" }, }); } /* The list of tests to perform. */ static std::vector> tests = { { "space", &test_space }, { "conversion", &test_conversion }, { "preimage", &test_preimage }, { "fixed power", &test_fixed_power }, { "box hull", &test_box_hull }, { "coalesce", &test_coalesce }, { "intersect", &test_intersect }, { "lexmin", &test_lexmin }, { "gist", &test_gist }, { "project out parameters", &test_project }, { "reverse", &test_reverse }, { "scale", &test_scale }, { "id-to-id", &test_id_to_id }, { "id-set", &test_id_set }, }; /* Perform some basic checks by means of the C++ bindings. */ int main(int argc, char **argv) { int ret = EXIT_SUCCESS; struct isl_ctx *ctx; struct isl_options *options; options = isl_options_new_with_defaults(); assert(options); argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL); ctx = isl_ctx_alloc_with_options(&isl_options_args, options); try { for (const auto &f : tests) { std::cout << f.first << "\n"; f.second(ctx); } } catch (const isl::exception &e) { std::cerr << e.what() << "\n"; ret = EXIT_FAILURE; } isl_ctx_free(ctx); return ret; } isl-0.28/isl_affine_hull.c0000664000175000017500000010317315072740040014615 0ustar00skimoskimo/* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2012 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include #include #include #include #include #include #include "isl_equalities.h" #include "isl_sample.h" #include "isl_tab.h" #include #include #include #include #include #include __isl_give isl_basic_map *isl_basic_map_implicit_equalities( __isl_take isl_basic_map *bmap) { struct isl_tab *tab; if (!bmap) return bmap; bmap = isl_basic_map_gauss(bmap, NULL); if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) return bmap; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_NO_IMPLICIT)) return bmap; if (bmap->n_ineq <= 1) return bmap; tab = isl_tab_from_basic_map(bmap, 0); if (isl_tab_detect_implicit_equalities(tab) < 0) goto error; bmap = isl_basic_map_update_from_tab(bmap, tab); isl_tab_free(tab); bmap = isl_basic_map_gauss(bmap, NULL); ISL_F_SET(bmap, ISL_BASIC_MAP_NO_IMPLICIT); return bmap; error: isl_tab_free(tab); isl_basic_map_free(bmap); return NULL; } __isl_give isl_basic_set *isl_basic_set_implicit_equalities( __isl_take isl_basic_set *bset) { return bset_from_bmap( isl_basic_map_implicit_equalities(bset_to_bmap(bset))); } /* Make eq[row][col] of both bmaps equal so we can add the row * add the column to the common matrix. * Note that because of the echelon form, the columns of row row * after column col are zero. */ static void set_common_multiple( struct isl_basic_set *bset1, struct isl_basic_set *bset2, unsigned row, unsigned col) { isl_int m, c; if (isl_int_eq(bset1->eq[row][col], bset2->eq[row][col])) return; isl_int_init(c); isl_int_init(m); isl_int_lcm(m, bset1->eq[row][col], bset2->eq[row][col]); isl_int_divexact(c, m, bset1->eq[row][col]); isl_seq_scale(bset1->eq[row], bset1->eq[row], c, col+1); isl_int_divexact(c, m, bset2->eq[row][col]); isl_seq_scale(bset2->eq[row], bset2->eq[row], c, col+1); isl_int_clear(c); isl_int_clear(m); } /* Delete a given equality, moving all the following equalities one up. */ static void delete_row(__isl_keep isl_basic_set *bset, unsigned row) { isl_int *t; int r; t = bset->eq[row]; bset->n_eq--; for (r = row; r < bset->n_eq; ++r) bset->eq[r] = bset->eq[r+1]; bset->eq[bset->n_eq] = t; } /* Make first row entries in column col of bset1 identical to * those of bset2, using the fact that entry bset1->eq[row][col]=a * is non-zero. Initially, these elements of bset1 are all zero. * For each row i < row, we set * A[i] = a * A[i] + B[i][col] * A[row] * B[i] = a * B[i] * so that * A[i][col] = B[i][col] = a * old(B[i][col]) */ static isl_stat construct_column( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2, unsigned row, unsigned col) { int r; isl_int a; isl_int b; isl_size total; total = isl_basic_set_dim(bset1, isl_dim_set); if (total < 0) return isl_stat_error; isl_int_init(a); isl_int_init(b); for (r = 0; r < row; ++r) { if (isl_int_is_zero(bset2->eq[r][col])) continue; isl_int_gcd(b, bset2->eq[r][col], bset1->eq[row][col]); isl_int_divexact(a, bset1->eq[row][col], b); isl_int_divexact(b, bset2->eq[r][col], b); isl_seq_combine(bset1->eq[r], a, bset1->eq[r], b, bset1->eq[row], 1 + total); isl_seq_scale(bset2->eq[r], bset2->eq[r], a, 1 + total); } isl_int_clear(a); isl_int_clear(b); delete_row(bset1, row); return isl_stat_ok; } /* Make first row entries in column col of bset1 identical to * those of bset2, using only these entries of the two matrices. * Let t be the last row with different entries. * For each row i < t, we set * A[i] = (A[t][col]-B[t][col]) * A[i] + (B[i][col]-A[i][col) * A[t] * B[i] = (A[t][col]-B[t][col]) * B[i] + (B[i][col]-A[i][col) * B[t] * so that * A[i][col] = B[i][col] = old(A[t][col]*B[i][col]-A[i][col]*B[t][col]) */ static isl_bool transform_column( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2, unsigned row, unsigned col) { int i, t; isl_int a, b, g; isl_size total; for (t = row-1; t >= 0; --t) if (isl_int_ne(bset1->eq[t][col], bset2->eq[t][col])) break; if (t < 0) return isl_bool_false; total = isl_basic_set_dim(bset1, isl_dim_set); if (total < 0) return isl_bool_error; isl_int_init(a); isl_int_init(b); isl_int_init(g); isl_int_sub(b, bset1->eq[t][col], bset2->eq[t][col]); for (i = 0; i < t; ++i) { isl_int_sub(a, bset2->eq[i][col], bset1->eq[i][col]); isl_int_gcd(g, a, b); isl_int_divexact(a, a, g); isl_int_divexact(g, b, g); isl_seq_combine(bset1->eq[i], g, bset1->eq[i], a, bset1->eq[t], 1 + total); isl_seq_combine(bset2->eq[i], g, bset2->eq[i], a, bset2->eq[t], 1 + total); } isl_int_clear(a); isl_int_clear(b); isl_int_clear(g); delete_row(bset1, t); delete_row(bset2, t); return isl_bool_true; } /* The implementation is based on Section 5.2 of Michael Karr, * "Affine Relationships Among Variables of a Program", * except that the echelon form we use starts from the last column * and that we are dealing with integer coefficients. */ static __isl_give isl_basic_set *affine_hull( __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { isl_size dim; unsigned total; int col; int row; dim = isl_basic_set_dim(bset1, isl_dim_set); if (dim < 0 || !bset2) goto error; total = 1 + dim; row = 0; for (col = total-1; col >= 0; --col) { int is_zero1 = row >= bset1->n_eq || isl_int_is_zero(bset1->eq[row][col]); int is_zero2 = row >= bset2->n_eq || isl_int_is_zero(bset2->eq[row][col]); if (!is_zero1 && !is_zero2) { set_common_multiple(bset1, bset2, row, col); ++row; } else if (!is_zero1 && is_zero2) { if (construct_column(bset1, bset2, row, col) < 0) goto error; } else if (is_zero1 && !is_zero2) { if (construct_column(bset2, bset1, row, col) < 0) goto error; } else { isl_bool transform; transform = transform_column(bset1, bset2, row, col); if (transform < 0) goto error; if (transform) --row; } } isl_assert(bset1->ctx, row == bset1->n_eq, goto error); isl_basic_set_free(bset2); bset1 = isl_basic_set_normalize_constraints(bset1); return bset1; error: isl_basic_set_free(bset1); isl_basic_set_free(bset2); return NULL; } /* Find an integer point in the set represented by "tab" * that lies outside of the equality "eq" e(x) = 0. * If "up" is true, look for a point satisfying e(x) - 1 >= 0. * Otherwise, look for a point satisfying -e(x) - 1 >= 0 (i.e., e(x) <= -1). * The point, if found, is returned. * If no point can be found, a zero-length vector is returned. * * Before solving an ILP problem, we first check if simply * adding the normal of the constraint to one of the known * integer points in the basic set represented by "tab" * yields another point inside the basic set. * * The caller of this function ensures that the tableau is bounded or * that tab->basis and tab->n_unbounded have been set appropriately. */ static __isl_give isl_vec *outside_point(struct isl_tab *tab, isl_int *eq, int up) { struct isl_ctx *ctx; struct isl_vec *sample = NULL; struct isl_tab_undo *snap; unsigned dim; if (!tab) return NULL; ctx = tab->mat->ctx; dim = tab->n_var; sample = isl_vec_alloc(ctx, 1 + dim); if (!sample) return NULL; isl_int_set_si(sample->el[0], 1); isl_seq_combine(sample->el + 1, ctx->one, tab->bmap->sample->el + 1, up ? ctx->one : ctx->negone, eq + 1, dim); if (isl_basic_map_contains(tab->bmap, sample)) return sample; isl_vec_free(sample); sample = NULL; snap = isl_tab_snap(tab); if (!up) isl_seq_neg(eq, eq, 1 + dim); isl_int_sub_ui(eq[0], eq[0], 1); if (isl_tab_extend_cons(tab, 1) < 0) goto error; if (isl_tab_add_ineq(tab, eq) < 0) goto error; sample = isl_tab_sample(tab); isl_int_add_ui(eq[0], eq[0], 1); if (!up) isl_seq_neg(eq, eq, 1 + dim); if (sample && isl_tab_rollback(tab, snap) < 0) goto error; return sample; error: isl_vec_free(sample); return NULL; } __isl_give isl_basic_set *isl_basic_set_recession_cone( __isl_take isl_basic_set *bset) { int i; isl_bool empty; empty = isl_basic_set_plain_is_empty(bset); if (empty < 0) return isl_basic_set_free(bset); if (empty) return bset; bset = isl_basic_set_cow(bset); if (isl_basic_set_check_no_locals(bset) < 0) return isl_basic_set_free(bset); for (i = 0; i < bset->n_eq; ++i) isl_int_set_si(bset->eq[i][0], 0); for (i = 0; i < bset->n_ineq; ++i) isl_int_set_si(bset->ineq[i][0], 0); ISL_F_CLR(bset, ISL_BASIC_SET_NO_IMPLICIT); return isl_basic_set_implicit_equalities(bset); } /* Move "sample" to a point that is one up (or down) from the original * point in dimension "pos". */ static void adjacent_point(__isl_keep isl_vec *sample, int pos, int up) { if (up) isl_int_add_ui(sample->el[1 + pos], sample->el[1 + pos], 1); else isl_int_sub_ui(sample->el[1 + pos], sample->el[1 + pos], 1); } /* Check if any points that are adjacent to "sample" also belong to "bset". * If so, add them to "hull" and return the updated hull. * * Before checking whether and adjacent point belongs to "bset", we first * check whether it already belongs to "hull" as this test is typically * much cheaper. */ static __isl_give isl_basic_set *add_adjacent_points( __isl_take isl_basic_set *hull, __isl_take isl_vec *sample, __isl_keep isl_basic_set *bset) { int i, up; isl_size dim; dim = isl_basic_set_dim(hull, isl_dim_set); if (!sample || dim < 0) goto error; for (i = 0; i < dim; ++i) { for (up = 0; up <= 1; ++up) { int contains; isl_basic_set *point; adjacent_point(sample, i, up); contains = isl_basic_set_contains(hull, sample); if (contains < 0) goto error; if (contains) { adjacent_point(sample, i, !up); continue; } contains = isl_basic_set_contains(bset, sample); if (contains < 0) goto error; if (contains) { point = isl_basic_set_from_vec( isl_vec_copy(sample)); hull = affine_hull(hull, point); } adjacent_point(sample, i, !up); if (contains) break; } } isl_vec_free(sample); return hull; error: isl_vec_free(sample); isl_basic_set_free(hull); return NULL; } /* Extend an initial (under-)approximation of the affine hull of basic * set represented by the tableau "tab" * by looking for points that do not satisfy one of the equalities * in the current approximation and adding them to that approximation * until no such points can be found any more. * * The caller of this function ensures that "tab" is bounded or * that tab->basis and tab->n_unbounded have been set appropriately. * * "bset" may be either NULL or the basic set represented by "tab". * If "bset" is not NULL, we check for any point we find if any * of its adjacent points also belong to "bset". */ static __isl_give isl_basic_set *extend_affine_hull(struct isl_tab *tab, __isl_take isl_basic_set *hull, __isl_keep isl_basic_set *bset) { int i, j; unsigned dim; if (!tab || !hull) goto error; dim = tab->n_var; if (isl_tab_extend_cons(tab, 2 * dim + 1) < 0) goto error; for (i = 0; i < dim; ++i) { struct isl_vec *sample; struct isl_basic_set *point; for (j = 0; j < hull->n_eq; ++j) { sample = outside_point(tab, hull->eq[j], 1); if (!sample) goto error; if (sample->size > 0) break; isl_vec_free(sample); sample = outside_point(tab, hull->eq[j], 0); if (!sample) goto error; if (sample->size > 0) break; isl_vec_free(sample); if (isl_tab_add_eq(tab, hull->eq[j]) < 0) goto error; } if (j == hull->n_eq) break; if (tab->samples && isl_tab_add_sample(tab, isl_vec_copy(sample)) < 0) hull = isl_basic_set_free(hull); if (bset) hull = add_adjacent_points(hull, isl_vec_copy(sample), bset); point = isl_basic_set_from_vec(sample); hull = affine_hull(hull, point); if (!hull) return NULL; } return hull; error: isl_basic_set_free(hull); return NULL; } /* Construct an initial underapproximation of the hull of "bset" * from "sample" and any of its adjacent points that also belong to "bset". */ static __isl_give isl_basic_set *initialize_hull(__isl_keep isl_basic_set *bset, __isl_take isl_vec *sample) { isl_basic_set *hull; hull = isl_basic_set_from_vec(isl_vec_copy(sample)); hull = add_adjacent_points(hull, sample, bset); return hull; } /* Look for all equalities satisfied by the integer points in bset, * which is assumed to be bounded. * * The equalities are obtained by successively looking for * a point that is affinely independent of the points found so far. * In particular, for each equality satisfied by the points so far, * we check if there is any point on a hyperplane parallel to the * corresponding hyperplane shifted by at least one (in either direction). */ static __isl_give isl_basic_set *uset_affine_hull_bounded( __isl_take isl_basic_set *bset) { struct isl_vec *sample = NULL; struct isl_basic_set *hull; struct isl_tab *tab = NULL; isl_size dim; if (isl_basic_set_plain_is_empty(bset)) return bset; dim = isl_basic_set_dim(bset, isl_dim_set); if (dim < 0) return isl_basic_set_free(bset); if (bset->sample && bset->sample->size == 1 + dim) { int contains = isl_basic_set_contains(bset, bset->sample); if (contains < 0) goto error; if (contains) { if (dim == 0) return bset; sample = isl_vec_copy(bset->sample); } else { isl_vec_free(bset->sample); bset->sample = NULL; } } tab = isl_tab_from_basic_set(bset, 1); if (!tab) goto error; if (tab->empty) { isl_tab_free(tab); isl_vec_free(sample); return isl_basic_set_set_to_empty(bset); } if (!sample) { struct isl_tab_undo *snap; snap = isl_tab_snap(tab); sample = isl_tab_sample(tab); if (isl_tab_rollback(tab, snap) < 0) goto error; isl_vec_free(tab->bmap->sample); tab->bmap->sample = isl_vec_copy(sample); } if (!sample) goto error; if (sample->size == 0) { isl_tab_free(tab); isl_vec_free(sample); return isl_basic_set_set_to_empty(bset); } hull = initialize_hull(bset, sample); hull = extend_affine_hull(tab, hull, bset); isl_basic_set_free(bset); isl_tab_free(tab); return hull; error: isl_vec_free(sample); isl_tab_free(tab); isl_basic_set_free(bset); return NULL; } /* Given an unbounded tableau and an integer point satisfying the tableau, * construct an initial affine hull containing the recession cone * shifted to the given point. * * The unbounded directions are taken from the last rows of the basis, * which is assumed to have been initialized appropriately. */ static __isl_give isl_basic_set *initial_hull(struct isl_tab *tab, __isl_take isl_vec *vec) { int i; int k; struct isl_basic_set *bset = NULL; struct isl_ctx *ctx; isl_size dim; if (!vec || !tab) return NULL; ctx = vec->ctx; isl_assert(ctx, vec->size != 0, goto error); bset = isl_basic_set_alloc(ctx, 0, vec->size - 1, 0, vec->size - 1, 0); dim = isl_basic_set_dim(bset, isl_dim_set); if (dim < 0) goto error; dim -= tab->n_unbounded; for (i = 0; i < dim; ++i) { k = isl_basic_set_alloc_equality(bset); if (k < 0) goto error; isl_seq_cpy(bset->eq[k] + 1, tab->basis->row[1 + i] + 1, vec->size - 1); isl_seq_inner_product(bset->eq[k] + 1, vec->el +1, vec->size - 1, &bset->eq[k][0]); isl_int_neg(bset->eq[k][0], bset->eq[k][0]); } bset->sample = vec; bset = isl_basic_set_gauss(bset, NULL); return bset; error: isl_basic_set_free(bset); isl_vec_free(vec); return NULL; } /* Given a tableau of a set and a tableau of the corresponding * recession cone, detect and add all equalities to the tableau. * If the tableau is bounded, then we can simply keep the * tableau in its state after the return from extend_affine_hull. * However, if the tableau is unbounded, then * isl_tab_set_initial_basis_with_cone will add some additional * constraints to the tableau that have to be removed again. * In this case, we therefore rollback to the state before * any constraints were added and then add the equalities back in. */ struct isl_tab *isl_tab_detect_equalities(struct isl_tab *tab, struct isl_tab *tab_cone) { int j; struct isl_vec *sample; struct isl_basic_set *hull = NULL; struct isl_tab_undo *snap; if (!tab || !tab_cone) goto error; snap = isl_tab_snap(tab); isl_mat_free(tab->basis); tab->basis = NULL; isl_assert(tab->mat->ctx, tab->bmap, goto error); isl_assert(tab->mat->ctx, tab->samples, goto error); isl_assert(tab->mat->ctx, tab->samples->n_col == 1 + tab->n_var, goto error); isl_assert(tab->mat->ctx, tab->n_sample > tab->n_outside, goto error); if (isl_tab_set_initial_basis_with_cone(tab, tab_cone) < 0) goto error; sample = isl_vec_alloc(tab->mat->ctx, 1 + tab->n_var); if (!sample) goto error; isl_seq_cpy(sample->el, tab->samples->row[tab->n_outside], sample->size); isl_vec_free(tab->bmap->sample); tab->bmap->sample = isl_vec_copy(sample); if (tab->n_unbounded == 0) hull = isl_basic_set_from_vec(isl_vec_copy(sample)); else hull = initial_hull(tab, isl_vec_copy(sample)); for (j = tab->n_outside + 1; j < tab->n_sample; ++j) { isl_seq_cpy(sample->el, tab->samples->row[j], sample->size); hull = affine_hull(hull, isl_basic_set_from_vec(isl_vec_copy(sample))); } isl_vec_free(sample); hull = extend_affine_hull(tab, hull, NULL); if (!hull) goto error; if (tab->n_unbounded == 0) { isl_basic_set_free(hull); return tab; } if (isl_tab_rollback(tab, snap) < 0) goto error; if (hull->n_eq > tab->n_zero) { for (j = 0; j < hull->n_eq; ++j) { isl_seq_normalize(tab->mat->ctx, hull->eq[j], 1 + tab->n_var); if (isl_tab_add_eq(tab, hull->eq[j]) < 0) goto error; } } isl_basic_set_free(hull); return tab; error: isl_basic_set_free(hull); isl_tab_free(tab); return NULL; } /* Compute the affine hull of "bset", where "cone" is the recession cone * of "bset". * * We first compute a unimodular transformation that puts the unbounded * directions in the last dimensions. In particular, we take a transformation * that maps all equalities to equalities (in HNF) on the first dimensions. * Let x be the original dimensions and y the transformed, with y_1 bounded * and y_2 unbounded. * * [ y_1 ] [ y_1 ] [ Q_1 ] * x = U [ y_2 ] [ y_2 ] = [ Q_2 ] x * * Let's call the input basic set S. We compute S' = preimage(S, U) * and drop the final dimensions including any constraints involving them. * This results in set S''. * Then we compute the affine hull A'' of S''. * Let F y_1 >= g be the constraint system of A''. In the transformed * space the y_2 are unbounded, so we can add them back without any constraints, * resulting in * * [ y_1 ] * [ F 0 ] [ y_2 ] >= g * or * [ Q_1 ] * [ F 0 ] [ Q_2 ] x >= g * or * F Q_1 x >= g * * The affine hull in the original space is then obtained as * A = preimage(A'', Q_1). */ static __isl_give isl_basic_set *affine_hull_with_cone( __isl_take isl_basic_set *bset, __isl_take isl_basic_set *cone) { isl_size total; unsigned cone_dim; struct isl_basic_set *hull; struct isl_mat *M, *U, *Q; total = isl_basic_set_dim(cone, isl_dim_all); if (!bset || total < 0) goto error; cone_dim = total - cone->n_eq; M = isl_mat_sub_alloc6(bset->ctx, cone->eq, 0, cone->n_eq, 1, total); M = isl_mat_left_hermite(M, 0, &U, &Q); if (!M) goto error; isl_mat_free(M); U = isl_mat_lin_to_aff(U); bset = isl_basic_set_preimage(bset, isl_mat_copy(U)); bset = isl_basic_set_drop_constraints_involving(bset, total - cone_dim, cone_dim); bset = isl_basic_set_drop_dims(bset, total - cone_dim, cone_dim); Q = isl_mat_lin_to_aff(Q); Q = isl_mat_drop_rows(Q, 1 + total - cone_dim, cone_dim); if (bset && bset->sample && bset->sample->size == 1 + total) bset->sample = isl_mat_vec_product(isl_mat_copy(Q), bset->sample); hull = uset_affine_hull_bounded(bset); if (!hull) { isl_mat_free(Q); isl_mat_free(U); } else { struct isl_vec *sample = isl_vec_copy(hull->sample); U = isl_mat_drop_cols(U, 1 + total - cone_dim, cone_dim); if (sample && sample->size > 0) sample = isl_mat_vec_product(U, sample); else isl_mat_free(U); hull = isl_basic_set_preimage(hull, Q); if (hull) { isl_vec_free(hull->sample); hull->sample = sample; } else isl_vec_free(sample); } isl_basic_set_free(cone); return hull; error: isl_basic_set_free(bset); isl_basic_set_free(cone); return NULL; } /* Look for all equalities satisfied by the integer points in bset, * which is assumed not to have any explicit equalities. * * The equalities are obtained by successively looking for * a point that is affinely independent of the points found so far. * In particular, for each equality satisfied by the points so far, * we check if there is any point on a hyperplane parallel to the * corresponding hyperplane shifted by at least one (in either direction). * * Before looking for any outside points, we first compute the recession * cone. The directions of this recession cone will always be part * of the affine hull, so there is no need for looking for any points * in these directions. * In particular, if the recession cone is full-dimensional, then * the affine hull is simply the whole universe. */ static __isl_give isl_basic_set *uset_affine_hull( __isl_take isl_basic_set *bset) { struct isl_basic_set *cone; isl_size total; if (isl_basic_set_plain_is_empty(bset)) return bset; cone = isl_basic_set_recession_cone(isl_basic_set_copy(bset)); if (!cone) goto error; if (cone->n_eq == 0) { isl_space *space; space = isl_basic_set_get_space(bset); isl_basic_set_free(cone); isl_basic_set_free(bset); return isl_basic_set_universe(space); } total = isl_basic_set_dim(cone, isl_dim_all); if (total < 0) bset = isl_basic_set_free(bset); if (cone->n_eq < total) return affine_hull_with_cone(bset, cone); isl_basic_set_free(cone); return uset_affine_hull_bounded(bset); error: isl_basic_set_free(bset); return NULL; } /* Look for all equalities satisfied by the integer points in bmap * that are independent of the equalities already explicitly available * in bmap. * * We first remove all equalities already explicitly available, * then look for additional equalities in the reduced space * and then transform the result to the original space. * The original equalities are _not_ added to this set. This is * the responsibility of the calling function. * The resulting basic set has all meaning about the dimensions removed. * In particular, dimensions that correspond to existential variables * in bmap and that are found to be fixed are not removed. */ static __isl_give isl_basic_set *equalities_in_underlying_set( __isl_take isl_basic_map *bmap) { struct isl_mat *T1 = NULL; struct isl_mat *T2 = NULL; struct isl_basic_set *bset = NULL; struct isl_basic_set *hull = NULL; bset = isl_basic_map_underlying_set(bmap); if (!bset) return NULL; if (bset->n_eq) bset = isl_basic_set_remove_equalities(bset, &T1, &T2); if (!bset) goto error; hull = uset_affine_hull(bset); if (!T2) return hull; if (!hull) { isl_mat_free(T1); isl_mat_free(T2); } else { struct isl_vec *sample = isl_vec_copy(hull->sample); if (sample && sample->size > 0) sample = isl_mat_vec_product(T1, sample); else isl_mat_free(T1); hull = isl_basic_set_preimage(hull, T2); if (hull) { isl_vec_free(hull->sample); hull->sample = sample; } else isl_vec_free(sample); } return hull; error: isl_mat_free(T1); isl_mat_free(T2); isl_basic_set_free(bset); isl_basic_set_free(hull); return NULL; } /* Detect and make explicit all equalities satisfied by the (integer) * points in bmap. */ __isl_give isl_basic_map *isl_basic_map_detect_equalities( __isl_take isl_basic_map *bmap) { int i, j; isl_size total; struct isl_basic_set *hull = NULL; if (!bmap) return NULL; if (bmap->n_ineq == 0) return bmap; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) return bmap; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_ALL_EQUALITIES)) return bmap; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL)) return isl_basic_map_implicit_equalities(bmap); hull = equalities_in_underlying_set(isl_basic_map_copy(bmap)); if (!hull) goto error; if (ISL_F_ISSET(hull, ISL_BASIC_SET_EMPTY)) { isl_basic_set_free(hull); return isl_basic_map_set_to_empty(bmap); } bmap = isl_basic_map_extend(bmap, 0, hull->n_eq, 0); total = isl_basic_set_dim(hull, isl_dim_all); if (total < 0) goto error; for (i = 0; i < hull->n_eq; ++i) { j = isl_basic_map_alloc_equality(bmap); if (j < 0) goto error; isl_seq_cpy(bmap->eq[j], hull->eq[i], 1 + total); } isl_vec_free(bmap->sample); bmap->sample = isl_vec_copy(hull->sample); isl_basic_set_free(hull); ISL_F_SET(bmap, ISL_BASIC_MAP_NO_IMPLICIT | ISL_BASIC_MAP_ALL_EQUALITIES); bmap = isl_basic_map_simplify(bmap); return isl_basic_map_finalize(bmap); error: isl_basic_set_free(hull); isl_basic_map_free(bmap); return NULL; } __isl_give isl_basic_set *isl_basic_set_detect_equalities( __isl_take isl_basic_set *bset) { return bset_from_bmap( isl_basic_map_detect_equalities(bset_to_bmap(bset))); } __isl_give isl_map *isl_map_detect_equalities(__isl_take isl_map *map) { return isl_map_inline_foreach_basic_map(map, &isl_basic_map_detect_equalities); } __isl_give isl_set *isl_set_detect_equalities(__isl_take isl_set *set) { return set_from_map(isl_map_detect_equalities(set_to_map(set))); } /* Return the superset of "bmap" described by the equalities * satisfied by "bmap" that are already known. */ __isl_give isl_basic_map *isl_basic_map_plain_affine_hull( __isl_take isl_basic_map *bmap) { bmap = isl_basic_map_cow(bmap); if (bmap) isl_basic_map_free_inequality(bmap, bmap->n_ineq); bmap = isl_basic_map_finalize(bmap); return bmap; } /* Return the superset of "bset" described by the equalities * satisfied by "bset" that are already known. */ __isl_give isl_basic_set *isl_basic_set_plain_affine_hull( __isl_take isl_basic_set *bset) { return isl_basic_map_plain_affine_hull(bset); } /* After computing the rational affine hull (by detecting the implicit * equalities), we compute the additional equalities satisfied by * the integer points (if any) and add the original equalities back in. */ __isl_give isl_basic_map *isl_basic_map_affine_hull( __isl_take isl_basic_map *bmap) { bmap = isl_basic_map_detect_equalities(bmap); bmap = isl_basic_map_plain_affine_hull(bmap); return bmap; } __isl_give isl_basic_set *isl_basic_set_affine_hull( __isl_take isl_basic_set *bset) { return bset_from_bmap(isl_basic_map_affine_hull(bset_to_bmap(bset))); } /* Given a rational affine matrix "M", add stride constraints to "bmap" * that ensure that * * M(x) * * is an integer vector. The variables x include all the variables * of "bmap" except the unknown divs. * * If d is the common denominator of M, then we need to impose that * * d M(x) = 0 mod d * * or * * exists alpha : d M(x) = d alpha * * This function is similar to add_strides in isl_morph.c */ static __isl_give isl_basic_map *add_strides(__isl_take isl_basic_map *bmap, __isl_keep isl_mat *M, int n_known) { int i, div, k; isl_int gcd; if (isl_int_is_one(M->row[0][0])) return bmap; bmap = isl_basic_map_extend(bmap, M->n_row - 1, M->n_row - 1, 0); isl_int_init(gcd); for (i = 1; i < M->n_row; ++i) { isl_seq_gcd(M->row[i], M->n_col, &gcd); if (isl_int_is_divisible_by(gcd, M->row[0][0])) continue; div = isl_basic_map_alloc_div(bmap); if (div < 0) goto error; isl_int_set_si(bmap->div[div][0], 0); k = isl_basic_map_alloc_equality(bmap); if (k < 0) goto error; isl_seq_cpy(bmap->eq[k], M->row[i], M->n_col); isl_seq_clr(bmap->eq[k] + M->n_col, bmap->n_div - n_known); isl_int_set(bmap->eq[k][M->n_col - n_known + div], M->row[0][0]); } isl_int_clear(gcd); return bmap; error: isl_int_clear(gcd); isl_basic_map_free(bmap); return NULL; } /* If there are any equalities that involve (multiple) unknown divs, * then extract the stride information encoded by those equalities * and make it explicitly available in "bmap". * * We first sort the divs so that the unknown divs appear last and * then we count how many equalities involve these divs. * * Let these equalities be of the form * * A(x) + B y = 0 * * where y represents the unknown divs and x the remaining variables. * Let [H 0] be the Hermite Normal Form of B, i.e., * * B = [H 0] Q * * Then x is a solution of the equalities iff * * H^-1 A(x) (= - [I 0] Q y) * * is an integer vector. Let d be the common denominator of H^-1. * We impose * * d H^-1 A(x) = d alpha * * in add_strides, with alpha fresh existentially quantified variables. */ static __isl_give isl_basic_map *isl_basic_map_make_strides_explicit( __isl_take isl_basic_map *bmap) { isl_bool known; int n_known; int n, n_col; isl_size v_div; isl_ctx *ctx; isl_mat *A, *B, *M; known = isl_basic_map_divs_known(bmap); if (known < 0) return isl_basic_map_free(bmap); if (known) return bmap; bmap = isl_basic_map_sort_divs(bmap); bmap = isl_basic_map_gauss(bmap, NULL); if (!bmap) return NULL; for (n_known = 0; n_known < bmap->n_div; ++n_known) if (isl_int_is_zero(bmap->div[n_known][0])) break; v_div = isl_basic_map_var_offset(bmap, isl_dim_div); if (v_div < 0) return isl_basic_map_free(bmap); for (n = 0; n < bmap->n_eq; ++n) if (!isl_seq_any_non_zero(bmap->eq[n] + 1 + v_div + n_known, bmap->n_div - n_known)) break; if (n == 0) return bmap; ctx = isl_basic_map_get_ctx(bmap); B = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 0, 1 + v_div + n_known); n_col = bmap->n_div - n_known; A = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 1 + v_div + n_known, n_col); A = isl_mat_left_hermite(A, 0, NULL, NULL); A = isl_mat_drop_cols(A, n, n_col - n); A = isl_mat_lin_to_aff(A); A = isl_mat_right_inverse(A); B = isl_mat_insert_zero_rows(B, 0, 1); B = isl_mat_set_element_si(B, 0, 0, 1); M = isl_mat_product(A, B); if (!M) return isl_basic_map_free(bmap); bmap = add_strides(bmap, M, n_known); bmap = isl_basic_map_gauss(bmap, NULL); isl_mat_free(M); return bmap; } /* Compute the affine hull of each basic map in "map" separately * and make all stride information explicit so that we can remove * all unknown divs without losing this information. * The result is also guaranteed to be gaussed. * * In simple cases where a div is determined by an equality, * calling isl_basic_map_gauss is enough to make the stride information * explicit, as it will derive an explicit representation for the div * from the equality. If, however, the stride information * is encoded through multiple unknown divs then we need to make * some extra effort in isl_basic_map_make_strides_explicit. */ static __isl_give isl_map *isl_map_local_affine_hull(__isl_take isl_map *map) { int i; map = isl_map_cow(map); if (!map) return NULL; for (i = 0; i < map->n; ++i) { map->p[i] = isl_basic_map_affine_hull(map->p[i]); map->p[i] = isl_basic_map_gauss(map->p[i], NULL); map->p[i] = isl_basic_map_make_strides_explicit(map->p[i]); if (!map->p[i]) return isl_map_free(map); } return map; } static __isl_give isl_set *isl_set_local_affine_hull(__isl_take isl_set *set) { return isl_map_local_affine_hull(set); } /* Return an empty basic map living in the same space as "map". */ static __isl_give isl_basic_map *replace_map_by_empty_basic_map( __isl_take isl_map *map) { isl_space *space; space = isl_map_get_space(map); isl_map_free(map); return isl_basic_map_empty(space); } /* Compute the affine hull of "map". * * We first compute the affine hull of each basic map separately. * Then we align the divs and recompute the affine hulls of the basic * maps since some of them may now have extra divs. * In order to avoid performing parametric integer programming to * compute explicit expressions for the divs, possible leading to * an explosion in the number of basic maps, we first drop all unknown * divs before aligning the divs. Note that isl_map_local_affine_hull tries * to make sure that all stride information is explicitly available * in terms of known divs. This involves calling isl_basic_set_gauss, * which is also needed because affine_hull assumes its input has been gaussed, * while isl_map_affine_hull may be called on input that has not been gaussed, * in particular from initial_facet_constraint. * Similarly, align_divs may reorder some divs so that we need to * gauss the result again. * Finally, we combine the individual affine hulls into a single * affine hull. */ __isl_give isl_basic_map *isl_map_affine_hull(__isl_take isl_map *map) { struct isl_basic_map *model = NULL; struct isl_basic_map *hull = NULL; struct isl_set *set; isl_basic_set *bset; map = isl_map_detect_equalities(map); map = isl_map_local_affine_hull(map); map = isl_map_remove_empty_parts(map); map = isl_map_remove_unknown_divs(map); map = isl_map_align_divs_internal(map); if (!map) return NULL; if (map->n == 0) return replace_map_by_empty_basic_map(map); model = isl_basic_map_copy(map->p[0]); set = isl_map_underlying_set(map); set = isl_set_cow(set); set = isl_set_local_affine_hull(set); if (!set) goto error; while (set->n > 1) set->p[0] = affine_hull(set->p[0], set->p[--set->n]); bset = isl_basic_set_copy(set->p[0]); hull = isl_basic_map_overlying_set(bset, model); isl_set_free(set); hull = isl_basic_map_simplify(hull); return isl_basic_map_finalize(hull); error: isl_basic_map_free(model); isl_set_free(set); return NULL; } __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set) { return bset_from_bmap(isl_map_affine_hull(set_to_map(set))); } isl-0.28/check_reparse_test_templ.c0000664000175000017500000000126415072740040016526 0ustar00skimoskimo#define xCAT(A,B) A ## B #define CAT(A,B) xCAT(A,B) #undef TYPE #define TYPE CAT(isl_,BASE) #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) #undef TESTS #define TESTS CAT(reparse_,CAT(BASE,_tests)) /* Test parsing of objects of type TYPE by printing * the expressions and checking that parsing the output results * in the same expression. * Do this for a set of expressions parsed from strings. */ static isl_stat FN(check,TESTS)(isl_ctx *ctx) { int i; for (i = 0; i < ARRAY_SIZE(TESTS); ++i) { TYPE *obj; obj = FN(TYPE,read_from_str)(ctx, TESTS[i]); if (FN(check_reparse,BASE)(ctx, obj) < 0) return isl_stat_error; } return isl_stat_ok; } isl-0.28/isl_dim_map.h0000664000175000017500000000261715072740040013755 0ustar00skimoskimo#ifndef ISL_DIM_MAP_H #define ISL_DIM_MAP_H #include #include #include #include struct isl_dim_map; typedef struct isl_dim_map isl_dim_map; __isl_give isl_dim_map *isl_dim_map_alloc(isl_ctx *ctx, unsigned len); __isl_null isl_dim_map *isl_dim_map_free(__isl_take isl_dim_map *dim_map); void isl_dim_map_range(__isl_keep isl_dim_map *dim_map, unsigned dst_pos, int dst_stride, unsigned src_pos, int src_stride, unsigned n, int sign); void isl_dim_map_dim_range(__isl_keep isl_dim_map *dim_map, __isl_keep isl_space *space, enum isl_dim_type type, unsigned first, unsigned n, unsigned dst_pos); void isl_dim_map_dim(__isl_keep isl_dim_map *dim_map, __isl_keep isl_space *space, enum isl_dim_type type, unsigned dst_pos); void isl_dim_map_div(__isl_keep isl_dim_map *dim_map, __isl_keep isl_basic_map *bmap, unsigned dst_pos); __isl_give isl_basic_set *isl_basic_set_add_constraints_dim_map( __isl_take isl_basic_set *dst, __isl_take isl_basic_set *src, __isl_take isl_dim_map *dim_map); __isl_give isl_basic_map *isl_basic_map_add_constraints_dim_map( __isl_take isl_basic_map *dst, __isl_take isl_basic_map *src, __isl_take isl_dim_map *dim_map); __isl_give isl_dim_map *isl_dim_map_extend(__isl_keep isl_dim_map *dim_map, __isl_keep isl_basic_map *bmap); __isl_give isl_dim_map *isl_dim_map_from_reordering( __isl_keep isl_reordering *exp); #endif isl-0.28/isl_multi_min_max_templ.c0000664000175000017500000000125415072740040016401 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ /* Return the (elementwise) minimum of "multi1" and "multi2". */ __isl_give MULTI(BASE) *FN(MULTI(BASE),min)(__isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) { return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,min)); } /* Return the (elementwise) maximum of "multi1" and "multi2". */ __isl_give MULTI(BASE) *FN(MULTI(BASE),max)(__isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2) { return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,max)); } isl-0.28/isl_pw_add_constant_val_templ.c0000664000175000017500000000043015072740040017543 0ustar00skimoskimo/* * Copyright 2019 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA */ #undef VAL_BASE #define VAL_BASE val #include isl-0.28/isl_bound.c0000664000175000017500000003737315072740040013460 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France */ #include #include #include #include #include #include #include #include #include /* Given a polynomial "poly" that is constant in terms * of the domain variables, construct a polynomial reduction * of type "type" that is equal to "poly" on "bset", * with the domain projected onto the parameters. */ __isl_give isl_pw_qpolynomial_fold *isl_qpolynomial_cst_bound( __isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, enum isl_fold type, isl_bool *tight) { isl_set *dom; isl_qpolynomial_fold *fold; isl_pw_qpolynomial_fold *pwf; fold = isl_qpolynomial_fold_alloc(type, poly); dom = isl_set_from_basic_set(bset); if (tight) *tight = isl_bool_true; pwf = isl_pw_qpolynomial_fold_alloc(type, dom, fold); return isl_pw_qpolynomial_fold_project_domain_on_params(pwf); } /* Add the bound "pwf", which is not known to be tight, * to the output of "bound". */ isl_stat isl_bound_add(struct isl_bound *bound, __isl_take isl_pw_qpolynomial_fold *pwf) { bound->pwf = isl_pw_qpolynomial_fold_fold(bound->pwf, pwf); return isl_stat_non_null(bound->pwf); } /* Add the bound "pwf", which is known to be tight, * to the output of "bound". */ isl_stat isl_bound_add_tight(struct isl_bound *bound, __isl_take isl_pw_qpolynomial_fold *pwf) { bound->pwf_tight = isl_pw_qpolynomial_fold_fold(bound->pwf_tight, pwf); return isl_stat_non_null(bound->pwf); } /* Given a polynomial "poly" that is constant in terms * of the domain variables and the domain "bset", * construct the corresponding polynomial reduction and * add it to the tight bounds of "bound". */ static isl_stat add_constant_poly(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct isl_bound *bound) { isl_pw_qpolynomial_fold *pwf; pwf = isl_qpolynomial_cst_bound(bset, poly, bound->type, NULL); return isl_bound_add_tight(bound, pwf); } /* Compute a bound on the polynomial defined over the parametric polytope * using either range propagation or bernstein expansion and * store the result in bound->pwf and bound->pwf_tight. * Since bernstein expansion requires bounded domains, we apply * range propagation on unbounded domains. Otherwise, we respect the choice * of the user. * * If the polynomial does not depend on the set variables * then the bound is equal to the polynomial and * it can be added to "bound" directly. */ static isl_stat compressed_guarded_poly_bound(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct isl_bound *bound) { isl_ctx *ctx; int bounded; int degree; if (!bset || !poly) goto error; degree = isl_qpolynomial_degree(poly); if (degree < -1) goto error; if (degree <= 0) return add_constant_poly(bset, poly, bound); ctx = isl_basic_set_get_ctx(bset); if (ctx->opt->bound == ISL_BOUND_RANGE) return isl_qpolynomial_bound_on_domain_range(bset, poly, bound); bounded = isl_basic_set_is_bounded(bset); if (bounded < 0) goto error; if (bounded) return isl_qpolynomial_bound_on_domain_bernstein(bset, poly, bound); else return isl_qpolynomial_bound_on_domain_range(bset, poly, bound); error: isl_basic_set_free(bset); isl_qpolynomial_free(poly); return isl_stat_error; } static isl_stat unwrapped_guarded_poly_bound(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct isl_bound *bound) { isl_pw_qpolynomial_fold *top_pwf; isl_pw_qpolynomial_fold *top_pwf_tight; isl_space *space; isl_morph *morph; isl_stat r; bset = isl_basic_set_detect_equalities(bset); if (!bset) goto error; if (bset->n_eq == 0) return compressed_guarded_poly_bound(bset, poly, bound); morph = isl_basic_set_full_compression(bset); bset = isl_morph_basic_set(isl_morph_copy(morph), bset); poly = isl_qpolynomial_morph_domain(poly, isl_morph_copy(morph)); space = isl_morph_get_ran_space(morph); space = isl_space_params(space); top_pwf = bound->pwf; top_pwf_tight = bound->pwf_tight; space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, 1); bound->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(space), bound->type); bound->pwf_tight = isl_pw_qpolynomial_fold_zero(space, bound->type); r = compressed_guarded_poly_bound(bset, poly, bound); morph = isl_morph_dom_params(morph); morph = isl_morph_ran_params(morph); morph = isl_morph_inverse(morph); bound->pwf = isl_pw_qpolynomial_fold_morph_domain(bound->pwf, isl_morph_copy(morph)); bound->pwf_tight = isl_pw_qpolynomial_fold_morph_domain( bound->pwf_tight, morph); isl_bound_add(bound, top_pwf); isl_bound_add_tight(bound, top_pwf_tight); return r; error: isl_basic_set_free(bset); isl_qpolynomial_free(poly); return isl_stat_error; } /* Update bound->pwf and bound->pwf_tight with a bound * of type bound->type on the (quasi-)polynomial "qp" over the domain "bset", * by calling "unwrapped" on unwrapped versions of "bset and "qp". * If "qp" is a polynomial, then "unwrapped" will also be called * on a polynomial. * * If the original problem did not have a wrapped relation in the domain, * then call "unwrapped" directly. * * Otherwise, the bound should be computed over the range * of the wrapped relation. Temporarily treat the domain dimensions * of this wrapped relation as parameters, compute a bound using "unwrapped" * in terms of these and the original parameters, * turn the parameters back into set dimensions and * add the results to bound->pwf and bound->pwf_tight. * * Note that even though "bset" is known to live in the same space * as the domain of "qp", the names of the set dimensions * may be different (or missing). Make sure the naming is exactly * the same before turning these dimensions into parameters * to ensure that the spaces are still the same after * this operation. */ static isl_stat unwrap(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *qp, isl_stat (*unwrapped)(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *qp, struct isl_bound *bound), struct isl_bound *bound) { isl_space *space; isl_pw_qpolynomial_fold *top_pwf; isl_pw_qpolynomial_fold *top_pwf_tight; isl_size nparam; isl_size n_in; isl_stat r; if (!bound->wrapping) return unwrapped(bset, qp, bound); nparam = isl_space_dim(bound->dim, isl_dim_param); n_in = isl_space_dim(bound->dim, isl_dim_in); if (nparam < 0 || n_in < 0) goto error; space = isl_qpolynomial_get_domain_space(qp); bset = isl_basic_set_reset_space(bset, space); bset = isl_basic_set_move_dims(bset, isl_dim_param, nparam, isl_dim_set, 0, n_in); qp = isl_qpolynomial_move_dims(qp, isl_dim_param, nparam, isl_dim_in, 0, n_in); space = isl_basic_set_get_space(bset); space = isl_space_params(space); top_pwf = bound->pwf; top_pwf_tight = bound->pwf_tight; space = isl_space_from_domain(space); space = isl_space_add_dims(space, isl_dim_out, 1); bound->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(space), bound->type); bound->pwf_tight = isl_pw_qpolynomial_fold_zero(space, bound->type); r = unwrapped(bset, qp, bound); bound->pwf = isl_pw_qpolynomial_fold_reset_space(bound->pwf, isl_space_copy(bound->dim)); bound->pwf_tight = isl_pw_qpolynomial_fold_reset_space(bound->pwf_tight, isl_space_copy(bound->dim)); isl_bound_add(bound, top_pwf); isl_bound_add_tight(bound, top_pwf_tight); return r; error: isl_basic_set_free(bset); isl_qpolynomial_free(qp); return isl_stat_error; } /* Update bound->pwf and bound->pwf_tight with a bound * of type bound->type on the polynomial "poly" over the domain "bset", * handling any wrapping in the domain. */ static isl_stat guarded_poly_bound(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, void *user) { struct isl_bound *bound = (struct isl_bound *)user; return unwrap(bset, poly, &unwrapped_guarded_poly_bound, bound); } /* Is "bset" bounded and is "qp" a quasi-affine expression? */ static isl_bool is_bounded_affine(__isl_keep isl_basic_set *bset, __isl_keep isl_qpolynomial *qp) { isl_bool affine; affine = isl_qpolynomial_isa_aff(qp); if (affine < 0 || !affine) return affine; return isl_basic_set_is_bounded(bset); } /* Update bound->pwf and bound->pwf_tight with a bound * of type bound->type on the quasi-polynomial "qp" over the domain "bset", * for the case where "bset" is bounded and * "qp" is a quasi-affine expression and * they have both been unwrapped already if needed. * * Consider the set of possible function values of "qp" over "bset" and * take the minimum or maximum value in this set, depending * on whether a lower or an upper bound is being computed. * Do this by calling isl_set_lexmin_pw_multi_aff or * isl_set_lexmax_pw_multi_aff, which compute a regular minimum or maximum * since the set is one-dimensional. * Since this computation is exact, the bound is always tight. * * Note that the minimum or maximum integer value is being computed, * so if "qp" has some non-trivial denominator, then it needs * to be multiplied out first and then taken into account again * after computing the minimum or maximum. */ static isl_stat unwrapped_affine_qp(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *qp, struct isl_bound *bound) { isl_val *d; isl_aff *aff; isl_basic_map *bmap; isl_set *range; isl_pw_multi_aff *opt; isl_pw_aff *pa; isl_pw_qpolynomial *pwqp; isl_pw_qpolynomial_fold *pwf; aff = isl_qpolynomial_as_aff(qp); d = isl_aff_get_denominator_val(aff); aff = isl_aff_scale_val(aff, isl_val_copy(d)); bmap = isl_basic_map_from_aff(aff); bmap = isl_basic_map_intersect_domain(bmap, bset); range = isl_set_from_basic_set(isl_basic_map_range(bmap)); if (bound->type == isl_fold_min) opt = isl_set_lexmin_pw_multi_aff(range); else opt = isl_set_lexmax_pw_multi_aff(range); pa = isl_pw_multi_aff_get_at(opt, 0); isl_pw_multi_aff_free(opt); pa = isl_pw_aff_scale_down_val(pa, d); pwqp = isl_pw_qpolynomial_from_pw_aff(pa); pwf = isl_pw_qpolynomial_fold_from_pw_qpolynomial(bound->type, pwqp); bound->pwf_tight = isl_pw_qpolynomial_fold_fold(bound->pwf_tight, pwf); return isl_stat_non_null(bound->pwf_tight); } /* Update bound->pwf and bound->pwf_tight with a bound * of type bound->type on the quasi-polynomial "qp" over the domain bound->bset, * for the case where bound->bset is bounded and * "qp" is a quasi-affine expression, * handling any wrapping in the domain. */ static isl_stat affine_qp(__isl_take isl_qpolynomial *qp, struct isl_bound *bound) { isl_basic_set *bset; bset = isl_basic_set_copy(bound->bset); return unwrap(bset, qp, &unwrapped_affine_qp, bound); } /* Update bound->pwf and bound->pwf_tight with a bound * of type bound->type on the quasi-polynomial "qp" over the domain bound->bset. * * If bound->bset is bounded and if "qp" is a quasi-affine expression, * then use a specialized version. * * Otherwise, treat the integer divisions as extra variables and * compute a bound over the polynomial in terms of the original and * the extra variables. */ static isl_stat guarded_qp(__isl_take isl_qpolynomial *qp, void *user) { struct isl_bound *bound = (struct isl_bound *)user; isl_stat r; isl_bool bounded_affine; bounded_affine = is_bounded_affine(bound->bset, qp); if (bounded_affine < 0) qp = isl_qpolynomial_free(qp); else if (bounded_affine) return affine_qp(qp, bound); r = isl_qpolynomial_as_polynomial_on_domain(qp, bound->bset, &guarded_poly_bound, user); isl_qpolynomial_free(qp); return r; } static isl_stat basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) { struct isl_bound *bound = (struct isl_bound *)user; isl_stat r; bound->bset = bset; r = isl_qpolynomial_fold_foreach_qpolynomial(bound->fold, &guarded_qp, user); isl_basic_set_free(bset); return r; } static isl_stat guarded_fold(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, void *user) { struct isl_bound *bound = (struct isl_bound *)user; if (!set || !fold) goto error; set = isl_set_make_disjoint(set); bound->fold = fold; bound->type = isl_qpolynomial_fold_get_type(fold); if (isl_set_foreach_basic_set(set, &basic_guarded_fold, bound) < 0) goto error; isl_set_free(set); isl_qpolynomial_fold_free(fold); return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_fold_free(fold); return isl_stat_error; } __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound( __isl_take isl_pw_qpolynomial_fold *pwf, isl_bool *tight) { isl_size nvar; struct isl_bound bound; isl_bool covers; if (!pwf) return NULL; bound.dim = isl_pw_qpolynomial_fold_get_domain_space(pwf); bound.wrapping = isl_space_is_wrapping(bound.dim); if (bound.wrapping) bound.dim = isl_space_unwrap(bound.dim); nvar = isl_space_dim(bound.dim, isl_dim_out); if (nvar < 0) bound.dim = isl_space_free(bound.dim); bound.dim = isl_space_domain(bound.dim); bound.dim = isl_space_from_domain(bound.dim); bound.dim = isl_space_add_dims(bound.dim, isl_dim_out, 1); if (nvar == 0) { if (tight) *tight = isl_bool_true; return isl_pw_qpolynomial_fold_reset_space(pwf, bound.dim); } if (isl_pw_qpolynomial_fold_is_zero(pwf)) { enum isl_fold type = pwf->type; isl_pw_qpolynomial_fold_free(pwf); if (tight) *tight = isl_bool_true; return isl_pw_qpolynomial_fold_zero(bound.dim, type); } bound.pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(bound.dim), pwf->type); bound.pwf_tight = isl_pw_qpolynomial_fold_zero(isl_space_copy(bound.dim), pwf->type); bound.check_tight = !!tight; if (isl_pw_qpolynomial_fold_foreach_lifted_piece(pwf, guarded_fold, &bound) < 0) goto error; covers = isl_pw_qpolynomial_fold_covers(bound.pwf_tight, bound.pwf); if (covers < 0) goto error; if (tight) *tight = covers; isl_space_free(bound.dim); isl_pw_qpolynomial_fold_free(pwf); if (covers) { isl_pw_qpolynomial_fold_free(bound.pwf); return bound.pwf_tight; } bound.pwf = isl_pw_qpolynomial_fold_fold(bound.pwf, bound.pwf_tight); return bound.pwf; error: isl_pw_qpolynomial_fold_free(bound.pwf_tight); isl_pw_qpolynomial_fold_free(bound.pwf); isl_pw_qpolynomial_fold_free(pwf); isl_space_free(bound.dim); return NULL; } __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound( __isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type, isl_bool *tight) { isl_pw_qpolynomial_fold *pwf; pwf = isl_pw_qpolynomial_fold_from_pw_qpolynomial(type, pwqp); return isl_pw_qpolynomial_fold_bound(pwf, tight); } struct isl_union_bound_data { enum isl_fold type; isl_bool tight; isl_union_pw_qpolynomial_fold *res; }; static isl_stat bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) { struct isl_union_bound_data *data = user; isl_pw_qpolynomial_fold *pwf; pwf = isl_pw_qpolynomial_bound(pwqp, data->type, data->tight ? &data->tight : NULL); data->res = isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold( data->res, pwf); return isl_stat_ok; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound( __isl_take isl_union_pw_qpolynomial *upwqp, enum isl_fold type, isl_bool *tight) { isl_space *space; struct isl_union_bound_data data = { type, 1, NULL }; if (!upwqp) return NULL; if (!tight) data.tight = isl_bool_false; space = isl_union_pw_qpolynomial_get_space(upwqp); data.res = isl_union_pw_qpolynomial_fold_zero(space, type); if (isl_union_pw_qpolynomial_foreach_pw_qpolynomial(upwqp, &bound_pw, &data) < 0) goto error; isl_union_pw_qpolynomial_free(upwqp); if (tight) *tight = data.tight; return data.res; error: isl_union_pw_qpolynomial_free(upwqp); isl_union_pw_qpolynomial_fold_free(data.res); return NULL; } isl-0.28/cat.c0000664000175000017500000000327615072740040012244 0ustar00skimoskimo#include #include #include #include #include struct isl_arg_choice cat_format[] = { {"isl", ISL_FORMAT_ISL}, {"omega", ISL_FORMAT_OMEGA}, {"polylib", ISL_FORMAT_POLYLIB}, {"ext-polylib", ISL_FORMAT_EXT_POLYLIB}, {"latex", ISL_FORMAT_LATEX}, {"C", ISL_FORMAT_C}, {0} }; struct isl_arg_choice cat_yaml_style[] = { { "block", ISL_YAML_STYLE_BLOCK }, { "flow", ISL_YAML_STYLE_FLOW }, { 0 } }; struct cat_options { struct isl_options *isl; unsigned format; unsigned yaml_style; }; ISL_ARGS_START(struct cat_options, cat_options_args) ISL_ARG_CHILD(struct cat_options, isl, "isl", &isl_options_args, "isl options") ISL_ARG_CHOICE(struct cat_options, format, 0, "format", \ cat_format, ISL_FORMAT_ISL, "output format") ISL_ARG_CHOICE(struct cat_options, yaml_style, 0, "yaml-style", \ cat_yaml_style, ISL_YAML_STYLE_BLOCK, "output YAML style") ISL_ARGS_END ISL_ARG_DEF(cat_options, struct cat_options, cat_options_args) int main(int argc, char **argv) { struct isl_ctx *ctx; isl_stream *s; struct isl_obj obj; struct cat_options *options; isl_printer *p; options = cat_options_new_with_defaults(); assert(options); argc = cat_options_parse(options, argc, argv, ISL_ARG_ALL); ctx = isl_ctx_alloc_with_options(&cat_options_args, options); s = isl_stream_new_file(ctx, stdin); obj = isl_stream_read_obj(s); isl_stream_free(s); p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, options->format); p = isl_printer_set_yaml_style(p, options->yaml_style); p = obj.type->print(p, obj.v); p = isl_printer_end_line(p); isl_printer_free(p); obj.type->free(obj.v); isl_ctx_free(ctx); return 0; } isl-0.28/isl_type_has_equal_space_templ.c0000664000175000017500000000125515072740040017716 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France */ #define xFN(TYPE,NAME) TYPE ## _ ## NAME #define FN(TYPE,NAME) xFN(TYPE,NAME) #ifndef PEEK_SPACE #define PEEK_SPACE peek_space #endif /* Do "obj1" and "obj2" have the same space? */ isl_bool FN(TYPE_PAIR,has_equal_space)(__isl_keep TYPE1 *obj1, __isl_keep TYPE2 *obj2) { isl_space *space1, *space2; space1 = FN(TYPE1,PEEK_SPACE)(obj1); space2 = FN(TYPE2,PEEK_SPACE)(obj2); return isl_space_is_equal(space1, space2); } isl-0.28/isl_point.c0000664000175000017500000004300715215726270013501 0ustar00skimoskimo/* * Copyright 2010 INRIA Saclay * Copyright 2013 Ecole Normale Superieure * Copyright 2015 Sven Verdoolaege * Copyright 2019,2022 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, * 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France * and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt) { return pnt ? isl_space_get_ctx(pnt->dim) : NULL; } #undef TYPE1 #define TYPE1 isl_basic_map #undef TYPE2 #define TYPE2 isl_point #undef TYPE_PAIR #define TYPE_PAIR isl_basic_map_point static #include "isl_type_has_equal_space_templ.c" static #include "isl_type_check_equal_space_templ.c" #undef TYPE #define TYPE isl_point #include "isl_check_named_params_templ.c" __isl_give isl_point *isl_point_alloc(__isl_take isl_space *space, __isl_take isl_vec *vec) { struct isl_point *pnt; isl_size dim; dim = isl_space_dim(space, isl_dim_all); if (dim < 0 || !vec) goto error; if (vec->size > 1 + dim) { vec = isl_vec_cow(vec); if (!vec) goto error; vec->size = 1 + dim; } pnt = isl_alloc_type(space->ctx, struct isl_point); if (!pnt) goto error; pnt->ref = 1; pnt->dim = space; pnt->vec = vec; return pnt; error: isl_space_free(space); isl_vec_free(vec); return NULL; } __isl_give isl_point *isl_point_zero(__isl_take isl_space *space) { isl_vec *vec; isl_size dim; dim = isl_space_dim(space, isl_dim_all); if (dim < 0) goto error; vec = isl_vec_alloc(space->ctx, 1 + dim); if (!vec) goto error; isl_int_set_si(vec->el[0], 1); isl_seq_clr(vec->el + 1, vec->size - 1); return isl_point_alloc(space, vec); error: isl_space_free(space); return NULL; } __isl_give isl_point *isl_point_dup(__isl_keep isl_point *pnt) { struct isl_point *pnt2; if (!pnt) return NULL; pnt2 = isl_point_alloc(isl_space_copy(pnt->dim), isl_vec_copy(pnt->vec)); return pnt2; } __isl_give isl_point *isl_point_cow(__isl_take isl_point *pnt) { struct isl_point *pnt2; if (!pnt) return NULL; if (pnt->ref == 1) return pnt; pnt2 = isl_point_dup(pnt); isl_point_free(pnt); return pnt2; } __isl_give isl_point *isl_point_copy(__isl_keep isl_point *pnt) { if (!pnt) return NULL; pnt->ref++; return pnt; } __isl_null isl_point *isl_point_free(__isl_take isl_point *pnt) { if (!pnt) return NULL; if (--pnt->ref > 0) return NULL; isl_space_free(pnt->dim); isl_vec_free(pnt->vec); free(pnt); return NULL; } __isl_give isl_point *isl_point_void(__isl_take isl_space *space) { if (!space) return NULL; return isl_point_alloc(space, isl_vec_alloc(space->ctx, 0)); } isl_bool isl_point_is_void(__isl_keep isl_point *pnt) { if (!pnt) return isl_bool_error; return isl_bool_ok(pnt->vec->size == 0); } #undef TYPE #define TYPE isl_point #undef FIELD_TYPE #define FIELD_TYPE isl_space #undef FIELD_NAME #define FIELD_NAME dim #undef PROPERTY #define PROPERTY space #include "isl_peek_templ.c" #include "isl_get_templ.c" #include "isl_take_templ.c" #include "isl_restore_templ.c" #undef TYPE #define TYPE isl_point #undef FIELD_TYPE #define FIELD_TYPE isl_vec #undef FIELD_NAME #define FIELD_NAME vec #undef PROPERTY #define PROPERTY vec #include "isl_peek_templ.c" #include "isl_get_templ.c" #include "isl_take_templ.c" #include "isl_restore_templ.c" /* Return the number of variables of the given type. */ static isl_size isl_point_dim(__isl_keep isl_point *pnt, enum isl_dim_type type) { return isl_space_dim(isl_point_peek_space(pnt), type); } /* Return the position of the coordinates of the given type * within the sequence of coordinates of "pnt". */ static isl_size isl_point_var_offset(__isl_keep isl_point *pnt, enum isl_dim_type type) { return pnt ? isl_space_offset(pnt->dim, type) : isl_size_error; } /* Reorder the coordinates of "pnt" based on the given reordering. */ static __isl_give isl_point *isl_point_reorder(__isl_take isl_point *pnt, __isl_take isl_reordering *r) { isl_vec *vec; isl_space_free(isl_point_take_space(pnt)); pnt = isl_point_restore_space(pnt, isl_reordering_get_space(r)); vec = isl_point_take_vec(pnt); vec = isl_vec_reorder(vec, 1, isl_reordering_copy(r)); pnt = isl_point_restore_vec(pnt, vec); return pnt; } /* Align the parameters of "pnt" along those of "model". * * Note that "model" is not allowed to have any parameters * that do not already appear in "pnt" since "pnt" does not specify * any value for such parameters. */ __isl_give isl_point *isl_point_align_params(__isl_take isl_point *pnt, __isl_take isl_space *model) { isl_space *space; isl_bool equal_params; space = isl_point_peek_space(pnt); equal_params = isl_space_has_equal_params(space, model); if (equal_params < 0) goto error; if (!equal_params) { isl_reordering *r; r = isl_parameter_alignment_reordering(space, model); if (!r) goto error; if (r->src_len != r->dst_len) isl_die(isl_point_get_ctx(pnt), isl_error_invalid, "no value specified for some parameters", r = isl_reordering_free(r)); pnt = isl_point_reorder(pnt, r); } isl_space_free(model); return pnt; error: isl_space_free(model); isl_point_free(pnt); return NULL; } #undef TYPE #define TYPE isl_point static #include "check_type_range_templ.c" /* Return the value of coordinate "pos" of type "type" of "pnt". */ __isl_give isl_val *isl_point_get_coordinate_val(__isl_keep isl_point *pnt, enum isl_dim_type type, int pos) { isl_ctx *ctx; isl_val *v; isl_size off; if (!pnt) return NULL; ctx = isl_point_get_ctx(pnt); if (isl_point_is_void(pnt)) isl_die(ctx, isl_error_invalid, "void point does not have coordinates", return NULL); if (isl_point_check_range(pnt, type, pos, 1) < 0) return NULL; off = isl_point_var_offset(pnt, type); if (off < 0) return NULL; pos += off; v = isl_val_rat_from_isl_int(ctx, pnt->vec->el[1 + pos], pnt->vec->el[0]); return isl_val_normalize(v); } /* Set all entries of "mv" to NaN. */ static __isl_give isl_multi_val *set_nan(__isl_take isl_multi_val *mv) { int i; isl_size n; isl_val *v; n = isl_multi_val_size(mv); if (n < 0) return isl_multi_val_free(mv); v = isl_val_nan(isl_multi_val_get_ctx(mv)); for (i = 0; i < n; ++i) mv = isl_multi_val_set_at(mv, i, isl_val_copy(v)); isl_val_free(v); return mv; } /* Return the values of the set dimensions of "pnt". * Return a sequence of NaNs in case of a void point. */ __isl_give isl_multi_val *isl_point_get_multi_val(__isl_keep isl_point *pnt) { int i; isl_bool is_void; isl_size n; isl_multi_val *mv; is_void = isl_point_is_void(pnt); if (is_void < 0) return NULL; mv = isl_multi_val_alloc(isl_point_get_space(pnt)); if (is_void) return set_nan(mv); n = isl_multi_val_size(mv); if (n < 0) return isl_multi_val_free(mv); for (i = 0; i < n; ++i) { isl_val *v; v = isl_point_get_coordinate_val(pnt, isl_dim_set, i); mv = isl_multi_val_set_at(mv, i, v); } return mv; } /* Replace coordinate "pos" of type "type" of "pnt" by "v". */ __isl_give isl_point *isl_point_set_coordinate_val(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, __isl_take isl_val *v) { isl_size off; off = isl_space_offset(isl_point_peek_space(pnt), type); if (off < 0 || !v) goto error; if (isl_point_is_void(pnt)) isl_die(isl_point_get_ctx(pnt), isl_error_invalid, "void point does not have coordinates", goto error); if (isl_point_check_range(pnt, type, pos, 1) < 0) goto error; if (!isl_val_is_rat(v)) isl_die(isl_point_get_ctx(pnt), isl_error_invalid, "expecting rational value", goto error); pos += off; if (isl_int_eq(pnt->vec->el[1 + pos], v->n) && isl_int_eq(pnt->vec->el[0], v->d)) { isl_val_free(v); return pnt; } pnt = isl_point_cow(pnt); if (!pnt) goto error; pnt->vec = isl_vec_cow(pnt->vec); if (!pnt->vec) goto error; if (isl_int_eq(pnt->vec->el[0], v->d)) { isl_int_set(pnt->vec->el[1 + pos], v->n); } else if (isl_int_is_one(v->d)) { isl_int_mul(pnt->vec->el[1 + pos], pnt->vec->el[0], v->n); } else { isl_seq_scale(pnt->vec->el + 1, pnt->vec->el + 1, v->d, pnt->vec->size - 1); isl_int_mul(pnt->vec->el[1 + pos], pnt->vec->el[0], v->n); isl_int_mul(pnt->vec->el[0], pnt->vec->el[0], v->d); pnt->vec = isl_vec_normalize(pnt->vec); if (!pnt->vec) goto error; } isl_val_free(v); return pnt; error: isl_val_free(v); isl_point_free(pnt); return NULL; } __isl_give isl_point *isl_point_add_ui(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, unsigned val) { isl_size off; if (!pnt || isl_point_is_void(pnt)) return pnt; pnt = isl_point_cow(pnt); if (!pnt) return NULL; pnt->vec = isl_vec_cow(pnt->vec); if (!pnt->vec) goto error; off = isl_point_var_offset(pnt, type); if (off < 0) goto error; pos += off; isl_int_add_ui(pnt->vec->el[1 + pos], pnt->vec->el[1 + pos], val); return pnt; error: isl_point_free(pnt); return NULL; } __isl_give isl_point *isl_point_sub_ui(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, unsigned val) { isl_size off; if (!pnt || isl_point_is_void(pnt)) return pnt; pnt = isl_point_cow(pnt); if (!pnt) return NULL; pnt->vec = isl_vec_cow(pnt->vec); if (!pnt->vec) goto error; off = isl_point_var_offset(pnt, type); if (off < 0) goto error; pos += off; isl_int_sub_ui(pnt->vec->el[1 + pos], pnt->vec->el[1 + pos], val); return pnt; error: isl_point_free(pnt); return NULL; } struct isl_foreach_point { struct isl_scan_callback callback; isl_stat (*fn)(__isl_take isl_point *pnt, void *user); void *user; isl_space *dim; }; static isl_stat foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sample) { struct isl_foreach_point *fp = (struct isl_foreach_point *)cb; isl_point *pnt; pnt = isl_point_alloc(isl_space_copy(fp->dim), sample); return fp->fn(pnt, fp->user); } isl_stat isl_set_foreach_point(__isl_keep isl_set *set, isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) { struct isl_foreach_point fp = { { &foreach_point }, fn, user }; int i; if (!set) return isl_stat_error; fp.dim = isl_set_get_space(set); if (!fp.dim) return isl_stat_error; set = isl_set_copy(set); set = isl_set_cow(set); set = isl_set_make_disjoint(set); set = isl_set_compute_divs(set); if (!set) goto error; for (i = 0; i < set->n; ++i) if (isl_basic_set_scan(isl_basic_set_copy(set->p[i]), &fp.callback) < 0) goto error; isl_set_free(set); isl_space_free(fp.dim); return isl_stat_ok; error: isl_set_free(set); isl_space_free(fp.dim); return isl_stat_error; } /* Return 1 if "bmap" contains the point "point". * "bmap" is assumed to have known divs. * The point is first extended with the divs and then passed * to basic_map_contains. */ isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, __isl_keep isl_point *point) { isl_local *local; isl_vec *vec; isl_bool contains; if (isl_basic_map_point_check_equal_space(bmap, point) < 0) return isl_bool_error; if (bmap->n_div == 0) return isl_basic_map_contains(bmap, point->vec); local = isl_local_alloc_from_mat(isl_basic_map_get_divs(bmap)); vec = isl_point_get_vec(point); vec = isl_local_extend_point_vec(local, vec); isl_local_free(local); contains = isl_basic_map_contains(bmap, vec); isl_vec_free(vec); return contains; } isl_bool isl_map_contains_point(__isl_keep isl_map *map, __isl_keep isl_point *point) { int i; isl_bool found = isl_bool_false; if (!map || !point) return isl_bool_error; map = isl_map_copy(map); map = isl_map_compute_divs(map); if (!map) return isl_bool_error; for (i = 0; i < map->n; ++i) { found = isl_basic_map_contains_point(map->p[i], point); if (found < 0) goto error; if (found) break; } isl_map_free(map); return found; error: isl_map_free(map); return isl_bool_error; } isl_bool isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point) { return isl_map_contains_point(set_to_map(set), point); } __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt) { isl_basic_set *bset; isl_basic_set *model; if (!pnt) return NULL; model = isl_basic_set_empty(isl_space_copy(pnt->dim)); bset = isl_basic_set_from_vec(isl_vec_copy(pnt->vec)); bset = isl_basic_set_from_underlying_set(bset, model); isl_point_free(pnt); return bset; } __isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt) { isl_basic_set *bset; bset = isl_basic_set_from_point(pnt); return isl_set_from_basic_set(bset); } /* This function performs the same operation as isl_set_from_point, * but is considered as a function on an isl_point when exported. */ __isl_give isl_set *isl_point_to_set(__isl_take isl_point *pnt) { return isl_set_from_point(pnt); } /* Construct a union set, containing the single element "pnt". * If "pnt" is void, then return an empty union set. */ __isl_give isl_union_set *isl_union_set_from_point(__isl_take isl_point *pnt) { if (!pnt) return NULL; if (isl_point_is_void(pnt)) { isl_space *space; space = isl_point_get_space(pnt); isl_point_free(pnt); return isl_union_set_empty(space); } return isl_union_set_from_set(isl_set_from_point(pnt)); } __isl_give isl_basic_set *isl_basic_set_box_from_points( __isl_take isl_point *pnt1, __isl_take isl_point *pnt2) { isl_basic_set *bset = NULL; isl_size total; int i; int k; isl_int t; isl_int_init(t); if (!pnt1 || !pnt2) goto error; isl_assert(pnt1->dim->ctx, isl_space_is_equal(pnt1->dim, pnt2->dim), goto error); if (isl_point_is_void(pnt1) && isl_point_is_void(pnt2)) { isl_space *space = isl_space_copy(pnt1->dim); isl_point_free(pnt1); isl_point_free(pnt2); isl_int_clear(t); return isl_basic_set_empty(space); } if (isl_point_is_void(pnt1)) { isl_point_free(pnt1); isl_int_clear(t); return isl_basic_set_from_point(pnt2); } if (isl_point_is_void(pnt2)) { isl_point_free(pnt2); isl_int_clear(t); return isl_basic_set_from_point(pnt1); } total = isl_point_dim(pnt1, isl_dim_all); if (total < 0) goto error; bset = isl_basic_set_alloc_space(isl_space_copy(pnt1->dim), 0, 0, 2 * total); for (i = 0; i < total; ++i) { isl_int_mul(t, pnt1->vec->el[1 + i], pnt2->vec->el[0]); isl_int_submul(t, pnt2->vec->el[1 + i], pnt1->vec->el[0]); k = isl_basic_set_alloc_inequality(bset); if (k < 0) goto error; isl_seq_clr(bset->ineq[k] + 1, total); if (isl_int_is_pos(t)) { isl_int_set_si(bset->ineq[k][1 + i], -1); isl_int_set(bset->ineq[k][0], pnt1->vec->el[1 + i]); } else { isl_int_set_si(bset->ineq[k][1 + i], 1); isl_int_neg(bset->ineq[k][0], pnt1->vec->el[1 + i]); } isl_int_fdiv_q(bset->ineq[k][0], bset->ineq[k][0], pnt1->vec->el[0]); k = isl_basic_set_alloc_inequality(bset); if (k < 0) goto error; isl_seq_clr(bset->ineq[k] + 1, total); if (isl_int_is_pos(t)) { isl_int_set_si(bset->ineq[k][1 + i], 1); isl_int_neg(bset->ineq[k][0], pnt2->vec->el[1 + i]); } else { isl_int_set_si(bset->ineq[k][1 + i], -1); isl_int_set(bset->ineq[k][0], pnt2->vec->el[1 + i]); } isl_int_fdiv_q(bset->ineq[k][0], bset->ineq[k][0], pnt2->vec->el[0]); } bset = isl_basic_set_finalize(bset); isl_point_free(pnt1); isl_point_free(pnt2); isl_int_clear(t); return bset; error: isl_point_free(pnt1); isl_point_free(pnt2); isl_int_clear(t); isl_basic_set_free(bset); return NULL; } __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1, __isl_take isl_point *pnt2) { isl_basic_set *bset; bset = isl_basic_set_box_from_points(pnt1, pnt2); return isl_set_from_basic_set(bset); } /* Print the coordinate at position "pos" of the point "pnt". */ static __isl_give isl_printer *print_coordinate(__isl_take isl_printer *p, struct isl_print_space_data *data, unsigned pos) { isl_point *pnt = data->user; isl_size off; off = isl_space_offset(data->space, data->type); if (off < 0) return isl_printer_free(p); pos += off; p = isl_printer_print_isl_int(p, pnt->vec->el[1 + pos]); if (!isl_int_is_one(pnt->vec->el[0])) { p = isl_printer_print_str(p, "/"); p = isl_printer_print_isl_int(p, pnt->vec->el[0]); } return p; } __isl_give isl_printer *isl_printer_print_point( __isl_take isl_printer *p, __isl_keep isl_point *pnt) { struct isl_print_space_data data = { 0 }; int i; isl_size nparam; if (!pnt) return p; if (isl_point_is_void(pnt)) { p = isl_printer_print_str(p, "void"); return p; } nparam = isl_point_dim(pnt, isl_dim_param); if (nparam < 0) return isl_printer_free(p); if (nparam > 0) { p = isl_printer_print_str(p, "["); for (i = 0; i < nparam; ++i) { const char *name; if (i) p = isl_printer_print_str(p, ", "); name = isl_space_get_dim_name(pnt->dim, isl_dim_param, i); if (name) { p = isl_printer_print_str(p, name); p = isl_printer_print_str(p, " = "); } p = isl_printer_print_isl_int(p, pnt->vec->el[1 + i]); if (!isl_int_is_one(pnt->vec->el[0])) { p = isl_printer_print_str(p, "/"); p = isl_printer_print_isl_int(p, pnt->vec->el[0]); } } p = isl_printer_print_str(p, "]"); p = isl_printer_print_str(p, " -> "); } data.print_dim = &print_coordinate; data.user = pnt; p = isl_printer_print_str(p, "{ "); p = isl_print_space(pnt->dim, p, 0, &data); p = isl_printer_print_str(p, " }"); return p; } isl-0.28/interface/0000775000175000017500000000000015222442312013257 5ustar00skimoskimoisl-0.28/interface/cpp.cc0000664000175000017500000011655415215726270014376 0ustar00skimoskimo/* * Copyright 2016, 2017 Tobias Grosser. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY TOBIAS GROSSER ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOBIAS GROSSER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as * representing official policies, either expressed or implied, of * Tobias Grosser. */ #include #include #include #include "cpp.h" #include "isl_config.h" /* Determine the isl types from which the given class can be implicitly * constructed using a unary constructor. * * Look through all constructors for implicit conversion constructors that take * an isl type and add those types, along with the corresponding * constructor argument. */ void cpp_generator::set_class_construction_types(isl_class &clazz) { for (const auto &cons : clazz.constructors) { ParmVarDecl *param; QualType type; std::string arg_type; if (!is_implicit_conversion(Method(clazz, cons))) continue; param = cons->getParamDecl(0); type = param->getOriginalType(); arg_type = extract_type(type); clazz.construction_types.emplace(arg_type, param); } } /* Determine the isl types from which any (proper) class can be constructed * using a unary constructor. */ void cpp_generator::set_construction_types() { for (auto &kvp : classes) { auto &clazz = kvp.second; set_class_construction_types(clazz); } } /* Construct a generator for C++ bindings. * * The classes and methods are extracted by the constructor * of the generator superclass. * * Additionally extract information about types * that can be converted to a class and copy all methods * from superclasses that can be converted to a given class * to that class. */ cpp_generator::cpp_generator(SourceManager &SM, set &exported_types, set exported_functions, set functions) : generator(SM, exported_types, exported_functions, functions) { set_construction_types(); copy_super_methods(); } /* Copy the method called "name" described by "fd" from "super" to "clazz" * with the distance to the original ancestor given by "depth". * * In particular, keep track of "fd" as well as the superclass * from which it was copied and the distance to the original ancestor. */ static void copy_method(isl_class &clazz, const isl_class &super, const std::string &name, FunctionDecl *fd, int depth) { clazz.methods[name].insert(fd); clazz.copied_from.emplace(fd, super); clazz.copy_depth.emplace(fd, depth); } /* Do "fd1" and "fd2" have the same signature (ignoring the first argument * which represents the object class on which the corresponding method * gets called). */ static bool same_signature(FunctionDecl *fd1, FunctionDecl *fd2) { int n1 = fd1->getNumParams(); int n2 = fd2->getNumParams(); if (n1 != n2) return false; for (int i = 1; i < n1; ++i) { ParmVarDecl *p1 = fd1->getParamDecl(i); ParmVarDecl *p2 = fd2->getParamDecl(i); if (p1->getOriginalType() != p2->getOriginalType()) return false; } return true; } /* Return the distance between "clazz" and the ancestor * from which "fd" got copied. * If no distance was recorded, then the method has not been copied * but appears in "clazz" itself and so the distance is zero. */ static int copy_depth(const isl_class &clazz, FunctionDecl *fd) { if (clazz.copy_depth.count(fd) == 0) return 0; return clazz.copy_depth.at(fd); } /* Is the method derived from "fd", with method name "name" and * with distance to the original ancestor "depth", * overridden by a method already in "clazz"? * * A method is considered to have been overridden if there * is a method with the same name in "clazz" that has the same signature and * that comes from an ancestor closer to "clazz", * where an ancestor is closer if the distance in the class hierarchy * is smaller or the distance is the same and the ancestor appears * closer in the declaration of the type (in which case it gets added first). * * If a method with the same signature has already been added, * but it does not override the method derived from "fd", * then this method is removed since it is overridden by "fd". */ static bool is_overridden(FunctionDecl *fd, isl_class &clazz, const std::string &name, int depth) { if (clazz.methods.count(name) == 0) return false; for (const auto &m : clazz.methods.at(name)) { if (!same_signature(fd, m)) continue; if (copy_depth(clazz, m) <= depth) return true; clazz.methods[name].erase(m); return false; } return false; } /* Add the methods "methods" with method name "name" from "super" to "clazz" * provided they have not been overridden by a method already in "clazz". * * Methods that are static in their original class are not copied. */ void cpp_generator::copy_methods(isl_class &clazz, const std::string &name, const isl_class &super, const function_set &methods) { for (auto fd : methods) { int depth; if (method2class(fd)->is_static(fd)) continue; depth = copy_depth(super, fd) + 1; if (is_overridden(fd, clazz, name, depth)) continue; copy_method(clazz, super, name, fd, depth); } } /* Add all methods from "super" to "clazz" that have not been overridden * by a method already in "clazz". * * Look through all groups of methods with the same name. */ void cpp_generator::copy_super_methods(isl_class &clazz, const isl_class &super) { for (const auto &kvp : super.methods) { const auto &name = kvp.first; const auto &methods = kvp.second; copy_methods(clazz, name, super, methods); } } /* Copy methods from the superclasses of "clazz" * if an object of this class can be implicitly converted to an object * from the superclass, keeping track * of the classes that have already been handled in "done". * * Make sure the superclasses have copied methods from their superclasses first * since those methods could be copied further down to this class. * * Consider the superclass that appears closest to the subclass first. */ void cpp_generator::copy_super_methods(isl_class &clazz, set &done) { auto supers = find_superclasses(clazz.type); for (const auto &super : supers) if (done.count(super) == 0) copy_super_methods(classes[super], done); done.insert(clazz.name); for (const auto &super_name : supers) { const auto &super = classes[super_name]; if (super.construction_types.count(clazz.name) == 0) continue; copy_super_methods(clazz, super); } } /* For each (proper) class, copy methods from its superclasses, * if an object from the class can be converted to an object * from the superclass. * * Type based subclasses are not considered for now since * they do not have any explicit superclasses. * * Iterate through all (proper) classes and copy methods * from their superclasses, * unless they have already been determined by a recursive call. */ void cpp_generator::copy_super_methods() { set done; for (auto &kvp : classes) { auto &clazz = kvp.second; if (clazz.is_type_subclass()) continue; if (done.count(clazz.name) != 0) continue; copy_super_methods(clazz, done); } } /* Print declarations or implementations of constructors. * * For each isl function that is marked as __isl_constructor, * add a corresponding C++ constructor. * * Example of declarations: * * inline /\* implicit *\/ union_set(basic_set bset); * inline /\* implicit *\/ union_set(set set); * inline explicit val(ctx ctx, long i); * inline explicit val(ctx ctx, const std::string &str); */ void cpp_generator::class_printer::print_constructors() { for (const auto &cons : clazz.constructors) print_method(Method(clazz, cons)); } /* Print declarations or definitions for methods in the class. */ void cpp_generator::class_printer::print_methods() { for (const auto &kvp : clazz.methods) print_method_group(kvp.second, kvp.first); } /* Print declarations or implementations for the methods derived from "fd", * which sets an enum. * * A method is generated for each value in the enum, setting * the enum to that value. */ void cpp_generator::class_printer::print_set_enums(FunctionDecl *fd) { for (const auto &set : clazz.set_enums.at(fd)) { EnumMethod method(clazz, fd, set.method_name, set.name); print_method(method); } } /* Print declarations or implementations for methods derived from functions * that set an enum. */ void cpp_generator::class_printer::print_set_enums() { for (const auto &kvp : clazz.set_enums) print_set_enums(kvp.first); } /* Update "convert" to reflect the next combination of automatic conversions * for the arguments of "fd", * returning false if there are no more combinations. * * In particular, find the last argument for which an automatic * conversion function is available mapping to the type of this argument and * that is not already marked for conversion. * Mark this argument, if any, for conversion and clear the markings * of all subsequent arguments. * Repeated calls to this method therefore run through * all possible combinations. * * Note that the first function argument is never considered * for automatic conversion since this is the argument * from which the isl_ctx used in the conversion is extracted. */ bool cpp_generator::class_printer::next_variant(FunctionDecl *fd, std::vector &convert) { size_t n = convert.size(); for (int i = n - 1; i >= 1; --i) { ParmVarDecl *param = fd->getParamDecl(i); const Type *type = param->getOriginalType().getTypePtr(); if (generator.conversions.count(type) == 0) continue; if (convert[i]) continue; convert[i] = true; for (size_t j = i + 1; j < n; ++j) convert[j] = false; return true; } return false; } /* Print a declaration or definition for a method called "name" * derived from "fd". * * If the method was copied from a superclass, then print a definition * that calls the corresponding method in the superclass. * Otherwise, for methods that are identified as "get" methods, also * print a declaration or definition for the method * using a name that includes the "get_" prefix. * * If the generated method is an object method, then check * whether any of its arguments can be automatically converted * from something else, and, if so, generate a method * for each combination of converted arguments. * Do so by constructing a ConversionMethod that changes the converted arguments * to those of the sources of the conversions. * * Note that a method may be both copied from a superclass and * have arguments that can be automatically converted. * In this case, the conversion methods for the arguments * call the corresponding method in this class, which * in turn will call the method in the superclass. */ void cpp_generator::class_printer::print_method_variants(FunctionDecl *fd, const std::string &name) { Method method(clazz, fd, name); std::vector convert(method.num_params()); if (method.clazz.copied_from.count(method.fd) == 0) { print_method(method); if (clazz.is_get_method(fd)) print_get_method(fd); } else { auto super = method.clazz.copied_from.at(method.fd); print_method(ConversionMethod(method, super.name)); } if (method.kind != Method::Kind::member_method) return; while (next_variant(fd, convert)) { print_method(ConversionMethod(method, [&] (int pos) { return get_param(fd, pos, convert); })); } } /* Given a function declaration representing a method, * does this method have a single argument (beyond the object * on which the method is called) that corresponds to * an isl object? */ static bool has_single_isl_argument(FunctionDecl *fd) { ParmVarDecl *param; if (fd->getNumParams() != 2) return false; param = fd->getParamDecl(1); return generator::is_isl_type(param->getOriginalType()); } /* Does the set "methods" contain exactly one function declaration * that corresponds to a method of "clazz" itself (i.e., that * was not copied from an ancestor)? */ static FunctionDecl *single_local(const isl_class &clazz, const function_set &methods) { int count = 0; FunctionDecl *local; for (const auto &fn : methods) { if (!clazz.first_arg_matches_class(fn)) continue; ++count; local = fn; } return count == 1 ? local : NULL; } /* Given a function declaration "fd" for a method called "name" * with a single argument representing an isl object, * generate declarations or definitions for methods with the same name, * but with as argument an isl object of a class that can be implicitly * converted to that of the original argument. * In particular, generate methods for converting this argument. */ void cpp_generator::class_printer::print_descendent_overloads( FunctionDecl *fd, const std::string &name) { Method method(clazz, fd, name); ParmVarDecl *param = fd->getParamDecl(1); QualType type = param->getOriginalType(); std::string arg = type->getPointeeType().getAsString(); for (const auto &kvp : generator.classes[arg].construction_types) { const auto sub = kvp.second; print_method(ConversionMethod(method, [&] (int pos) { return sub; })); } } /* Print declarations or definitions for methods called "name" * derived from "methods". * * If want_descendent_overloads signals that variants should be added that take * as arguments those types that can be converted to the original argument type * through a unary constructor and if only one of the methods in the group * was originally defined in "clazz", then effectively add those variants. * Only do this for methods with a single (isl object) argument. */ void cpp_generator::class_printer::print_method_group( const function_set &methods, const std::string &name) { FunctionDecl *local; for (const auto &fd : methods) print_method_variants(fd, name); if (!want_descendent_overloads(methods)) return; local = single_local(clazz, methods); if (!local) return; if (!has_single_isl_argument(local)) return; print_descendent_overloads(local, name); } /* Print the use of the argument at position "pos" to "os". * * Member methods pass the isl object corresponding to "this" * as first argument (at position 0). * Any other arguments are passed along from the method arguments. * * If the argument value is loaded from a this pointer, the original * value must be preserved and must consequently be copied. Values that are * loaded from method parameters do not need to be preserved, as such values * will already be copies of the actual parameters. It is consequently possible * to directly take the pointer from these values, which saves * an unnecessary copy. * * In case the parameter is a callback function, two parameters get printed, * a wrapper for the callback function and a pointer to the actual * callback function. The wrapper is expected to be available * in a previously declared variable _lambda, while * the actual callback function is expected to be stored * in a structure called _data. * The caller of this function must ensure that these variables exist. */ void Method::print_param_use(ostream &os, int pos) const { ParmVarDecl *param = fd->getParamDecl(pos); bool load_from_this_ptr = pos == 0 && kind == member_method; string name = param->getName().str(); QualType type = param->getOriginalType(); if (type->isIntegerType()) { os << name; return; } if (generator::is_string(type)) { os << name << ".c_str()"; return; } if (generator::is_callback(type)) { os << name << "_lambda, "; os << "&" << name << "_data"; return; } if (!load_from_this_ptr) os << name << "."; if (generator::keeps(param)) { os << "get()"; } else { if (load_from_this_ptr) os << "copy()"; else os << "release()"; } } /* Does the isl function from which this method is derived * modify an object of a subclass based on a type function? */ bool Method::is_subclass_mutator() const { return clazz.is_type_subclass() && generator::is_mutator(clazz, fd); } /* Return the C++ return type of the method "method". * * If the corresponding function modifies an object of a subclass, then return * the type of this subclass. * Otherwise, return the C++ counterpart of the actual return type. */ std::string cpp_type_printer::return_type(const Method &method) const { if (method.is_subclass_mutator()) return cpp_generator::type2cpp(method.clazz); else return param(-1, method.fd->getReturnType()); } /* Return the formal parameter at position "pos" of "fd". * However, if this parameter should be converted, as indicated * by "convert", then return the second formal parameter * of the conversion function instead. */ ParmVarDecl *cpp_generator::class_printer::get_param(FunctionDecl *fd, int pos, const std::vector &convert) { ParmVarDecl *param = fd->getParamDecl(pos); if (!convert[pos]) return param; return generator.conversions[param->getOriginalType().getTypePtr()]; } /* Print the header for "method", without newline or semicolon, * using "type_printer" to print argument and return types. * * Print the header of a declaration if this->declarations is set, * otherwise print the header of a method definition. * * This function prints headers for member methods, static methods, and * constructors, either for their declaration or definition. * * Member functions are declared as "const", as they do not change the current * object, but instead create a new object. They always retrieve the first * parameter of the original isl function from the this-pointer of the object, * such that only starting at the second parameter the parameters of the * original function become part of the method's interface. * * A function * * __isl_give isl_set *isl_set_intersect(__isl_take isl_set *s1, * __isl_take isl_set *s2); * * is translated into: * * inline set intersect(set set2) const * * For static functions and constructors all parameters of the original isl * function are exposed. * * Parameters of which no copy is required, are passed * as const reference, which allows the compiler to optimize the parameter * transfer. * * Constructors are marked as explicit using the C++ keyword 'explicit' or as * implicit using a comment in place of the explicit keyword. By annotating * implicit constructors with a comment, users of the interface are made * aware of the potential danger that implicit construction is possible * for these constructors, whereas without a comment not every user would * know that implicit construction is allowed in absence of an explicit keyword. * * Note that in case "method" is a ConversionMethod, the argument returned * by Method::get_param may be different from the original argument. * The name of the argument is, however, derived from the original * function argument. */ void cpp_generator::class_printer::print_method_header( const Method &method, const cpp_type_printer &type_printer) { string rettype_str = type_printer.return_type(method); if (declarations) { os << " "; if (method.kind == Method::Kind::static_method) os << "static "; os << "inline "; if (method.kind == Method::Kind::constructor) { if (generator.is_implicit_conversion(method)) os << "/* implicit */ "; else os << "explicit "; } } if (method.kind != Method::Kind::constructor) os << rettype_str << " "; if (!declarations) os << type_printer.class_type(cppstring) << "::"; if (method.kind != Method::Kind::constructor) os << method.name; else os << cppstring; method.print_cpp_arg_list(os, [&] (int i, int arg) { std::string name = method.fd->getParamDecl(i)->getName().str(); ParmVarDecl *param = method.get_param(i); QualType type = param->getOriginalType(); string cpptype = type_printer.param(arg, type); if (!method.param_needs_copy(i)) os << "const " << cpptype << " &" << name; else os << cpptype << " " << name; }); if (method.kind == Method::Kind::member_method) os << " const"; } /* Generate the list of argument types for a callback function of * type "type", appearing in argument position "arg". * If "cpp" is set, then generate the C++ type list, otherwise * the C type list. * * For a callback of type * * isl_stat (*)(__isl_take isl_map *map, void *user) * * the following C++ argument list is generated: * * map * * The arguments of the callback are considered to appear * after the position of the callback itself. */ std::string cpp_type_printer::generate_callback_args(int arg, QualType type, bool cpp) const { std::string type_str; const FunctionProtoType *callback; int num_params; callback = generator::extract_prototype(type); num_params = callback->getNumParams(); if (cpp) num_params--; for (long i = 0; i < num_params; i++) { QualType type = callback->getParamType(i); if (cpp) type_str += param(arg + 1 + i, type); else type_str += type.getAsString(); if (!cpp) type_str += "arg_" + ::to_string(i); if (i != num_params - 1) type_str += ", "; } return type_str; } /* Generate the full cpp type of a callback function of type "type", * appearing in argument position "arg". * * For a callback of type * * isl_stat (*)(__isl_take isl_map *map, void *user) * * the following type is generated: * * std::function */ std::string cpp_type_printer::generate_callback_type(int arg, QualType type) const { std::string type_str; const FunctionProtoType *callback = generator::extract_prototype(type); QualType return_type = callback->getReturnType(); string rettype_str = param(arg, return_type); type_str = "std::function<"; type_str += rettype_str; type_str += "("; type_str += generate_callback_args(arg, type, true); type_str += ")>"; return type_str; } /* An array listing functions that must be renamed and the function name they * should be renamed to. We currently rename functions in case their name would * match a reserved C++ keyword, which is not allowed in C++. */ static const char *rename_map[][2] = { { "union", "unite" }, }; /* Rename method "name" in case the method name in the C++ bindings should not * match the name in the C bindings. We do this for example to avoid * C++ keywords. */ static std::string rename_method(std::string name) { for (size_t i = 0; i < sizeof(rename_map) / sizeof(rename_map[0]); i++) if (name.compare(rename_map[i][0]) == 0) return rename_map[i][1]; return name; } /* Translate isl class "clazz" to its corresponding C++ type. * Use the name of the type based subclass, if any. */ string cpp_generator::type2cpp(const isl_class &clazz) { return type2cpp(clazz.subclass_name); } /* Translate type string "type_str" to its C++ name counterpart. */ string cpp_generator::type2cpp(string type_str) { return type_str.substr(4); } /* Return the C++ counterpart to the isl_bool type. * * By default, this is simply "bool" since * the exceptional case is handled through exceptions. */ std::string cpp_type_printer::isl_bool() const { return "bool"; } /* Return the C++ counterpart to the isl_stat type. * * By default, this is simply "void" since * the exceptional case is handled through exceptions. */ string cpp_type_printer::isl_stat() const { return "void"; } /* Return the C++ counterpart to the isl_size type. * * By default, this is simply "unsigned" since * the exceptional case is handled through exceptions. */ string cpp_type_printer::isl_size() const { return "unsigned"; } /* Return the namespace of the generated C++ bindings. * * By default, this is "isl::". */ std::string cpp_type_printer::isl_namespace() const { return "isl::"; } /* Return the class type given the C++ name. * * By default, directly use the C++ name. */ std::string cpp_type_printer::class_type(const std::string &cpp_name) const { return cpp_name; } /* Return the qualified form of the given C++ isl type name appearing * in argument position "arg" (-1 for return type). * * By default, the argument position is ignored. */ std::string cpp_type_printer::qualified(int arg, const std::string &cpp_type) const { return isl_namespace() + cpp_type; } /* Return the C++ counterpart to the given isl type appearing * in argument position "arg" (-1 for return type). */ std::string cpp_type_printer::isl_type(int arg, QualType type) const { auto name = type->getPointeeType().getAsString(); return qualified(arg, cpp_generator::type2cpp(name)); } /* Translate parameter or return type "type" to its C++ name counterpart. * "arg" is the position of the argument, or -1 in case of the return type. * If any callback is involved, then the return type and arguments types * of the callback are considered to start at the position of the callback. */ std::string cpp_type_printer::param(int arg, QualType type) const { if (cpp_generator::is_isl_type(type)) return isl_type(arg, type); if (cpp_generator::is_isl_bool(type)) return isl_bool(); if (cpp_generator::is_isl_stat(type)) return isl_stat(); if (cpp_generator::is_isl_size(type)) return isl_size(); if (type->isIntegerType()) return type.getAsString(); if (cpp_generator::is_string(type)) return "std::string"; if (cpp_generator::is_callback(type)) return generate_callback_type(arg, type); generator::die("Cannot convert type to C++ type"); } /* Check if "subclass_type" is a subclass of "class_type". */ bool cpp_generator::is_subclass(QualType subclass_type, const isl_class &class_type) { std::string type_str = subclass_type->getPointeeType().getAsString(); std::vector superclasses; std::vector parents; std::vector::iterator ci; superclasses = generator::find_superclasses(classes[type_str].type); for (ci = superclasses.begin(); ci < superclasses.end(); ci++) parents.push_back(&classes[*ci]); while (!parents.empty()) { const isl_class *candidate = parents.back(); parents.pop_back(); if (&class_type == candidate) return true; superclasses = generator::find_superclasses(candidate->type); for (ci = superclasses.begin(); ci < superclasses.end(); ci++) parents.push_back(&classes[*ci]); } return false; } /* Check if "cons" is an implicit conversion constructor of class "clazz". * * An implicit conversion constructor is generated in case "cons" has a single * parameter, where the parameter type is a subclass of the class that is * currently being generated. */ bool cpp_generator::is_implicit_conversion(const Method &cons) { const auto &clazz = cons.clazz; ParmVarDecl *param = cons.fd->getParamDecl(0); QualType type = param->getOriginalType(); int num_params = cons.fd->getNumParams(); if (num_params != 1) return false; if (is_isl_type(type) && !is_isl_ctx(type) && is_subclass(type, clazz)) return true; return false; } /* Construct a list combiner for printing a list. */ Method::list_combiner Method::print_combiner(std::ostream &os) { return { [&] () { os << "("; }, [&] () { os << ", "; }, [&] () { os << ")"; } }; } /* Construct a list combiner for simply iterating over a list. */ Method::list_combiner Method::empty_combiner() { return { [&] () { }, [&] () { }, [&] () { } }; } /* Get kind of "method" in "clazz". * * Given the declaration of a static or member method, returns its kind. */ static Method::Kind get_kind(const isl_class &clazz, FunctionDecl *method) { if (generator::is_constructor(method)) return Method::Kind::constructor; else if (generator::is_static(clazz, method)) return Method::Kind::static_method; else return Method::Kind::member_method; } /* Return the callback arguments of "fd". */ static std::vector find_callback_args(FunctionDecl *fd) { std::vector callbacks; int num_params = fd->getNumParams(); for (int i = 0; i < num_params; ++i) { ParmVarDecl *param = fd->getParamDecl(i); if (generator::is_callback(param->getType())) callbacks.emplace_back(param); } return callbacks; } /* Construct a C++ method object from the class to which is belongs, * the isl function from which it is derived and the method name. * * Perform any renaming of the method that may be required and * determine the type of the method. */ Method::Method(const isl_class &clazz, FunctionDecl *fd, const std::string &name) : clazz(clazz), fd(fd), name(rename_method(name)), kind(get_kind(clazz, fd)), callbacks(find_callback_args(fd)) { } /* Construct a C++ method object from the class to which is belongs and * the isl function from which it is derived. * * Obtain the default method name and continue * with the generic constructor. */ Method::Method(const isl_class &clazz, FunctionDecl *fd) : Method(clazz, fd, clazz.method_name(fd)) { } /* Return the number of parameters of the corresponding C function. * * This number includes any possible user pointers that follow callback * arguments. These are skipped by Method::print_fd_arg_list * during the actual argument printing. */ int Method::c_num_params() const { return fd->getNumParams(); } /* Return the number of parameters of the method * (including the implicit "this"). * * By default, it is the same as the number of parameters * of the corresponding C function. */ int Method::num_params() const { return c_num_params(); } /* Call "on_arg_skip_next" on the arguments from "start" (inclusive) * to "end" (exclusive), calling the methods of "combiner" * before, between and after the arguments. * If "on_arg_skip_next" returns true then the next argument is skipped. */ void Method::on_arg_list(int start, int end, const Method::list_combiner &combiner, const std::function &on_arg_skip_next) { combiner.before(); for (int i = start; i < end; ++i) { if (i != start) combiner.between(); if (on_arg_skip_next(i)) ++i; } combiner.after(); } /* Print the arguments from "start" (inclusive) to "end" (exclusive) * as arguments to a method of C function call, using "print_arg_skip_next" * to print each individual argument. If this callback return true * then the next argument is skipped. */ void Method::print_arg_list(std::ostream &os, int start, int end, const std::function &print_arg_skip_next) { on_arg_list(start, end, print_combiner(os), [&] (int i) { return print_arg_skip_next(i); }); } /* Call "on_arg" on the arguments from "start" (inclusive) to "end" (exclusive), * calling the methods of "combiner" before, between and after the arguments. * The first argument to "on_arg" is the position of the argument * in this->fd. * The second argument is the (first) position in the list of arguments * with all callback arguments spliced in. * * Call on_arg_list to do the actual iteration over the arguments, skipping * the user argument that comes after every callback argument. * On the C++ side no user pointer is needed, as arguments can be forwarded * as part of the std::function argument which specifies the callback function. * The user pointer is also removed from the number of parameters * of the C function because the pair of callback and user pointer * is considered as a single argument that is printed as a whole * by Method::print_param_use. * * In case of a callback argument, the second argument to "print_arg" * is also adjusted to account for the spliced-in arguments of the callback. * The return value takes the place of the callback itself, * while the arguments (excluding the final user pointer) * take the following positions. */ void Method::on_fd_arg_list(int start, int end, const Method::list_combiner &combiner, const std::function &on_arg) const { int arg = start; on_arg_list(start, end, combiner, [this, &on_arg, &arg] (int i) { auto type = fd->getParamDecl(i)->getType(); on_arg(i, arg++); if (!generator::is_callback(type)) return false; arg += generator::prototype_n_args(type) - 1; return true; }); } /* Print the arguments from "start" (inclusive) to "end" (exclusive) * as arguments to a method of C function call, using "print_arg" * to print each individual argument. * The first argument to this callback is the position of the argument * in this->fd. * The second argument is the (first) position in the list of arguments * with all callback arguments spliced in. */ void Method::print_fd_arg_list(std::ostream &os, int start, int end, const std::function &print_arg) const { on_fd_arg_list(start, end, print_combiner(os), print_arg); } /* Call "on_arg" on the arguments to the method call, * calling the methods of "combiner" before, between and after the arguments. * The first argument to "on_arg" is the position of the argument * in this->fd. * The second argument is the (first) position in the list of arguments * with all callback arguments spliced in. */ void Method::on_cpp_arg_list(const Method::list_combiner &combiner, const std::function &on_arg) const { int first_param = kind == member_method ? 1 : 0; on_fd_arg_list(first_param, num_params(), combiner, on_arg); } /* Call "on_arg" on the arguments to the method call. * The first argument to "on_arg" is the position of the argument * in this->fd. * The second argument is the (first) position in the list of arguments * with all callback arguments spliced in. */ void Method::on_cpp_arg_list( const std::function &on_arg) const { on_cpp_arg_list(empty_combiner(), on_arg); } /* Print the arguments to the method call, using "print_arg" * to print each individual argument. * The first argument to this callback is the position of the argument * in this->fd. * The second argument is the (first) position in the list of arguments * with all callback arguments spliced in. */ void Method::print_cpp_arg_list(std::ostream &os, const std::function &print_arg) const { on_cpp_arg_list(print_combiner(os), print_arg); } /* Should the parameter at position "pos" be a copy (rather than * a const reference)? * * Strictly speaking, a copy is only needed on isl types that are * not marked __isl_keep, since those will be release()'d * by code printed by Method::print_param_use. * * However, there may be other arguments such as integer types * that are more naturally passed as a copy. * The default is therefore to require a copy, except for * arguments marked __isl_keep, string arguments or callback arguments. */ bool Method::param_needs_copy(int pos) const { ParmVarDecl *param = get_param(pos); QualType type = param->getOriginalType(); if (generator::keeps(param)) return false; if (generator::is_string(type) || generator::is_callback(type)) return false; return true; } /* Return the method argument at position "pos". */ clang::ParmVarDecl *Method::get_param(int pos) const { return fd->getParamDecl(pos); } /* Construct a method that performs one or more conversions * from the original Method (without conversions), * the name of the type to which "this" should be converted and * a function for determining the arguments of the constructed method. */ ConversionMethod::ConversionMethod(const Method &method, const std::string &this_type, const std::function &get_param) : NoCopyMethod(method), this_type(this_type), get_param_fn(get_param) { } /* Construct a method that only performs a conversion on "this" * from the original Method (without conversions) and * the name of the type to which "this" should be converted. * * Call the generic constructor with * a function for determining the arguments of the constructed method * that performs no conversion. */ ConversionMethod::ConversionMethod(const Method &method, const std::string &this_type) : ConversionMethod(method, this_type, [this] (int pos) { return Method::get_param(pos); }) { } /* Construct a method that performs one or more argument conversions * from the original Method (without conversions) and * a function for determining the arguments of the constructed method. * * Call the generic constructor with method.clazz.name as "this" type, * indicating that "this" should not be converted. */ ConversionMethod::ConversionMethod(const Method &method, const std::function &get_param) : ConversionMethod(method, method.clazz.name, get_param) { } /* Should the parameter at position "pos" be a copy (rather than * a const reference)? * * Parameters of isl type do not need to be a copy. * For other types, use the same defaults as Method. */ bool NoCopyMethod::param_needs_copy(int pos) const { ParmVarDecl *param = get_param(pos); QualType type = param->getOriginalType(); if (generator::is_isl_type(type)) return false; return Method::param_needs_copy(pos); } /* Return the method argument at position "pos". * * Call get_param_fn to determine this argument. */ clang::ParmVarDecl *ConversionMethod::get_param(int pos) const { return get_param_fn(pos); } /* Print a call to the method (without the arguments), * with "ns" the namespace of the generated C++ bindings. * * If "this_type" is different from the name of the class of the method, * then "this" needs to be converted to that type before * the call is performed. */ void ConversionMethod::print_call(std::ostream &os, const std::string &ns) const { if (clazz.name == this_type) { os << "this->"; } else { auto cpp_type = ns + cpp_generator::type2cpp(this_type); os << cpp_type << "(*this)."; } os << name; } /* Construct an object representing a C++ method for setting an enum * from the class to which is belongs, * the isl function from which it is derived and the method and enum names. */ EnumMethod::EnumMethod(const isl_class &clazz, FunctionDecl *fd, const std::string &method_name, const std::string &enum_name) : Method(clazz, fd, method_name), enum_name(enum_name) { } /* Print the use of the argument at position "pos" to "os". * * If the position is beyond the number of method arguments, * then it corresponds to the enum value corresponding to this EnumMethod. * Otherwise, delegate to Method::print_param_use. */ void EnumMethod::print_param_use(ostream &os, int pos) const { if (pos == num_params()) os << enum_name; else Method::print_param_use(os, pos); } /* Return the number of parameters of the method * (including the implicit "this"). * * The last argument of the C function does not appear in the method call, * because it is replaced by a break-up into several methods. */ int EnumMethod::num_params() const { return Method::num_params() - 1; } /* Initialize a class method printer from the stream onto which the methods * are printed, the class method description and the C++ interface generator. */ cpp_generator::class_printer::class_printer(std::ostream &os, const isl_class &clazz, cpp_generator &generator, bool declarations) : os(os), clazz(clazz), cppstring(type2cpp(clazz)), generator(generator), declarations(declarations) { } isl-0.28/interface/plain_cpp.h0000664000175000017500000001461315072740040015404 0ustar00skimoskimo#ifndef ISL_INTERFACE_PLAIN_CPP_H #define ISL_INTERFACE_PLAIN_CPP_H #include #include #include "cpp.h" #include "generator.h" using namespace std; using namespace clang; /* A type printer for converting argument and return types * to string representations of the corresponding types * in the checked C++ interface. */ struct checked_cpp_type_printer : public cpp_type_printer { virtual std::string isl_bool() const override; virtual std::string isl_stat() const override; virtual std::string isl_size() const override; virtual std::string isl_namespace() const override; }; /* Generator for plain C++ bindings. * * "checked" is set if C++ bindings should be generated * that rely on the user to check for error conditions. */ class plain_cpp_generator : public cpp_generator { struct plain_printer; struct decl_printer; struct impl_printer; protected: bool checked; public: plain_cpp_generator(SourceManager &SM, set &exported_types, set exported_functions, set functions, bool checked = false); virtual void generate(); private: void print_forward_declarations(ostream &os); void print_declarations(ostream &os); void print_class(ostream &os, const isl_class &clazz); void print_class_forward_decl(ostream &os, const isl_class &clazz); void print_implementations(ostream &os); void print_class_impl(ostream &os, const isl_class &clazz); void print_check_no_persistent_callback(ostream &os, const isl_class &clazz, FunctionDecl *fd); void print_invalid(ostream &os, int indent, const char *msg, const char *checked_code); void print_method_param_use(ostream &os, ParmVarDecl *param, bool load_from_this_ptr); std::unique_ptr type_printer(); std::string get_return_type(const Method &method); string generate_callback_args(QualType type, bool cpp); string generate_callback_type(QualType type); string isl_bool2cpp(); string isl_namespace(); string param2cpp(QualType type); }; /* A helper class for printing method declarations and definitions * of a class for the plain C++ interface. * * "generator" is the C++ interface generator printing the classes. */ struct plain_cpp_generator::plain_printer : public cpp_generator::class_printer { plain_cpp_generator &generator; plain_printer(std::ostream &os, const isl_class &clazz, plain_cpp_generator &generator, bool is_declaration) : class_printer(os, clazz, generator, is_declaration), generator(generator) {} void print_persistent_callback_prototype(FunctionDecl *method); void print_persistent_callback_setter_prototype(FunctionDecl *method); void print_full_method_header(const Method &method); void print_callback_data_decl(ParmVarDecl *param, const string &name); virtual bool want_descendent_overloads(const function_set &methods) override; virtual void print_public_constructors() = 0; virtual void print_copy_assignment() = 0; virtual void print_destructor() = 0; virtual void print_ptr() = 0; virtual void print_downcast() = 0; virtual void print_ctx() = 0; virtual void print_method_separator() = 0; virtual void print_persistent_callbacks() = 0; void print_public_methods(); void print_id_constructor_user_header(); void print_id_user_header(bool optional); virtual void print_id_constructor_user() = 0; virtual void print_id_user(bool optional) = 0; void print_special_id(); void print_special(); }; /* A helper class for printing method declarations of a class. */ struct plain_cpp_generator::decl_printer : public plain_cpp_generator::plain_printer { decl_printer(std::ostream &os, const isl_class &clazz, plain_cpp_generator &generator) : plain_printer(os, clazz, generator, true) {} void print_subclass_type(); void print_class_factory(const std::string &prefix = std::string()); void print_protected_constructors(); virtual void print_copy_assignment() override; virtual void print_public_constructors() override; virtual void print_destructor() override; virtual void print_ptr() override; void print_isa_type_template(int indent, const isl_class &super); virtual void print_downcast() override; virtual void print_ctx() override; virtual void print_method_separator() override; void print_persistent_callback_data(FunctionDecl *method); virtual void print_persistent_callbacks() override; virtual void print_method(const Method &method) override; virtual void print_method(const ConversionMethod &method) override; virtual void print_get_method(FunctionDecl *fd) override; virtual void print_id_constructor_user() override; virtual void print_id_user(bool optional) override; }; /* A helper class for printing method definitions of a class. */ struct plain_cpp_generator::impl_printer : public plain_cpp_generator::plain_printer { impl_printer(std::ostream &os, const isl_class &clazz, plain_cpp_generator &generator) : plain_printer(os, clazz, generator, false) {} void print_arg_conversion(ParmVarDecl *dst, ParmVarDecl *src); virtual void print_method(const Method &method) override; virtual void print_method(const ConversionMethod &method) override; virtual void print_get_method(FunctionDecl *fd) override; void print_check_ptr(const char *ptr); void print_check_ptr_start(const char *ptr); void print_check_ptr_end(const char *ptr); void print_class_factory(); void print_protected_constructors(); virtual void print_public_constructors() override; virtual void print_copy_assignment() override; virtual void print_destructor() override; virtual void print_ptr() override; virtual void print_downcast() override; virtual void print_ctx() override; virtual void print_method_separator() override; void print_set_persistent_callback(const Method &method); virtual void print_persistent_callbacks() override; void print_argument_validity_check(const Method &method); void print_save_ctx(const std::string &ctx); void print_save_ctx(const Method &method); void print_on_error_continue(); void print_exceptional_execution_check(const Method &method); void print_method_return(const Method &method); void print_stream_insertion(); void print_wrapped_call_checked(int indent, const std::string &call); void print_wrapped_call(int indent, const std::string &call, QualType rtype); void print_callback_body(int indent, ParmVarDecl *param, const string &name); void print_callback_local(ParmVarDecl *param); virtual void print_id_constructor_user() override; virtual void print_id_user(bool optional) override; }; #endif isl-0.28/interface/config.sub0000755000175000017500000010511615072740065015255 0ustar00skimoskimo#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: isl-0.28/interface/configure0000775000175000017500000274311415215726347015221 0ustar00skimoskimo#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for isl-interface 0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: isl-development@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='isl-interface' PACKAGE_TARNAME='isl-interface' PACKAGE_VERSION='0' PACKAGE_STRING='isl-interface 0' PACKAGE_BUGREPORT='isl-development@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CONFIG_STATUS_DEPENDENCIES XCODE_SELECT LLVM_CONFIG CLANG_LIBS CLANG_RFLAG CLANG_LDFLAGS CLANG_CXXFLAGS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP SED LIBTOOL HAVE_CXX11 GREP CXXCPPFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXXCPP_FOR_BUILD ac_ct_CXX_FOR_BUILD CXX_FOR_BUILD host_os host_vendor host_cpu host CXXCPP LDFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CFLAGS_FOR_BUILD CCDEPMODE_FOR_BUILD BUILD_OBJEXT BUILD_EXEEXT CPP_FOR_BUILD ac_ct_CC_FOR_BUILD CC_FOR_BUILD build_os build_vendor build_cpu build CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__xargs_n am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static enable_pic with_pic enable_fast_install enable_aix_soname with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP CXXCPP LT_SYS_LIBRARY_PATH' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures isl-interface 0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/isl-interface] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of isl-interface 0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF isl-interface configure 0 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by isl-interface $as_me 0, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="ltmain.sh config.guess config.sub compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 am__api_version='1.18' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir ;; esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='isl-interface' VERSION='0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test x$am_uid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} elif test $am_uid -le $am_max_uid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test x$gm_gid = xunknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 printf "%s\n" "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} elif test $am_gid -le $am_max_gid; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } _am_tools=none fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 printf %s "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if test ${am_cv_prog_tar_ustar+y} then : printf %s "(cached) " >&6 else case e in #( e) am_cv_prog_tar_ustar=$_am_tool ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi AM_DEFAULT_VERBOSITY=0 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 printf %s "checking whether the C++ compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 printf %s "checking for C++ compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C++ compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else case e in #( e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else case e in #( e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 ;; esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac cross_compiling_build=no ac_build_tool_prefix= if test -n "$build" then : ac_build_tool_prefix="$build-" elif test -n "$build_alias" then : ac_build_tool_prefix="$build_alias-" fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu was_set_c_compiler_gnu=${ac_cv_c_compiler_gnu+y} if test ${was_set_c_compiler_gnu} then : saved_c_compiler_gnu=$ac_cv_c_compiler_gnu { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;} fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_build_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_build_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC_FOR_BUILD"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC_FOR_BUILD="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC_FOR_BUILD shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC_FOR_BUILD to just the basename; use the full file name. shift ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_build_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="$ac_build_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC_FOR_BUILD" && break done fi if test -z "$CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC_FOR_BUILD" && break done if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_build_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_build_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling_build:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi fi test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC_FOR_BUILD=yes else GCC_FOR_BUILD= fi ac_test_CFLAGS=${CFLAGS_FOR_BUILD+y} ac_save_CFLAGS=$CFLAGS_FOR_BUILD { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } if test ${ac_cv_build_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_build_prog_cc_g=no CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes else case e in #( e) CFLAGS_FOR_BUILD="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS_FOR_BUILD=$ac_save_CFLAGS elif test $ac_cv_build_prog_cc_g = yes; then if test "$GCC_FOR_BUILD" = yes; then CFLAGS_FOR_BUILD="-g -O2" else CFLAGS_FOR_BUILD="-g" fi else if test "$GCC_FOR_BUILD" = yes; then CFLAGS_FOR_BUILD="-O2" else CFLAGS_FOR_BUILD= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C11 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } if test ${ac_cv_build_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c11=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c11" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C99 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } if test ${ac_cv_build_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c99=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c99" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C89 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } if test ${ac_cv_build_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_build_prog_cc_c89=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_build_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC ;; esac fi if test "x$ac_cv_build_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_build_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_build_prog_cc_c89" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_build_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 printf %s "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } if test ${am_cv_build_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_build_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_build_objext; then : OK else am_cv_build_prog_cc_c_o=no break fi done # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_build_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_build_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_build_objext conftest2.dSYM unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_build_prog_cc_c_o" >&6; } if test "$am_cv_build_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu depcc="$CC_FOR_BUILD" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_build_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_build_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${BUILD_OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${BUILD_OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_build_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_build_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_build_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_build_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_build_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_build_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_build_TRUE= am__fastdepCC_build_FALSE='#' else am__fastdepCC_build_TRUE='#' am__fastdepCC_build_FALSE= fi if test ${was_set_c_compiler_gnu} then : ac_cv_c_compiler_gnu=$saved_c_compiler_gnu fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_build_exeext+y} && test "$ac_cv_build_exeext" != no; then :; else ac_cv_build_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_build_exeext" = no && ac_cv_build_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_build_exeext=$ac_cv_build_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_build_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_build_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_build_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_exeext" >&5 printf "%s\n" "$ac_cv_build_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_build_exeext ac_build_exeext=$BUILD_EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling_build" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_build_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling_build=no else if test "$cross_compiling_build" = maybe; then cross_compiling_build=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--build'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling_build" >&5 printf "%s\n" "$cross_compiling_build" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_build_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_build_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_build_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_build_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_objext" >&5 printf "%s\n" "$ac_cv_build_objext" >&6; } OBJEXT=$ac_cv_build_objext ac_build_objext=$BUILD_OBJEXT ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then CPP_FOR_BUILD= fi if test -z "$CPP_FOR_BUILD"; then if test ${ac_cv_build_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_build_prog_CPP=$CPP_FOR_BUILD ;; esac fi CPP_FOR_BUILD=$ac_cv_build_prog_CPP else ac_cv_build_prog_CPP=$CPP_FOR_BUILD fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 printf "%s\n" "$CPP_FOR_BUILD" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_build_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu EXEEXT=$ac_cv_exeext BUILD_EXEEXT=$ac_cv_build_exeext; ac_build_exeext=$ac_cv_build_exeext OBJEXT=$ac_cv_objext BUILD_OBJEXT=$ac_cv_build_objext; ac_build_objext=$ac_cv_build_objext CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type CCDEPMODE_FOR_BUILD=depmode=$am_cv_build_CC_dependencies_compiler_type 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP ;; esac fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac save_cross_compiling=$cross_compiling save_ac_tool_prefix=$ac_tool_prefix cross_compiling=no ac_tool_prefix= ac_ext=cpp ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX_FOR_BUILD"; then if test -n "$CCC"; then CXX_FOR_BUILD=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CXX_FOR_BUILD"; then ac_cv_prog_CXX_FOR_BUILD="$CXX_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX_FOR_BUILD="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CXX_FOR_BUILD=$ac_cv_prog_CXX_FOR_BUILD if test -n "$CXX_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX_FOR_BUILD" >&5 printf "%s\n" "$CXX_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX_FOR_BUILD" && break done fi if test -z "$CXX_FOR_BUILD"; then ac_ct_CXX_FOR_BUILD=$CXX_FOR_BUILD for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX_FOR_BUILD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CXX_FOR_BUILD"; then ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_ct_CXX_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CXX_FOR_BUILD=$ac_cv_prog_ac_ct_CXX_FOR_BUILD if test -n "$ac_ct_CXX_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CXX_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX_FOR_BUILD" && break done if test "x$ac_ct_CXX_FOR_BUILD" = x; then CXX_FOR_BUILD="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CXX_FOR_BUILD=$ac_ct_CXX_FOR_BUILD fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_build_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS_FOR_BUILD+y} ac_save_CXXFLAGS=$CXXFLAGS_FOR_BUILD { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX_FOR_BUILD accepts -g" >&5 printf %s "checking whether $CXX_FOR_BUILD accepts -g... " >&6; } if test ${ac_cv_build_prog_cxx_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_build_prog_cxx_g=no CXXFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_build_prog_cxx_g=yes else case e in #( e) CXXFLAGS_FOR_BUILD="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else case e in #( e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_build_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_build_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS_FOR_BUILD=$ac_save_CXXFLAGS elif test $ac_cv_build_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS_FOR_BUILD="-g -O2" else CXXFLAGS_FOR_BUILD="-g" fi else if test "$GXX" = yes; then CXXFLAGS_FOR_BUILD="-O2" else CXXFLAGS_FOR_BUILD= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX_FOR_BUILD option to enable C++11 features" >&5 printf %s "checking for $CXX_FOR_BUILD option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX_FOR_BUILD="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX_FOR_BUILD=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX_FOR_BUILD="$CXX_FOR_BUILD $ac_cv_prog_cxx_cxx11" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 ;; esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX_FOR_BUILD option to enable C++98 features" >&5 printf %s "checking for $CXX_FOR_BUILD option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX_FOR_BUILD="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX_FOR_BUILD=$ac_save_CXX ;; esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX_FOR_BUILD="$CXX_FOR_BUILD $ac_cv_prog_cxx_cxx98" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX_FOR_BUILD" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP_FOR_BUILD"; then if test ${ac_cv_build_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP_FOR_BUILD in "$CXX_FOR_BUILD -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD ;; esac fi CXXCPP_FOR_BUILD=$ac_cv_build_prog_CXXCPP else ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP_FOR_BUILD" >&5 printf "%s\n" "$CXXCPP_FOR_BUILD" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP_FOR_BUILD\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_tool_prefix=$save_ac_tool_prefix cross_compiling=$save_cross_compiling # extract_interface needs to be run on the build system. # Since this is the only target that is being built, # simply use the build compiler throughout. # This ensures that the clang configure checks are # performed using the right compiler. CXX="$CXX_FOR_BUILD" CXXCPP="$CXXCPP_FOR_BUILD" EXEEXT="$BUILD_EXEEXT" OBJEXT="$BUILD_OBJEXT" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" echo $CXX | $GREP -e "-std=" > /dev/null 2> /dev/null if test $? -eq 0; 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 ac_success=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 printf %s "checking whether $CXX supports C++11 features by default... " >&6; } if test ${ax_cv_cxx_compile_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_compile_cxx11=yes else case e in #( e) ax_cv_cxx_compile_cxx11=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes 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 if test x$ac_success = xno; then HAVE_CXX11=0 else HAVE_CXX11=1 printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h fi else ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false 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 ac_success=no if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval $cachevar=yes else case e in #( e) eval $cachevar=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done 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 if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX11=0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h fi fi # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_shared=no ;; esac fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.5.4' macro_revision='2.5.4' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 printf %s "checking for -no_fixup_chains linker flag... " >&6; } if test ${lt_cv_support_no_fixup_chains+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_support_no_fixup_chains=yes else case e in #( e) lt_cv_support_no_fixup_chains=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_static=yes ;; esac fi # Check whether --enable-pic was given. if test ${enable_pic+y} then : enableval=$enable_pic; lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --enable-aix-soname was given. if test ${enable_aix_soname+y} then : enableval=$enable_aix_soname; case $enableval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$enable_aix_soname else case e in #( e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi ;; esac fi enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; *-mlibc) archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; serenity*) ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_c_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi ='-fPIC' archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc=no no_undefined_flag= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP ;; esac fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=no ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; *-mlibc) ld_shlibs_CXX=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; serenity*) ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. if test x-L = x"$p" || test x-R = x"$p" || test x-l = x"$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi ='-fPIC' archive_cmds_CXX='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc_CXX=no no_undefined_flag_CXX= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" 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: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed if test "x$with_clang_prefix" != "x"; then LLVM_CONFIG="$with_clang_prefix/bin/llvm-config" fi # Extract the first word of ""llvm-config"", so it can be a program name with args. set dummy "llvm-config"; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LLVM_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $LLVM_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_LLVM_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi LLVM_CONFIG=$ac_cv_path_LLVM_CONFIG if test -n "$LLVM_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 printf "%s\n" "$LLVM_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$LLVM_CONFIG" || test ! -x "$LLVM_CONFIG"; then as_fn_error $? "llvm-config not found" "$LINENO" 5 fi CLANG_CXXFLAGS=`$LLVM_CONFIG --cxxflags | \ $SED -e 's/-Wcovered-switch-default//' \ -e 's/-gsplit-dwarf//' \ -e 's/-Wl,--no-keep-files-mapped//'` CLANG_LDFLAGS=`$LLVM_CONFIG --ldflags` # Construct a -R argument for libtool. # This is needed in case some of the clang libraries are shared libraries. CLANG_RFLAG=`echo "$CLANG_LDFLAGS" | $SED -e 's/-L/-R/g'` CLANG_VERSION=`$LLVM_CONFIG --version` CLANG_LIB="LLVM-$CLANG_VERSION" SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$CLANG_LDFLAGS $LDFLAGS" as_ac_Lib=`printf "%s\n" "ac_cv_lib_$CLANG_LIB""_main" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$CLANG_LIB" >&5 printf %s "checking for main in -l$CLANG_LIB... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-l$CLANG_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else case e in #( e) eval "$as_ac_Lib=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : have_lib_llvm=yes else case e in #( e) have_lib_llvm=no ;; esac fi LDFLAGS="$SAVE_LDFLAGS" # Use single libLLVM shared library when available. # Otherwise, try and figure out all the required libraries if test "$have_lib_llvm" = yes; then CLANG_LIBS="-l$CLANG_LIB" else targets=`$LLVM_CONFIG --targets-built` components="$targets asmparser bitreader support mc" # Link in option and frontendopenmp components when available # since they may be used by the clang libraries. for c in option frontendopenmp; do $LLVM_CONFIG --components | $GREP $c > /dev/null 2> /dev/null if test $? -eq 0; then components="$components $c" fi done CLANG_LIBS=`$LLVM_CONFIG --libs $components` fi systemlibs=`$LLVM_CONFIG --system-libs 2> /dev/null | tail -1` if test $? -eq 0; then CLANG_LIBS="$CLANG_LIBS $systemlibs" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CPPFLAGS="$CLANG_CXXFLAGS -I$srcdir $CPPFLAGS" LDFLAGS="$CLANG_LDFLAGS $LDFLAGS" # A test program for checking whether linking against libclang-cpp works. # Use single libclang-cpp shared library when available. # Otherwise, use a selection of clang libraries that appears to work. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclang-cpp" >&5 printf %s "checking for main in -lclang-cpp... " >&6; } if test ${ac_cv_lib_clang_cpp_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclang-cpp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clang_cpp_main=yes else case e in #( e) ac_cv_lib_clang_cpp_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clang_cpp_main" >&5 printf "%s\n" "$ac_cv_lib_clang_cpp_main" >&6; } if test "x$ac_cv_lib_clang_cpp_main" = xyes then : have_lib_clang=yes else case e in #( e) have_lib_clang=no ;; esac fi if test "$have_lib_clang" = yes; then # The LLVM libraries may be linked into libclang-cpp already. # Linking against them again can cause errors about options # being registered more than once. # Check whether linking against libclang-cpp requires # linking against the LLVM libraries as well. # Fail if linking fails with or without the LLVM libraries. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libclang-cpp needs LLVM libraries" >&5 printf %s "checking whether libclang-cpp needs LLVM libraries... " >&6; } LIBS="-lclang-cpp $SAVE_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { new clang::CompilerInstance(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : clangcpp_needs_llvm=no else case e in #( e) LIBS="-lclang-cpp $CLANG_LIBS $SAVE_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { new clang::CompilerInstance(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : clangcpp_needs_llvm=yes else case e in #( e) clangcpp_needs_llvm=unknown ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $clangcpp_needs_llvm" >&5 printf "%s\n" "$clangcpp_needs_llvm" >&6; } if test "$clangcpp_needs_llvm" = "no" then : CLANG_LIBS="-lclang-cpp" elif test "$clangcpp_needs_llvm" = "yes" then : CLANG_LIBS="-lclang-cpp $CLANG_LIBS" else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "unable to link against libclang-cpp See 'config.log' for more details" "$LINENO" 5; } ;; esac fi else LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangSupport" >&5 printf %s "checking for main in -lclangSupport... " >&6; } if test ${ac_cv_lib_clangSupport_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangSupport $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangSupport_main=yes else case e in #( e) ac_cv_lib_clangSupport_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangSupport_main" >&5 printf "%s\n" "$ac_cv_lib_clangSupport_main" >&6; } if test "x$ac_cv_lib_clangSupport_main" = xyes then : CLANG_LIBS="-lclangSupport $CLANG_LIBS" fi CLANG_LIBS="-lclangDriver -lclangBasic $CLANG_LIBS" LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangOptions" >&5 printf %s "checking for main in -lclangOptions... " >&6; } if test ${ac_cv_lib_clangOptions_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangOptions $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangOptions_main=yes else case e in #( e) ac_cv_lib_clangOptions_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangOptions_main" >&5 printf "%s\n" "$ac_cv_lib_clangOptions_main" >&6; } if test "x$ac_cv_lib_clangOptions_main" = xyes then : CLANG_LIBS="-lclangOptions $CLANG_LIBS" fi LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangASTMatchers" >&5 printf %s "checking for main in -lclangASTMatchers... " >&6; } if test ${ac_cv_lib_clangASTMatchers_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangASTMatchers $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangASTMatchers_main=yes else case e in #( e) ac_cv_lib_clangASTMatchers_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangASTMatchers_main" >&5 printf "%s\n" "$ac_cv_lib_clangASTMatchers_main" >&6; } if test "x$ac_cv_lib_clangASTMatchers_main" = xyes then : CLANG_LIBS="-lclangASTMatchers $CLANG_LIBS" fi CLANG_LIBS="-lclangAnalysis -lclangAST -lclangLex $CLANG_LIBS" LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangAnalysisLifetimeSafety" >&5 printf %s "checking for main in -lclangAnalysisLifetimeSafety... " >&6; } if test ${ac_cv_lib_clangAnalysisLifetimeSafety_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangAnalysisLifetimeSafety $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangAnalysisLifetimeSafety_main=yes else case e in #( e) ac_cv_lib_clangAnalysisLifetimeSafety_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangAnalysisLifetimeSafety_main" >&5 printf "%s\n" "$ac_cv_lib_clangAnalysisLifetimeSafety_main" >&6; } if test "x$ac_cv_lib_clangAnalysisLifetimeSafety_main" = xyes then : CLANG_LIBS="-lclangAnalysisLifetimeSafety $CLANG_LIBS" fi LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangEdit" >&5 printf %s "checking for main in -lclangEdit... " >&6; } if test ${ac_cv_lib_clangEdit_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangEdit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangEdit_main=yes else case e in #( e) ac_cv_lib_clangEdit_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangEdit_main" >&5 printf "%s\n" "$ac_cv_lib_clangEdit_main" >&6; } if test "x$ac_cv_lib_clangEdit_main" = xyes then : CLANG_LIBS="-lclangEdit $CLANG_LIBS" fi LIBS="$CLANG_LIBS $SAVE_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclangAPINotes" >&5 printf %s "checking for main in -lclangAPINotes... " >&6; } if test ${ac_cv_lib_clangAPINotes_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lclangAPINotes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace conftest { extern "C" int main (); } int main (void) { return conftest::main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_clangAPINotes_main=yes else case e in #( e) ac_cv_lib_clangAPINotes_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clangAPINotes_main" >&5 printf "%s\n" "$ac_cv_lib_clangAPINotes_main" >&6; } if test "x$ac_cv_lib_clangAPINotes_main" = xyes then : CLANG_LIBS="-lclangAPINotes $CLANG_LIBS" fi CLANG_LIBS="-lclangParse -lclangSema $CLANG_LIBS" CLANG_LIBS="-lclangFrontend -lclangSerialization $CLANG_LIBS" fi CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" LIBS="$SAVE_LIBS" 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 CLANG_PREFIX=`$LLVM_CONFIG --prefix` printf "%s\n" "#define ISL_CLANG_PREFIX \"$CLANG_PREFIX\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang resource directory" >&5 printf %s "checking for clang resource directory... " >&6; } CLANG_RESOURCE_DIR=`$CLANG_PREFIX/bin/clang -print-resource-dir 2>/dev/null` if test $? -eq 0 && test "x$CLANG_RESOURCE_DIR" != "x"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CLANG_RESOURCE_DIR" >&5 printf "%s\n" "$CLANG_RESOURCE_DIR" >&6; } printf "%s\n" "#define ISL_CLANG_RESOURCE_DIR \"$CLANG_RESOURCE_DIR\"" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found or not supported" >&5 printf "%s\n" "not found or not supported" >&6; } fi # If $CLANG_PREFIX/bin/clang cannot find the standard include files, # then see if setting sysroot to `xcode-select -p`/SDKs/MacOSX.sdk helps. # This may be required on some versions of OS X since they lack /usr/include. # If so, set ISL_CLANG_SYSROOT accordingly. SAVE_CC="$CC" CC="$CLANG_PREFIX/bin/clang" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CLANG_PREFIX/bin/clang can find standard include files" >&5 printf %s "checking whether $CLANG_PREFIX/bin/clang can find standard include files... " >&6; } found_header=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : found_header=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $found_header" >&5 printf "%s\n" "$found_header" >&6; } if test "x$found_header" != "xyes"; then # Extract the first word of "xcode-select", so it can be a program name with args. set dummy xcode-select; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_XCODE_SELECT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$XCODE_SELECT"; then ac_cv_prog_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_XCODE_SELECT="xcode-select" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi XCODE_SELECT=$ac_cv_prog_XCODE_SELECT if test -n "$XCODE_SELECT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XCODE_SELECT" >&5 printf "%s\n" "$XCODE_SELECT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$XCODE_SELECT"; then as_fn_error $? "Cannot find xcode-select" "$LINENO" 5 fi sysroot=`$XCODE_SELECT -p`/SDKs/MacOSX.sdk SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -isysroot $sysroot" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether standard include files can be found with sysroot set" >&5 printf %s "checking whether standard include files can be found with sysroot set... " >&6; } found_header=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : found_header=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $found_header" >&5 printf "%s\n" "$found_header" >&6; } CPPFLAGS="$SAVE_CPPFLAGS" if test "x$found_header" != "xyes"; then as_fn_error $? "Cannot find standard include files" "$LINENO" 5 else printf "%s\n" "#define ISL_CLANG_SYSROOT \"$sysroot\"" >>confdefs.h fi fi CC="$SAVE_CC" 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 SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CLANG_CXXFLAGS -I$srcdir $CPPFLAGS" ac_fn_cxx_check_header_compile "$LINENO" "clang/Basic/SourceLocation.h" "ac_cv_header_clang_Basic_SourceLocation_h" "$ac_includes_default" if test "x$ac_cv_header_clang_Basic_SourceLocation_h" = xyes then : else case e in #( e) as_fn_error $? "clang header file not found" "$LINENO" 5 ;; esac fi ac_fn_cxx_check_header_compile "$LINENO" "llvm/TargetParser/Host.h" "ac_cv_header_llvm_TargetParser_Host_h" "$ac_includes_default" if test "x$ac_cv_header_llvm_TargetParser_Host_h" = xyes then : printf "%s\n" "#define HAVE_TARGETPARSER_HOST_H /**/" >>confdefs.h else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "getDefaultTargetTriple" >/dev/null 2>&1 then : else case e in #( e) printf "%s\n" "#define getDefaultTargetTriple getHostTriple" >>confdefs.h ;; esac fi rm -rf conftest* ;; esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "getExpansionLineNumber" >/dev/null 2>&1 then : else case e in #( e) printf "%s\n" "#define getExpansionLineNumber getInstantiationLineNumber" >>confdefs.h ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "getImmediateExpansionRange" >/dev/null 2>&1 then : else case e in #( e) printf "%s\n" "#define getImmediateExpansionRange getImmediateInstantiationRange" >>confdefs.h ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "ArrayRef.*CommandLineArgs" >/dev/null 2>&1 then : printf "%s\n" "#define CREATE_FROM_ARGS_TAKES_ARRAYREF /**/" >>confdefs.h fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "void HandleTopLevelDecl\(" >/dev/null 2>&1 then : printf "%s\n" "#define HandleTopLevelDeclReturn void" >>confdefs.h printf "%s\n" "#define HandleTopLevelDeclContinue /**/" >>confdefs.h else case e in #( e) printf "%s\n" "#define HandleTopLevelDeclReturn bool" >>confdefs.h printf "%s\n" "#define HandleTopLevelDeclContinue true" >>confdefs.h ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { using namespace clang; std::shared_ptr TO; DiagnosticsEngine *Diags; TargetInfo::CreateTargetInfo(*Diags, TO); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define CREATETARGETINFO_TAKES_SHARED_PTR /**/" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "getReturnType" >/dev/null 2>&1 then : else case e in #( e) printf "%s\n" "#define getReturnType getResultType" >>confdefs.h ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "initializeBuiltins" >/dev/null 2>&1 then : else case e in #( e) printf "%s\n" "#define initializeBuiltins InitializeBuiltins" >>confdefs.h ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "IK_C" >/dev/null 2>&1 then : else case e in #( e) ac_fn_cxx_check_header_compile "$LINENO" "clang/Basic/LangStandard.h" "ac_cv_header_clang_Basic_LangStandard_h" "$ac_includes_default" if test "x$ac_cv_header_clang_Basic_LangStandard_h" = xyes then : IK_C=Language::C else case e in #( e) IK_C=InputKind::C ;; esac fi printf "%s\n" "#define IK_C $IK_C" >>confdefs.h ;; esac fi rm -rf conftest* # llvmorg-15-init-7544-g93471e65df48 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "setLangDefaults" >/dev/null 2>&1 then : SETLANGDEFAULTS=LangOptions else case e in #( e) SETLANGDEFAULTS=CompilerInvocation ;; esac fi rm -rf conftest* printf "%s\n" "#define SETLANGDEFAULTS $SETLANGDEFAULTS" >>confdefs.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include "include/isl-interface/set_lang_defaults_arg4.h" int main (void) { using namespace clang; CompilerInstance *Clang; TargetOptions TO; llvm::Triple T(TO.Triple); PreprocessorOptions PO; SETLANGDEFAULTS::setLangDefaults(Clang->getLangOpts(), IK_C, T, setLangDefaultsArg4(PO), LangStandard::lang_unspecified); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define SETLANGDEFAULTS_TAKES_5_ARGUMENTS /**/" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_fn_cxx_check_header_compile "$LINENO" "llvm/Option/Arg.h" "ac_cv_header_llvm_Option_Arg_h" "$ac_includes_default" if test "x$ac_cv_header_llvm_Option_Arg_h" = xyes then : printf "%s\n" "#define HAVE_LLVM_OPTION_ARG_H /**/" >>confdefs.h fi # llvmorg-20-init-12950-gbdd10d9d249b cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { clang::CompilerInstance *Clang; Clang->createDiagnostics(*llvm::vfs::getRealFileSystem()); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define CREATEDIAGNOSTICS_TAKES_VFS /**/" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="$SAVE_CPPFLAGS" 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 CONFIG_STATUS_DEPENDENCIES=$LLVM_CONFIG ac_config_headers="$ac_config_headers isl_config.h include/isl-interface/config.h" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by isl-interface $as_me 0, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ isl-interface config.status 0 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "isl_config.h") CONFIG_HEADERS="$CONFIG_HEADERS isl_config.h" ;; "include/isl-interface/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/isl-interface/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi isl-0.28/interface/Makefile.am0000664000175000017500000000143715215726270015332 0ustar00skimoskimoACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = nostdinc noinst_PROGRAMS = extract_interface pkginclude_HEADERS = \ include/isl-interface/clang_wrap.h \ include/isl-interface/config.h \ include/isl-interface/set_lang_defaults_arg4.h includes = -I$(top_builddir) -I$(top_srcdir) \ -I$(top_builddir)/include -I$(top_srcdir)/include extract_interface_CPPFLAGS = $(includes) extract_interface_CXXFLAGS = $(CLANG_CXXFLAGS) extract_interface_SOURCES = \ generator.h \ generator.cc \ python.h \ python.cc \ cpp.h \ cpp.cc \ cpp_conversion.h \ cpp_conversion.cc \ plain_cpp.h \ plain_cpp.cc \ template_cpp.h \ template_cpp.cc \ extract_interface.h \ extract_interface.cc extract_interface_LDFLAGS = $(CLANG_LDFLAGS) $(CLANG_RFLAG) extract_interface_LDADD = $(CLANG_LIBS) $(CLANG_LDFLAGS) isl-0.28/interface/extract_interface.h0000664000175000017500000000012715072740040017124 0ustar00skimoskimo#include bool has_annotation(clang::Decl *decl, const char *name); isl-0.28/interface/configure.ac0000664000175000017500000000145215215726270015561 0ustar00skimoskimoAC_INIT([isl-interface], [0], [isl-development@googlegroups.com]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([../m4]) AM_INIT_AUTOMAKE([foreign]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PROG_CXX AX_PROG_CXX_FOR_BUILD # extract_interface needs to be run on the build system. # Since this is the only target that is being built, # simply use the build compiler throughout. # This ensures that the clang configure checks are # performed using the right compiler. CXX="$CXX_FOR_BUILD" CXXCPP="$CXXCPP_FOR_BUILD" EXEEXT="$BUILD_EXEEXT" OBJEXT="$BUILD_OBJEXT" AX_CXX_COMPILE_STDCXX_11_NO_OVERRIDE AC_DISABLE_SHARED LT_INIT AX_DETECT_CLANG AC_SUBST([CONFIG_STATUS_DEPENDENCIES], [$LLVM_CONFIG]) AC_CONFIG_HEADERS(isl_config.h include/isl-interface/config.h) AC_CONFIG_FILES(Makefile) AC_OUTPUT isl-0.28/interface/extract_interface.cc0000664000175000017500000002045615215726270017301 0ustar00skimoskimo/* * Copyright 2011 Sven Verdoolaege. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY SVEN VERDOOLAEGE ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SVEN VERDOOLAEGE OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as * representing official policies, either expressed or implied, of * Sven Verdoolaege. */ #include "isl_config.h" #undef PACKAGE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "isl-interface/clang_wrap.h" #include "extract_interface.h" #include "generator.h" #include "python.h" #include "plain_cpp.h" #include "cpp_conversion.h" #include "template_cpp.h" using namespace std; using namespace clang; using namespace clang::driver; #ifdef HAVE_LLVM_OPTION_ARG_H using namespace llvm::opt; #endif static llvm::cl::opt InputFilename(llvm::cl::Positional, llvm::cl::Required, llvm::cl::desc("")); static llvm::cl::list Includes("I", llvm::cl::desc("Header search path"), llvm::cl::value_desc("path"), llvm::cl::Prefix); static llvm::cl::opt OutputLanguage(llvm::cl::Required, llvm::cl::ValueRequired, "language", llvm::cl::desc("Bindings to generate"), llvm::cl::value_desc("name")); /* Does decl have an attribute of the following form? * * __attribute__((annotate("name"))) */ bool has_annotation(Decl *decl, const char *name) { if (!decl->hasAttrs()) return false; AttrVec attrs = decl->getAttrs(); for (AttrVec::const_iterator i = attrs.begin() ; i != attrs.end(); ++i) { const AnnotateAttr *ann = dyn_cast(*i); if (!ann) continue; if (ann->getAnnotation().str() == name) return true; } return false; } /* Is decl marked as exported? */ static bool is_exported(Decl *decl) { return has_annotation(decl, "isl_export"); } /* Collect all types and functions that are annotated "isl_export" * in "exported_types" and "exported_function". Collect all function * declarations in "functions". * * We currently only consider single declarations. */ struct MyASTConsumer : public ASTConsumer { set exported_types; set exported_functions; set functions; virtual HandleTopLevelDeclReturn HandleTopLevelDecl(DeclGroupRef D) { Decl *decl; if (!D.isSingleDecl()) return HandleTopLevelDeclContinue; decl = D.getSingleDecl(); if (isa(decl)) functions.insert(cast(decl)); if (!is_exported(decl)) return HandleTopLevelDeclContinue; switch (decl->getKind()) { case Decl::Record: exported_types.insert(cast(decl)); break; case Decl::Function: exported_functions.insert(cast(decl)); break; default: break; } return HandleTopLevelDeclContinue; } }; /* A class specializing the Wrap helper class for * extracting the isl interface. */ struct Extractor : public isl::clang::Wrap { virtual TextDiagnosticPrinter *construct_printer() override; virtual void suppress_errors(DiagnosticsEngine &Diags) override; virtual void add_paths(HeaderSearchOptions &HSO) override; virtual void add_macros(PreprocessorOptions &PO) override; virtual void handle_error() override; virtual bool handle(CompilerInstance *Clang) override; }; /* Construct a TextDiagnosticPrinter. */ TextDiagnosticPrinter *Extractor::construct_printer(void) { return new TextDiagnosticPrinter(llvm::errs(), getDiagnosticOptions()); } /* Suppress any errors, if needed. */ void Extractor::suppress_errors(DiagnosticsEngine &Diags) { } /* Add required search paths to "HSO". */ void Extractor::add_paths(HeaderSearchOptions &HSO) { for (llvm::cl::list::size_type i = 0; i < Includes.size(); ++i) isl::clang::add_path(HSO, Includes[i]); } /* Add required macro definitions to "PO". */ void Extractor::add_macros(PreprocessorOptions &PO) { PO.addMacroDef("__isl_give=__attribute__((annotate(\"isl_give\")))"); PO.addMacroDef("__isl_keep=__attribute__((annotate(\"isl_keep\")))"); PO.addMacroDef("__isl_take=__attribute__((annotate(\"isl_take\")))"); PO.addMacroDef("__isl_export=__attribute__((annotate(\"isl_export\")))"); PO.addMacroDef("__isl_overload=" "__attribute__((annotate(\"isl_overload\"))) " "__attribute__((annotate(\"isl_export\")))"); PO.addMacroDef("__isl_constructor=__attribute__((annotate(\"isl_constructor\"))) __attribute__((annotate(\"isl_export\")))"); PO.addMacroDef("__isl_subclass(super)=__attribute__((annotate(\"isl_subclass(\" #super \")\"))) __attribute__((annotate(\"isl_export\")))"); } /* Handle an error opening the file. */ void Extractor::handle_error() { assert(false); } /* Create an interface generator for the selected language and * then use it to generate the interface. */ static void generate(MyASTConsumer &consumer, SourceManager &SM) { generator *gen; if (OutputLanguage.compare("python") == 0) { gen = new python_generator(SM, consumer.exported_types, consumer.exported_functions, consumer.functions); } else if (OutputLanguage.compare("cpp") == 0) { gen = new plain_cpp_generator(SM, consumer.exported_types, consumer.exported_functions, consumer.functions); } else if (OutputLanguage.compare("cpp-checked") == 0) { gen = new plain_cpp_generator(SM, consumer.exported_types, consumer.exported_functions, consumer.functions, true); } else if (OutputLanguage.compare("cpp-checked-conversion") == 0) { gen = new cpp_conversion_generator(SM, consumer.exported_types, consumer.exported_functions, consumer.functions); } else if (OutputLanguage.compare("template-cpp") == 0) { gen = new template_cpp_generator(SM, consumer.exported_types, consumer.exported_functions, consumer.functions); } else { cerr << "Language '" << OutputLanguage << "' not recognized." << endl << "Not generating bindings." << endl; exit(EXIT_FAILURE); } gen->generate(); } /* Parse the current source file, returning true if no error was encountered. */ bool Extractor::handle(CompilerInstance *Clang) { Preprocessor &PP = Clang->getPreprocessor(); MyASTConsumer consumer; Sema *sema = new Sema(PP, Clang->getASTContext(), consumer); DiagnosticsEngine &Diags = Clang->getDiagnostics(); Diags.getClient()->BeginSourceFile(Clang->getLangOpts(), &PP); ParseAST(*sema); Diags.getClient()->EndSourceFile(); generate(consumer, Clang->getSourceManager()); delete sema; return !Diags.hasErrorOccurred(); } int main(int argc, char *argv[]) { llvm::cl::ParseCommandLineOptions(argc, argv); Extractor extractor; bool ok = extractor.invoke(InputFilename.c_str()); llvm::llvm_shutdown(); if (!ok) return EXIT_FAILURE; return EXIT_SUCCESS; } isl-0.28/interface/isl_config.h.in0000664000175000017500000000646215215726364016177 0ustar00skimoskimo/* isl_config.h.in. Generated from configure.ac by autoheader. */ /* Define if CompilerInstance::createDiagnostics takes VFS */ #undef CREATEDIAGNOSTICS_TAKES_VFS /* Define if TargetInfo::CreateTargetInfo takes shared_ptr */ #undef CREATETARGETINFO_TAKES_SHARED_PTR /* Define if CompilerInvocation::CreateFromArgs takes ArrayRef */ #undef CREATE_FROM_ARGS_TAKES_ARRAYREF /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if llvm/Option/Arg.h exists */ #undef HAVE_LLVM_OPTION_ARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if llvm/TargetParser/Host.h exists */ #undef HAVE_TARGETPARSER_HOST_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Return type of HandleTopLevelDeclReturn */ #undef HandleTopLevelDeclContinue /* Return type of HandleTopLevelDeclReturn */ #undef HandleTopLevelDeclReturn /* Define to Language::C or InputKind::C for newer versions of clang */ #undef IK_C /* Clang installation prefix */ #undef ISL_CLANG_PREFIX /* Clang resource directory */ #undef ISL_CLANG_RESOURCE_DIR /* Define to sysroot if needed */ #undef ISL_CLANG_SYSROOT /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to class with setLangDefaults method */ #undef SETLANGDEFAULTS /* Define if CompilerInvocation::setLangDefaults takes 5 arguments */ #undef SETLANGDEFAULTS_TAKES_5_ARGUMENTS /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to getHostTriple for older versions of clang */ #undef getDefaultTargetTriple /* Define to getInstantiationLineNumber for older versions of clang */ #undef getExpansionLineNumber /* Define to getImmediateInstantiationRange for older versions of clang */ #undef getImmediateExpansionRange /* Define to getResultType for older versions of clang */ #undef getReturnType /* Define to InitializeBuiltins for older versions of clang */ #undef initializeBuiltins isl-0.28/interface/Makefile.in0000664000175000017500000013670015215726347015352 0ustar00skimoskimo# Makefile.in generated by automake 1.18.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2025 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = extract_interface$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/../m4/ax_cxx_compile_stdcxx_11_no_override.m4 \ $(top_srcdir)/../m4/ax_detect_clang.m4 \ $(top_srcdir)/../m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/../m4/ax_prog_cxx_for_build.m4 \ $(top_srcdir)/../m4/isl_detect_clang.m4 \ $(top_srcdir)/../m4/libtool.m4 \ $(top_srcdir)/../m4/ltoptions.m4 \ $(top_srcdir)/../m4/ltsugar.m4 \ $(top_srcdir)/../m4/ltversion.m4 \ $(top_srcdir)/../m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(pkginclude_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = isl_config.h \ $(top_builddir)/include/isl-interface/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_extract_interface_OBJECTS = extract_interface-generator.$(OBJEXT) \ extract_interface-python.$(OBJEXT) \ extract_interface-cpp.$(OBJEXT) \ extract_interface-cpp_conversion.$(OBJEXT) \ extract_interface-plain_cpp.$(OBJEXT) \ extract_interface-template_cpp.$(OBJEXT) \ extract_interface-extract_interface.$(OBJEXT) extract_interface_OBJECTS = $(am_extract_interface_OBJECTS) am__DEPENDENCIES_1 = extract_interface_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = extract_interface_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(extract_interface_CXXFLAGS) $(CXXFLAGS) \ $(extract_interface_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/extract_interface-cpp.Po \ ./$(DEPDIR)/extract_interface-cpp_conversion.Po \ ./$(DEPDIR)/extract_interface-extract_interface.Po \ ./$(DEPDIR)/extract_interface-generator.Po \ ./$(DEPDIR)/extract_interface-plain_cpp.Po \ ./$(DEPDIR)/extract_interface-python.Po \ ./$(DEPDIR)/extract_interface-template_cpp.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(extract_interface_SOURCES) DIST_SOURCES = $(extract_interface_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pkgincludedir)" HEADERS = $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ isl_config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/isl_config.h.in \ $(top_srcdir)/include/isl-interface/config.h.in compile \ config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = -9 DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = \ find . \( -type f -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CCDEPMODE_FOR_BUILD = @CCDEPMODE_FOR_BUILD@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CLANG_CXXFLAGS = @CLANG_CXXFLAGS@ CLANG_LDFLAGS = @CLANG_LDFLAGS@ CLANG_LIBS = @CLANG_LIBS@ CLANG_RFLAG = @CLANG_RFLAG@ CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ CXX_FOR_BUILD = @CXX_FOR_BUILD@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LLVM_CONFIG = @LLVM_CONFIG@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XCODE_SELECT = @XCODE_SELECT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = nostdinc pkginclude_HEADERS = \ include/isl-interface/clang_wrap.h \ include/isl-interface/config.h \ include/isl-interface/set_lang_defaults_arg4.h includes = -I$(top_builddir) -I$(top_srcdir) \ -I$(top_builddir)/include -I$(top_srcdir)/include extract_interface_CPPFLAGS = $(includes) extract_interface_CXXFLAGS = $(CLANG_CXXFLAGS) extract_interface_SOURCES = \ generator.h \ generator.cc \ python.h \ python.cc \ cpp.h \ cpp.cc \ cpp_conversion.h \ cpp_conversion.cc \ plain_cpp.h \ plain_cpp.cc \ template_cpp.h \ template_cpp.cc \ extract_interface.h \ extract_interface.cc extract_interface_LDFLAGS = $(CLANG_LDFLAGS) $(CLANG_RFLAG) extract_interface_LDADD = $(CLANG_LIBS) $(CLANG_LDFLAGS) all: isl_config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): isl_config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/isl_config.h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status isl_config.h $(srcdir)/isl_config.h.in: $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)touch $@ include/isl-interface/config.h: include/isl-interface/stamp-h2 @test -f $@ || rm -f include/isl-interface/stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) include/isl-interface/stamp-h2 include/isl-interface/stamp-h2: $(top_srcdir)/include/isl-interface/config.h.in $(top_builddir)/config.status $(AM_V_at)rm -f include/isl-interface/stamp-h2 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status include/isl-interface/config.h distclean-hdr: -rm -f isl_config.h stamp-h1 include/isl-interface/config.h include/isl-interface/stamp-h2 clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) extract_interface$(EXEEXT): $(extract_interface_OBJECTS) $(extract_interface_DEPENDENCIES) $(EXTRA_extract_interface_DEPENDENCIES) @rm -f extract_interface$(EXEEXT) $(AM_V_CXXLD)$(extract_interface_LINK) $(extract_interface_OBJECTS) $(extract_interface_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-cpp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-cpp_conversion.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-extract_interface.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-generator.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-plain_cpp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-python.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_interface-template_cpp.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< extract_interface-generator.o: generator.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-generator.o -MD -MP -MF $(DEPDIR)/extract_interface-generator.Tpo -c -o extract_interface-generator.o `test -f 'generator.cc' || echo '$(srcdir)/'`generator.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-generator.Tpo $(DEPDIR)/extract_interface-generator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='generator.cc' object='extract_interface-generator.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-generator.o `test -f 'generator.cc' || echo '$(srcdir)/'`generator.cc extract_interface-generator.obj: generator.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-generator.obj -MD -MP -MF $(DEPDIR)/extract_interface-generator.Tpo -c -o extract_interface-generator.obj `if test -f 'generator.cc'; then $(CYGPATH_W) 'generator.cc'; else $(CYGPATH_W) '$(srcdir)/generator.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-generator.Tpo $(DEPDIR)/extract_interface-generator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='generator.cc' object='extract_interface-generator.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-generator.obj `if test -f 'generator.cc'; then $(CYGPATH_W) 'generator.cc'; else $(CYGPATH_W) '$(srcdir)/generator.cc'; fi` extract_interface-python.o: python.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-python.o -MD -MP -MF $(DEPDIR)/extract_interface-python.Tpo -c -o extract_interface-python.o `test -f 'python.cc' || echo '$(srcdir)/'`python.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-python.Tpo $(DEPDIR)/extract_interface-python.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='python.cc' object='extract_interface-python.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-python.o `test -f 'python.cc' || echo '$(srcdir)/'`python.cc extract_interface-python.obj: python.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-python.obj -MD -MP -MF $(DEPDIR)/extract_interface-python.Tpo -c -o extract_interface-python.obj `if test -f 'python.cc'; then $(CYGPATH_W) 'python.cc'; else $(CYGPATH_W) '$(srcdir)/python.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-python.Tpo $(DEPDIR)/extract_interface-python.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='python.cc' object='extract_interface-python.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-python.obj `if test -f 'python.cc'; then $(CYGPATH_W) 'python.cc'; else $(CYGPATH_W) '$(srcdir)/python.cc'; fi` extract_interface-cpp.o: cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-cpp.o -MD -MP -MF $(DEPDIR)/extract_interface-cpp.Tpo -c -o extract_interface-cpp.o `test -f 'cpp.cc' || echo '$(srcdir)/'`cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-cpp.Tpo $(DEPDIR)/extract_interface-cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp.cc' object='extract_interface-cpp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-cpp.o `test -f 'cpp.cc' || echo '$(srcdir)/'`cpp.cc extract_interface-cpp.obj: cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-cpp.obj -MD -MP -MF $(DEPDIR)/extract_interface-cpp.Tpo -c -o extract_interface-cpp.obj `if test -f 'cpp.cc'; then $(CYGPATH_W) 'cpp.cc'; else $(CYGPATH_W) '$(srcdir)/cpp.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-cpp.Tpo $(DEPDIR)/extract_interface-cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp.cc' object='extract_interface-cpp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-cpp.obj `if test -f 'cpp.cc'; then $(CYGPATH_W) 'cpp.cc'; else $(CYGPATH_W) '$(srcdir)/cpp.cc'; fi` extract_interface-cpp_conversion.o: cpp_conversion.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-cpp_conversion.o -MD -MP -MF $(DEPDIR)/extract_interface-cpp_conversion.Tpo -c -o extract_interface-cpp_conversion.o `test -f 'cpp_conversion.cc' || echo '$(srcdir)/'`cpp_conversion.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-cpp_conversion.Tpo $(DEPDIR)/extract_interface-cpp_conversion.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp_conversion.cc' object='extract_interface-cpp_conversion.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-cpp_conversion.o `test -f 'cpp_conversion.cc' || echo '$(srcdir)/'`cpp_conversion.cc extract_interface-cpp_conversion.obj: cpp_conversion.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-cpp_conversion.obj -MD -MP -MF $(DEPDIR)/extract_interface-cpp_conversion.Tpo -c -o extract_interface-cpp_conversion.obj `if test -f 'cpp_conversion.cc'; then $(CYGPATH_W) 'cpp_conversion.cc'; else $(CYGPATH_W) '$(srcdir)/cpp_conversion.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-cpp_conversion.Tpo $(DEPDIR)/extract_interface-cpp_conversion.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp_conversion.cc' object='extract_interface-cpp_conversion.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-cpp_conversion.obj `if test -f 'cpp_conversion.cc'; then $(CYGPATH_W) 'cpp_conversion.cc'; else $(CYGPATH_W) '$(srcdir)/cpp_conversion.cc'; fi` extract_interface-plain_cpp.o: plain_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-plain_cpp.o -MD -MP -MF $(DEPDIR)/extract_interface-plain_cpp.Tpo -c -o extract_interface-plain_cpp.o `test -f 'plain_cpp.cc' || echo '$(srcdir)/'`plain_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-plain_cpp.Tpo $(DEPDIR)/extract_interface-plain_cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='plain_cpp.cc' object='extract_interface-plain_cpp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-plain_cpp.o `test -f 'plain_cpp.cc' || echo '$(srcdir)/'`plain_cpp.cc extract_interface-plain_cpp.obj: plain_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-plain_cpp.obj -MD -MP -MF $(DEPDIR)/extract_interface-plain_cpp.Tpo -c -o extract_interface-plain_cpp.obj `if test -f 'plain_cpp.cc'; then $(CYGPATH_W) 'plain_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/plain_cpp.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-plain_cpp.Tpo $(DEPDIR)/extract_interface-plain_cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='plain_cpp.cc' object='extract_interface-plain_cpp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-plain_cpp.obj `if test -f 'plain_cpp.cc'; then $(CYGPATH_W) 'plain_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/plain_cpp.cc'; fi` extract_interface-template_cpp.o: template_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-template_cpp.o -MD -MP -MF $(DEPDIR)/extract_interface-template_cpp.Tpo -c -o extract_interface-template_cpp.o `test -f 'template_cpp.cc' || echo '$(srcdir)/'`template_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-template_cpp.Tpo $(DEPDIR)/extract_interface-template_cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='template_cpp.cc' object='extract_interface-template_cpp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-template_cpp.o `test -f 'template_cpp.cc' || echo '$(srcdir)/'`template_cpp.cc extract_interface-template_cpp.obj: template_cpp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-template_cpp.obj -MD -MP -MF $(DEPDIR)/extract_interface-template_cpp.Tpo -c -o extract_interface-template_cpp.obj `if test -f 'template_cpp.cc'; then $(CYGPATH_W) 'template_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/template_cpp.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-template_cpp.Tpo $(DEPDIR)/extract_interface-template_cpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='template_cpp.cc' object='extract_interface-template_cpp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-template_cpp.obj `if test -f 'template_cpp.cc'; then $(CYGPATH_W) 'template_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/template_cpp.cc'; fi` extract_interface-extract_interface.o: extract_interface.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-extract_interface.o -MD -MP -MF $(DEPDIR)/extract_interface-extract_interface.Tpo -c -o extract_interface-extract_interface.o `test -f 'extract_interface.cc' || echo '$(srcdir)/'`extract_interface.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-extract_interface.Tpo $(DEPDIR)/extract_interface-extract_interface.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='extract_interface.cc' object='extract_interface-extract_interface.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-extract_interface.o `test -f 'extract_interface.cc' || echo '$(srcdir)/'`extract_interface.cc extract_interface-extract_interface.obj: extract_interface.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -MT extract_interface-extract_interface.obj -MD -MP -MF $(DEPDIR)/extract_interface-extract_interface.Tpo -c -o extract_interface-extract_interface.obj `if test -f 'extract_interface.cc'; then $(CYGPATH_W) 'extract_interface.cc'; else $(CYGPATH_W) '$(srcdir)/extract_interface.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract_interface-extract_interface.Tpo $(DEPDIR)/extract_interface-extract_interface.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='extract_interface.cc' object='extract_interface-extract_interface.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extract_interface_CPPFLAGS) $(CPPFLAGS) $(extract_interface_CXXFLAGS) $(CXXFLAGS) -c -o extract_interface-extract_interface.obj `if test -f 'extract_interface.cc'; then $(CYGPATH_W) 'extract_interface.cc'; else $(CYGPATH_W) '$(srcdir)/extract_interface.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-bzip3: distdir tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.bz3*) \ bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) isl_config.h installdirs: for dir in "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/extract_interface-cpp.Po -rm -f ./$(DEPDIR)/extract_interface-cpp_conversion.Po -rm -f ./$(DEPDIR)/extract_interface-extract_interface.Po -rm -f ./$(DEPDIR)/extract_interface-generator.Po -rm -f ./$(DEPDIR)/extract_interface-plain_cpp.Po -rm -f ./$(DEPDIR)/extract_interface-python.Po -rm -f ./$(DEPDIR)/extract_interface-template_cpp.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/extract_interface-cpp.Po -rm -f ./$(DEPDIR)/extract_interface-cpp_conversion.Po -rm -f ./$(DEPDIR)/extract_interface-extract_interface.Po -rm -f ./$(DEPDIR)/extract_interface-generator.Po -rm -f ./$(DEPDIR)/extract_interface-plain_cpp.Po -rm -f ./$(DEPDIR)/extract_interface-python.Po -rm -f ./$(DEPDIR)/extract_interface-template_cpp.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-am clean clean-cscope clean-generic clean-libtool \ clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-bzip3 dist-gzip dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgincludeHEADERS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pkgincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% isl-0.28/interface/compile0000755000175000017500000001670515072740065014655 0ustar00skimoskimo#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: isl-0.28/interface/ltmain.sh0000755000175000017500000122276515072740064015127 0ustar00skimoskimo#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.5.4 Debian-2.5.4-4" package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2024-12-01.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.5.4-4 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. Assumes ARG has no leading or trailing path separator # characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 case $host in i[3456]86-*-mingw32*) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ;; *) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" ;; esac } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. # -q