idzebra-2.2.10/0000755000175000017500000000000015136704660011652 5ustar00adamadamidzebra-2.2.10/rset/0000755000175000017500000000000015136704657012635 5ustar00adamadamidzebra-2.2.10/rset/rsmultiandor.c0000664000175000017500000004642214754717556015545 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * \file rsmultiandor.c * \brief This module implements the rsmulti_or and rsmulti_and result sets * * rsmultior is based on a heap, from which we find the next hit. * * rsmultiand is based on a simple array of rsets, and a linear * search to find the record that exists in all of those rsets. * To speed things up, the array is sorted so that the smallest * rsets come first, they are most likely to have the hits furthest * away, and thus forwarding to them makes the most sense. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include static RSFD r_open_and(RSET ct, int flag); static RSFD r_open_or(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_read_and(RSFD rfd, void *buf, TERMID *term); static int r_read_or(RSFD rfd, void *buf, TERMID *term); static int r_forward_and(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static int r_forward_or(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static void r_pos_and(RSFD rfd, double *current, double *total); static void r_pos_or(RSFD rfd, double *current, double *total); static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm); static const struct rset_control control_or = { "multi-or", r_delete, r_get_terms, r_open_or, r_close, r_forward_or, r_pos_or, r_read_or, rset_no_write, }; static const struct rset_control control_and = { "multi-and", r_delete, r_get_terms, r_open_and, r_close, r_forward_and, r_pos_and, r_read_and, rset_no_write, }; /* The heap structure: * The rset contains a list or rsets we are ORing together * The rfd contains a heap of heap-items, which contain * a rfd opened to those rsets, and a buffer for one key. * They also contain a ptr to the rset list in the rset * itself, for practical reasons. */ struct heap_item { RSFD fd; void *buf; RSET rset; TERMID term; }; struct heap { int heapnum; int heapmax; const struct rset_key_control *kctrl; struct heap_item **heap; /* ptrs to the rfd */ }; typedef struct heap *HEAP; struct rset_private { int dummy; }; struct rfd_private { int flag; struct heap_item *items; /* we alloc and free them here */ HEAP h; /* and move around here */ zint hits; /* returned so far */ int eof; /* seen the end of it */ int tailcount; /* how many items are tailing */ zint segment; int skip; char *tailbits; }; static int log_level = 0; static int log_level_initialized = 0; /* Heap functions ***********************/ static void heap_swap(HEAP h, int x, int y) { struct heap_item *swap; swap = h->heap[x]; h->heap[x] = h->heap[y]; h->heap[y] = swap; } static int heap_cmp(HEAP h, int x, int y) { return (*h->kctrl->cmp)(h->heap[x]->buf, h->heap[y]->buf); } static int heap_empty(HEAP h) { return 0 == h->heapnum; } /** \brief deletes the first item in the heap, and balances the rest */ static void heap_delete(HEAP h) { int cur = 1, child = 2; h->heap[1] = 0; /* been deleted */ heap_swap(h, 1, h->heapnum--); while (child <= h->heapnum) { if (child < h->heapnum && heap_cmp(h, child, 1 + child) > 0) child++; if (heap_cmp(h,cur,child) > 0) { heap_swap(h, cur, child); cur = child; child = 2*cur; } else break; } } /** \brief puts item into heap. The heap root element has changed value (to bigger) Swap downwards until the heap is ordered again */ static void heap_balance(HEAP h) { int cur = 1, child = 2; while (child <= h->heapnum) { if (child < h->heapnum && heap_cmp(h, child, 1 + child) > 0) child++; if (heap_cmp(h,cur,child) > 0) { heap_swap(h, cur, child); cur = child; child = 2*cur; } else break; } } static void heap_insert(HEAP h, struct heap_item *hi) { int cur, parent; cur = ++(h->heapnum); assert(cur <= h->heapmax); h->heap[cur] = hi; parent = cur/2; while (parent && (heap_cmp(h,parent,cur) > 0)) { assert(parent>0); heap_swap(h, cur, parent); cur = parent; parent = cur/2; } } static HEAP heap_create(NMEM nmem, int size, const struct rset_key_control *kctrl) { HEAP h = (HEAP) nmem_malloc(nmem, sizeof(*h)); ++size; /* heap array starts at 1 */ h->heapnum = 0; h->heapmax = size; h->kctrl = kctrl; h->heap = (struct heap_item**) nmem_malloc(nmem, size * sizeof(*h->heap)); h->heap[0] = 0; /* not used */ return h; } static void heap_clear( HEAP h) { assert(h); h->heapnum = 0; } static void heap_destroy(HEAP h) { /* nothing to delete, all is nmem'd, and will go away in due time */ } /** \brief compare and items for quicksort used in qsort to get the multi-and args in optimal order that is, those with fewest occurrences first */ int compare_ands(const void *x, const void *y) { const struct heap_item *hx = x; const struct heap_item *hy = y; double cur, totx, toty; rset_pos(hx->fd, &cur, &totx); rset_pos(hy->fd, &cur, &toty); if (totx > toty + 0.5) return 1; if (totx < toty - 0.5) return -1; return 0; /* return totx - toty, except for overflows and rounding */ } static RSET rsmulti_andor_create(NMEM nmem, struct rset_key_control *kcontrol, int scope, TERMID termid, int no_rsets, RSET* rsets, const struct rset_control *ctrl) { RSET rnew = rset_create_base(ctrl, nmem, kcontrol, scope, termid, no_rsets, rsets); struct rset_private *info; if (!log_level_initialized) { log_level = yaz_log_module_level("rsmultiandor"); log_level_initialized = 1; } yaz_log(log_level, "rsmultiand_andor_create scope=%d", scope); info = (struct rset_private *) nmem_malloc(rnew->nmem, sizeof(*info)); rnew->priv = info; return rnew; } RSET rset_create_or(NMEM nmem, struct rset_key_control *kcontrol, int scope, TERMID termid, int no_rsets, RSET* rsets) { return rsmulti_andor_create(nmem, kcontrol, scope, termid, no_rsets, rsets, &control_or); } RSET rset_create_and(NMEM nmem, struct rset_key_control *kcontrol, int scope, int no_rsets, RSET* rsets) { return rsmulti_andor_create(nmem, kcontrol, scope, 0, no_rsets, rsets, &control_and); } static void r_delete(RSET ct) { } static RSFD r_open_andor(RSET ct, int flag, int is_and) { RSFD rfd; struct rfd_private *p; const struct rset_key_control *kctrl = ct->keycontrol; int i; if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "multiandor set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) { p = (struct rfd_private *)rfd->priv; if (!is_and) heap_clear(p->h); assert(p->items); /* all other pointers shouls already be allocated, in right sizes! */ } else { p = (struct rfd_private *) nmem_malloc(ct->nmem,sizeof(*p)); rfd->priv = p; p->h = 0; p->tailbits = 0; if (is_and) p->tailbits = nmem_malloc(ct->nmem, ct->no_children*sizeof(char) ); else p->h = heap_create(ct->nmem, ct->no_children, kctrl); p->items = (struct heap_item *) nmem_malloc(ct->nmem, ct->no_children*sizeof(*p->items)); for (i = 0; i < ct->no_children; i++) { p->items[i].rset = ct->children[i]; p->items[i].buf = nmem_malloc(ct->nmem, kctrl->key_size); } } p->flag = flag; p->hits = 0; p->eof = 0; p->tailcount = 0; if (is_and) { /* read the array and sort it */ for (i = 0; i < ct->no_children; i++) { p->items[i].fd = rset_open(ct->children[i], RSETF_READ); if (!rset_read(p->items[i].fd, p->items[i].buf, &p->items[i].term)) p->eof = 1; p->tailbits[i] = 0; } qsort(p->items, ct->no_children, sizeof(p->items[0]), compare_ands); } else { /* fill the heap for ORing */ for (i = 0; i < ct->no_children; i++) { p->items[i].fd = rset_open(ct->children[i],RSETF_READ); if ( rset_read(p->items[i].fd, p->items[i].buf, &p->items[i].term)) heap_insert(p->h, &(p->items[i])); } } return rfd; } static RSFD r_open_or(RSET ct, int flag) { return r_open_andor(ct, flag, 0); } static RSFD r_open_and(RSET ct, int flag) { return r_open_andor(ct, flag, 1); } static void r_close(RSFD rfd) { struct rfd_private *p=(struct rfd_private *)(rfd->priv); int i; if (p->h) heap_destroy(p->h); for (i = 0; i < rfd->rset->no_children; i++) if (p->items[i].fd) rset_close(p->items[i].fd); } static int r_forward_or(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { /* while heap head behind untilbuf, forward it and rebalance heap */ struct rfd_private *p = rfd->priv; const struct rset_key_control *kctrl = rfd->rset->keycontrol; if (heap_empty(p->h)) return 0; while ((*kctrl->cmp)(p->h->heap[1]->buf,untilbuf) < -rfd->rset->scope ) { if (rset_forward(p->h->heap[1]->fd, p->h->heap[1]->buf, &p->h->heap[1]->term, untilbuf)) heap_balance(p->h); else { heap_delete(p->h); if (heap_empty(p->h)) return 0; } } return r_read_or(rfd, buf, term); } /** \brief reads one item key from an 'or' set \param rfd set handle \param buf resulting item buffer \param term resulting term \retval 0 EOF \retval 1 item could be read */ static int r_read_or(RSFD rfd, void *buf, TERMID *term) { RSET rset = rfd->rset; struct rfd_private *mrfd = rfd->priv; const struct rset_key_control *kctrl = rset->keycontrol; struct heap_item *it; int rdres; if (heap_empty(mrfd->h)) return 0; it = mrfd->h->heap[1]; memcpy(buf, it->buf, kctrl->key_size); if (term) { if (rset->term) *term = rset->term; else *term = it->term; } (mrfd->hits)++; rdres = rset_read(it->fd, it->buf, &it->term); if (rdres) heap_balance(mrfd->h); else heap_delete(mrfd->h); return 1; } /** \brief reads one item key from an 'and' set \param rfd set handle \param buf resulting item buffer \param term resulting term \retval 0 EOF \retval 1 item could be read Has to return all hits where each item points to the same sysno (scope), in order. Keep an extra key (hitkey) as long as all records do not point to hitkey, forward them, and update hitkey to be the highest seen so far. (if any item eof's, mark eof, and return 0 thereafter) Once a hit has been found, scan all items for the smallest value. Mark all as being in the tail. Read next from that item, and if not in the same record, clear its tail bit */ static int r_read_and(RSFD rfd, void *buf, TERMID *term) { struct rfd_private *p = rfd->priv; RSET ct = rfd->rset; const struct rset_key_control *kctrl = ct->keycontrol; int i; while (1) { if (p->tailcount) { /* we are tailing, find lowest tail and return it */ int mintail = -1; int cmp; for (i = 0; i < ct->no_children; i++) { if (p->tailbits[i]) { if (mintail >= 0) cmp = (*kctrl->cmp) (p->items[i].buf, p->items[mintail].buf); else cmp = -1; if (cmp < 0) mintail = i; if (kctrl->get_segment) { /* segments enabled */ zint segment = kctrl->get_segment(p->items[i].buf); /* store segment if not stored already */ if (!p->segment && segment) p->segment = segment; /* skip rest entirely if segments don't match */ if (p->segment && segment && p->segment != segment) p->skip = 1; } } } /* return the lowest tail */ memcpy(buf, p->items[mintail].buf, kctrl->key_size); if (term) *term = p->items[mintail].term; if (!rset_read(p->items[mintail].fd, p->items[mintail].buf, &p->items[mintail].term)) { p->eof = 1; /* game over, once tails have been returned */ p->tailbits[mintail] = 0; (p->tailcount)--; } else { /* still a tail? */ cmp = (*kctrl->cmp)(p->items[mintail].buf,buf); if (cmp >= rfd->rset->scope) { p->tailbits[mintail] = 0; (p->tailcount)--; } } if (p->skip) continue; /* skip again.. eventually tailcount will be 0 */ if (p->tailcount == 0) (p->hits)++; return 1; } /* not tailing, forward until all records match, and set up */ /* as tails. the earlier 'if' will then return the hits */ if (p->eof) return 0; /* nothing more to see */ i = 1; /* assume items[0] is highest up */ while (i < ct->no_children) { int cmp = (*kctrl->cmp)(p->items[0].buf, p->items[i].buf); if (cmp <= -rfd->rset->scope) { /* [0] was behind, forward it */ if (!rset_forward(p->items[0].fd, p->items[0].buf, &p->items[0].term, p->items[i].buf)) { p->eof = 1; /* game over */ return 0; } i = 0; /* start forwarding from scratch */ } else if (cmp >= rfd->rset->scope) { /* [0] was ahead, forward i */ if (!rset_forward(p->items[i].fd, p->items[i].buf, &p->items[i].term, p->items[0].buf)) { p->eof = 1; /* game over */ return 0; } } else i++; } /* while i */ /* if we get this far, all rsets are now within +- scope of [0] */ /* ergo, we have a hit. Mark them all as tailing, and let the */ /* upper 'if' return the hits in right order */ for (i = 0; i < ct->no_children; i++) p->tailbits[i] = 1; p->tailcount = ct->no_children; p->segment = 0; p->skip = 0; } /* while 1 */ } static int r_forward_and(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { struct rfd_private *p = rfd->priv; RSET ct = rfd->rset; const struct rset_key_control *kctrl = ct->keycontrol; int i; int cmp; int killtail = 0; for (i = 0; i < ct->no_children; i++) { cmp = (*kctrl->cmp)(p->items[i].buf,untilbuf); if (cmp <= -rfd->rset->scope) { killtail = 1; /* we are moving to a different hit */ if (!rset_forward(p->items[i].fd, p->items[i].buf, &p->items[i].term, untilbuf)) { p->eof = 1; /* game over */ p->tailcount = 0; return 0; } } } if (killtail) { for (i = 0; i < ct->no_children; i++) p->tailbits[i] = 0; p->tailcount = 0; } return r_read_and(rfd,buf,term); } static void r_pos_x(RSFD rfd, double *current, double *total, int and_op) { RSET ct = rfd->rset; struct rfd_private *mrfd = (struct rfd_private *)(rfd->priv); double ratio = and_op ? 0.0 : 1.0; int i; double sum_cur = 0.0; double sum_tot = 0.0; for (i = 0; i < ct->no_children; i++) { double cur, tot; rset_pos(mrfd->items[i].fd, &cur, &tot); if (i < 100) yaz_log(log_level, "r_pos: %d %0.1f %0.1f", i, cur,tot); if (and_op) { if (tot > 0.0) { double nratio = cur / tot; if (nratio > ratio) ratio = nratio; } } else { if (cur > 0) sum_cur += (cur - 1); sum_tot += tot; } } if (!and_op && sum_tot > 0.0) { yaz_log(YLOG_LOG, "or op sum_cur=%0.1f sum_tot=%0.1f hits=%f", sum_cur, sum_tot, (double) mrfd->hits); ratio = sum_cur / sum_tot; } if (ratio == 0.0 || ratio == 1.0) { /* nothing there */ *current = 0; *total = 0; yaz_log(log_level, "r_pos: NULL %0.1f %0.1f", *current, *total); } else { *current = (double) (mrfd->hits); *total = *current / ratio; yaz_log(log_level, "r_pos: = %0.1f %0.1f", *current, *total); } } static void r_pos_and(RSFD rfd, double *current, double *total) { r_pos_x(rfd, current, total, 1); } static void r_pos_or(RSFD rfd, double *current, double *total) { r_pos_x(rfd, current, total, 0); } static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) { if (ct->term) rset_get_one_term(ct, terms, maxterms, curterm); else { /* Special case: Some multi-ors have all terms pointing to the same term. We do not want to duplicate those. Other multiors (and ands) have different terms under them. Those we want. */ int firstterm = *curterm; int i; for (i = 0; i < ct->no_children; i++) { rset_getterms(ct->children[i], terms, maxterms, curterm); if (*curterm > firstterm + 1 && *curterm <= maxterms && terms[(*curterm) - 1] == terms[firstterm]) (*curterm)--; /* forget the term, seen that before */ } } } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rsnull.c0000664000175000017500000000423714754717556014337 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static void r_pos(RSFD rfd, double *current, double *total); static int r_read(RSFD rfd, void *buf, TERMID *term); static const struct rset_control control = { "null", r_delete, rset_get_one_term, r_open, r_close, 0, /* no forward */ r_pos, r_read, rset_no_write, }; RSET rset_create_null(NMEM nmem, struct rset_key_control *kcontrol, TERMID term) { RSET rnew = rset_create_base(&control, nmem, kcontrol, 0, term, 0, 0); rnew->priv = 0; return rnew; } static RSFD r_open(RSET ct, int flag) { RSFD rfd; if (flag & RSETF_WRITE) { yaz_log (YLOG_FATAL, "NULL set type is read-only"); return NULL; } rfd = rfd_create_base(ct); rfd->priv = 0; return rfd; } static void r_close(RSFD rfd) { } static void r_delete(RSET ct) { } static void r_pos(RSFD rfd, double *current, double *total) { assert(rfd); assert(current); assert(total); *total = 0; *current = 0; } static int r_read(RSFD rfd, void *buf, TERMID *term) { if (term) *term = 0; return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rsprox.c0000664000175000017500000002632614754717556014360 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifndef RSET_DEBUG #define RSET_DEBUG 0 #endif static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static int r_read(RSFD rfd, void *buf, TERMID *term); static void r_pos(RSFD rfd, double *current, double *total); static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm); static const struct rset_control control = { "prox", r_delete, r_get_terms, r_open, r_close, r_forward, r_pos, r_read, rset_no_write, }; struct rset_prox_info { int ordered; int exclusion; int relation; int distance; }; struct rset_prox_rfd { RSFD *rfd; char **buf; /* lookahead key buffers */ char *more; /* more in each lookahead? */ TERMID *terms; /* lookahead terms */ zint hits; }; RSET rset_create_prox(NMEM nmem, struct rset_key_control *kcontrol, int scope, int rset_no, RSET *rset, int ordered, int exclusion, int relation, int distance) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, 0, rset_no, rset); struct rset_prox_info *info; info = (struct rset_prox_info *) nmem_malloc(rnew->nmem,sizeof(*info)); info->ordered = ordered; info->exclusion = exclusion; info->relation = relation; info->distance = distance; rnew->priv = info; return rnew; } static void r_delete(RSET ct) { } static RSFD r_open(RSET ct, int flag) { RSFD rfd; struct rset_prox_rfd *p; int i; if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "prox set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) p = (struct rset_prox_rfd *)(rfd->priv); else { p = (struct rset_prox_rfd *) nmem_malloc(ct->nmem,sizeof(*p)); rfd->priv = p; p->more = nmem_malloc(ct->nmem,sizeof(*p->more) * ct->no_children); p->buf = nmem_malloc(ct->nmem,sizeof(*p->buf) * ct->no_children); p->terms = nmem_malloc(ct->nmem,sizeof(*p->terms) * ct->no_children); for (i = 0; i < ct->no_children; i++) { p->buf[i] = nmem_malloc(ct->nmem,ct->keycontrol->key_size); p->terms[i] = 0; } p->rfd = nmem_malloc(ct->nmem,sizeof(*p->rfd) * ct->no_children); } yaz_log(YLOG_DEBUG,"rsprox (%s) open [%p] n=%d", ct->control->desc, rfd, ct->no_children); for (i = 0; i < ct->no_children; i++) { p->rfd[i] = rset_open(ct->children[i], RSETF_READ); p->more[i] = rset_read(p->rfd[i], p->buf[i], &p->terms[i]); } p->hits = 0; return rfd; } static void r_close(RSFD rfd) { RSET ct = rfd->rset; struct rset_prox_rfd *p = (struct rset_prox_rfd *)(rfd->priv); int i; for (i = 0; i < ct->no_children; i++) rset_close(p->rfd[i]); } static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { RSET ct = rfd->rset; struct rset_prox_info *info = (struct rset_prox_info *)(ct->priv); struct rset_prox_rfd *p = (struct rset_prox_rfd *)(rfd->priv); const struct rset_key_control *kctrl = ct->keycontrol; int cmp = 0; int i; if (untilbuf) { /* it is enough to forward first one. Other will follow. */ if (p->more[0] && /* was: cmp >=2 */ ((kctrl->cmp)(untilbuf, p->buf[0]) >= rfd->rset->scope) ) p->more[0] = rset_forward(p->rfd[0], p->buf[0], &p->terms[0], untilbuf); } if (info->ordered && info->relation <= 3 && info->exclusion == 0) { while (p->more[0]) { for (i = 1; i < ct->no_children; i++) { if (!p->more[i]) { p->more[0] = 0; /* saves us a goto out of while loop. */ break; } cmp = (*kctrl->cmp)(p->buf[i], p->buf[i-1]); if (cmp >= rfd->rset->scope) /* not same record */ { p->more[i-1] = rset_forward(p->rfd[i-1], p->buf[i-1], &p->terms[i-1], p->buf[i]); break; } else if (cmp > 0) /* within record and ordered */ { zint diff = (*kctrl->getseq)(p->buf[i]) - (*kctrl->getseq)(p->buf[i-1]); if (info->relation == 3 && diff == info->distance) continue; else if (info->relation == 2 && diff <= info->distance) continue; else if (info->relation == 1 && diff < info->distance) continue; p->more[i-1] = rset_read(p->rfd[i-1], p->buf[i-1], &p->terms[i-1]); break; } else /* within record - wrong order */ { p->more[i] = rset_forward(p->rfd[i], p->buf[i], &p->terms[i], p->buf[i-1]); break; } } if (i == ct->no_children) { i = ct->no_children-1; memcpy(buf, p->buf[i], kctrl->key_size); if (term) *term = p->terms[i]; p->more[i] = rset_read(p->rfd[i], p->buf[i], &p->terms[i]); p->hits++; return 1; } } } else if (ct->no_children == 2) { while (p->more[0] && p->more[1]) { int cmp = (*kctrl->cmp)(p->buf[0], p->buf[1]); if ( cmp <= - rfd->rset->scope) /* cmp<-1*/ p->more[0] = rset_forward(p->rfd[0], p->buf[0], &p->terms[0],p->buf[1]); else if ( cmp >= rfd->rset->scope ) /* cmp>1 */ p->more[1] = rset_forward(p->rfd[1], p->buf[1], &p->terms[1],p->buf[0]); else { zint seqno[500]; /* FIXME - why 500 ?? */ int n = 0; seqno[n++] = (*kctrl->getseq)(p->buf[0]); while ((p->more[0] = rset_read(p->rfd[0], p->buf[0], &p->terms[0]))) { cmp = (*kctrl->cmp)(p->buf[0], p->buf[1]); if (cmp <= - rfd->rset->scope || cmp >= rfd->rset->scope) break; if (n < 500) seqno[n++] = (*kctrl->getseq)(p->buf[0]); } /* set up return buffer.. (save buf[1]) */ memcpy(buf, p->buf[1], kctrl->key_size); if (term) *term = p->terms[1]; while (1) { for (i = 0; i < n; i++) { zint diff = (*kctrl->getseq)(p->buf[1]) - seqno[i]; int excl = info->exclusion; if (!info->ordered && diff < 0) diff = -diff; switch (info->relation) { case 1: /* < */ if (diff < info->distance && diff >= 0) excl = !excl; break; case 2: /* <= */ if (diff <= info->distance && diff >= 0) excl = !excl; break; case 3: /* == */ if (diff == info->distance && diff >= 0) excl = !excl; break; case 4: /* >= */ if (diff >= info->distance && diff >= 0) excl = !excl; break; case 5: /* > */ if (diff > info->distance && diff >= 0) excl = !excl; break; case 6: /* != */ if (diff != info->distance && diff >= 0) excl = !excl; break; } if (excl) { p->more[1] = rset_read( p->rfd[1], p->buf[1], &p->terms[1]); p->hits++; return 1; } } p->more[1] = rset_read(p->rfd[1], p->buf[1], &p->terms[1]); if (!p->more[1]) break; cmp = (*kctrl->cmp)(buf, p->buf[1]); if (cmp <= - rfd->rset->scope || cmp >= rfd->rset->scope) break; } } } } return 0; } static int r_read(RSFD rfd, void *buf, TERMID *term) { return r_forward(rfd, buf, term, 0); } static void r_pos(RSFD rfd, double *current, double *total) { RSET ct = rfd->rset; struct rset_prox_rfd *p = (struct rset_prox_rfd *)(rfd->priv); int i; double ratio = 0.0; for (i = 0; i < ct->no_children; i++) { double cur, tot; rset_pos(p->rfd[i], &cur, &tot); if (tot > 0.0) { double nratio = cur / tot; if (ratio < nratio) ratio = nratio; } } *current = (double) p->hits; if (ratio > 0.0) *total = *current/ratio; else *total = 0.0; yaz_log(YLOG_DEBUG, "prox_pos: [%d] %0.1f/%0.1f= %0.4f ", i, *current, *total, ratio); } static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) { int i; for (i = 0; i < ct->no_children; i++) rset_getterms(ct->children[i], terms, maxterms, curterm); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/Makefile.in0000644000175000017500000005067415136704635014712 0ustar00adamadam# 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@ subdir = rset ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libidzebra_rset_la_LIBADD = am_libidzebra_rset_la_OBJECTS = rset.lo rstemp.lo rsnull.lo rsbool.lo \ rsbetween.lo rsisamc.lo rsmultiandor.lo rsisams.lo rsisamb.lo \ rsprox.lo libidzebra_rset_la_OBJECTS = $(am_libidzebra_rset_la_OBJECTS) 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 = 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 = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rsbetween.Plo ./$(DEPDIR)/rsbool.Plo \ ./$(DEPDIR)/rset.Plo ./$(DEPDIR)/rsisamb.Plo \ ./$(DEPDIR)/rsisamc.Plo ./$(DEPDIR)/rsisams.Plo \ ./$(DEPDIR)/rsmultiandor.Plo ./$(DEPDIR)/rsnull.Plo \ ./$(DEPDIR)/rsprox.Plo ./$(DEPDIR)/rstemp.Plo am__mv = mv -f 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 = $(libidzebra_rset_la_SOURCES) DIST_SOURCES = $(libidzebra_rset_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ noinst_LTLIBRARIES = libidzebra-rset.la libidzebra_rset_la_SOURCES = rset.c rstemp.c rsnull.c rsbool.c rsbetween.c \ rsisamc.c rsmultiandor.c rsisams.c rsisamb.c rsprox.c AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rset/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu rset/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libidzebra-rset.la: $(libidzebra_rset_la_OBJECTS) $(libidzebra_rset_la_DEPENDENCIES) $(EXTRA_libidzebra_rset_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libidzebra_rset_la_OBJECTS) $(libidzebra_rset_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsbetween.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsbool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsisamb.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsisamc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsisams.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsmultiandor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsnull.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsprox.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rstemp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: 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-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rsbetween.Plo -rm -f ./$(DEPDIR)/rsbool.Plo -rm -f ./$(DEPDIR)/rset.Plo -rm -f ./$(DEPDIR)/rsisamb.Plo -rm -f ./$(DEPDIR)/rsisamc.Plo -rm -f ./$(DEPDIR)/rsisams.Plo -rm -f ./$(DEPDIR)/rsmultiandor.Plo -rm -f ./$(DEPDIR)/rsnull.Plo -rm -f ./$(DEPDIR)/rsprox.Plo -rm -f ./$(DEPDIR)/rstemp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: 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 ./$(DEPDIR)/rsbetween.Plo -rm -f ./$(DEPDIR)/rsbool.Plo -rm -f ./$(DEPDIR)/rset.Plo -rm -f ./$(DEPDIR)/rsisamb.Plo -rm -f ./$(DEPDIR)/rsisamc.Plo -rm -f ./$(DEPDIR)/rsisams.Plo -rm -f ./$(DEPDIR)/rsmultiandor.Plo -rm -f ./$(DEPDIR)/rsnull.Plo -rm -f ./$(DEPDIR)/rsprox.Plo -rm -f ./$(DEPDIR)/rstemp.Plo -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ 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 .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.% idzebra-2.2.10/rset/rsisamb.c0000664000175000017500000001151414754717556014454 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static void r_pos(RSFD rfd, double *current, double *total); static int r_read(RSFD rfd, void *buf, TERMID *term); static int r_read_filter(RSFD rfd, void *buf, TERMID *term); static const struct rset_control control = { "isamb", r_delete, rset_get_one_term, r_open, r_close, r_forward, r_pos, r_read, rset_no_write, }; static const struct rset_control control_filter = { "isamb", r_delete, rset_get_one_term, r_open, r_close, r_forward, r_pos, r_read_filter, rset_no_write, }; struct rfd_private { ISAMB_PP pt; void *buf; }; struct rset_private { ISAMB is; ISAM_P pos; }; static int log_level = 0; static int log_level_initialized = 0; RSET rsisamb_create(NMEM nmem, struct rset_key_control *kcontrol, int scope, ISAMB is, ISAM_P pos, TERMID term) { RSET rnew = rset_create_base( kcontrol->filter_func ? &control_filter : &control, nmem, kcontrol, scope, term, 0, 0); struct rset_private *info; assert(pos); if (!log_level_initialized) { log_level = yaz_log_module_level("rsisamb"); log_level_initialized = 1; } info = (struct rset_private *) nmem_malloc(rnew->nmem, sizeof(*info)); info->is = is; info->pos = pos; rnew->priv = info; yaz_log(log_level, "rsisamb_create"); return rnew; } static void r_delete(RSET ct) { yaz_log(log_level, "rsisamb_delete"); } RSFD r_open(RSET ct, int flag) { struct rset_private *info = (struct rset_private *) ct->priv; RSFD rfd; struct rfd_private *ptinfo; if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "ISAMB set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) ptinfo = (struct rfd_private *) (rfd->priv); else { ptinfo = (struct rfd_private *) nmem_malloc(ct->nmem,sizeof(*ptinfo)); ptinfo->buf = nmem_malloc(ct->nmem,ct->keycontrol->key_size); rfd->priv = ptinfo; } ptinfo->pt = isamb_pp_open(info->is, info->pos, ct->scope ); yaz_log(log_level, "rsisamb_open"); return rfd; } static void r_close(RSFD rfd) { struct rfd_private *ptinfo = (struct rfd_private *)(rfd->priv); isamb_pp_close (ptinfo->pt); yaz_log(log_level, "rsisamb_close"); } static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { struct rfd_private *pinfo = (struct rfd_private *)(rfd->priv); int rc; rc = isamb_pp_forward(pinfo->pt, buf, untilbuf); if (rc && term) *term = rfd->rset->term; yaz_log(log_level, "rsisamb_forward"); return rc; } static void r_pos(RSFD rfd, double *current, double *total) { struct rfd_private *pinfo = (struct rfd_private *)(rfd->priv); assert(rfd); isamb_pp_pos(pinfo->pt, current, total); yaz_log(log_level, "isamb.r_pos returning %0.1f/%0.1f", *current, *total); } static int r_read(RSFD rfd, void *buf, TERMID *term) { struct rfd_private *pinfo = (struct rfd_private *)(rfd->priv); int rc; rc = isamb_pp_read(pinfo->pt, buf); if (rc && term) *term = rfd->rset->term; yaz_log(log_level, "isamb.r_read "); return rc; } static int r_read_filter(RSFD rfd, void *buf, TERMID *term) { struct rfd_private *pinfo = (struct rfd_private *)rfd->priv; const struct rset_key_control *kctrl = rfd->rset->keycontrol; int rc; while((rc = isamb_pp_read(pinfo->pt, buf))) { int incl = (*kctrl->filter_func)(buf, kctrl->filter_data); if (incl) break; } if (rc && term) *term = rfd->rset->term; yaz_log(log_level, "isamb.r_read_filter"); return rc; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rset.c0000664000175000017500000003046214754717556013774 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include static int log_level = 0; static int log_level_initialized = 0; /** \brief Common constuctor for RFDs \param rs Result set handle. Creates an rfd. Either allocates a new one, in which case the priv pointer is null, and will have to be filled in, or picks up one from the freelist, in which case the priv is already allocated, and presumably everything that hangs from it as well */ RSFD rfd_create_base(RSET rs) { RSFD rnew = rs->free_list; if (rnew) { rs->free_list = rnew->next; assert(rnew->rset==rs); yaz_log(log_level, "rfd_create_base (fl): rfd=%p rs=%p fl=%p priv=%p", rnew, rs, rs->free_list, rnew->priv); } else { rnew = nmem_malloc(rs->nmem, sizeof(*rnew)); rnew->counted_buf = nmem_malloc(rs->nmem, rs->keycontrol->key_size); rnew->priv = 0; rnew->rset = rs; yaz_log(log_level, "rfd_create_base (new): rfd=%p rs=%p fl=%p priv=%p", rnew, rs, rs->free_list, rnew->priv); } rnew->next = rs->use_list; rs->use_list = rnew; rnew->counted_items = 0; return rnew; } static void rset_close_int(RSET rs, RSFD rfd) { RSFD *pfd; (*rs->control->f_close)(rfd); yaz_log(log_level, "rfd_delete_base: rfd=%p rs=%p priv=%p fl=%p", rfd, rs, rfd->priv, rs->free_list); for (pfd = &rs->use_list; *pfd; pfd = &(*pfd)->next) if (*pfd == rfd) { *pfd = (*pfd)->next; rfd->next = rs->free_list; rs->free_list = rfd; return; } yaz_log(YLOG_WARN, "rset_close handle not found. type=%s", rs->control->desc); } void rset_set_hits_limit(RSET rs, zint l) { yaz_log(log_level, "rset_set_hits_limit %p l=" ZINT_FORMAT, rs, l); rs->hits_limit = l; } /** \brief Closes a result set RFD handle \param rfd the RFD handle. */ void rset_close(RSFD rfd) { RSET rs = rfd->rset; if (rs->hits_count == 0) { TERMID termid; char buf[100]; while (rfd->counted_items <= rs->hits_limit && rset_default_read(rfd, buf, &termid)) ; rs->hits_count = rfd->counted_items; yaz_log(log_level, "rset_close rset=%p hits_count=" ZINT_FORMAT " hits_limit=" ZINT_FORMAT, rs, rs->hits_count, rs->hits_limit); rs->hits_approx = 0; if (rs->hits_count > rs->hits_limit && rs->hits_limit > 0) { double cur, tot; zint est; rset_pos(rfd, &cur, &tot); if (tot > 0) { int i; double ratio = cur/tot; est = (zint)(0.5 + rs->hits_count / ratio); yaz_log(log_level, "Estimating hits (%s) " "%0.1f->" ZINT_FORMAT "; %0.1f->" ZINT_FORMAT, rs->control->desc, cur, rs->hits_count, tot, est); i = 0; /* round to significant digits */ while (est > rs->hits_round) { est /= 10; i++; } while (i--) est *= 10; rs->hits_count = est; rs->hits_approx = 1; } } yaz_log(log_level, "rset_close(%s) p=%p count=" ZINT_FORMAT, rs->control->desc, rs, rs->hits_count); } rset_close_int(rs, rfd); } /** \brief Common constuctor for RSETs \param sel The interface control handle \param nmem The memory handle for it. \param kcontrol Key control info (decode, encode, comparison etc) \param scope scope for set \param term Information about term for it (NULL for none). \param no_children number of child rsets (0 for none) \param children child rsets (NULL for none). Creates an rfd. Either allocates a new one, in which case the priv pointer is null, and will have to be filled in, or picks up one from the freelist, in which case the priv is already allocated, and presumably everything that hangs from it as well */ RSET rset_create_base(const struct rset_control *sel, NMEM nmem, struct rset_key_control *kcontrol, int scope, TERMID term, int no_children, RSET *children) { RSET rset; assert(nmem); if (!log_level_initialized) { log_level = yaz_log_module_level("rset"); log_level_initialized = 1; } rset = (RSET) nmem_malloc(nmem, sizeof(*rset)); yaz_log(log_level, "rs_create(%s) rs=%p (nm=%p)", sel->desc, rset, nmem); yaz_log(log_level, " ref_id=%s", (term && term->ref_id ? term->ref_id : "null")); rset->nmem = nmem; rset->control = sel; rset->refcount = 1; rset->priv = 0; rset->free_list = NULL; rset->use_list = NULL; rset->hits_count = 0; rset->hits_limit = 0; rset->hits_round = 1000; rset->keycontrol = kcontrol; (*kcontrol->inc)(kcontrol); rset->scope = scope; rset->term = term; if (term) { term->rset = rset; rset->hits_limit = term->hits_limit; } rset->no_children = no_children; rset->children = 0; if (no_children) { rset->children = (RSET*) nmem_malloc(rset->nmem, no_children*sizeof(RSET *)); memcpy(rset->children, children, no_children*sizeof(RSET *)); } return rset; } /** \brief Destructor RSETs \param rs Handle for result set. Destroys a result set and all its children. The f_delete method of control is called for the result set. */ void rset_delete(RSET rs) { (rs->refcount)--; yaz_log(log_level, "rs_delete(%s), rs=%p, refcount=%d", rs->control->desc, rs, rs->refcount); if (!rs->refcount) { int i; if (rs->use_list) yaz_log(YLOG_WARN, "rs_delete(%s) still has RFDs in use", rs->control->desc); for (i = 0; ino_children; i++) rset_delete(rs->children[i]); (*rs->control->f_delete)(rs); (*rs->keycontrol->dec)(rs->keycontrol); } } /** \brief Test for last use of RFD \param rfd RFD handle. Returns 1 if this RFD is the last reference to it; 0 otherwise. */ int rfd_is_last(RSFD rfd) { if (rfd->rset->use_list == rfd && rfd->next == 0) return 1; return 0; } /** \brief Duplicate an RSET \param rs Handle for result set. Duplicates a result set by incrementing the reference count to it. */ RSET rset_dup (RSET rs) { (rs->refcount)++; yaz_log(log_level, "rs_dup(%s), rs=%p, refcount=%d", rs->control->desc, rs, rs->refcount); return rs; } /** \brief Estimates hit count for result set. \param rs Result Set. rset_count uses rset_pos to get the total and returns that. This is ok for rsisamb/c/s, and for some other rsets, but in case of booleans etc it will give bad estimate, as nothing has been read from that rset */ zint rset_count(RSET rs) { double cur, tot; RSFD rfd = rset_open(rs, 0); rset_pos(rfd, &cur, &tot); rset_close_int(rs, rfd); return (zint) tot; } /** \brief is a getterms function for those that don't have any \param ct result set handle \param terms array of terms (0..maxterms-1) \param maxterms length of terms array \param curterm current size of terms array If there is a term associated with rset the term is appeneded; otherwise the terms array is untouched but curterm is incremented anyway. */ void rset_get_one_term(RSET ct, TERMID *terms, int maxterms, int *curterm) { if (ct->term) { if (*curterm < maxterms) terms[*curterm] = ct->term; (*curterm)++; } } struct ord_list *ord_list_create(NMEM nmem) { return 0; } struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list, int ord) { struct ord_list *n = nmem_malloc(nmem, sizeof(*n)); n->ord = ord; n->next = list; return n; } struct ord_list *ord_list_dup(NMEM nmem, struct ord_list *list) { struct ord_list *n = ord_list_create(nmem); for (; list; list = list->next) n = ord_list_append(nmem, n, list->ord); return n; } void ord_list_print(struct ord_list *list) { for (; list; list = list->next) yaz_log(YLOG_LOG, "ord_list %d", list->ord); } /** \brief Creates a TERMID entry. \param name Term/Name buffer with given length \param length of term \param flags for term \param type Term Type, Z_Term_general, Z_Term_characterString,.. \param nmem memory for term. \param ol ord list \param reg_type register type \param hits_limit limit before counting stops and gets approximate \param ref_id supplied ID for term that can be used to identify this */ TERMID rset_term_create(const char *name, int length, const char *flags, int type, NMEM nmem, struct ord_list *ol, int reg_type, zint hits_limit, const char *ref_id) { TERMID t = (TERMID) nmem_malloc(nmem, sizeof(*t)); if (!name) name = ""; if (length == -1) t->name = nmem_strdup(nmem, name); else t->name = nmem_strdupn(nmem, name, length); if (!ref_id) t->ref_id = 0; else t->ref_id = nmem_strdup(nmem, ref_id); if (!flags) t->flags = NULL; else t->flags = nmem_strdup(nmem, flags); t->hits_limit = hits_limit; t->type = type; t->reg_type = reg_type; t->rankpriv = 0; t->rset = 0; t->ol = ord_list_dup(nmem, ol); return t; } int rset_default_read(RSFD rfd, void *buf, TERMID *term) { RSET rset = rfd->rset; int rc = (*rset->control->f_read)(rfd, buf, term); if (rc > 0) { int got_scope; if (rfd->counted_items == 0) got_scope = rset->scope+1; else got_scope = rset->keycontrol->cmp(buf, rfd->counted_buf); #if 0 key_logdump_txt(YLOG_LOG, buf, "rset_default_read"); yaz_log(YLOG_LOG, "rset_scope=%d got_scope=%d", rset->scope, got_scope); #endif if (got_scope > rset->scope) { memcpy(rfd->counted_buf, buf, rset->keycontrol->key_size); rfd->counted_items++; } } return rc; } int rset_default_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { RSET rset = rfd->rset; int more; if (rset->control->f_forward && rfd->counted_items >= rset->hits_limit) { assert (rset->control->f_forward != rset_default_forward); return rset->control->f_forward(rfd, buf, term, untilbuf); } while ((more = rset_read(rfd, buf, term)) > 0) { if ((rfd->rset->keycontrol->cmp)(untilbuf, buf) < rset->scope) break; } if (log_level) yaz_log(log_level, "rset_default_forward exiting rfd=%p scope=%d m=%d c=%d", rfd, rset->scope, more, rset->scope); return more; } void rset_visit(RSET rset, int level) { int i; yaz_log(YLOG_LOG, "%*s%c " ZINT_FORMAT, level, "", rset->hits_approx ? '~' : '=', rset->hits_count); for (i = 0; ino_children; i++) rset_visit(rset->children[i], level+1); } int rset_no_write(RSFD rfd, const void *buf) { yaz_log(YLOG_FATAL, "%s set type is read-only", rfd->rset->control->desc); return -1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/Makefile.am0000664000175000017500000000033714754717556014705 0ustar00adamadam noinst_LTLIBRARIES = libidzebra-rset.la libidzebra_rset_la_SOURCES = rset.c rstemp.c rsnull.c rsbool.c rsbetween.c \ rsisamc.c rsmultiandor.c rsisams.c rsisamb.c rsprox.c AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) idzebra-2.2.10/rset/rsisams.c0000664000175000017500000000610614754717556014476 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static int r_read (RSFD rfd, void *buf, TERMID *term); static void r_pos (RSFD rfd, double *current, double *total); static const struct rset_control control = { "isams", r_delete, rset_get_one_term, r_open, r_close, 0, /* no forward */ r_pos, r_read, rset_no_write, }; struct rfd_private { ISAMS_PP pt; }; struct rset_private { ISAMS is; ISAM_P pos; }; RSET rsisams_create(NMEM nmem, struct rset_key_control *kcontrol, int scope, ISAMS is, ISAM_P pos, TERMID term) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, term, 0, 0); struct rset_private *info; info = (struct rset_private *) nmem_malloc(rnew->nmem, sizeof(*info)); rnew->priv = info; info->is = is; info->pos = pos; return rnew; } static void r_delete (RSET ct) { yaz_log (YLOG_DEBUG, "rsisams_delete"); } RSFD r_open (RSET ct, int flag) { struct rset_private *info = (struct rset_private *) ct->priv; RSFD rfd; struct rfd_private *ptinfo; yaz_log (YLOG_DEBUG, "risams_open"); if (flag & RSETF_WRITE) { yaz_log (YLOG_FATAL, "ISAMS set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) ptinfo = (struct rfd_private *)(rfd->priv); else { ptinfo = (struct rfd_private *) nmem_malloc(ct->nmem,sizeof(*ptinfo)); rfd->priv = ptinfo; } ptinfo->pt = isams_pp_open (info->is, info->pos); return rfd; } static void r_close (RSFD rfd) { struct rfd_private *ptinfo = (struct rfd_private *)(rfd->priv); isams_pp_close (ptinfo->pt); } static int r_read (RSFD rfd, void *buf, TERMID *term) { struct rfd_private *ptinfo = (struct rfd_private *)(rfd->priv); int rc = isams_pp_read(ptinfo->pt, buf); if (rc && term) *term = rfd->rset->term; return rc; } static void r_pos (RSFD rfd, double *current, double *total) { *current=-1; /* sorry, not implemented yet */ *total=-1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rsbool.c0000664000175000017500000001663314754717556014323 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifndef RSET_DEBUG #define RSET_DEBUG 0 #endif static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static void r_pos(RSFD rfd, double *current, double *total); static int r_read_not(RSFD rfd, void *buf, TERMID *term); static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm); static const struct rset_control control_not = { "not", r_delete, r_get_terms, r_open, r_close, r_forward, r_pos, r_read_not, rset_no_write, }; struct rset_private { RSET rset_l; RSET rset_r; }; struct rfd_private { zint hits; RSFD rfd_l; RSFD rfd_r; int more_l; int more_r; void *buf_l; void *buf_r; TERMID term_l; TERMID term_r; int tail; }; static RSET rsbool_create_base(const struct rset_control *ctrl, NMEM nmem, struct rset_key_control *kcontrol, int scope, RSET rset_l, RSET rset_r) { RSET children[2], rnew; struct rset_private *info; children[0] = rset_l; children[1] = rset_r; rnew = rset_create_base(ctrl, nmem, kcontrol, scope, 0, 2, children); info = (struct rset_private *) nmem_malloc(rnew->nmem, sizeof(*info)); info->rset_l = rset_l; info->rset_r = rset_r; rnew->priv = info; return rnew; } RSET rset_create_not(NMEM nmem, struct rset_key_control *kcontrol, int scope, RSET rset_l, RSET rset_r) { return rsbool_create_base(&control_not, nmem, kcontrol, scope, rset_l, rset_r); } static void r_delete(RSET ct) { } static RSFD r_open(RSET ct, int flag) { struct rset_private *info = (struct rset_private *) ct->priv; RSFD rfd; struct rfd_private *p; if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "bool set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) p = (struct rfd_private *)rfd->priv; else { p = nmem_malloc(ct->nmem,sizeof(*p)); rfd->priv = p; p->buf_l = nmem_malloc(ct->nmem, ct->keycontrol->key_size); p->buf_r = nmem_malloc(ct->nmem, ct->keycontrol->key_size); } yaz_log(YLOG_DEBUG,"rsbool (%s) open [%p]", ct->control->desc, rfd); p->hits=0; p->rfd_l = rset_open (info->rset_l, RSETF_READ); p->rfd_r = rset_open (info->rset_r, RSETF_READ); p->more_l = rset_read(p->rfd_l, p->buf_l, &p->term_l); p->more_r = rset_read(p->rfd_r, p->buf_r, &p->term_r); p->tail = 0; return rfd; } static void r_close (RSFD rfd) { struct rfd_private *prfd=(struct rfd_private *)rfd->priv; rset_close (prfd->rfd_l); rset_close (prfd->rfd_r); } static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { struct rfd_private *p = (struct rfd_private *)rfd->priv; const struct rset_key_control *kctrl=rfd->rset->keycontrol; if ( p->more_l && ((kctrl->cmp)(untilbuf,p->buf_l)>=rfd->rset->scope) ) p->more_l = rset_forward(p->rfd_l, p->buf_l, &p->term_l, untilbuf); if ( p->more_r && ((kctrl->cmp)(untilbuf,p->buf_r)>=rfd->rset->scope)) p->more_r = rset_forward(p->rfd_r, p->buf_r, &p->term_r, untilbuf); p->tail = 0; return rset_read(rfd,buf,term); } /* 1,1 1,3 1,9 2,1 1,11 3,1 2,9 1,1 1,1 1,3 1,3 1,9 1,11 2,1 2,1 2,9 3,1 */ static int r_read_not(RSFD rfd, void *buf, TERMID *term) { struct rfd_private *p = (struct rfd_private *)rfd->priv; const struct rset_key_control *kctrl = rfd->rset->keycontrol; while (p->more_l) { int cmp; if (p->more_r) cmp = (*kctrl->cmp)(p->buf_l, p->buf_r); else cmp = -rfd->rset->scope; if (cmp <= -rfd->rset->scope) { /* cmp == -2 */ memcpy (buf, p->buf_l, kctrl->key_size); if (term) *term=p->term_l; p->more_l = rset_read(p->rfd_l, p->buf_l, &p->term_l); p->hits++; return 1; } else if (cmp >= rfd->rset->scope) /* cmp >1 */ { p->more_r = rset_forward( p->rfd_r, p->buf_r, &p->term_r, p->buf_l); } else { /* cmp== -1, 0, or 1 */ memcpy (buf, p->buf_l, kctrl->key_size); if (term) *term = p->term_l; do { p->more_l = rset_read(p->rfd_l, p->buf_l, &p->term_l); if (!p->more_l) break; cmp = (*kctrl->cmp)(p->buf_l, buf); } while (abs(cmp)rset->scope); /* (cmp >= -1 && cmp <= 1) */ do { p->more_r = rset_read(p->rfd_r, p->buf_r, &p->term_r); if (!p->more_r) break; cmp = (*kctrl->cmp)(p->buf_r, buf); } while (abs(cmp)rset->scope); /* (cmp >= -1 && cmp <= 1) */ } } return 0; } static void r_pos(RSFD rfd, double *current, double *total) { struct rfd_private *p = (struct rfd_private *)rfd->priv; double lcur, ltot; double rcur, rtot; double r; ltot = -1; rtot = -1; rset_pos(p->rfd_l, &lcur, <ot); rset_pos(p->rfd_r, &rcur, &rtot); if ( (rtot<0) && (ltot<0)) { /*no position */ *current = rcur; /* return same as you got */ *total = rtot; /* probably -1 for not available */ } if (rtot < 0) rtot = rcur = 0; /* if only one useful, use it */ if (ltot < 0) ltot = lcur = 0; if (rtot+ltot < 1) { /* empty rset */ *current = *total = 0; return; } r = 1.0*(lcur+rcur)/(ltot+rtot); /* weighed average of l and r */ *current = (double) (p->hits); *total = *current/r ; #if RSET_DEBUG yaz_log(YLOG_DEBUG,"bool_pos: (%s/%s) %0.1f/%0.1f= %0.4f ", info->rset_l->control->desc, info->rset_r->control->desc, *current, *total, r); #endif } static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) { struct rset_private *info = (struct rset_private *) ct->priv; rset_getterms(info->rset_l, terms, maxterms, curterm); rset_getterms(info->rset_r, terms, maxterms, curterm); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rsbetween.c0000664000175000017500000002526614754717556015023 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* rsbetween is (mostly) used for xml searches. It returns the hits of the * "middle" rset, that are in between the "left" and "right" rsets. For * example "Shakespeare" in between "" and . The thing is * complicated by the inclusion of attributes (from their own rset). If attrs * specified, they must match the "left" rset (start tag). "Hamlet" between * "" and "". (This assumes that the attributes are * indexed to the same seqno as the tags). * */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf); static int r_read(RSFD rfd, void *buf, TERMID *term ); static void r_pos(RSFD rfd, double *current, double *total); static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm); static const struct rset_control control = { "between", r_delete, r_get_terms, r_open, r_close, r_forward, r_pos, r_read, rset_no_write, }; struct rset_between_info { TERMID startterm; /* pseudo terms for detecting which one we read from */ TERMID stopterm; TERMID attrterm; TERMID *hit2_terms; }; struct rset_between_rfd { RSFD andrfd; void *recbuf; /* a key that tells which record we are in */ void *startbuf; /* the start tag */ int startbufok; /* we have seen the first start tag */ void *attrbuf; /* the attr tag. If these two match, we have attr match */ int attrbufok; /* we have seen the first attr tag, can compare */ int depth; /* number of start-tags without end-tags */ int attrdepth; /* on what depth the attr matched */ int match_1; int match_2; zint hits; }; static int log_level = 0; static int log_level_initialized = 0; /* make sure that the rset has a term attached. If not, create one */ /* we need these terms for the tags, to distinguish what we read */ static void checkterm(RSET rs, char *tag, NMEM nmem) { if (!rs->term) { rs->term = rset_term_create(tag, -1, "", 0, nmem, 0, 0, 0, 0); rs->term->rset = rs; } } RSET rset_create_between(NMEM nmem, struct rset_key_control *kcontrol, int scope, RSET rset_l, RSET rset_m1, RSET rset_m2, RSET rset_r, RSET rset_attr) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, 0, 0, 0); struct rset_between_info *info = (struct rset_between_info *) nmem_malloc(rnew->nmem,sizeof(*info)); RSET rsetarray[5]; int n = 0; if (!log_level_initialized) { log_level = yaz_log_module_level("rsbetween"); log_level_initialized = 1; } rsetarray[n++] = rset_l; checkterm(rset_l, "", nmem); info->startterm = rset_l->term; rsetarray[n++] = rset_r; checkterm(rset_r, "", nmem); info->stopterm = rset_r->term; rsetarray[n++] = rset_m1; if (rset_m2) { rsetarray[n++] = rset_m2; /* hard to work do determine whether we get results from rset_m2 or rset_m1 */ info->hit2_terms = (TERMID*) nmem_malloc(nmem, (2 + rset_m2->no_children) * sizeof(TERMID)); int i; for (i = 0; i < rset_m2->no_children; i++) /* sub terms */ info->hit2_terms[i] = rset_m2->children[i]->term; if (rset_m2->term) /* immediate term */ info->hit2_terms[i++] = rset_m2->term; info->hit2_terms[i] = 0; } else info->hit2_terms = NULL; if (rset_attr) { rsetarray[n++] = rset_attr; checkterm(rset_attr, "(attr)", nmem); info->attrterm = rset_attr->term; } else info->attrterm = NULL; rnew->no_children = 1; rnew->children = nmem_malloc(rnew->nmem, sizeof(RSET *)); rnew->children[0] = rset_create_and(nmem, kcontrol, scope, n, rsetarray); rnew->priv = info; yaz_log(log_level, "create rset at %p", rnew); return rnew; } static void r_delete(RSET ct) { } static RSFD r_open(RSET ct, int flag) { RSFD rfd; struct rset_between_rfd *p; if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "between set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) p = (struct rset_between_rfd *) rfd->priv; else { p = (struct rset_between_rfd *) nmem_malloc(ct->nmem, sizeof(*p)); rfd->priv = p; p->recbuf = nmem_malloc(ct->nmem, ct->keycontrol->key_size); p->startbuf = nmem_malloc(ct->nmem, ct->keycontrol->key_size); p->attrbuf = nmem_malloc(ct->nmem, ct->keycontrol->key_size); } p->andrfd = rset_open(ct->children[0], RSETF_READ); p->hits = -1; p->depth = 0; p->attrdepth = 0; p->attrbufok = 0; p->startbufok = 0; yaz_log(log_level, "open rset=%p rfd=%p", ct, rfd); return rfd; } static void r_close(RSFD rfd) { struct rset_between_rfd *p = (struct rset_between_rfd *) rfd->priv; yaz_log(log_level, "close rfd=%p", rfd); rset_close(p->andrfd); } static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) { struct rset_between_rfd *p = (struct rset_between_rfd *) rfd->priv; int rc; yaz_log(log_level, "forwarding "); rc = rset_forward(p->andrfd,buf,term,untilbuf); return rc; } static void checkattr(RSFD rfd) { struct rset_between_info *info = (struct rset_between_info *) rfd->rset->priv; struct rset_between_rfd *p = (struct rset_between_rfd *)rfd->priv; const struct rset_key_control *kctrl = rfd->rset->keycontrol; int cmp; if (p->attrdepth) return; /* already found one */ if (!info->attrterm) { p->attrdepth = -1; /* matches always */ return; } if ( p->startbufok && p->attrbufok ) { /* have buffers to compare */ cmp = (kctrl->cmp)(p->startbuf, p->attrbuf); if (0 == cmp) /* and the keys match */ { p->attrdepth = p->depth; yaz_log(log_level, "found attribute match at depth %d", p->attrdepth); } } } static int r_read(RSFD rfd, void *buf, TERMID *term) { struct rset_between_info *info = (struct rset_between_info *)rfd->rset->priv; struct rset_between_rfd *p = (struct rset_between_rfd *)rfd->priv; const struct rset_key_control *kctrl = rfd->rset->keycontrol; int cmp; TERMID dummyterm = 0; yaz_log(log_level, "== read: term=%p",term); if (!term) term = &dummyterm; while (rset_read(p->andrfd, buf, term)) { yaz_log(log_level, "read loop term=%p d=%d ad=%d", *term, p->depth, p->attrdepth); if (p->hits < 0) {/* first time? */ memcpy(p->recbuf, buf, kctrl->key_size); p->hits = 0; cmp = rfd->rset->scope; /* force newrecord */ } else { cmp = (kctrl->cmp)(buf, p->recbuf); yaz_log(log_level, "cmp=%d", cmp); } if (cmp >= rfd->rset->scope) { yaz_log(log_level, "new record"); p->depth = 0; p->attrdepth = 0; p->match_1 = p->match_2 = 0; memcpy(p->recbuf, buf, kctrl->key_size); } if (*term) yaz_log(log_level, " term: '%s'", (*term)->name); if (*term == info->startterm) { p->depth++; yaz_log(log_level, "read start tag. d=%d", p->depth); memcpy(p->startbuf, buf, kctrl->key_size); p->startbufok = 1; checkattr(rfd); /* in case we already saw the attr here */ } else if (*term == info->stopterm) { if (p->depth == p->attrdepth) p->attrdepth = 0; /* ending the tag with attr match */ p->depth--; if (p->depth == 0) p->match_1 = p->match_2 = 0; yaz_log(log_level, "read end tag. d=%d ad=%d", p->depth, p->attrdepth); } else if (*term == info->attrterm) { yaz_log(log_level, "read attr"); memcpy(p->attrbuf, buf, kctrl->key_size); p->attrbufok = 1; checkattr(rfd); /* in case the start tag came first */ } else { /* mut be a real hit */ if (p->depth && p->attrdepth) { if (!info->hit2_terms) p->match_1 = p->match_2 = 1; else { int i; for (i = 0; info->hit2_terms[i]; i++) if (info->hit2_terms[i] == *term) break; if (info->hit2_terms[i]) p->match_2 = 1; else p->match_1 = 1; } if (p->match_1 && p->match_2) { p->hits++; yaz_log(log_level, "got a hit h="ZINT_FORMAT" d=%d ad=%d", p->hits, p->depth, p->attrdepth); return 1; /* we have everything in place already! */ } } else yaz_log(log_level, "Ignoring hit. h="ZINT_FORMAT" d=%d ad=%d", p->hits, p->depth, p->attrdepth); } } /* while read */ return 0; } /* r_read */ static void r_pos(RSFD rfd, double *current, double *total) { struct rset_between_rfd *p = (struct rset_between_rfd *) rfd->priv; rset_pos(p->andrfd, current, total); yaz_log(log_level, "pos: %0.1f/%0.1f ", *current, *total); } static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) { rset_getterms(ct->children[0], terms, maxterms, curterm); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rstemp.c0000664000175000017500000002351514754717556014332 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifdef WIN32 #include #endif #if HAVE_UNISTD_H #include #endif #include #include #include #include static RSFD r_open(RSET ct, int flag); static void r_close(RSFD rfd); static void r_delete(RSET ct); static int r_read(RSFD rfd, void *buf, TERMID *term); static int r_write(RSFD rfd, const void *buf); static void r_pos(RSFD rfd, double *current, double *total); static void r_flush(RSFD rfd, int mk); static void r_reread(RSFD rfd); static const struct rset_control control = { "temp", r_delete, rset_get_one_term, r_open, r_close, 0, /* no forward */ r_pos, r_read, r_write, }; struct rset_private { int fd; /* file descriptor for temp file */ char *fname; /* name of temp file */ char *buf_mem; /* window buffer */ size_t buf_size; /* size of window */ size_t pos_end; /* last position in set */ size_t pos_buf; /* position of first byte in window */ size_t pos_border; /* position of last byte+1 in window */ int dirty; /* window is dirty */ zint hits; /* no of hits */ char *temp_path; }; struct rfd_private { void *buf; size_t pos_cur; /* current position in set */ /* FIXME - term pos or what ?? */ zint cur; /* number of the current hit */ }; static int log_level = 0; static int log_level_initialized = 0; RSET rset_create_temp(NMEM nmem, struct rset_key_control *kcontrol, int scope, const char *temp_path, TERMID term) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, term, 0, 0); struct rset_private *info; if (!log_level_initialized) { log_level = yaz_log_module_level("rstemp"); log_level_initialized = 1; } info = (struct rset_private *) nmem_malloc(rnew->nmem, sizeof(*info)); info->fd = -1; info->fname = NULL; info->buf_size = 4096; info->buf_mem = (char *) nmem_malloc(rnew->nmem, info->buf_size); info->pos_end = 0; info->pos_buf = 0; info->dirty = 0; info->hits = 0; if (!temp_path) info->temp_path = NULL; else info->temp_path = nmem_strdup(rnew->nmem, temp_path); rnew->priv = info; return rnew; } /* rstemp_create */ static void r_delete(RSET ct) { struct rset_private *info = (struct rset_private*) ct->priv; yaz_log(log_level, "r_delete: set size %ld", (long) info->pos_end); if (info->fname) { yaz_log(log_level, "r_delete: unlink %s", info->fname); unlink(info->fname); } } static RSFD r_open(RSET ct, int flag) { struct rset_private *info = (struct rset_private *) ct->priv; RSFD rfd; struct rfd_private *prfd; if (info->fd == -1 && info->fname) { if (flag & RSETF_WRITE) info->fd = open(info->fname, O_BINARY|O_RDWR|O_CREAT, 0666); else info->fd = open(info->fname, O_BINARY|O_RDONLY); if (info->fd == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: open failed %s", info->fname); zebra_exit("r_open"); } } rfd = rfd_create_base(ct); if (!rfd->priv) { prfd = (struct rfd_private *) nmem_malloc(ct->nmem, sizeof(*prfd)); rfd->priv = (void *)prfd; prfd->buf = nmem_malloc(ct->nmem,ct->keycontrol->key_size); } else prfd= rfd->priv; r_flush(rfd, 0); prfd->pos_cur = 0; info->pos_buf = 0; r_reread(rfd); prfd->cur = 0; return rfd; } /* r_flush: flush current window to file if file is assocated with set */ static void r_flush(RSFD rfd, int mk) { struct rset_private *info = rfd->rset->priv; if (!info->fname && mk) { #if HAVE_MKSTEMP char template[1024]; if (info->temp_path) yaz_snprintf(template, sizeof(template) - 80, "%s/", info->temp_path); else strcpy(template, ""); strcat(template, "zrs_"); #if HAVE_UNISTD_H yaz_snprintf(template + strlen(template), 40, "%ld_", (long) getpid()); #endif strcat(template, "XXXXXX"); info->fd = mkstemp(template); if (info->fd == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: mkstemp %s", template); zebra_exit("r_flush"); } info->fname = nmem_strdup(rfd->rset->nmem, template); #else char *s = (char*) tempnam(info->temp_path, "zrs"); yaz_log(log_level, "creating tempfile %s", s); info->fd = open(s, O_BINARY|O_RDWR|O_CREAT, 0666); if (info->fd == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: open %s", s); zebra_exit("r_flush"); } info->fname= nmem_strdup(rfd->rset->nmem, s); #endif } if (info->fname && info->fd != -1 && info->dirty) { size_t count; int r; if (lseek(info->fd, info->pos_buf, SEEK_SET) == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: lseek (1) %s", info->fname); zebra_exit("r_flusxh"); } count = info->buf_size; if (count > info->pos_end - info->pos_buf) count = info->pos_end - info->pos_buf; if ((r = write(info->fd, info->buf_mem, count)) < (int) count) { if (r == -1) yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: write %s", info->fname); else yaz_log(YLOG_FATAL, "rstemp: write of %ld but got %ld", (long) count, (long) r); zebra_exit("r_flush"); } info->dirty = 0; } } static void r_close(RSFD rfd) { struct rset_private *info = (struct rset_private *)rfd->rset->priv; if (rfd_is_last(rfd)) { r_flush(rfd, 0); if (info->fname && info->fd != -1) { close(info->fd); info->fd = -1; } } } /* r_reread: read from file to window if file is assocated with set - indicated by fname */ static void r_reread(RSFD rfd) { struct rfd_private *mrfd = (struct rfd_private*) rfd->priv; struct rset_private *info = (struct rset_private *)rfd->rset->priv; if (info->fname) { size_t count; int r; info->pos_border = mrfd->pos_cur + info->buf_size; if (info->pos_border > info->pos_end) info->pos_border = info->pos_end; count = info->pos_border - info->pos_buf; if (count > 0) { if (lseek(info->fd, info->pos_buf, SEEK_SET) == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: lseek (2) %s fd=%d", info->fname, info->fd); zebra_exit("r_reread"); } if ((r = read(info->fd, info->buf_mem, count)) < (int) count) { if (r == -1) yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: read %s", info->fname); else yaz_log(YLOG_FATAL, "read of %ld but got %ld", (long) count, (long) r); zebra_exit("r_reread"); } } } else info->pos_border = info->pos_end; } static int r_read(RSFD rfd, void *buf, TERMID *term) { struct rfd_private *mrfd = (struct rfd_private*) rfd->priv; struct rset_private *info = (struct rset_private *)rfd->rset->priv; size_t nc = mrfd->pos_cur + rfd->rset->keycontrol->key_size; if (mrfd->pos_cur < info->pos_buf || nc > info->pos_border) { if (nc > info->pos_end) return 0; r_flush(rfd, 0); info->pos_buf = mrfd->pos_cur; r_reread(rfd); } memcpy(buf, info->buf_mem + (mrfd->pos_cur - info->pos_buf), rfd->rset->keycontrol->key_size); if (term) *term = rfd->rset->term; /* FIXME - should we store and return terms ?? */ mrfd->pos_cur = nc; mrfd->cur++; return 1; } static int r_write(RSFD rfd, const void *buf) { struct rfd_private *mrfd = (struct rfd_private*) rfd->priv; struct rset_private *info = (struct rset_private *)rfd->rset->priv; size_t nc = mrfd->pos_cur + rfd->rset->keycontrol->key_size; if (nc > info->pos_buf + info->buf_size) { r_flush(rfd, 1); info->pos_buf = mrfd->pos_cur; if (info->pos_buf < info->pos_end) r_reread(rfd); } info->dirty = 1; memcpy(info->buf_mem + (mrfd->pos_cur - info->pos_buf), buf, rfd->rset->keycontrol->key_size); mrfd->pos_cur = nc; if (nc > info->pos_end) info->pos_border = info->pos_end = nc; info->hits++; return 1; } static void r_pos(RSFD rfd, double *current, double *total) { struct rfd_private *mrfd = (struct rfd_private*) rfd->priv; struct rset_private *info = (struct rset_private *)rfd->rset->priv; *current = (double) mrfd->cur; *total = (double) info->hits; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/rset/rsisamc.c0000664000175000017500000000671414754717556014463 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static int r_read (RSFD rfd, void *buf, TERMID *term); static void r_pos (RSFD rfd, double *current, double *total); static const struct rset_control control = { "isamc", r_delete, rset_get_one_term, r_open, r_close, 0, /* no forward */ r_pos, r_read, rset_no_write, }; struct rset_pp_info { ISAMC_PP pt; void *buf; }; struct rset_isamc_info { ISAMC is; ISAM_P pos; }; static int log_level = 0; static int log_level_initialized = 0; RSET rsisamc_create(NMEM nmem, struct rset_key_control *kcontrol, int scope, ISAMC is, ISAM_P pos, TERMID term) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, term, 0, 0); struct rset_isamc_info *info; if (!log_level_initialized) { log_level = yaz_log_module_level("rsisamc"); log_level_initialized = 1; } info = (struct rset_isamc_info *) nmem_malloc(rnew->nmem, sizeof(*info)); info->is = is; info->pos = pos; rnew->priv = info; yaz_log(log_level, "create: term=%p", term); return rnew; } static void r_delete (RSET ct) { yaz_log(log_level, "rsisamc_delete"); } RSFD r_open (RSET ct, int flag) { struct rset_isamc_info *info = (struct rset_isamc_info *) ct->priv; RSFD rfd; struct rset_pp_info *ptinfo; yaz_log(log_level, "risamc_open"); if (flag & RSETF_WRITE) { yaz_log(YLOG_FATAL, "ISAMC set type is read-only"); return NULL; } rfd = rfd_create_base(ct); if (rfd->priv) ptinfo = (struct rset_pp_info *)rfd->priv; else { ptinfo = (struct rset_pp_info *) nmem_malloc (ct->nmem,sizeof(*ptinfo)); rfd->priv = ptinfo; ptinfo->buf = nmem_malloc (ct->nmem,ct->keycontrol->key_size); } ptinfo->pt = isamc_pp_open(info->is, info->pos); return rfd; } static void r_close (RSFD rfd) { struct rset_pp_info *p = (struct rset_pp_info *)(rfd->priv); isamc_pp_close(p->pt); } static int r_read (RSFD rfd, void *buf, TERMID *term) { struct rset_pp_info *p = (struct rset_pp_info *)(rfd->priv); int r; r = isamc_pp_read(p->pt, buf); if (term) *term = rfd->rset->term; yaz_log(log_level, "isamc.r_read"); return r; } static void r_pos (RSFD rfd, double *current, double *total) { *current = -1; /* sorry, not implemented yet */ *total = -1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/0000755000175000017500000000000015136704657012652 5ustar00adamadamidzebra-2.2.10/data1/d1_tagset.c0000664000175000017500000001640214754717556014705 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include /* * We'll probably want to add some sort of hashed index to these lookup- * functions eventually. */ data1_datatype data1_maptype(data1_handle dh, char *t) { static struct { char *tname; data1_datatype type; } types[] = { {"structured", DATA1K_structured}, {"string", DATA1K_string}, {"numeric", DATA1K_numeric}, {"oid", DATA1K_oid}, {"bool", DATA1K_bool}, {"generalizedtime", DATA1K_generalizedtime}, {"intunit", DATA1K_intunit}, {"int", DATA1K_int}, {"octetstring", DATA1K_octetstring}, {"null", DATA1K_null}, {NULL, (data1_datatype) -1} }; int i; for (i = 0; types[i].tname; i++) if (!data1_matchstr(types[i].tname, t)) return types[i].type; return DATA1K_unknown; } data1_tag *data1_gettagbynum(data1_handle dh, data1_tagset *s, int type, int value) { data1_tag *r; for (; s; s = s->next) { /* scan local set */ if (type == s->type) for (r = s->tags; r; r = r->next) if (r->which == DATA1T_numeric && r->value.numeric == value) return r; /* scan included sets */ if (s->children && (r = data1_gettagbynum(dh, s->children, type, value))) return r; } return 0; } data1_tag *data1_gettagbyname(data1_handle dh, data1_tagset *s, const char *name) { data1_tag *r; for (; s; s = s->next) { /* scan local set */ for (r = s->tags; r; r = r->next) { data1_name *np; for (np = r->names; np; np = np->next) if (!data1_matchstr(np->name, name)) return r; } /* scan included sets */ if (s->children && (r = data1_gettagbyname(dh, s->children, name))) return r; } return 0; } data1_tagset *data1_empty_tagset(data1_handle dh) { data1_tagset *res = (data1_tagset *) nmem_malloc(data1_nmem_get(dh), sizeof(*res)); res->name = 0; res->oid = 0; res->tags = 0; res->type = 0; res->children = 0; res->next = 0; return res; } data1_tagset *data1_read_tagset(data1_handle dh, const char *file, int type) { NMEM mem = data1_nmem_get(dh); data1_tagset *res = 0; data1_tagset **childp; data1_tag **tagp; FILE *f; int lineno = 0; int argc; char *argv[50], line[512]; if (!(f = data1_path_fopen(dh, file, "r"))) { yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file); return 0; } res = data1_empty_tagset(dh); res->type = type; childp = &res->children; tagp = &res->tags; while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) { char *cmd = *argv; if (!strcmp(cmd, "tag")) { int value; char *names, *type, *nm; data1_tag *rr; data1_name **npp; if (argc != 4) { yaz_log(YLOG_WARN, "%s:%d: Bad # args to tag", file, lineno); continue; } value = atoi(argv[1]); names = argv[2]; type = argv[3]; rr = *tagp = (data1_tag *)nmem_malloc(mem, sizeof(*rr)); rr->tagset = res; rr->next = 0; rr->which = DATA1T_numeric; rr->value.numeric = value; /* * how to deal with local numeric tags? */ if (!(rr->kind = data1_maptype(dh, type))) { yaz_log(YLOG_WARN, "%s:%d: Unknown datatype %s", file, lineno, type); fclose(f); return 0; } /* read namelist */ nm = names; npp = &rr->names; do { char *e; *npp = (data1_name *)nmem_malloc(mem, sizeof(**npp)); if ((e = strchr(nm, '/'))) *(e++) = '\0'; (*npp)->name = nmem_strdup(mem, nm); (*npp)->next = 0; npp = &(*npp)->next; nm = e; } while (nm); tagp = &rr->next; } else if (!strcmp(cmd, "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args to name", file, lineno); continue; } res->name = nmem_strdup(mem, argv[1]); } else if (!strcmp(cmd, "reference")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args to reference", file, lineno); continue; } name = argv[1]; res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_TAGSET, name, mem); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'", file, lineno, name); continue; } } else if (!strcmp(cmd, "type")) { if (argc != 2) { yaz_log (YLOG_WARN, "%s:%d: Bad # args to type", file, lineno); continue; } if (!res->type) res->type = atoi(argv[1]); } else if (!strcmp(cmd, "include")) { char *name; int type = 0; if (argc < 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args to include", file, lineno); continue; } name = argv[1]; if (argc == 3) type = atoi(argv[2]); *childp = data1_read_tagset(dh, name, type); if (!(*childp)) { yaz_log(YLOG_WARN, "%s:%d: Inclusion failed for tagset %s", file, lineno, name); continue; } childp = &(*childp)->next; } else { yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); } } fclose(f); return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/Makefile.in0000644000175000017500000005456115136704635014726 0ustar00adamadam# 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@ subdir = data1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libidzebra_data1_la_LIBADD = am_libidzebra_data1_la_OBJECTS = d1_handle.lo d1_read.lo d1_attset.lo \ d1_tagset.lo d1_absyn.lo d1_grs.lo d1_sutrs.lo d1_varset.lo \ d1_espec.lo d1_doespec.lo d1_map.lo d1_marc.lo d1_write.lo \ d1_expout.lo d1_sumout.lo d1_soif.lo d1_prtree.lo d1_if.lo \ d1_utils.lo libidzebra_data1_la_OBJECTS = $(am_libidzebra_data1_la_OBJECTS) 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 = 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 = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/d1_absyn.Plo \ ./$(DEPDIR)/d1_attset.Plo ./$(DEPDIR)/d1_doespec.Plo \ ./$(DEPDIR)/d1_espec.Plo ./$(DEPDIR)/d1_expout.Plo \ ./$(DEPDIR)/d1_grs.Plo ./$(DEPDIR)/d1_handle.Plo \ ./$(DEPDIR)/d1_if.Plo ./$(DEPDIR)/d1_map.Plo \ ./$(DEPDIR)/d1_marc.Plo ./$(DEPDIR)/d1_prtree.Plo \ ./$(DEPDIR)/d1_read.Plo ./$(DEPDIR)/d1_soif.Plo \ ./$(DEPDIR)/d1_sumout.Plo ./$(DEPDIR)/d1_sutrs.Plo \ ./$(DEPDIR)/d1_tagset.Plo ./$(DEPDIR)/d1_utils.Plo \ ./$(DEPDIR)/d1_varset.Plo ./$(DEPDIR)/d1_write.Plo am__mv = mv -f 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 = $(libidzebra_data1_la_SOURCES) DIST_SOURCES = $(libidzebra_data1_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ noinst_LTLIBRARIES = libidzebra-data1.la libidzebra_data1_la_SOURCES = d1_handle.c d1_read.c d1_attset.c d1_tagset.c \ d1_absyn.c d1_grs.c d1_sutrs.c d1_varset.c d1_espec.c d1_doespec.c d1_map.c \ d1_marc.c d1_write.c d1_expout.c d1_sumout.c d1_soif.c d1_prtree.c d1_if.c \ d1_utils.c AM_CPPFLAGS = -I$(top_srcdir)/include $(YAZINC) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data1/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libidzebra-data1.la: $(libidzebra_data1_la_OBJECTS) $(libidzebra_data1_la_DEPENDENCIES) $(EXTRA_libidzebra_data1_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libidzebra_data1_la_OBJECTS) $(libidzebra_data1_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_absyn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_attset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_doespec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_espec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_expout.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_grs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_if.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_map.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_marc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_prtree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_read.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_soif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_sumout.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_sutrs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_tagset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_varset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_write.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: 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-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/d1_absyn.Plo -rm -f ./$(DEPDIR)/d1_attset.Plo -rm -f ./$(DEPDIR)/d1_doespec.Plo -rm -f ./$(DEPDIR)/d1_espec.Plo -rm -f ./$(DEPDIR)/d1_expout.Plo -rm -f ./$(DEPDIR)/d1_grs.Plo -rm -f ./$(DEPDIR)/d1_handle.Plo -rm -f ./$(DEPDIR)/d1_if.Plo -rm -f ./$(DEPDIR)/d1_map.Plo -rm -f ./$(DEPDIR)/d1_marc.Plo -rm -f ./$(DEPDIR)/d1_prtree.Plo -rm -f ./$(DEPDIR)/d1_read.Plo -rm -f ./$(DEPDIR)/d1_soif.Plo -rm -f ./$(DEPDIR)/d1_sumout.Plo -rm -f ./$(DEPDIR)/d1_sutrs.Plo -rm -f ./$(DEPDIR)/d1_tagset.Plo -rm -f ./$(DEPDIR)/d1_utils.Plo -rm -f ./$(DEPDIR)/d1_varset.Plo -rm -f ./$(DEPDIR)/d1_write.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: 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 ./$(DEPDIR)/d1_absyn.Plo -rm -f ./$(DEPDIR)/d1_attset.Plo -rm -f ./$(DEPDIR)/d1_doespec.Plo -rm -f ./$(DEPDIR)/d1_espec.Plo -rm -f ./$(DEPDIR)/d1_expout.Plo -rm -f ./$(DEPDIR)/d1_grs.Plo -rm -f ./$(DEPDIR)/d1_handle.Plo -rm -f ./$(DEPDIR)/d1_if.Plo -rm -f ./$(DEPDIR)/d1_map.Plo -rm -f ./$(DEPDIR)/d1_marc.Plo -rm -f ./$(DEPDIR)/d1_prtree.Plo -rm -f ./$(DEPDIR)/d1_read.Plo -rm -f ./$(DEPDIR)/d1_soif.Plo -rm -f ./$(DEPDIR)/d1_sumout.Plo -rm -f ./$(DEPDIR)/d1_sutrs.Plo -rm -f ./$(DEPDIR)/d1_tagset.Plo -rm -f ./$(DEPDIR)/d1_utils.Plo -rm -f ./$(DEPDIR)/d1_varset.Plo -rm -f ./$(DEPDIR)/d1_write.Plo -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ 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 .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.% idzebra-2.2.10/data1/d1_grs.c0000664000175000017500000003012514754717556014207 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* converts data1 tree to GRS-1 record */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #define D1_VARIANTARRAY 20 /* fixed max length on sup'd variant-list. Lazy me */ static Z_GenericRecord *data1_nodetogr_r(data1_handle dh, data1_node *n, int select, ODR o, int *len, data1_tag *wellknown_tag); static Z_ElementMetaData *get_ElementMetaData(ODR o) { Z_ElementMetaData *r = (Z_ElementMetaData *)odr_malloc(o, sizeof(*r)); r->seriesOrder = 0; r->usageRight = 0; r->num_hits = 0; r->hits = 0; r->displayName = 0; r->num_supportedVariants = 0; r->supportedVariants = 0; r->message = 0; r->elementDescriptor = 0; r->surrogateFor = 0; r->surrogateElement = 0; r->other = 0; return r; } /* * N should point to the *last* (leaf) triple in a sequence. Construct a variant * from each of the triples beginning (ending) with 'n', up to the * nearest parent tag. num should equal the number of triples in the * sequence. */ static Z_Variant *make_variant(data1_node *n, int num, ODR o) { Z_Variant *v = (Z_Variant *)odr_malloc(o, sizeof(*v)); data1_node *p; v->globalVariantSetId = 0; v->num_triples = num; v->triples = (Z_Triple **)odr_malloc(o, sizeof(Z_Triple*) * num); /* * cycle back up through the tree of variants * (traversing exactly 'level' variants). */ for (p = n, num--; p && num >= 0; p = p->parent, num--) { Z_Triple *t; assert(p->which == DATA1N_variant); t = v->triples[num] = (Z_Triple *)odr_malloc(o, sizeof(*t)); t->variantSetId = 0; t->zclass = odr_intdup(o, p->u.variant.type->zclass->zclass); t->type = odr_intdup(o, p->u.variant.type->type); switch (p->u.variant.type->datatype) { case DATA1K_string: t->which = Z_Triple_internationalString; t->value.internationalString = odr_strdup(o, p->u.variant.value); break; default: yaz_log(YLOG_WARN, "Unable to handle value for variant %s", p->u.variant.type->name); return 0; } } return v; } /* * Traverse the variant children of n, constructing a supportedVariant list. */ static int traverse_triples(data1_node *n, int level, Z_ElementMetaData *m, ODR o) { data1_node *c; for (c = n->child; c; c = c->next) if (c->which == DATA1N_data && level) { if (!m->supportedVariants) m->supportedVariants = (Z_Variant **)odr_malloc(o, sizeof(Z_Variant*) * D1_VARIANTARRAY); else if (m->num_supportedVariants >= D1_VARIANTARRAY) { yaz_log(YLOG_WARN, "Too many variants (D1_VARIANTARRAY==%d)", D1_VARIANTARRAY); return -1; } if (!(m->supportedVariants[m->num_supportedVariants++] = make_variant(n, level, o))) return -1; } else if (c->which == DATA1N_variant) if (traverse_triples(c, level+1, m, o) < 0) return -1; return 0; } /* * Locate some data under this node. This routine should handle variants * prettily. */ static char *get_data(data1_node *n, int *len) { char *r; data1_node *np = 0; while (n) { if (n->which == DATA1N_data) { int i; *len = n->u.data.len; for (i = 0; i<*len; i++) if (!d1_isspace(n->u.data.data[i])) break; while (*len && d1_isspace(n->u.data.data[*len - 1])) (*len)--; *len = *len - i; if (*len > 0) return n->u.data.data + i; } if (n->which == DATA1N_tag) np = n->child; n = n->next; if (!n) { n = np; np = 0; } } r = ""; *len = strlen(r); return r; } static Z_ElementData *nodetoelementdata(data1_handle dh, data1_node *n, int select, int leaf, ODR o, int *len, data1_tag *wellknown_tag) { Z_ElementData *res = (Z_ElementData *)odr_malloc(o, sizeof(*res)); if (!n) { res->which = Z_ElementData_elementNotThere; res->u.elementNotThere = odr_nullval(); } else if (n->which == DATA1N_data && leaf) { char str[64], *cp; int toget = n->u.data.len; cp = get_data (n, &toget); switch (n->u.data.what) { case DATA1I_num: res->which = Z_ElementData_numeric; res->u.numeric = odr_intdup(o, atoi_n(cp, toget)); *len += 4; break; case DATA1I_text: case DATA1I_xmltext: res->which = Z_ElementData_string; res->u.string = (char *)odr_malloc(o, toget+1); if (toget) memcpy(res->u.string, cp, toget); res->u.string[toget] = '\0'; *len += toget; break; case DATA1I_oid: res->which = Z_ElementData_oid; if (toget > 63) toget = 63; memcpy (str, cp, toget); str[toget] = '\0'; res->u.oid = odr_getoidbystr(o, str); *len += oid_oidlen(res->u.oid) * sizeof(int); break; default: yaz_log(YLOG_WARN, "Can't handle datatype."); return 0; } } else { res->which = Z_ElementData_subtree; if (!(res->u.subtree = data1_nodetogr_r (dh, n->parent, select, o, len, wellknown_tag ))) return 0; } return res; } static int is_empty_data (data1_node *n) { if (n && n->which == DATA1N_data && (n->u.data.what == DATA1I_text || n->u.data.what == DATA1I_xmltext)) { int i = n->u.data.len; while (i > 0 && d1_isspace(n->u.data.data[i-1])) i--; if (i == 0) return 1; } return 0; } static Z_TaggedElement *nodetotaggedelement(data1_handle dh, data1_node *n, int select, ODR o, int *len, data1_tag *wellknown_tag) { Z_TaggedElement *res = (Z_TaggedElement *)odr_malloc(o, sizeof(*res)); data1_tag *tag = 0; data1_node *data; int leaf = 0; if (n->which == DATA1N_tag) { if (n->u.tag.element) tag = n->u.tag.element->tag; data = n->child; /* skip empty data children */ while (is_empty_data(data)) data = data->next; if (!data) data = n->child; else { /* got one. see if this is the only non-empty one */ data1_node *sub = data->next; while (sub && is_empty_data(sub)) sub = sub->next; if (!sub) leaf = 1; /* all empty. 'data' is the only child */ } } /* * If we're a data element at this point, we need to insert a * wellKnown tag to wrap us up. */ else if (n->which == DATA1N_data || n->which == DATA1N_variant) { tag = wellknown_tag; if (!tag) return 0; data = n; leaf = 1; if (is_empty_data(data)) return 0; } else { yaz_log(YLOG_WARN, "Bad data."); return 0; } res->tagType = odr_intdup(o, (tag && tag->tagset) ? tag->tagset->type : 3); res->tagValue = (Z_StringOrNumeric *)odr_malloc(o, sizeof(Z_StringOrNumeric)); if (tag && tag->which == DATA1T_numeric) { res->tagValue->which = Z_StringOrNumeric_numeric; res->tagValue->u.numeric = odr_intdup(o, tag->value.numeric); } else { char *tagstr; if (n->which == DATA1N_tag) tagstr = n->u.tag.tag; /* tag at node */ else if (tag) tagstr = tag->value.string; /* no take from well-known */ else return 0; res->tagValue->which = Z_StringOrNumeric_string; res->tagValue->u.string = odr_strdup(o, tagstr); } res->tagOccurrence = 0; res->appliedVariant = 0; res->metaData = 0; if (n->which == DATA1N_variant || (data && data->which == DATA1N_variant && data->next == NULL)) { int nvars = 0; res->metaData = get_ElementMetaData(o); if (n->which == DATA1N_tag && n->u.tag.make_variantlist) if (traverse_triples(data, 0, res->metaData, o) < 0) return 0; while (data && data->which == DATA1N_variant) { nvars++; data = data->child; } if (n->which != DATA1N_tag || !n->u.tag.no_data_requested) res->appliedVariant = make_variant(data->parent, nvars-1, o); } if (n->which == DATA1N_tag && n->u.tag.no_data_requested) { res->content = (Z_ElementData *)odr_malloc(o, sizeof(*res->content)); res->content->which = Z_ElementData_noDataRequested; res->content->u.noDataRequested = odr_nullval(); } else if (!(res->content = nodetoelementdata (dh, data, select, leaf, o, len, wellknown_tag))) return 0; *len += 10; return res; } static Z_GenericRecord *data1_nodetogr_r(data1_handle dh, data1_node *n, int select, ODR o, int *len, data1_tag *wellknown_tag) { Z_GenericRecord *res = (Z_GenericRecord *)odr_malloc(o, sizeof(*res)); data1_node *c; int num_children = 0; for (c = n->child; c; c = c->next) num_children++; res->elements = (Z_TaggedElement **) odr_malloc(o, sizeof(Z_TaggedElement *) * num_children); res->num_elements = 0; for (c = n->child; c; c = c->next) { if (c->which == DATA1N_tag && select && !c->u.tag.node_selected) continue; if ((res->elements[res->num_elements] = nodetotaggedelement (dh, c, select, o, len, wellknown_tag))) res->num_elements++; } return res; } Z_GenericRecord *data1_nodetogr(data1_handle dh, data1_node *n, int select, ODR o, int *len) { data1_tag *wellknown_tag = 0; if (n->which == DATA1N_root) n = data1_get_root_tag (dh, n); if (n->root->u.root.absyn && !(wellknown_tag = data1_gettagbyname (dh, n->root->u.root.absyn->tagset, "wellKnown"))) { yaz_log(YLOG_WARN, "Unable to locate tag for 'wellKnown'"); wellknown_tag = odr_malloc(o, sizeof(*wellknown_tag)); wellknown_tag->which = DATA1T_numeric; wellknown_tag->value.numeric = 19; wellknown_tag->next = 0; wellknown_tag->tagset = odr_malloc(o, sizeof(*wellknown_tag->tagset)); wellknown_tag->tagset->type = 1; wellknown_tag->kind = DATA1K_string; } return data1_nodetogr_r(dh, n, select, o, len, wellknown_tag); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_utils.c0000664000175000017500000000457014754717556014561 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include void data1_remove_node(data1_handle dh, data1_node *n) { /* n is first childen */ if (n->parent->child == n) { n->parent->child = n->next; /* n is the only child */ if(! n->next){ n->parent->last_child = 0; } } /* n is one of the following childrens */ else { data1_node * before; /* need to find sibling before me */ before = n->parent->child; while (before->next != n) before = before->next; before->next = n->next; /* n is last child of many */ if ( n->parent->last_child == n) n->parent->last_child = before; } /* break pointers to root, parent and following siblings */ n->parent = 0; n->root = 0; n->next = 0; } void data1_remove_idzebra_subtree(data1_handle dh, data1_node *n) { if (n->which == DATA1N_tag && !strcmp(n->u.tag.tag, "idzebra") && n->u.tag.attributes) { data1_xattr *xattr = n->u.tag.attributes; for (; xattr; xattr = xattr->next) { if (!strcmp(xattr->name, "xmlns") && !strcmp(xattr->value, "http://www.indexdata.dk/zebra/")) data1_remove_node(dh, n); } } if (n->child) data1_remove_idzebra_subtree(dh, n->child); if (n->next) data1_remove_idzebra_subtree(dh, n->next); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/Makefile.am0000664000175000017500000000052314754717556014717 0ustar00adamadam noinst_LTLIBRARIES=libidzebra-data1.la libidzebra_data1_la_SOURCES = d1_handle.c d1_read.c d1_attset.c d1_tagset.c \ d1_absyn.c d1_grs.c d1_sutrs.c d1_varset.c d1_espec.c d1_doespec.c d1_map.c \ d1_marc.c d1_write.c d1_expout.c d1_sumout.c d1_soif.c d1_prtree.c d1_if.c \ d1_utils.c AM_CPPFLAGS=-I$(top_srcdir)/include $(YAZINC) idzebra-2.2.10/data1/d1_if.c0000664000175000017500000002114014754717556014007 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include /* * Search for a token in the supplied string up to the supplied list of stop characters or EOL * At the end, return the character causing the break and fill pTokenBuffer with the token string so far * After the scan, *pPosInBuffer will point to the next character after the one causing the break and * pTokenBuffer will contain the actual token */ char data1_ScanNextToken(char* pBuffer, char** pPosInBuffer, char* pBreakChars, char* pWhitespaceChars, char* pTokenBuffer) { char* pBuff = pTokenBuffer; *pBuff = '\0'; while ( **pPosInBuffer ) { if ( strchr(pBreakChars,**pPosInBuffer) != NULL ) { /* Current character is a break character */ *pBuff++ = '\0'; return *((*pPosInBuffer)++); } else { if ( strchr(pWhitespaceChars, **pPosInBuffer) != NULL ) (*pPosInBuffer)++; else *pBuff++ = *((*pPosInBuffer)++); } } *pBuff++ = *((*pPosInBuffer)++); return(**pPosInBuffer); } /* * Attempt to find a string value given the specified tagpath * * Need to make this safe by passing in a buffer..... * */ char *data1_getNodeValue(data1_node* node, char* pTagPath) { data1_node* n = NULL; n = data1_LookupNode(node, pTagPath ); if ( n ) { /* n should be a tag node with some data under it.... */ if ( n->child ) { if ( n->child->which == DATA1N_data ) { return n->child->u.data.data; } else { yaz_log(YLOG_WARN,"Attempting to lookup data for tagpath: Child node is not a data node"); } } else { yaz_log(YLOG_WARN,"Found a node matching the tagpath, but it has no child data nodes"); } } else { yaz_log(YLOG_WARN,"Unable to lookup a node on the specified tag path"); } return ""; } /* Max length of a tag */ #define MAX_TAG_SIZE 50 /* * data1_LookupNode : Try and find a node as specified by a tagpath */ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) { /* Node matching the pattern in the tagpath */ data1_node* matched_node = NULL; /* Current Child node as we search for nodes matching the pattern in the tagpath */ data1_node* current_child = node->child; /* Current position in string */ char* pCurrCharInPath = pTagPath; /* Work buffer */ char Buffer[MAX_TAG_SIZE]; /* The tag type of this node */ int iTagType = 0; /* for non string tags, the tag value */ int iTagValue = 0; /* for string tags, the tag value */ char StringTagVal[MAX_TAG_SIZE]; /* Which occurence of that tag under this node */ int iOccurences=0; /* Character causing a break */ char sepchr = '\0'; Buffer[0] = '\0'; StringTagVal[0] = '\0'; sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, ",[(."," ", Buffer); if ( sepchr == '[' ) { /* Next component in node value is [ TagType, TagVal, TagOccurence ] */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, ","," ", Buffer); iTagType = atoi(Buffer); /* Occurence is optional... */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, ",]."," ", Buffer); if ( iTagType == 3 ) strcpy(StringTagVal,Buffer); else iTagValue = atoi(Buffer); /* If sepchar was a ',' there should be an instance */ if ( sepchr == ',' ) { sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, "]."," ", Buffer); iOccurences = atoi(Buffer); } if ( sepchr == ']' ) { /* See if we can scan the . for the next component or the end of the line... */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, "."," ", Buffer); } else { yaz_log(YLOG_FATAL,"Node does not end with a ]"); /* Fatal Error */ return(NULL); } } else { /* We have a TagName so Read up to ( or . or EOL */ iTagType = 3; strcpy(StringTagVal,Buffer); if ( sepchr == '(' ) { /* Read the occurence */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, ")"," ", Buffer); iOccurences = atoi(Buffer); /* See if we can find the . at the end of this clause */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, "."," ", Buffer); } } yaz_log(YLOG_DEBUG,"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences); /* OK.. We have extracted tagtype, Value and Occurence, see if we can find a node */ /* Under the current parent matching that description */ while ( ( current_child ) && ( matched_node == NULL ) ) { if ( current_child->which == DATA1N_tag ) { if ( iTagType == 3 ) { if ( ( current_child->u.tag.element == NULL ) && ( strcmp(current_child->u.tag.tag, StringTagVal) == 0 ) ) { if ( iOccurences ) { /* Everything matched, but not yet found the right occurence of the given tag */ iOccurences--; } else { /* We have matched a string tag... Is there more to process? */ matched_node = current_child; } } } else /* Attempt to match real element */ { yaz_log(YLOG_WARN,"Non string tag matching not yet implemented"); } } current_child = current_child->next; } /* If there is more... Continue */ if ( ( sepchr == '.' ) && ( matched_node ) ) { return data1_LookupNode(matched_node, pCurrCharInPath); } else { return matched_node; } } /** \brief Count the number of occurences of the last instance on a tagpath. \param node : The root of the tree we wish to look for occurences in \param pTagPath : The tagpath we want to count the occurences of... */ int data1_CountOccurences(data1_node* node, char* pTagPath) { int iRetVal = 0; data1_node* n = NULL; data1_node* pParent = NULL; n = data1_LookupNode(node, pTagPath ); if ( ( n ) && ( n->which == DATA1N_tag ) && ( n->parent ) ) { data1_node* current_child; pParent = n->parent; for ( current_child = pParent->child; current_child; current_child = current_child->next ) { if ( current_child->which == DATA1N_tag ) { if ( current_child->u.tag.element == NULL ) { if ( ( n->u.tag.tag ) && ( current_child->u.tag.tag ) && ( strcmp(current_child->u.tag.tag, n->u.tag.tag) == 0 ) ) { iRetVal++; } } else if ( current_child->u.tag.element == n->u.tag.element ) { /* Hmmm... Is the above right for non string tags???? */ iRetVal++; } } } } return iRetVal; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_read.c0000664000175000017500000010353114754717556014331 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This module reads "loose" SGML and converts it to data1 tree */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include data1_node *data1_get_root_tag(data1_handle dh, data1_node *n) { if (!n) return 0; if (data1_is_xmlmode(dh)) { n = n->child; while (n && n->which != DATA1N_tag) n = n->next; } return n; } /* * get the tag which is the immediate parent of this node (this may mean * traversing intermediate things like variants and stuff. */ data1_node *get_parent_tag(data1_handle dh, data1_node *n) { if (data1_is_xmlmode(dh)) { for (; n && n->which != DATA1N_root; n = n->parent) if (n->which == DATA1N_tag && n->parent && n->parent->which != DATA1N_root) return n; } else { for (; n && n->which != DATA1N_root; n = n->parent) if (n->which == DATA1N_tag) return n; } return 0; } data1_node *data1_mk_node(data1_handle dh, NMEM m) { return data1_mk_node2(dh, m, DATA1N_root, 0); } data1_node *data1_mk_node_type(data1_handle dh, NMEM m, int type) { return data1_mk_node2(dh, m, type, 0); } static void data1_init_node(data1_handle dh, data1_node *r, int type) { r->which = type; switch(type) { case DATA1N_tag: r->u.tag.tag = 0; r->u.tag.element = 0; r->u.tag.no_data_requested = 0; r->u.tag.node_selected = 0; r->u.tag.make_variantlist = 0; r->u.tag.get_bytes = -1; r->u.tag.attributes = 0; break; case DATA1N_root: r->u.root.type = 0; r->u.root.absyn = 0; break; case DATA1N_data: r->u.data.data = 0; r->u.data.len = 0; r->u.data.what = 0; r->u.data.formatted_text = 0; break; case DATA1N_comment: r->u.data.data = 0; r->u.data.len = 0; r->u.data.what = 0; r->u.data.formatted_text = 1; break; case DATA1N_variant: r->u.variant.type = 0; r->u.variant.value = 0; break; case DATA1N_preprocess: r->u.preprocess.target = 0; r->u.preprocess.attributes = 0; break; default: yaz_log(YLOG_WARN, "data_mk_node_type. bad type = %d\n", type); } } data1_node *data1_append_node(data1_handle dh, NMEM m, int type, data1_node *parent) { data1_node *r = (data1_node *)nmem_malloc(m, sizeof(*r)); r->next = r->child = r->last_child = 0; r->parent = parent; if (!parent) r->root = r; else { r->root = parent->root; if (!parent->child) parent->child = parent->last_child = r; else parent->last_child->next = r; parent->last_child = r; } data1_init_node(dh, r, type); return r; } data1_node *data1_mk_node2(data1_handle dh, NMEM m, int type, data1_node *parent) { return data1_append_node(dh, m, type, parent); } data1_node *data1_insert_node(data1_handle dh, NMEM m, int type, data1_node *parent) { data1_node *r = (data1_node *)nmem_malloc(m, sizeof(*r)); r->next = r->child = r->last_child = 0; if (!parent) r->root = r; else { r->root = parent->root; r->parent = parent; if (!parent->child) parent->last_child = r; else r->next = parent->child; parent->child = r; } data1_init_node(dh, r, type); return r; } data1_node *data1_mk_root(data1_handle dh, NMEM nmem, const char *name) { data1_absyn *absyn = data1_get_absyn(dh, name, 1); data1_node *res; if (!absyn) { yaz_log(YLOG_WARN, "Unable to acquire abstract syntax " "for '%s'", name); /* It's now OK for a record not to have an absyn */ } res = data1_mk_node2(dh, nmem, DATA1N_root, 0); res->u.root.type = data1_insert_string(dh, res, nmem, name); res->u.root.absyn = absyn; return res; } void data1_set_root(data1_handle dh, data1_node *res, NMEM nmem, const char *name) { data1_absyn *absyn = data1_get_absyn( dh, name, DATA1_XPATH_INDEXING_ENABLE); res->u.root.type = data1_insert_string(dh, res, nmem, name); res->u.root.absyn = absyn; } void data1_add_attrs(data1_handle dh, NMEM nmem, const char **attr, data1_xattr **p) { while (*p) p = &(*p)->next; while (attr && *attr) { *p = (data1_xattr*) nmem_malloc(nmem, sizeof(**p)); (*p)->name = nmem_strdup(nmem, *attr++); (*p)->value = nmem_strdup(nmem, *attr++); (*p)->what = DATA1I_text; p = &(*p)->next; } *p = 0; } data1_node *data1_mk_preprocess(data1_handle dh, NMEM nmem, const char *target, const char **attr, data1_node *at) { return data1_mk_preprocess_n(dh, nmem, target, strlen(target), attr, at); } data1_node *data1_mk_preprocess_n(data1_handle dh, NMEM nmem, const char *target, size_t len, const char **attr, data1_node *at) { data1_node *res = data1_mk_node2(dh, nmem, DATA1N_preprocess, at); res->u.preprocess.target = data1_insert_string_n(dh, res, nmem, target, len); data1_add_attrs(dh, nmem, attr, &res->u.preprocess.attributes); return res; } data1_node *data1_insert_preprocess(data1_handle dh, NMEM nmem, const char *target, const char **attr, data1_node *at) { return data1_insert_preprocess_n(dh, nmem, target, strlen(target), attr, at); } data1_node *data1_insert_preprocess_n(data1_handle dh, NMEM nmem, const char *target, size_t len, const char **attr, data1_node *at) { data1_node *res = data1_insert_node(dh, nmem, DATA1N_preprocess, at); res->u.preprocess.target = data1_insert_string_n(dh, res, nmem, target, len); data1_add_attrs(dh, nmem, attr, &res->u.preprocess.attributes); return res; } data1_node *data1_mk_tag_n(data1_handle dh, NMEM nmem, const char *tag, size_t len, const char **attr, data1_node *at) { data1_node *partag = get_parent_tag(dh, at); data1_node *res = data1_mk_node2(dh, nmem, DATA1N_tag, at); data1_element *e = 0; res->u.tag.tag = data1_insert_string_n(dh, res, nmem, tag, len); if (!partag) /* top tag? */ e = data1_getelementbytagname(dh, at->root->u.root.absyn, 0 /* index as local */, res->u.tag.tag); else { /* only set element for known tags */ e = partag->u.tag.element; if (e) e = data1_getelementbytagname(dh, at->root->u.root.absyn, e, res->u.tag.tag); } res->u.tag.element = e; data1_add_attrs(dh, nmem, attr, &res->u.tag.attributes); return res; } void data1_tag_add_attr(data1_handle dh, NMEM nmem, data1_node *res, const char **attr) { if (res->which != DATA1N_tag) return; data1_add_attrs(dh, nmem, attr, &res->u.tag.attributes); } data1_node *data1_mk_tag(data1_handle dh, NMEM nmem, const char *tag, const char **attr, data1_node *at) { return data1_mk_tag_n(dh, nmem, tag, strlen(tag), attr, at); } data1_node *data1_search_tag(data1_handle dh, data1_node *n, const char *tag) { if (*tag == '/') { n = data1_get_root_tag(dh, n); if (n) n = n->child; tag++; } for (; n; n = n->next) if (n->which == DATA1N_tag && n->u.tag.tag && !yaz_matchstr(n->u.tag.tag, tag)) { return n; } return 0; } data1_node *data1_mk_tag_uni(data1_handle dh, NMEM nmem, const char *tag, data1_node *at) { data1_node *node = data1_search_tag(dh, at->child, tag); if (!node) node = data1_mk_tag(dh, nmem, tag, 0 /* attr */, at); else node->child = node->last_child = 0; return node; } data1_node *data1_mk_text_n(data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent) { data1_node *res = data1_mk_node2(dh, mem, DATA1N_data, parent); data1_set_data_string_n(dh, res, mem, buf, len); return res; } data1_node *data1_mk_text_nf(data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent) { data1_node *res = data1_mk_text_n(dh, mem, buf, len, parent); res->u.data.formatted_text = 1; return res; } data1_node *data1_mk_text(data1_handle dh, NMEM mem, const char *buf, data1_node *parent) { return data1_mk_text_n(dh, mem, buf, strlen(buf), parent); } data1_node *data1_mk_comment_n(data1_handle dh, NMEM mem, const char *buf, size_t len, data1_node *parent) { data1_node *res = data1_mk_node2(dh, mem, DATA1N_comment, parent); data1_set_data_string_n(dh, res, mem, buf, len); return res; } data1_node *data1_mk_comment(data1_handle dh, NMEM mem, const char *buf, data1_node *parent) { return data1_mk_comment_n(dh, mem, buf, strlen(buf), parent); } void data1_set_data_string_n(data1_handle dh, data1_node *res, NMEM m, const char *str, size_t len) { res->u.data.what = DATA1I_text; res->u.data.data = data1_insert_string_n(dh, res, m, str, len); res->u.data.len = len; } void data1_set_data_string(data1_handle dh, data1_node *res, NMEM m, const char *str) { data1_set_data_string_n(dh, res, m, str, strlen(str)); } char *data1_insert_string_n(data1_handle dh, data1_node *res, NMEM m, const char *str, size_t len) { char *b; if (len >= DATA1_LOCALDATA) b = (char *) nmem_malloc(m, len+1); else b = res->lbuf; memcpy(b, str, len); b[len] = 0; return b; } char *data1_insert_zint(data1_handle dh, data1_node *res, NMEM m, zint num) { char str[64]; yaz_snprintf(str, sizeof(str), ZINT_FORMAT, num); return data1_insert_string(dh, res, m, str); } void data1_set_data_zint(data1_handle dh, data1_node *res, NMEM m, zint num) { res->u.data.what = DATA1I_num; res->u.data.data = data1_insert_zint(dh, res, m, num); res->u.data.len = strlen(res->u.data.data); } char *data1_insert_string(data1_handle dh, data1_node *res, NMEM m, const char *str) { return data1_insert_string_n(dh, res, m, str, strlen(str)); } static data1_node *data1_add_insert_taggeddata(data1_handle dh, data1_node *at, const char *tagname, NMEM m, int local_allowed, int insert_mode) { data1_node *root = at->root; data1_node *partag = get_parent_tag(dh, at); data1_element *e = NULL; data1_node *datn = 0; data1_node *tagn = 0; if (!partag) e = data1_getelementbytagname(dh, root->u.root.absyn, 0, tagname); else { e = partag->u.tag.element; if (e) e = data1_getelementbytagname(dh, root->u.root.absyn, e, tagname); } if (local_allowed || e) { if (insert_mode) tagn = data1_insert_node(dh, m, DATA1N_tag, at); else tagn = data1_append_node(dh, m, DATA1N_tag, at); tagn->u.tag.tag = data1_insert_string(dh, tagn, m, tagname); tagn->u.tag.element = e; datn = data1_mk_node2(dh, m, DATA1N_data, tagn); } return datn; } data1_node *data1_mk_tag_data(data1_handle dh, data1_node *at, const char *tagname, NMEM m) { return data1_add_insert_taggeddata(dh, at, tagname, m, 1, 0); } /* * Insert a tagged node into the record root as first child of the node at * which should be root or tag itself). Returns pointer to the data node, * which can then be modified. */ data1_node *data1_mk_tag_data_wd(data1_handle dh, data1_node *at, const char *tagname, NMEM m) { return data1_add_insert_taggeddata(dh, at, tagname, m, 0, 1); } data1_node *data1_insert_taggeddata(data1_handle dh, data1_node *root, data1_node *at, const char *tagname, NMEM m) { return data1_add_insert_taggeddata(dh, at, tagname, m, 0, 1); } data1_node *data1_add_taggeddata(data1_handle dh, data1_node *root, data1_node *at, const char *tagname, NMEM m) { return data1_add_insert_taggeddata(dh, at, tagname, m, 1, 0); } data1_node *data1_mk_tag_data_zint(data1_handle dh, data1_node *at, const char *tag, zint num, NMEM nmem) { data1_node *node_data; node_data = data1_mk_tag_data(dh, at, tag, nmem); if (!node_data) return 0; data1_set_data_zint(dh, node_data, nmem, num); return node_data; } data1_node *data1_mk_tag_data_int(data1_handle dh, data1_node *at, const char *tag, int num, NMEM nmem) { return data1_mk_tag_data_zint(dh, at, tag, num, nmem); } data1_node *data1_mk_tag_data_oid(data1_handle dh, data1_node *at, const char *tag, Odr_oid *oid, NMEM nmem) { data1_node *node_data; char str[128], *p = str; size_t i; node_data = data1_mk_tag_data(dh, at, tag, nmem); if (!node_data) return 0; for (i = 0; i < 14 && oid[i] >= 0; i++) { if (i > 0) *p++ = '.'; yaz_snprintf(p, 7, "%d", oid[i]); p += strlen(p); } data1_set_data_string(dh, node_data, nmem, str); node_data->u.data.what = DATA1I_oid; return node_data; } data1_node *data1_mk_tag_data_text(data1_handle dh, data1_node *at, const char *tag, const char *str, NMEM nmem) { data1_node *node_data = data1_mk_tag_data(dh, at, tag, nmem); if (!node_data) return 0; data1_set_data_string(dh, node_data, nmem, str); return node_data; } data1_node *data1_mk_tag_data_text_uni(data1_handle dh, data1_node *at, const char *tag, const char *str, NMEM nmem) { data1_node *node = data1_search_tag(dh, at->child, tag); if (!node) return data1_mk_tag_data_text(dh, at, tag, str, nmem); node = node->child; data1_set_data_string(dh, node, nmem, str); node->child = node->last_child = 0; return node; } static int ampr(int (*get_byte)(void *fh), void *fh, int *amp) { int c = (*get_byte)(fh); *amp = 0; return c; } data1_xattr *data1_read_xattr(data1_handle dh, NMEM m, int (*get_byte)(void *fh), void *fh, WRBUF wrbuf, int *ch, int *amp) { data1_xattr *p_first = 0; data1_xattr **pp = &p_first; int c = *ch; for (;;) { data1_xattr *p; while (*amp || (c && d1_isspace(c))) c = ampr(get_byte, fh, amp); if (*amp == 0 && (c == 0 || c == '>' || c == '/')) break; *pp = p = (data1_xattr *) nmem_malloc(m, sizeof(*p)); p->next = 0; pp = &p->next; p->value = 0; p->what = DATA1I_xmltext; wrbuf_rewind(wrbuf); while (c && c != '=' && c != '>' && c != '/' && !d1_isspace(c)) { wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, amp); } p->name = nmem_strdup(m, wrbuf_cstr(wrbuf)); if (c == '=') { c = ampr(get_byte, fh, amp); if (*amp == 0 && c == '"') { c = ampr(get_byte, fh, amp); wrbuf_rewind(wrbuf); while (*amp || (c && c != '"')) { wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, amp); } if (c) c = ampr(get_byte, fh, amp); } else if (*amp == 0 && c == '\'') { c = ampr(get_byte, fh, amp); wrbuf_rewind(wrbuf); while (*amp || (c && c != '\'')) { wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, amp); } if (c) c = ampr(get_byte, fh, amp); } else { wrbuf_rewind(wrbuf); while (*amp || (c && c != '>' && c != '/')) { wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, amp); } } p->value = nmem_strdup(m, wrbuf_cstr(wrbuf)); } } *ch = c; return p_first; } /* * Ugh. Sometimes functions just grow and grow on you. This one reads a * 'node' and its children. */ data1_node *data1_read_nodex(data1_handle dh, NMEM m, int (*get_byte)(void *fh), void *fh, WRBUF wrbuf) { data1_node *d1_stack[256]; data1_node *res; int c, amp; int level = 0; int line = 1; d1_stack[level] = 0; c = ampr(get_byte, fh, &); while (c != '\0') { data1_node *parent = level ? d1_stack[level-1] : 0; if (amp == 0 && c == '<') /* beginning of tag */ { data1_xattr *xattr; char tag[256]; int null_tag = 0; int end_tag = 0; size_t i = 0; c = ampr(get_byte, fh, &); if (amp == 0 && c == '/') { end_tag = 1; c = ampr(get_byte, fh, &); } else if (amp == 0 && c == '?') { int quote_mode = 0; while ((c = ampr(get_byte, fh, &))) { if (amp) continue; if (quote_mode == 0) { if (c == '"') quote_mode = c; else if (c == '\'') quote_mode = c; else if (c == '>') { c = ampr(get_byte, fh, &); break; } } else { if (amp == 0 && c == quote_mode) quote_mode = 0; } } continue; } else if (amp == 0 && c == '!') { int c0, amp0; wrbuf_rewind(wrbuf); c0 = ampr(get_byte, fh, &0); if (amp0 == 0 && c0 == '\0') break; c = ampr(get_byte, fh, &); if (amp0 == 0 && c0 == '-' && amp == 0 && c == '-') { /* COMMENT: */ int no_dash = 0; c = ampr(get_byte, fh, &); while (amp || c) { if (amp == 0 && c == '-') no_dash++; else if (amp == 0 && c == '>' && no_dash >= 2) { if (level > 0) d1_stack[level] = data1_mk_comment_n( dh, m, wrbuf_buf(wrbuf), wrbuf_len(wrbuf)-2, d1_stack[level-1]); c = ampr(get_byte, fh, &); /* skip > */ break; } else no_dash = 0; wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, &); } continue; } else { /* DIRECTIVE: */ int blevel = 0; while (amp || c) { if (amp == 0 && c == '>' && blevel == 0) { c = ampr(get_byte, fh, &); break; } if (amp == 0 && c == '[') blevel++; if (amp == 0 && c == ']' && blevel > 0) blevel--; c = ampr(get_byte, fh, &); } continue; } } while (amp || (c && c != '>' && c != '/' && !d1_isspace(c))) { if (i < (sizeof(tag)-1)) tag[i++] = c; c = ampr(get_byte, fh, &); } tag[i] = '\0'; xattr = data1_read_xattr(dh, m, get_byte, fh, wrbuf, &c, &); if (amp == 0 && c == '/') { /* or */ null_tag = 1; c = ampr(get_byte, fh, &); } if (amp || c != '>') { yaz_log(YLOG_WARN, "d1: %d: Malformed tag", line); return 0; } else c = ampr(get_byte, fh, &); /* End tag? */ if (end_tag) { if (*tag == '\0') --level; /* */ else { /* */ int i = level; while (i > 0) { parent = d1_stack[--i]; if ((parent->which == DATA1N_root && !strcmp(tag, parent->u.root.type)) || (parent->which == DATA1N_tag && !strcmp(tag, parent->u.tag.tag))) { level = i; break; } } if (i != level) { yaz_log(YLOG_WARN, "%d: no begin tag for %s", line, tag); break; } } if (data1_is_xmlmode(dh)) { if (level <= 1) return d1_stack[0]; } else { if (level <= 0) return d1_stack[0]; } continue; } else if (!strcmp(tag, "var") && xattr && xattr->next && xattr->next->next && xattr->value == 0 && xattr->next->value == 0 && xattr->next->next->value == 0) { /* */ const char *tclass = xattr->name; const char *type = xattr->next->name; const char *value = xattr->next->name; data1_vartype *tp; yaz_log(YLOG_LOG, "Variant class=%s type=%s value=%s", tclass, type, value); if (!(tp = data1_getvartypebyct(dh, parent->root->u.root.absyn->varset, tclass, type))) continue; /* * If we're the first variant in this group, create a parent * variant, and insert it before the current variant. */ if (parent->which != DATA1N_variant) { res = data1_mk_node2(dh, m, DATA1N_variant, parent); } else { /* * now determine if one of our ancestor triples is of * same type. If so, we break here. */ int i; for (i = level-1; d1_stack[i]->which==DATA1N_variant; --i) if (d1_stack[i]->u.variant.type == tp) { level = i; break; } res = data1_mk_node2(dh, m, DATA1N_variant, parent); res->u.variant.type = tp; res->u.variant.value = data1_insert_string(dh, res, m, value); } } else { /* tag .. acquire our element in the abstract syntax */ if (level == 0) { parent = data1_mk_root(dh, m, tag); res = d1_stack[level] = parent; if (data1_is_xmlmode(dh)) { level++; res = data1_mk_tag(dh, m, tag, 0 /* attr */, parent); res->u.tag.attributes = xattr; } } else { res = data1_mk_tag(dh, m, tag, 0 /* attr */, parent); res->u.tag.attributes = xattr; } } d1_stack[level] = res; d1_stack[level+1] = 0; if (level < 250 && !null_tag) ++level; } else /* != '<'... this is a body of text */ { int len; if (level == 0) { c = ampr(get_byte, fh, &); continue; } res = data1_mk_node2(dh, m, DATA1N_data, parent); res->u.data.what = DATA1I_xmltext; res->u.data.formatted_text = 0; d1_stack[level] = res; wrbuf_rewind(wrbuf); while (amp || (c && c != '<')) { wrbuf_putc(wrbuf, c); c = ampr(get_byte, fh, &); } len = wrbuf_len(wrbuf); /* use local buffer of nmem if too large */ if (len >= DATA1_LOCALDATA) res->u.data.data = (char*) nmem_malloc(m, len); else res->u.data.data = res->lbuf; if (len) memcpy(res->u.data.data, wrbuf_buf(wrbuf), len); else res->u.data.data = 0; res->u.data.len = len; } } return 0; } int getc_mem(void *fh) { const char **p = (const char **) fh; if (**p) return *(*p)++; return 0; } data1_node *data1_read_node(data1_handle dh, const char **buf, NMEM m) { WRBUF wrbuf = wrbuf_alloc(); data1_node *node; node = data1_read_nodex(dh, m, getc_mem, (void *) (buf), wrbuf); wrbuf_destroy(wrbuf); return node; } /* * Read a record in the native syntax. */ data1_node *data1_read_record(data1_handle dh, int (*rf)(void *, char *, size_t), void *fh, NMEM m) { int *size; char **buf = data1_get_read_buf(dh, &size); const char *bp; int rd = 0, res; if (!*buf) *buf = (char *)xmalloc(*size = 4096); for (;;) { if (rd + 2048 >= *size && !(*buf =(char *)xrealloc(*buf, *size *= 2))) abort(); if ((res = (*rf)(fh, *buf + rd, 2048)) <= 0) { if (!res) { bp = *buf; (*buf)[rd] = '\0'; return data1_read_node(dh, &bp, m); } else return 0; } rd += res; } } data1_node *data1_read_sgml(data1_handle dh, NMEM m, const char *buf) { const char *bp = buf; return data1_read_node(dh, &bp, m); } static int conv_item(NMEM m, yaz_iconv_t t, WRBUF wrbuf, char *inbuf, size_t inlen) { wrbuf_rewind(wrbuf); wrbuf_iconv_write(wrbuf, t, inbuf, inlen); wrbuf_iconv_reset(wrbuf, t); return 0; } static void data1_iconv_s(data1_handle dh, NMEM m, data1_node *n, yaz_iconv_t t, WRBUF wrbuf, const char *tocode) { for (; n; n = n->next) { switch (n->which) { case DATA1N_data: case DATA1N_comment: if (conv_item(m, t, wrbuf, n->u.data.data, n->u.data.len) == 0) { n->u.data.data = data1_insert_string_n(dh, n, m, wrbuf->buf, wrbuf->pos); n->u.data.len = wrbuf->pos; } break; case DATA1N_tag: if (conv_item(m, t, wrbuf, n->u.tag.tag, strlen(n->u.tag.tag)) == 0) { n->u.tag.tag = data1_insert_string_n(dh, n, m, wrbuf->buf, wrbuf->pos); } if (n->u.tag.attributes) { data1_xattr *p; for (p = n->u.tag.attributes; p; p = p->next) { if (p->value && conv_item(m, t, wrbuf, p->value, strlen(p->value)) == 0) { p->value = nmem_strdup(m, wrbuf_cstr(wrbuf)); } } } break; case DATA1N_preprocess: if (strcmp(n->u.preprocess.target, "xml") == 0) { data1_xattr *p = n->u.preprocess.attributes; for (; p; p = p->next) if (strcmp(p->name, "encoding") == 0) p->value = nmem_strdup(m, tocode); } break; } data1_iconv_s(dh, m, n->child, t, wrbuf, tocode); } } const char *data1_get_encoding(data1_handle dh, data1_node *n) { /* see if we have an xml header that specifies encoding */ if (n && n->child && n->child->which == DATA1N_preprocess && strcmp(n->child->u.preprocess.target, "xml") == 0) { data1_xattr *xp = n->child->u.preprocess.attributes; for (; xp; xp = xp->next) if (strcmp(xp->name, "encoding") == 0) return xp->value; } /* no encoding in header, so see if "encoding" was specified for abs */ if (n && n->which == DATA1N_root && n->u.root.absyn && n->u.root.absyn->encoding) return n->u.root.absyn->encoding; /* none of above, return a hard coded default */ return "ISO-8859-1"; } int data1_iconv(data1_handle dh, NMEM m, data1_node *n, const char *tocode, const char *fromcode) { if (yaz_matchstr(tocode, fromcode)) { WRBUF wrbuf = wrbuf_alloc(); yaz_iconv_t t = yaz_iconv_open(tocode, fromcode); if (!t) { wrbuf_destroy(wrbuf); return -1; } data1_iconv_s(dh, m, n, t, wrbuf, tocode); yaz_iconv_close(t); wrbuf_destroy(wrbuf); } return 0; } void data1_chop_text(data1_handle dh, NMEM m, data1_node *n) { for (; n; n = n->next) { if (n->which == DATA1N_data) { int sz = n->u.data.len; const char *ndata = n->u.data.data; int off = 0; for (off = 0; off < sz; off++) if (!d1_isspace(ndata[off])) break; sz = sz - off; ndata += off; while (sz && d1_isspace(ndata[sz - 1])) sz--; n->u.data.data = nmem_malloc(m, sz); n->u.data.len = sz; memcpy(n->u.data.data, ndata, sz); } data1_chop_text(dh, m, n->child); } } void data1_concat_text(data1_handle dh, NMEM m, data1_node *n) { for (; n; n = n->next) { if (n->which == DATA1N_data && n->next && n->next->which == DATA1N_data) { int sz = 0; int off = 0; char *ndata; data1_node *np; for (np = n; np && np->which == DATA1N_data; np=np->next) sz += np->u.data.len; ndata = nmem_malloc(m, sz); for (np = n; np && np->which == DATA1N_data; np=np->next) { memcpy(ndata+off, np->u.data.data, np->u.data.len); off += np->u.data.len; } n->u.data.data = ndata; n->u.data.len = sz; n->next = np; if (!np && n->parent) n->parent->last_child = n; } data1_concat_text(dh, m, n->child); } } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_handle.c0000664000175000017500000000753214754717556014655 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #define DATA1_FLAG_XML 1 struct data1_handle_info { WRBUF wrbuf; char *tab_path; char *tab_root; char *read_buf; int read_len; data1_absyn_cache absyn_cache; data1_attset_cache attset_cache; char *map_buf; int map_len; NMEM mem; }; data1_handle data1_create(void) { data1_handle p = (data1_handle)xmalloc(sizeof(*p)); if (!p) return 0; p->tab_path = NULL; p->tab_root = NULL; p->wrbuf = wrbuf_alloc(); p->read_buf = NULL; p->read_len = 0; p->map_buf = NULL; p->map_len = 0; p->absyn_cache = NULL; p->attset_cache = NULL; p->mem = nmem_create(); return p; } NMEM data1_nmem_get(data1_handle dh) { return dh->mem; } data1_absyn_cache *data1_absyn_cache_get(data1_handle dh) { return &dh->absyn_cache; } data1_attset_cache *data1_attset_cache_get(data1_handle dh) { return &dh->attset_cache; } void data1_destroy(data1_handle dh) { if (!dh) return; /* *ostrich* We need to destroy DFAs, in xp_element (xelm) definitions pop, 2002-12-13 */ data1_absyn_destroy(dh); wrbuf_destroy(dh->wrbuf); xfree(dh->tab_path); xfree(dh->tab_root); xfree(dh->read_buf); xfree(dh->map_buf); nmem_destroy(dh->mem); xfree(dh); } WRBUF data1_get_wrbuf(data1_handle dp) { return dp->wrbuf; } char **data1_get_read_buf(data1_handle dp, int **lenp) { *lenp = &dp->read_len; yaz_log(YLOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp); return &dp->read_buf; } char **data1_get_map_buf(data1_handle dp, int **lenp) { *lenp = &dp->map_len; yaz_log(YLOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp); return &dp->map_buf; } void data1_set_tabpath(data1_handle dp, const char *p) { xfree(dp->tab_path); dp->tab_path = NULL; if (p) dp->tab_path = xstrdup (p); } void data1_set_tabroot(data1_handle dp, const char *p) { xfree(dp->tab_root); dp->tab_root = NULL; if (p) dp->tab_root = xstrdup(p); } const char *data1_get_tabpath(data1_handle dp) { return dp->tab_path; } const char *data1_get_tabroot(data1_handle dp) { return dp->tab_root; } FILE *data1_path_fopen(data1_handle dh, const char *file, const char *mode) { FILE *f; const char *path = data1_get_tabpath(dh); const char *root = data1_get_tabroot(dh); yaz_log(YLOG_DEBUG, "data1_path_fopen path=%s root=%s " "file=%s mode=%s", path ? path : "NULL", root ? root : "NULL", file, mode); if (!path || !*path) return 0; f = yaz_fopen(path, file, mode, root); if (!f) { yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't open %s", file); if (root) yaz_log(YLOG_LOG, "for root=%s", root); if (path) yaz_log(YLOG_LOG, "for profilePath=%s", path); } return f; } int data1_is_xmlmode(data1_handle dh) { return 1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_sutrs.c0000664000175000017500000001127014754717556014574 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* converts data1 tree to SUTRS record */ #if HAVE_CONFIG_H #include #endif #include #define NTOBUF_INDENT 2 #define NTOBUF_MARGIN 75 static int wordlen(char *b, int i) { int l = 0; while (i && !d1_isspace(*b)) l++, b++, i--; return l; } static int nodetobuf(data1_node *n, int select, WRBUF b, int indent, int col) { data1_node *c; for (c = n->child; c; c = c->next) { char *tag; if (c->which == DATA1N_tag) { if (select && !c->u.tag.node_selected) continue; if (c->u.tag.element && c->u.tag.element->tag) tag = c->u.tag.element->tag->names->name; /* first name */ else tag = c->u.tag.tag; /* local string tag */ if (data1_matchstr(tag, "wellknown")) /* skip wellknown */ { if (col) wrbuf_putc(b, '\n'); wrbuf_printf(b, "%*s%s:", indent * NTOBUF_INDENT, "", tag); col = indent * NTOBUF_INDENT + 1 + strlen(tag); } if (nodetobuf(c, select, b, indent+1, col) < 0) return 0; } else if (c->which == DATA1N_data) { char *p = c->u.data.data; int l = c->u.data.len; int first = 0; if ((c->u.data.what == DATA1I_text || c->u.data.what == DATA1I_xmltext) && c->u.data.formatted_text) { wrbuf_putc(b, '\n'); wrbuf_write(b, c->u.data.data, c->u.data.len); wrbuf_printf(b, "%*s", indent * NTOBUF_INDENT, ""); col = indent * NTOBUF_INDENT; } else if (c->u.data.what == DATA1I_text || c->u.data.what == DATA1I_xmltext) { while (l) { int wlen; while (l && d1_isspace(*p)) p++, l--; if (!l) break; /* break if we'll cross margin and word is not too long */ if (col + (wlen = wordlen(p, l)) > NTOBUF_MARGIN && wlen < NTOBUF_MARGIN - indent * NTOBUF_INDENT) { wrbuf_printf(b, "\n%*s", indent * NTOBUF_INDENT, ""); col = indent * NTOBUF_INDENT; first = 1; } if (!first) { wrbuf_putc(b, ' '); col++; } while (l && !d1_isspace(*p)) { if (col > NTOBUF_MARGIN) { wrbuf_putc(b, '='); wrbuf_putc(b, '\n'); wrbuf_printf(b, "%*s", indent * NTOBUF_INDENT, ""); col = indent * NTOBUF_INDENT; } wrbuf_putc(b, *p); p++; l--; col++; } first = 0; } } else if (c->u.data.what == DATA1I_num) { wrbuf_putc(b, ' '); wrbuf_write(b, c->u.data.data, c->u.data.len); } } } return 0; } /* * Return area containing SUTRS-formatted data. Ownership of this data * remains in this module, and the buffer is reused on next call. This may * need changing. */ char *data1_nodetobuf(data1_handle dh, data1_node *n, int select, int *len) { WRBUF b = data1_get_wrbuf(dh); wrbuf_rewind(b); if (nodetobuf(n, select, b, 0, 0)) return 0; wrbuf_putc(b, '\n'); *len = wrbuf_len(b); return wrbuf_buf(b); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_doespec.c0000664000175000017500000002702714754717556015045 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** \file d1_doespec.c * \brief handle Z39.50 variant-1 specs * * See http://www.loc.gov/z3950/agency/defns/variant1.html */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include static int match_children(data1_handle dh, data1_node *n, Z_Espec1 *e, int i, Z_ETagUnit **t, int num, int select_flag); static int match_children_wildpath(data1_handle dh, data1_node *n, Z_Espec1 *e, int i, Z_ETagUnit **t, int num) { return 0; } /* * Locate a specific triple within a variant. * set is the set to look for, universal set is the set that applies to a * triple with an unknown set. */ static Z_Triple *find_triple(Z_Variant *var, const Odr_oid *universal_oid, const Odr_oid *var_oid, int zclass, int type) { int i; for (i = 0; i < var->num_triples; i++) { const Odr_oid *cur_oid = var->triples[i]->variantSetId; if (!cur_oid) cur_oid = var->globalVariantSetId; if (cur_oid && var_oid && !oid_oidcmp(var_oid, cur_oid) && *var->triples[i]->type == type) return var->triples[i]; } return 0; } static void mark_subtree(data1_node *n, int make_variantlist, int no_data, int get_bytes, Z_Variant *vreq, int select_flag) { data1_node *c; #if 1 if (n->which == DATA1N_tag) #else if (n->which == DATA1N_tag && (!n->child || n->child->which != DATA1N_tag)) /* * This seems to cause multi-level elements to fall out when only a * top-level elementRequest has been given... Problem is, I can't figure * out what it was supposed to ACHIEVE.... delete when code has been * verified. */ #endif { n->u.tag.node_selected = select_flag; n->u.tag.make_variantlist = make_variantlist; n->u.tag.no_data_requested = no_data; n->u.tag.get_bytes = get_bytes; } for (c = n->child; c; c = c->next) { if (c->which == DATA1N_tag && (!n->child || n->child->which != DATA1N_tag)) { c->u.tag.node_selected = select_flag; c->u.tag.make_variantlist = make_variantlist; c->u.tag.no_data_requested = no_data; c->u.tag.get_bytes = get_bytes; } mark_subtree(c, make_variantlist, no_data, get_bytes, vreq, select_flag); } } static void match_triple(data1_handle dh, Z_Variant *vreq, const Odr_oid *def_oid, const Odr_oid *var_oid, data1_node *n) { data1_node **c; if (!(n = n->child)) return; if (n->which != DATA1N_variant) return; c = &n->child; while (*c) { int remove_flag = 0; Z_Triple *r; assert ((*c)->which == DATA1N_variant); if ((*c)->u.variant.type->zclass->zclass == 4 && (*c)->u.variant.type->type == 1) { if ((r = find_triple(vreq, def_oid, var_oid, 4, 1)) && (r->which == Z_Triple_internationalString)) { const char *string_value = r->value.internationalString; if (strcmp ((*c)->u.variant.value, string_value)) remove_flag = 1; } } if (remove_flag) { *c = (*c)->next; } else { match_triple(dh, vreq, def_oid, var_oid, *c); c = &(*c)->next; } } } static int match_node_and_attr (data1_node *c, const char *spec) { char predicate[64]; char elem[64]; char attr[64]; char value[64]; char dummy_ch; data1_tag *tag = 0; if (c->u.tag.element) tag = c->u.tag.element->tag; *predicate = '\0'; sscanf(spec, "%63[^[]%c%63[^]]", elem, &dummy_ch, predicate); if (data1_matchstr(elem, tag ? tag->value.string : c->u.tag.tag)) return 0; if (*predicate == '\0') return 1; else if (sscanf(predicate, "@%63[^=]=%63s", attr, value) == 2) { data1_xattr *xa; for (xa = c->u.tag.attributes; xa; xa = xa->next) if (!strcmp(xa->name, attr) && !strcmp(xa->value, value)) return 1; return 0; } else if (sscanf(predicate, "@%63s", attr) == 1) { data1_xattr *xa; for (xa = c->u.tag.attributes; xa; xa = xa->next) if (!strcmp(xa->name, attr)) return 1; } else { yaz_log(YLOG_WARN, "Bad simpleelement component: '%s'", spec); } return 0; } static int match_children_here (data1_handle dh, data1_node *n, Z_Espec1 *e, int i, Z_ETagUnit **t, int num, int select_flag) { int counter = 0, hits = 0; data1_node *c; Z_ETagUnit *tp = *t; Z_Occurrences *occur; for (c = n->child; c ; c = c->next) { data1_tag *tag = 0; if (c->which != DATA1N_tag) continue; if (tp->which == Z_ETagUnit_specificTag) { Z_SpecificTag *want = tp->u.specificTag; occur = want->occurrences; if (c->u.tag.element) tag = c->u.tag.element->tag; if (*want->tagType != ((tag && tag->tagset) ? tag->tagset->type : 3)) continue; if (want->tagValue->which == Z_StringOrNumeric_numeric) { if (!tag || tag->which != DATA1T_numeric) continue; if (*want->tagValue->u.numeric != tag->value.numeric) continue; } else if (want->tagValue->which == Z_StringOrNumeric_string) { const char *str_val = want->tagValue->u.string; if (str_val[0] == '!') { str_val++; select_flag = 0; } if (tag && tag->which != DATA1T_string) continue; #if 1 if (!match_node_and_attr(c, str_val)) continue; #else if (data1_matchstr(str_val, tag ? tag->value.string : c->u.tag.tag)) continue; #endif } else { yaz_log(YLOG_WARN, "Bad SpecificTag type: %d", want->tagValue->which); continue; } } else if (tp->which == Z_ETagUnit_wildThing) occur = tp->u.wildThing; else continue; /* * Ok, so we have a matching tag. Are we within occurrences-range? */ counter++; if (occur && occur->which == Z_Occurrences_last) { yaz_log(YLOG_WARN, "Can't do occurrences=last (yet)"); return 0; } if (!occur || occur->which == Z_Occurrences_all || (occur->which == Z_Occurrences_values && counter >= *occur->u.values->start)) { if (match_children(dh, c, e, i, t + 1, num - 1, select_flag)) { c->u.tag.node_selected = select_flag; /* * Consider the variant specification if this is a complete * match. */ if (num == 1) { int show_variantlist = 0; int no_data = 0; int get_bytes = -1; Z_Variant *vreq = e->elements[i]->u.simpleElement->variantRequest; const Odr_oid *var_oid = yaz_oid_varset_variant_1; if (!vreq) vreq = e->defaultVariantRequest; if (vreq) { Z_Triple *r; /* * 6,5: meta-data requested, variant list. */ if (find_triple(vreq, e->defaultVariantSetId, var_oid, 6, 5)) show_variantlist = 1; /* * 9,1: Miscellaneous, no data requested. */ if (find_triple(vreq, e->defaultVariantSetId, var_oid, 9, 1)) no_data = 1; /* howmuch */ if ((r = find_triple(vreq, e->defaultVariantSetId, var_oid, 5, 5))) if (r->which == Z_Triple_integer) get_bytes = *r->value.integer; if (!show_variantlist) match_triple(dh, vreq, e->defaultVariantSetId, var_oid, c); } mark_subtree(c, show_variantlist, no_data, get_bytes, vreq, select_flag); } hits++; /* * have we looked at enough children? */ if (!occur || (occur->which == Z_Occurrences_values && (!occur->u.values->howMany || counter - *occur->u.values->start >= *occur->u.values->howMany - 1))) return hits; } } } return hits; } static int match_children(data1_handle dh, data1_node *n, Z_Espec1 *e, int i, Z_ETagUnit **t, int num, int select_flag) { int res; if (!num) return 1; switch (t[0]->which) { case Z_ETagUnit_wildThing: case Z_ETagUnit_specificTag: res = match_children_here(dh, n, e, i, t, num, select_flag); break; case Z_ETagUnit_wildPath: res = match_children_wildpath(dh, n, e, i, t, num); break; default: abort(); } return res; } int data1_doespec1 (data1_handle dh, data1_node *n, Z_Espec1 *e) { int i; n = data1_get_root_tag (dh, n); if (n && n->which == DATA1N_tag) n->u.tag.node_selected = 1; for (i = 0; i < e->num_elements; i++) { if (e->elements[i]->which != Z_ERequest_simpleElement) return 100; match_children(dh, n, e, i, e->elements[i]->u.simpleElement->path->tags, e->elements[i]->u.simpleElement->path->num_tags, 1 /* select (include) by default */ ); } return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_expout.c0000664000175000017500000012370314754717556014745 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This module converts data1 tree to Z39.50 Explain records */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include typedef struct { data1_handle dh; ODR o; int select; bool_t *false_value; bool_t *true_value; } ExpHandle; static int is_numeric_tag(ExpHandle *eh, data1_node *c) { if (!c || c->which != DATA1N_tag) return 0; if (!c->u.tag.element) { yaz_log(YLOG_WARN, "Tag %s is local", c->u.tag.tag); return 0; } if (c->u.tag.element->tag->which != DATA1T_numeric) { yaz_log(YLOG_WARN, "Tag %s is not numeric", c->u.tag.tag); return 0; } if (eh->select && !c->u.tag.node_selected) return 0; return c->u.tag.element->tag->value.numeric; } static int is_data_tag(ExpHandle *eh, data1_node *c) { if (!c || c->which != DATA1N_data) return 0; if (eh->select && !c->u.tag.node_selected) return 0; return 1; } static Odr_int *f_integer(ExpHandle *eh, data1_node *c) { char intbuf[64]; c = c->child; if (!is_data_tag(eh, c) || c->u.data.len >= sizeof(intbuf)) return 0; memcpy(intbuf, c->u.data.data, c->u.data.len); intbuf[c->u.data.len] = '\0'; return odr_intdup(eh->o, atoi(intbuf)); } static char *f_string(ExpHandle *eh, data1_node *c) { char *r; c = c->child; if (!is_data_tag(eh, c)) return 0; r = (char *)odr_malloc(eh->o, c->u.data.len + 1); memcpy(r, c->u.data.data, c->u.data.len); r[c->u.data.len] = '\0'; return r; } static bool_t *f_bool(ExpHandle *eh, data1_node *c) { bool_t *tf; char intbuf[64]; c = c->child; if (!is_data_tag (eh, c) || c->u.data.len >= sizeof(intbuf)) return 0; memcpy(intbuf, c->u.data.data, c->u.data.len); intbuf[c->u.data.len] = '\0'; tf = (int *)odr_malloc(eh->o, sizeof(*tf)); *tf = atoi(intbuf); return tf; } static Odr_oid *f_oid(ExpHandle *eh, data1_node *c, oid_class oclass) { char oidstr[128]; c = c->child; if (!is_data_tag(eh, c) || c->u.data.len >= sizeof(oidstr)) return 0; memcpy(oidstr, c->u.data.data, c->u.data.len); oidstr[c->u.data.len] = '\0'; return yaz_string_to_oid_odr(yaz_oid_std(), CLASS_GENERAL, oidstr, eh->o); } static Z_IntUnit *f_intunit(ExpHandle *eh, data1_node *c) { /* fix */ return 0; } static Z_HumanString *f_humstring(ExpHandle *eh, data1_node *c) { Z_HumanString *r; Z_HumanStringUnit *u; c = c->child; if (!is_data_tag(eh, c)) return 0; r = (Z_HumanString *)odr_malloc(eh->o, sizeof(*r)); r->num_strings = 1; r->strings = (Z_HumanStringUnit **)odr_malloc(eh->o, sizeof(Z_HumanStringUnit*)); r->strings[0] = u = (Z_HumanStringUnit *)odr_malloc(eh->o, sizeof(*u)); u->language = 0; u->text = (char *)odr_malloc(eh->o, c->u.data.len+1); memcpy(u->text, c->u.data.data, c->u.data.len); u->text[c->u.data.len] = '\0'; return r; } static Z_CommonInfo *f_commonInfo(ExpHandle *eh, data1_node *n) { Z_CommonInfo *res = (Z_CommonInfo *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->dateAdded = 0; res->dateChanged = 0; res->expiry = 0; res->humanStringLanguage = 0; res->otherInfo = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 601: res->dateAdded = f_string(eh, c); break; case 602: res->dateChanged = f_string(eh, c); break; case 603: res->expiry = f_string(eh, c); break; case 604: res->humanStringLanguage = f_string(eh, c); break; } } return res; } Odr_oid **f_oid_seq(ExpHandle *eh, data1_node *n, int *num, oid_class oclass) { Odr_oid **res; data1_node *c; int i; *num = 0; for (c = n->child ; c; c = c->next) if (is_numeric_tag(eh, c) == 1000) ++(*num); if (!*num) return NULL; res = (Odr_oid **)odr_malloc (eh->o, sizeof(*res) * (*num)); for (c = n->child, i = 0 ; c; c = c->next) if (is_numeric_tag(eh, c) == 1000) res[i++] = f_oid (eh, c, oclass); return res; } char **f_string_seq(ExpHandle *eh, data1_node *n, int *num) { char **res; data1_node *c; int i; *num = 0; for (c = n->child ; c; c = c->next) { if (is_numeric_tag(eh, c) != 1001) continue; ++(*num); } if (!*num) return NULL; res = (char **)odr_malloc(eh->o, sizeof(*res) * (*num)); for (c = n->child, i = 0 ; c; c = c->next) { if (is_numeric_tag(eh, c) != 1001) continue; res[i++] = f_string(eh, c); } return res; } Z_ProximitySupport *f_proximitySupport(ExpHandle *eh, data1_node *n) { Z_ProximitySupport *res = (Z_ProximitySupport *) odr_malloc(eh->o, sizeof(*res)); res->anySupport = eh->false_value; res->num_unitsSupported = 0; res->unitsSupported = 0; return res; } Z_RpnCapabilities *f_rpnCapabilities(ExpHandle *eh, data1_node *n) { Z_RpnCapabilities *res = (Z_RpnCapabilities *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->num_operators = 0; res->operators = NULL; res->resultSetAsOperandSupported = eh->false_value; res->restrictionOperandSupported = eh->false_value; res->proximity = NULL; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 550: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 551) continue; (res->num_operators)++; } if (res->num_operators) res->operators = (Odr_int **) odr_malloc(eh->o, res->num_operators * sizeof(*res->operators)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 551) continue; res->operators[i++] = f_integer(eh, n); } break; case 552: res->resultSetAsOperandSupported = f_bool(eh, c); break; case 553: res->restrictionOperandSupported = f_bool(eh, c); break; case 554: res->proximity = f_proximitySupport(eh, c); break; } } return res; } Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n) { Z_QueryTypeDetails *res = (Z_QueryTypeDetails *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->which = Z_QueryTypeDetails_rpn; res->u.rpn = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 519: res->which = Z_QueryTypeDetails_rpn; res->u.rpn = f_rpnCapabilities (eh, c); break; case 520: break; case 521: break; } } return res; } static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n) { Z_AccessInfo *res = (Z_AccessInfo *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->num_queryTypesSupported = 0; res->queryTypesSupported = 0; res->num_diagnosticsSets = 0; res->diagnosticsSets = 0; res->num_attributeSetIds = 0; res->attributeSetIds = 0; res->num_schemas = 0; res->schemas = 0; res->num_recordSyntaxes = 0; res->recordSyntaxes = 0; res->num_resourceChallenges = 0; res->resourceChallenges = 0; res->restrictedAccess = 0; res->costInfo = 0; res->num_variantSets = 0; res->variantSets = 0; res->num_elementSetNames = 0; res->elementSetNames = 0; res->num_unitSystems = 0; res->unitSystems = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 501: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 518) continue; (res->num_queryTypesSupported)++; } if (res->num_queryTypesSupported) res->queryTypesSupported = (Z_QueryTypeDetails **) odr_malloc(eh->o, res->num_queryTypesSupported * sizeof(*res->queryTypesSupported)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 518) continue; res->queryTypesSupported[i++] = f_queryTypeDetails(eh, n); } break; case 503: res->diagnosticsSets = f_oid_seq(eh, c, &res->num_diagnosticsSets, CLASS_DIAGSET); break; case 505: res->attributeSetIds = f_oid_seq(eh, c, &res->num_attributeSetIds, CLASS_ATTSET); break; case 507: res->schemas = f_oid_seq(eh, c, &res->num_schemas, CLASS_SCHEMA); break; case 509: res->recordSyntaxes = f_oid_seq(eh, c, &res->num_recordSyntaxes, CLASS_RECSYN); break; case 511: res->resourceChallenges = f_oid_seq(eh, c, &res->num_resourceChallenges, CLASS_RESFORM); break; case 513: res->restrictedAccess = NULL; break; /* fix */ case 514: res->costInfo = NULL; break; /* fix */ case 515: res->variantSets = f_oid_seq(eh, c, &res->num_variantSets, CLASS_VARSET); break; case 516: res->elementSetNames = f_string_seq(eh, c, &res->num_elementSetNames); break; case 517: res->unitSystems = f_string_seq(eh, c, &res->num_unitSystems); break; } } return res; } static Odr_int *f_recordCount(ExpHandle *eh, data1_node *c, int *which) { int *wp = which; char intbuf[64]; c = c->child; if (!is_numeric_tag(eh, c)) return 0; if (c->u.tag.element->tag->value.numeric == 210) *wp = Z_DatabaseInfo_actualNumber; else if (c->u.tag.element->tag->value.numeric == 211) *wp = Z_DatabaseInfo_approxNumber; else return 0; c = c->child; if (!c || c->which != DATA1N_data || c->u.data.len >= sizeof(intbuf)) return 0; memcpy(intbuf, c->u.data.data, c->u.data.len); intbuf[c->u.data.len] = '\0'; return odr_intdup(eh->o, atoi(intbuf)); } static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n) { Z_ContactInfo *res = (Z_ContactInfo *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->name = 0; res->description = 0; res->address = 0; res->email = 0; res->phone = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag (eh, c)) { case 102: res->name = f_string(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 127: res->address = f_humstring(eh, c); break; case 128: res->email = f_string(eh, c); break; case 129: res->phone = f_string(eh, c); break; } } return res; } static Z_DatabaseList *f_databaseList(ExpHandle *eh, data1_node *n) { data1_node *c; Z_DatabaseList *res; int i = 0; for (c = n->child; c; c = c->next) { if (is_numeric_tag (eh, c) != 102) continue; ++i; } if (!i) return NULL; res = (Z_DatabaseList *)odr_malloc (eh->o, sizeof(*res)); res->num_databases = i; res->databases = (char **)odr_malloc (eh->o, sizeof(*res->databases) * i); i = 0; for (c = n->child; c; c = c->next) { if (is_numeric_tag(eh, c) != 102) continue; res->databases[i++] = f_string(eh, c); } return res; } static Z_NetworkAddressIA *f_networkAddressIA(ExpHandle *eh, data1_node *n) { Z_NetworkAddressIA *res = (Z_NetworkAddressIA *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->hostAddress = 0; res->port = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 121: res->hostAddress = f_string(eh, c); break; case 122: res->port = f_integer(eh, c); break; } } return res; } static Z_NetworkAddressOther *f_networkAddressOther(ExpHandle *eh, data1_node *n) { Z_NetworkAddressOther *res = (Z_NetworkAddressOther *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->type = 0; res->address = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 124: res->type = f_string(eh, c); break; case 121: res->address = f_string(eh, c); break; } } return res; } static Z_NetworkAddress **f_networkAddresses(ExpHandle *eh, data1_node *n, int *num) { Z_NetworkAddress **res = NULL; data1_node *c; int i = 0; *num = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 120: case 123: (*num)++; break; } } if (*num) res = (Z_NetworkAddress **) odr_malloc(eh->o, sizeof(*res) * (*num)); for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 120: res[i] = (Z_NetworkAddress *) odr_malloc(eh->o, sizeof(**res)); res[i]->which = Z_NetworkAddress_iA; res[i]->u.internetAddress = f_networkAddressIA(eh, c); i++; break; case 123: res[i] = (Z_NetworkAddress *) odr_malloc(eh->o, sizeof(**res)); res[i]->which = Z_NetworkAddress_other; res[i]->u.other = f_networkAddressOther(eh, c); i++; break; } } return res; } static Z_CategoryInfo *f_categoryInfo(ExpHandle *eh, data1_node *n) { Z_CategoryInfo *res = (Z_CategoryInfo *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->category = 0; res->originalCategory = 0; res->description = 0; res->asn1Module = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 102: res->category = f_string(eh, c); break; case 302: res->originalCategory = f_string(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 303: res->asn1Module = f_string (eh, c); break; } } return res; } static Z_CategoryList *f_categoryList(ExpHandle *eh, data1_node *n) { Z_CategoryList *res = (Z_CategoryList *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->commonInfo = 0; res->num_categories = 0; res->categories = NULL; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 300: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 301) continue; (res->num_categories)++; } if (res->num_categories) res->categories = (Z_CategoryInfo **)odr_malloc(eh->o, res->num_categories * sizeof(*res->categories)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 301) continue; res->categories[i++] = f_categoryInfo(eh, n); } break; } } assert (res->num_categories && res->categories); return res; } static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n) { Z_TargetInfo *res = (Z_TargetInfo *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->commonInfo = 0; res->name = 0; res->recentNews = 0; res->icon = 0; res->namedResultSets = 0; res->multipleDBsearch = 0; res->maxResultSets = 0; res->maxResultSize = 0; res->maxTerms = 0; res->timeoutInterval = 0; res->welcomeMessage = 0; res->contactInfo = 0; res->description = 0; res->num_nicknames = 0; res->nicknames = 0; res->usageRest = 0; res->paymentAddr = 0; res->hours = 0; res->num_dbCombinations = 0; res->dbCombinations = 0; res->num_addresses = 0; res->addresses = 0; res->num_languages = 0; res->languages = NULL; res->commonAccessInfo = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 102: res->name = f_string(eh, c); break; case 103: res->recentNews = f_humstring(eh, c); break; case 104: res->icon = NULL; break; /* fix */ case 105: res->namedResultSets = f_bool(eh, c); break; case 106: res->multipleDBsearch = f_bool(eh, c); break; case 107: res->maxResultSets = f_integer(eh, c); break; case 108: res->maxResultSize = f_integer(eh, c); break; case 109: res->maxTerms = f_integer(eh, c); break; case 110: res->timeoutInterval = f_intunit(eh, c); break; case 111: res->welcomeMessage = f_humstring(eh, c); break; case 112: res->contactInfo = f_contactInfo(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 114: res->num_nicknames = 0; for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 102) continue; (res->num_nicknames)++; } if (res->num_nicknames) res->nicknames = (char **)odr_malloc(eh->o, res->num_nicknames * sizeof(*res->nicknames)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 102) continue; res->nicknames[i++] = f_string(eh, n); } break; case 115: res->usageRest = f_humstring(eh, c); break; case 116: res->paymentAddr = f_humstring(eh, c); break; case 117: res->hours = f_humstring(eh, c); break; case 118: res->num_dbCombinations = 0; for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 605) continue; (res->num_dbCombinations)++; } if (res->num_dbCombinations) res->dbCombinations = (Z_DatabaseList **) odr_malloc(eh->o, res->num_dbCombinations * sizeof(*res->dbCombinations)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 605) continue; res->dbCombinations[i++] = f_databaseList(eh, n); } break; case 119: res->addresses = f_networkAddresses(eh, c, &res->num_addresses); break; case 125: res->num_languages = 0; for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 126) continue; (res->num_languages)++; } if (res->num_languages) res->languages = (char **) odr_malloc(eh->o, res->num_languages * sizeof(*res->languages)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 126) continue; res->languages[i++] = f_string (eh, n); } break; case 500: res->commonAccessInfo = f_accessInfo(eh, c); break; } } if (!res->namedResultSets) res->namedResultSets = eh->false_value; if (!res->multipleDBsearch) res->multipleDBsearch = eh->false_value; return res; } static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n) { Z_DatabaseInfo *res = (Z_DatabaseInfo *)odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->commonInfo = 0; res->name = 0; res->explainDatabase = 0; res->num_nicknames = 0; res->nicknames = 0; res->icon = 0; res->userFee = 0; res->available = 0; res->titleString = 0; res->num_keywords = 0; res->keywords = 0; res->description = 0; res->associatedDbs = 0; res->subDbs = 0; res->disclaimers = 0; res->news = 0; res->u.actualNumber = 0; res->defaultOrder = 0; res->avRecordSize = 0; res->maxRecordSize = 0; res->hours = 0; res->bestTime = 0; res->lastUpdate = 0; res->updateInterval = 0; res->coverage = 0; res->proprietary = 0; res->copyrightText = 0; res->copyrightNotice = 0; res->producerContactInfo = 0; res->supplierContactInfo = 0; res->submissionContactInfo = 0; res->accessInfo = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 102: res->name = f_string(eh, c); break; case 226: res->explainDatabase = odr_nullval(); break; case 114: res->num_nicknames = 0; for (n = c->child; n; n = n->next) { if (!is_numeric_tag(eh, n) || n->u.tag.element->tag->value.numeric != 102) continue; (res->num_nicknames)++; } if (res->num_nicknames) res->nicknames = (char **)odr_malloc (eh->o, res->num_nicknames * sizeof(*res->nicknames)); for (n = c->child; n; n = n->next) { if (!is_numeric_tag(eh, n) || n->u.tag.element->tag->value.numeric != 102) continue; res->nicknames[i++] = f_string (eh, n); } break; case 104: res->icon = 0; break; /* fix */ case 201: res->userFee = f_bool(eh, c); break; case 202: res->available = f_bool(eh, c); break; case 203: res->titleString = f_humstring(eh, c); break; case 227: res->num_keywords = 0; for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 1000) continue; (res->num_keywords)++; } if (res->num_keywords) res->keywords = (Z_HumanString **)odr_malloc (eh->o, res->num_keywords * sizeof(*res->keywords)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 1000) continue; res->keywords[i++] = f_humstring (eh, n); } break; case 113: res->description = f_humstring(eh, c); break; case 205: res->associatedDbs = f_databaseList (eh, c); break; case 206: res->subDbs = f_databaseList (eh, c); break; case 207: res->disclaimers = f_humstring(eh, c); break; case 103: res->news = f_humstring(eh, c); break; case 209: res->u.actualNumber = f_recordCount(eh, c, &res->which); break; case 212: res->defaultOrder = f_humstring(eh, c); break; case 213: res->avRecordSize = f_integer(eh, c); break; case 214: res->maxRecordSize = f_integer(eh, c); break; case 215: res->hours = f_humstring(eh, c); break; case 216: res->bestTime = f_humstring(eh, c); break; case 217: res->lastUpdate = f_string(eh, c); break; case 218: res->updateInterval = f_intunit(eh, c); break; case 219: res->coverage = f_humstring(eh, c); break; case 220: res->proprietary = f_bool(eh, c); break; case 221: res->copyrightText = f_humstring(eh, c); break; case 222: res->copyrightNotice = f_humstring(eh, c); break; case 223: res->producerContactInfo = f_contactInfo(eh, c); break; case 224: res->supplierContactInfo = f_contactInfo(eh, c); break; case 225: res->submissionContactInfo = f_contactInfo(eh, c); break; case 500: res->accessInfo = f_accessInfo(eh, c); break; } } if (!res->userFee) res->userFee = eh->false_value; if (!res->available) res->available = eh->true_value; return res; } Z_StringOrNumeric *f_stringOrNumeric(ExpHandle *eh, data1_node *n) { Z_StringOrNumeric *res = (Z_StringOrNumeric *) odr_malloc (eh->o, sizeof(*res)); data1_node *c; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 1001: res->which = Z_StringOrNumeric_string; res->u.string = f_string(eh, c); break; case 1002: res->which = Z_StringOrNumeric_numeric; res->u.numeric = f_integer(eh, c); break; } } return res; } Z_AttributeDescription *f_attributeDescription( ExpHandle *eh, data1_node *n) { Z_AttributeDescription *res = (Z_AttributeDescription *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; int i = 0; res->name = 0; res->description = 0; res->attributeValue = 0; res->num_equivalentAttributes = 0; res->equivalentAttributes = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 102: res->name = f_string(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 710: res->attributeValue = f_stringOrNumeric(eh, c); break; case 752: (res->num_equivalentAttributes++); break; } } if (res->num_equivalentAttributes) res->equivalentAttributes = (Z_StringOrNumeric **) odr_malloc(eh->o, sizeof(*res->equivalentAttributes) * res->num_equivalentAttributes); for (c = n->child; c; c = c->next) if (is_numeric_tag(eh, c) == 752) res->equivalentAttributes[i++] = f_stringOrNumeric(eh, c); return res; } Z_AttributeType *f_attributeType(ExpHandle *eh, data1_node *n) { Z_AttributeType *res = (Z_AttributeType *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->name = 0; res->description = 0; res->attributeType = 0; res->num_attributeValues = 0; res->attributeValues = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 102: res->name = f_string(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 704: res->attributeType = f_integer(eh, c); break; case 708: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 709) continue; (res->num_attributeValues)++; } if (res->num_attributeValues) res->attributeValues = (Z_AttributeDescription **) odr_malloc(eh->o, res->num_attributeValues * sizeof(*res->attributeValues)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 709) continue; res->attributeValues[i++] = f_attributeDescription(eh, n); } break; } } return res; } Z_AttributeSetInfo *f_attributeSetInfo(ExpHandle *eh, data1_node *n) { Z_AttributeSetInfo *res = (Z_AttributeSetInfo *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->commonInfo = 0; res->attributeSet = 0; res->name = 0; res->num_attributes = 0; res->attributes = 0; res->description = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break; case 102: res->name = f_string(eh, c); break; case 750: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 751) continue; (res->num_attributes)++; } if (res->num_attributes) res->attributes = (Z_AttributeType **) odr_malloc(eh->o, res->num_attributes * sizeof(*res->attributes)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 751) continue; res->attributes[i++] = f_attributeType(eh, n); } break; case 113: res->description = f_humstring(eh, c); break; } } return res; } Z_OmittedAttributeInterpretation *f_omittedAttributeInterpretation( ExpHandle *eh, data1_node *n) { Z_OmittedAttributeInterpretation *res = (Z_OmittedAttributeInterpretation*) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->defaultValue = 0; res->defaultDescription = 0; for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 706: res->defaultValue = f_stringOrNumeric(eh, c); break; case 113: res->defaultDescription = f_humstring(eh, c); break; } } return res; } Z_AttributeValue *f_attributeValue(ExpHandle *eh, data1_node *n) { Z_AttributeValue *res = (Z_AttributeValue *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->value = 0; res->description = 0; res->num_subAttributes = 0; res->subAttributes = 0; res->num_superAttributes = 0; res->superAttributes = 0; res->partialSupport = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag (eh, c)) { case 710: res->value = f_stringOrNumeric(eh, c); break; case 113: res->description = f_humstring(eh, c); break; case 712: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 713) continue; (res->num_subAttributes)++; } if (res->num_subAttributes) res->subAttributes = (Z_StringOrNumeric **) odr_malloc(eh->o, res->num_subAttributes * sizeof(*res->subAttributes)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 713) continue; res->subAttributes[i++] = f_stringOrNumeric(eh, n); } break; case 714: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 715) continue; (res->num_superAttributes)++; } if (res->num_superAttributes) res->superAttributes = (Z_StringOrNumeric **) odr_malloc(eh->o, res->num_superAttributes * sizeof(*res->superAttributes)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 715) continue; res->superAttributes[i++] = f_stringOrNumeric(eh, n); } break; case 711: res->partialSupport = odr_nullval(); break; } } return res; } Z_AttributeTypeDetails *f_attributeTypeDetails(ExpHandle *eh, data1_node *n) { Z_AttributeTypeDetails *res = (Z_AttributeTypeDetails *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->attributeType = 0; res->defaultIfOmitted = 0; res->num_attributeValues = 0; res->attributeValues = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 704: res->attributeType = f_integer(eh, c); break; case 705: res->defaultIfOmitted = f_omittedAttributeInterpretation(eh, c); break; case 708: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 709) continue; (res->num_attributeValues)++; } if (res->num_attributeValues) res->attributeValues = (Z_AttributeValue **) odr_malloc(eh->o, res->num_attributeValues * sizeof(*res->attributeValues)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 709) continue; res->attributeValues[i++] = f_attributeValue(eh, n); } break; } } return res; } Z_AttributeSetDetails *f_attributeSetDetails(ExpHandle *eh, data1_node *n) { Z_AttributeSetDetails *res = (Z_AttributeSetDetails *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->attributeSet = 0; res->num_attributesByType = 0; res->attributesByType = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break; case 702: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 703) continue; (res->num_attributesByType)++; } if (res->num_attributesByType) res->attributesByType = (Z_AttributeTypeDetails **) odr_malloc(eh->o, res->num_attributesByType * sizeof(*res->attributesByType)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 703) continue; res->attributesByType[i++] = f_attributeTypeDetails(eh, n); } break; } } return res; } Z_AttributeValueList *f_attributeValueList(ExpHandle *eh, data1_node *n) { Z_AttributeValueList *res = (Z_AttributeValueList *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; int i = 0; res->num_attributes = 0; res->attributes = 0; for (c = n->child; c; c = c->next) if (is_numeric_tag(eh, c) == 710) (res->num_attributes)++; if (res->num_attributes) { res->attributes = (Z_StringOrNumeric **) odr_malloc(eh->o, res->num_attributes * sizeof(*res->attributes)); } for (c = n->child; c; c = c->next) if (is_numeric_tag(eh, c) == 710) res->attributes[i++] = f_stringOrNumeric(eh, c); return res; } Z_AttributeOccurrence *f_attributeOccurrence(ExpHandle *eh, data1_node *n) { Z_AttributeOccurrence *res = (Z_AttributeOccurrence *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->attributeSet = 0; res->attributeType = 0; res->mustBeSupplied = 0; res->which = Z_AttributeOcc_any_or_none; res->attributeValues.any_or_none = odr_nullval(); for (c = n->child; c; c = c->next) { switch (is_numeric_tag(eh, c)) { case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break; case 704: res->attributeType = f_integer(eh, c); break; case 720: res->mustBeSupplied = odr_nullval(); break; case 721: res->which = Z_AttributeOcc_any_or_none; res->attributeValues.any_or_none = odr_nullval(); break; case 722: res->which = Z_AttributeOcc_specific; res->attributeValues.specific = f_attributeValueList(eh, c); break; } } return res; } Z_AttributeCombination *f_attributeCombination(ExpHandle *eh, data1_node *n) { Z_AttributeCombination *res = (Z_AttributeCombination *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; int i = 0; res->num_occurrences = 0; res->occurrences = 0; for (c = n->child; c; c = c->next) if (is_numeric_tag(eh, c) == 719) (res->num_occurrences)++; if (res->num_occurrences) { res->occurrences = (Z_AttributeOccurrence **) odr_malloc(eh->o, res->num_occurrences * sizeof(*res->occurrences)); } for (c = n->child; c; c = c->next) if (is_numeric_tag(eh, c) == 719) res->occurrences[i++] = f_attributeOccurrence(eh, c); assert (res->num_occurrences); return res; } Z_AttributeCombinations *f_attributeCombinations(ExpHandle *eh, data1_node *n) { Z_AttributeCombinations *res = (Z_AttributeCombinations *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->defaultAttributeSet = 0; res->num_legalCombinations = 0; res->legalCombinations = 0; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 1000: res->defaultAttributeSet = f_oid(eh, c, CLASS_ATTSET); break; case 717: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 718) continue; (res->num_legalCombinations)++; } if (res->num_legalCombinations) res->legalCombinations = (Z_AttributeCombination **) odr_malloc (eh->o, res->num_legalCombinations * sizeof(*res->legalCombinations)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 718) continue; res->legalCombinations[i++] = f_attributeCombination(eh, n); } break; } } assert(res->num_legalCombinations); return res; } Z_AttributeDetails *f_attributeDetails(ExpHandle *eh, data1_node *n) { Z_AttributeDetails *res = (Z_AttributeDetails *) odr_malloc(eh->o, sizeof(*res)); data1_node *c; res->commonInfo = 0; res->databaseName = 0; res->num_attributesBySet = 0; res->attributesBySet = NULL; res->attributeCombinations = NULL; for (c = n->child; c; c = c->next) { int i = 0; switch (is_numeric_tag(eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 102: res->databaseName = f_string(eh, c); break; case 700: for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 701) continue; (res->num_attributesBySet)++; } if (res->num_attributesBySet) res->attributesBySet = (Z_AttributeSetDetails **) odr_malloc(eh->o, res->num_attributesBySet * sizeof(*res->attributesBySet)); for (n = c->child; n; n = n->next) { if (is_numeric_tag(eh, n) != 701) continue; res->attributesBySet[i++] = f_attributeSetDetails(eh, n); } break; case 716: res->attributeCombinations = f_attributeCombinations(eh, c); break; } } return res; } Z_ExplainRecord *data1_nodetoexplain(data1_handle dh, data1_node *n, int select, ODR o) { ExpHandle eh; Z_ExplainRecord *res = (Z_ExplainRecord *)odr_malloc(o, sizeof(*res)); eh.dh = dh; eh.select = select; eh.o = o; eh.false_value = (int *)odr_malloc(eh.o, sizeof(eh.false_value)); *eh.false_value = 0; eh.true_value = (int *)odr_malloc(eh.o, sizeof(eh.true_value)); *eh.true_value = 1; assert(n->which == DATA1N_root); if (strcmp(n->u.root.type, "explain")) { yaz_log(YLOG_WARN, "Attempt to convert a non-Explain record"); return 0; } for (n = n->child; n; n = n->next) { switch (is_numeric_tag(&eh, n)) { case 1: res->which = Z_Explain_categoryList; if (!(res->u.categoryList = f_categoryList(&eh, n))) return 0; return res; case 2: res->which = Z_Explain_targetInfo; if (!(res->u.targetInfo = f_targetInfo(&eh, n))) return 0; return res; case 3: res->which = Z_Explain_databaseInfo; if (!(res->u.databaseInfo = f_databaseInfo(&eh, n))) return 0; return res; case 7: res->which = Z_Explain_attributeSetInfo; if (!(res->u.attributeSetInfo = f_attributeSetInfo(&eh, n))) return 0; return res; case 10: res->which = Z_Explain_attributeDetails; if (!(res->u.attributeDetails = f_attributeDetails(&eh, n))) return 0; return res; } } yaz_log(YLOG_WARN, "No category in Explain record"); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_sumout.c0000664000175000017500000000730114754717556014750 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include static Odr_int *f_integer(data1_node *c, ODR o) { char intbuf[64]; if (!c->child || c->child->which != DATA1N_data || c->child->u.data.len >= sizeof(intbuf)) return 0; memcpy(intbuf, c->child->u.data.data, c->u.data.len); intbuf[c->u.data.len] = '\0'; return odr_intdup(o, atoi(intbuf)); } static char *f_string(data1_node *c, ODR o) { char *r; if (!c->child || c->child->which != DATA1N_data) return 0; r = (char *)odr_malloc(o, c->child->u.data.len + 1); memcpy(r, c->child->u.data.data, c->child->u.data.len); r[c->child->u.data.len] = '\0'; return r; } Z_BriefBib *data1_nodetosummary(data1_handle dh, data1_node *n, int select, ODR o) { Z_BriefBib *res = (Z_BriefBib *)odr_malloc(o, sizeof(*res)); data1_node *c; assert(n->which == DATA1N_root); if (strcmp(n->u.root.type, "summary")) { yaz_log(YLOG_WARN, "Attempt to convert a non-summary record"); return 0; } res->title = "[UNKNOWN]"; res->author = 0; res->callNumber = 0; res->recordType = 0; res->bibliographicLevel = 0; res->num_format = 0; res->format = 0; res->publicationPlace = 0; res->publicationDate = 0; res->targetSystemKey = 0; res->satisfyingElement = 0; res->rank = 0; res->documentId = 0; res->abstract = 0; res->otherInfo = 0; for (c = n->child; c; c = c->next) { if (c->which != DATA1N_tag || !c->u.tag.element) { yaz_log(YLOG_WARN, "Malformed element in Summary record"); return 0; } if (select && !c->u.tag.node_selected) continue; switch (c->u.tag.element->tag->value.numeric) { case 0: res->title = f_string(c, o); break; case 1: res->author = f_string(c, o); break; case 2: res->callNumber = f_string(c, o); break; case 3: res->recordType = f_string(c, o); break; case 4: res->bibliographicLevel = f_string(c, o); break; case 5: abort(); /* TODO */ case 10: res->publicationPlace = f_string(c, o); break; case 11: res->publicationDate = f_string(c, o); break; case 12: res->targetSystemKey = f_string(c, o); break; case 13: res->satisfyingElement = f_string(c, o); break; case 14: res->rank = f_integer(c, o); break; case 15: res->documentId = f_string(c, o); break; case 16: res->abstract = f_string(c, o); break; case 17: abort(); /* TODO */ default: yaz_log(YLOG_WARN, "Unknown element in Summary record."); } } return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_map.c0000664000175000017500000002567714754717556014211 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include struct data1_mapunit { int no_data; int no_chop; char *source_element_name; data1_maptag *target_path; struct data1_mapunit *next; }; data1_maptab *data1_read_maptab(data1_handle dh, const char *file) { NMEM mem = data1_nmem_get(dh); data1_maptab *res = (data1_maptab *)nmem_malloc(mem, sizeof(*res)); FILE *f; int lineno = 0; int argc; char *argv[50], line[512]; data1_mapunit **mapp; int local_numeric = 0; if (!(f = data1_path_fopen(dh, file, "r"))) return 0; res->name = 0; res->oid = 0; res->map = 0; mapp = &res->map; res->next = 0; while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) if (!strcmp(argv[0], "targetref")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args for targetref", file, lineno); continue; } res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_RECSYN, argv[1], mem); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown reference '%s'", file, lineno, argv[1]); continue; } } else if (!strcmp(argv[0], "targetname")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args for targetname", file, lineno); continue; } res->target_absyn_name = nmem_strdup(mem, argv[1]); } else if (!yaz_matchstr(argv[0], "localnumeric")) local_numeric = 1; else if (!strcmp(argv[0], "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args for name", file, lineno); continue; } res->name = nmem_strdup(mem, argv[1]); } else if (!strcmp(argv[0], "map")) { data1_maptag **mtp; char *ep, *path = argv[2]; if (argc < 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args for map", file, lineno); continue; } *mapp = (data1_mapunit *)nmem_malloc(mem, sizeof(**mapp)); (*mapp)->next = 0; if (argc > 3 && !data1_matchstr(argv[3], "nodata")) (*mapp)->no_data = 1; else (*mapp)->no_data = 0; if (argc > 3 && !data1_matchstr(argv[3], "nochop")) (*mapp)->no_chop = 1; else (*mapp)->no_chop = 0; (*mapp)->source_element_name = nmem_strdup(mem, argv[1]); mtp = &(*mapp)->target_path; if (*path == '/') path++; for (ep = strchr(path, '/'); path; (void)((path = ep) && (ep = strchr(path, '/')))) { int type, np; char valstr[512], parm[512]; if (ep) ep++; if ((np = sscanf(path, "(%d,%511[^)]):%511[^/]", &type, valstr, parm)) < 2) { yaz_log(YLOG_WARN, "%s:%d: Syntax error in map " "directive: %s", file, lineno, argv[2]); fclose(f); return 0; } *mtp = (data1_maptag *)nmem_malloc(mem, sizeof(**mtp)); (*mtp)->next = 0; (*mtp)->type = type; if (np > 2 && !data1_matchstr(parm, "new")) (*mtp)->new_field = 1; else (*mtp)->new_field = 0; if ((type != 3 || local_numeric) && d1_isdigit(*valstr)) { (*mtp)->which = D1_MAPTAG_numeric; (*mtp)->value.numeric = atoi(valstr); } else { (*mtp)->which = D1_MAPTAG_string; (*mtp)->value.string = nmem_strdup(mem, valstr); } mtp = &(*mtp)->next; } mapp = &(*mapp)->next; } else yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, argv[0]); fclose(f); return res; } /* * See if the node n is equivalent to the tag t. */ static int tagmatch(data1_node *n, data1_maptag *t) { if (n->which != DATA1N_tag) return 0; if (n->u.tag.element) { if (n->u.tag.element->tag->tagset) { if (n->u.tag.element->tag->tagset->type != t->type) return 0; } else if (t->type != 3) return 0; if (n->u.tag.element->tag->which == DATA1T_numeric) { if (t->which != D1_MAPTAG_numeric) return 0; if (n->u.tag.element->tag->value.numeric != t->value.numeric) return 0; } else { if (t->which != D1_MAPTAG_string) return 0; if (data1_matchstr(n->u.tag.element->tag->value.string, t->value.string)) return 0; } } else /* local tag */ { if (t->type != 3) return 0; if (t->which == D1_MAPTAG_numeric) { char str[16]; yaz_snprintf(str, sizeof(str), "%d", t->value.numeric); if (data1_matchstr(n->u.tag.tag, str)) return 0; } else { if (data1_matchstr(n->u.tag.tag, t->value.string)) return 0; } } return 1; } static data1_node *dup_child(data1_handle dh, data1_node *n, data1_node **last, NMEM mem, data1_node *parent) { data1_node *first = 0; data1_node **m = &first; for (; n; n = n->next) { *last = *m = (data1_node *) nmem_malloc(mem, sizeof(**m)); memcpy(*m, n, sizeof(**m)); (*m)->parent = parent; (*m)->root = parent->root; (*m)->child = dup_child(dh, n->child, &(*m)->last_child, mem, *m); m = &(*m)->next; } *m = 0; return first; } static int map_children(data1_handle dh, data1_node *n, data1_maptab *map, data1_node *res, NMEM mem) { data1_node *c; data1_mapunit *m; /* * locate each source element in turn. */ for (c = n->child; c; c = c->next) if (c->which == DATA1N_tag && c->u.tag.element) { for (m = map->map; m; m = m->next) { if (!data1_matchstr(m->source_element_name, c->u.tag.element->name)) { data1_node *pn = res; data1_node *cur = pn->last_child; data1_maptag *mt; /* * process the target path specification. */ for (mt = m->target_path; mt; mt = mt->next) { if (!cur || mt->new_field || !tagmatch(cur, mt)) { if (mt->which == D1_MAPTAG_string) { cur = data1_mk_node2(dh, mem, DATA1N_tag, pn); cur->u.tag.tag = mt->value.string; } else if (mt->which == D1_MAPTAG_numeric) { data1_tag *tag = data1_gettagbynum( dh, pn->root->u.root.absyn->tagset, mt->type, mt->value.numeric); if (tag && tag->names->name) { cur = data1_mk_tag( dh, mem, tag->names->name, 0, pn); } } } if (mt->next) pn = cur; else if (!m->no_data) { cur->child = dup_child(dh, c->child, &cur->last_child, mem, cur); if (!m->no_chop) { data1_concat_text(dh, mem, cur->child); data1_chop_text(dh, mem, cur->child); } } } } } if (map_children(dh, c, map, res, mem) < 0) return -1; } return 0; } /* * Create a (possibly lossy) copy of the given record based on the * table. The new copy will refer back to the data of the original record, * which should not be discarded during the lifetime of the copy. */ data1_node *data1_map_record(data1_handle dh, data1_node *n, data1_maptab *map, NMEM m) { data1_node *res1, *res = data1_mk_node2(dh, m, DATA1N_root, 0); res->which = DATA1N_root; res->u.root.type = map->target_absyn_name; if (!(res->u.root.absyn = data1_get_absyn(dh, map->target_absyn_name, DATA1_XPATH_INDEXING_ENABLE))) { yaz_log(YLOG_WARN, "%s: Failed to load target absyn '%s'", map->name, map->target_absyn_name); } n = n->child; if (!n) return 0; res1 = data1_mk_tag(dh, m, map->target_absyn_name, 0, res); while (n && n->which != DATA1N_tag) n = n->next; if (map_children(dh, n, map, res1, m) < 0) return 0; return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_prtree.c0000664000175000017500000001041414754717556014714 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include static void pr_string (FILE *out, const char *str, int len) { int i; for (i = 0; i126) fprintf (out, "\\x%02x", c & 255); else fputc (c, out); } } static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) { fprintf (out, "%*s", level, ""); switch (n->which) { case DATA1N_root: fprintf (out, "root abstract syntax=%s\n", n->u.root.type); break; case DATA1N_tag: fprintf (out, "tag type=%s sel=%d\n", n->u.tag.tag, n->u.tag.node_selected); if (n->u.tag.attributes) { data1_xattr *xattr = n->u.tag.attributes; fprintf (out, "%*s attr", level, ""); for (; xattr; xattr = xattr->next) fprintf (out, " %s=%s ", xattr->name, xattr->value); fprintf (out, "\n"); } break; case DATA1N_data: case DATA1N_comment: if (n->which == DATA1N_data) fprintf (out, "data type="); else fprintf (out, "comment type="); switch (n->u.data.what) { case DATA1I_inctxt: fprintf (out, "inctxt\n"); break; case DATA1I_incbin: fprintf (out, "incbin\n"); break; case DATA1I_text: fprintf (out, "text '"); pr_string (out, n->u.data.data, n->u.data.len); fprintf (out, "'\n"); break; case DATA1I_num: fprintf (out, "num '"); pr_string (out, n->u.data.data, n->u.data.len); fprintf (out, "'\n"); break; case DATA1I_oid: fprintf (out, "oid '"); pr_string (out, n->u.data.data, n->u.data.len); fprintf (out, "'\n"); break; case DATA1I_xmltext: fprintf (out, "xml text '"); pr_string (out, n->u.data.data, n->u.data.len); fprintf (out, "'\n"); break; default: fprintf (out, "unknown(%d)\n", n->u.data.what); break; } break; case DATA1N_preprocess: fprintf (out, "preprocess target=%s\n", n->u.preprocess.target); if (n->u.preprocess.attributes) { data1_xattr *xattr = n->u.preprocess.attributes; fprintf (out, "%*s attr", level, ""); for (; xattr; xattr = xattr->next) fprintf (out, " %s=%s ", xattr->name, xattr->value); fprintf (out, "\n"); } break; case DATA1N_variant: fprintf (out, "variant\n"); #if 0 if (n->u.variant.type->name) fprintf (out, " class=%s type=%d value=%s\n", n->u.variant.type->name, n->u.variant.type->type, n->u.variant.value); #endif break; default: fprintf (out, "unknown(%d)\n", n->which); } if (n->child) pr_tree (dh, n->child, out, level+4); if (n->next) pr_tree (dh, n->next, out, level); else { if (n->parent && n->parent->last_child != n) fprintf(out, "%*sWARNING: last_child=%p != %p\n", level, "", n->parent->last_child, n); } } void data1_pr_tree (data1_handle dh, data1_node *n, FILE *out) { pr_tree (dh, n, out, 0); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_espec.c0000664000175000017500000002650214754717556014517 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include static Z_Variant *read_variant(int argc, char **argv, NMEM nmem, const char *file, int lineno) { Z_Variant *r = (Z_Variant *)nmem_malloc(nmem, sizeof(*r)); int i; r->globalVariantSetId = odr_oiddup_nmem(nmem, yaz_oid_varset_variant_1); if (argc) r->triples = (Z_Triple **)nmem_malloc(nmem, sizeof(Z_Triple*) * argc); else r->triples = 0; r->num_triples = argc; for (i = 0; i < argc; i++) { int zclass, type; char value[512]; Z_Triple *t; if (sscanf(argv[i], "(%d,%d,%511[^)])", &zclass, &type, value) < 3) { yaz_log(YLOG_WARN, "%s:%d: Syntax error in variant component '%s'", file, lineno, argv[i]); return 0; } t = r->triples[i] = (Z_Triple *)nmem_malloc(nmem, sizeof(Z_Triple)); t->variantSetId = 0; t->zclass = nmem_intdup(nmem, zclass); t->type = nmem_intdup(nmem, type); /* * This is wrong.. we gotta look up the correct type for the * variant, I guess... damn this stuff. */ if (*value == '@') { t->which = Z_Triple_null; t->value.null = odr_nullval(); } else if (d1_isdigit(*value)) { t->which = Z_Triple_integer; t->value.integer = nmem_intdup(nmem, atoi(value)); } else { t->which = Z_Triple_internationalString; t->value.internationalString = nmem_strdup(nmem, value); } } return r; } static Z_Occurrences *read_occurrences(char *occ, NMEM nmem, const char *file, int lineno) { Z_Occurrences *op = (Z_Occurrences *)nmem_malloc(nmem, sizeof(*op)); char *p; if (!occ) { op->which = Z_Occurrences_values; op->u.values = (Z_OccurValues *) nmem_malloc(nmem, sizeof(Z_OccurValues)); op->u.values->start = nmem_intdup(nmem, 1); op->u.values->howMany = 0; } else if (!strcmp(occ, "all")) { op->which = Z_Occurrences_all; op->u.all = odr_nullval(); } else if (!strcmp(occ, "last")) { op->which = Z_Occurrences_last; op->u.all = odr_nullval(); } else { Z_OccurValues *ov = (Z_OccurValues *)nmem_malloc(nmem, sizeof(*ov)); if (!d1_isdigit(*occ)) { yaz_log(YLOG_WARN, "%s:%d: Bad occurrences-spec %s", file, lineno, occ); return 0; } op->which = Z_Occurrences_values; op->u.values = ov; ov->start = nmem_intdup(nmem, atoi(occ)); if ((p = strchr(occ, '+'))) ov->howMany = nmem_intdup(nmem, atoi(p + 1)); else ov->howMany = 0; } return op; } static Z_ETagUnit *read_tagunit(char *buf, NMEM nmem, const char *file, int lineno) { Z_ETagUnit *u = (Z_ETagUnit *)nmem_malloc(nmem, sizeof(*u)); int terms; int type; char value[512], occ[512]; if (*buf == '*') { u->which = Z_ETagUnit_wildPath; u->u.wildPath = odr_nullval(); } else if (*buf == '?') { u->which = Z_ETagUnit_wildThing; if (buf[1] == ':') u->u.wildThing = read_occurrences(buf+2, nmem, file, lineno); else u->u.wildThing = read_occurrences(0, nmem, file, lineno); } else if ((terms = sscanf(buf, "(%d,%511[^)]):%511[a-zA-Z0-9+]", &type, value, occ)) >= 2) { int numval; Z_SpecificTag *t; char *valp = value; int force_string = 0; if (*valp == '\'') { valp++; force_string = 1; if (*valp && valp[strlen(valp)-1] == '\'') *valp = '\0'; } u->which = Z_ETagUnit_specificTag; u->u.specificTag = t = (Z_SpecificTag *)nmem_malloc(nmem, sizeof(*t)); t->tagType = nmem_intdup(nmem, type); t->tagValue = (Z_StringOrNumeric *) nmem_malloc(nmem, sizeof(*t->tagValue)); if (!force_string && isdigit(*(unsigned char *)valp)) { numval = atoi(valp); t->tagValue->which = Z_StringOrNumeric_numeric; t->tagValue->u.numeric = nmem_intdup(nmem, numval); } else { t->tagValue->which = Z_StringOrNumeric_string; t->tagValue->u.string = nmem_strdup(nmem, valp); } if (terms > 2) /* an occurrences-spec exists */ t->occurrences = read_occurrences(occ, nmem, file, lineno); else t->occurrences = 0; } else if ((terms = sscanf(buf, "%511[^)]", value)) >= 1) { Z_SpecificTag *t; char *valp = value; u->which = Z_ETagUnit_specificTag; u->u.specificTag = t = (Z_SpecificTag *)nmem_malloc(nmem, sizeof(*t)); t->tagType = nmem_intdup(nmem, 3); t->tagValue = (Z_StringOrNumeric *) nmem_malloc(nmem, sizeof(*t->tagValue)); t->tagValue->which = Z_StringOrNumeric_string; t->tagValue->u.string = nmem_strdup(nmem, valp); t->occurrences = read_occurrences("all", nmem, file, lineno); } else { return 0; } return u; } /* * Read an element-set specification from a file. * NOTE: If !o, memory is allocated directly from the heap by nmem_malloc(). */ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) { FILE *f; NMEM nmem = data1_nmem_get (dh); int lineno = 0; int argc, size_esn = 0; char *argv[50], line[512]; Z_Espec1 *res = (Z_Espec1 *)nmem_malloc(nmem, sizeof(*res)); if (!(f = data1_path_fopen(dh, file, "r"))) return 0; res->num_elementSetNames = 0; res->elementSetNames = 0; res->defaultVariantSetId = 0; res->defaultVariantRequest = 0; res->defaultTagType = 0; res->num_elements = 0; res->elements = 0; while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) if (!strcmp(argv[0], "elementsetnames")) { int nnames = argc-1, i; if (!nnames) { yaz_log(YLOG_WARN, "%s:%d: Empty elementsetnames directive", file, lineno); continue; } res->elementSetNames = (char **)nmem_malloc(nmem, sizeof(char**)*nnames); for (i = 0; i < nnames; i++) { res->elementSetNames[i] = nmem_strdup(nmem, argv[i+1]); } res->num_elementSetNames = nnames; } else if (!strcmp(argv[0], "defaultvariantsetid")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s", file, lineno, argv[0]); continue; } if (!(res->defaultVariantSetId = odr_getoidbystr_nmem(nmem, argv[1]))) { yaz_log(YLOG_WARN, "%s:%d: Bad defaultvariantsetid", file, lineno); continue; } } else if (!strcmp(argv[0], "defaulttagtype")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s", file, lineno, argv[0]); continue; } res->defaultTagType = nmem_intdup(nmem, atoi(argv[1])); } else if (!strcmp(argv[0], "defaultvariantrequest")) { if (!(res->defaultVariantRequest = read_variant(argc-1, argv+1, nmem, file, lineno))) { yaz_log(YLOG_WARN, "%s:%d: Bad defaultvariantrequest", file, lineno); continue; } } else if (!strcmp(argv[0], "simpleelement")) { Z_ElementRequest *er; Z_SimpleElement *se; Z_ETagPath *tp; char *path = argv[1]; char *ep; int num, i = 0; if (!res->elements) res->elements = (Z_ElementRequest **) nmem_malloc(nmem, size_esn = 24*sizeof(er)); else if (res->num_elements >= (int) (size_esn/sizeof(er))) { Z_ElementRequest **oe = res->elements; size_esn *= 2; res->elements = (Z_ElementRequest **) nmem_malloc (nmem, size_esn*sizeof(er)); memcpy (res->elements, oe, size_esn/2); } if (argc < 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s", file, lineno, argv[0]); continue; } res->elements[res->num_elements++] = er = (Z_ElementRequest *)nmem_malloc(nmem, sizeof(*er)); er->which = Z_ERequest_simpleElement; er->u.simpleElement = se = (Z_SimpleElement *) nmem_malloc(nmem, sizeof(*se)); se->variantRequest = 0; se->path = tp = (Z_ETagPath *)nmem_malloc(nmem, sizeof(*tp)); tp->num_tags = 0; /* * Parse the element selector. */ for (num = 1, ep = path; (ep = strchr(ep, '/')); num++, ep++) ; tp->tags = (Z_ETagUnit **) nmem_malloc(nmem, sizeof(Z_ETagUnit*)*num); for ((ep = strchr(path, '/')) ; path ; (void)((path = ep) && (ep = strchr(path, '/')))) { Z_ETagUnit *tagunit; if (ep) ep++; assert(itags[tp->num_tags++] = tagunit; } if (argc > 2 && !strcmp(argv[2], "variant")) se->variantRequest= read_variant(argc-3, argv+3, nmem, file, lineno); } else yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, argv[0]); fclose (f); return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_attset.c0000664000175000017500000001231214754717556014716 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include data1_att *data1_getattbyname(data1_handle dh, data1_attset *s, const char *name) { data1_att *r; data1_attset_child *c; /* scan local set */ for (r = s->atts; r; r = r->next) if (!data1_matchstr(r->name, name)) return r; for (c = s->children; c; c = c->next) { assert (c->child); /* scan included sets */ if ((r = data1_getattbyname(dh, c->child, name))) return r; } return 0; } data1_attset *data1_empty_attset(data1_handle dh) { NMEM mem = data1_nmem_get(dh); data1_attset *res = (data1_attset*) nmem_malloc(mem,sizeof(*res)); res->name = 0; res->oid = 0; res->atts = 0; res->children = 0; res->next = 0; return res; } data1_attset *data1_read_attset(data1_handle dh, const char *file) { data1_attset *res = 0; data1_attset_child **childp; data1_att **attp; FILE *f; NMEM mem = data1_nmem_get(dh); int lineno = 0; int argc; char *argv[50], line[512]; if (!(f = data1_path_fopen(dh, file, "r"))) return NULL; res = data1_empty_attset(dh); childp = &res->children; attp = &res->atts; while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) { char *cmd = argv[0]; if (!strcmp(cmd, "att")) { int num; char *name; char *endptr; data1_att *t; if (argc < 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to att", file, lineno); continue; } if (argc > 3) { yaz_log(YLOG_WARN, "%s:%d: Local attributes not supported", file, lineno); } num = strtol(argv[1], &endptr, 10); if (*endptr != '\0') { yaz_log(YLOG_WARN, "%s:%d: Bad attribute integer %s", file, lineno, argv[1]); continue; } name = argv[2]; t = *attp = (data1_att *)nmem_malloc(mem, sizeof(*t)); t->parent = res; t->name = nmem_strdup(mem, name); t->value = num; t->next = 0; attp = &t->next; } else if (!strcmp(cmd, "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to name", file, lineno); continue; } } else if (!strcmp(cmd, "reference")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to reference", file, lineno); continue; } name = argv[1]; res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_ATTSET, name, mem); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown reference oid '%s'", file, lineno, name); fclose(f); return 0; } } else if (!strcmp(cmd, "ordinal")) { yaz_log (YLOG_WARN, "%s:%d: Directive ordinal ignored", file, lineno); } else if (!strcmp(cmd, "include")) { char *name; data1_attset *attset; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to include", file, lineno); continue; } name = argv[1]; if (!(attset = data1_get_attset(dh, name))) { yaz_log(YLOG_WARN, "%s:%d: Include of attset %s failed", file, lineno, name); continue; } *childp = (data1_attset_child *) nmem_malloc(mem, sizeof(**childp)); (*childp)->child = attset; (*childp)->next = 0; childp = &(*childp)->next; } else { yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); } } fclose(f); return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_varset.c0000664000175000017500000001200014754717556014710 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include data1_vartype *data1_getvartypebyct (data1_handle dh, data1_varset *set, const char *zclass, const char *type) { data1_varclass *c; data1_vartype *t; for (c = set->classes; c; c = c->next) if (!data1_matchstr(c->name, zclass)) { for (t = c->types; t; t = t->next) if (!data1_matchstr(t->name, type)) return t; yaz_log(YLOG_WARN, "Unknown variant type %s in class %s", type, zclass); return 0; } yaz_log(YLOG_WARN, "Unknown variant class %s", zclass); return 0; } data1_vartype *data1_getvartypeby_absyn (data1_handle dh, data1_absyn *absyn, char *zclass, char *type) { return data1_getvartypebyct(dh, absyn->varset, zclass, type); } data1_varset *data1_read_varset (data1_handle dh, const char *file) { NMEM mem = data1_nmem_get (dh); data1_varset *res = (data1_varset *)nmem_malloc(mem, sizeof(*res)); data1_varclass **classp = &res->classes, *zclass = 0; data1_vartype **typep = 0; FILE *f; int lineno = 0; int argc; char *argv[50],line[512]; res->name = 0; res->oid = 0; res->classes = 0; if (!(f = data1_path_fopen(dh, file, "r"))) { yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file); return 0; } while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) if (!strcmp(argv[0], "class")) { data1_varclass *r; if (argc != 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # or args to class", file, lineno); continue; } *classp = r = zclass = (data1_varclass *) nmem_malloc(mem, sizeof(*r)); r->set = res; r->zclass = atoi(argv[1]); r->name = nmem_strdup(mem, argv[2]); r->types = 0; typep = &r->types; r->next = 0; classp = &r->next; } else if (!strcmp(argv[0], "type")) { data1_vartype *r; if (!typep) { yaz_log(YLOG_WARN, "%s:%d: Directive class must precede type", file, lineno); continue; } if (argc != 4) { yaz_log(YLOG_WARN, "%s:%d: Bad # or args to type", file, lineno); continue; } *typep = r = (data1_vartype *)nmem_malloc(mem, sizeof(*r)); r->name = nmem_strdup(mem, argv[2]); r->zclass = zclass; r->type = atoi(argv[1]); if (!(r->datatype = data1_maptype (dh, argv[3]))) { yaz_log(YLOG_WARN, "%s:%d: Unknown datatype '%s'", file, lineno, argv[3]); fclose(f); return 0; } r->next = 0; typep = &r->next; } else if (!strcmp(argv[0], "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args for name", file, lineno); continue; } res->name = nmem_strdup(mem, argv[1]); } else if (!strcmp(argv[0], "reference")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # args for reference", file, lineno); continue; } res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_VARSET, argv[1], mem); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown reference '%s'", file, lineno, argv[1]); continue; } } else yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, argv[0]); fclose(f); return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_marc.c0000664000175000017500000003402014754717556014334 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* converts data1 tree to ISO2709/MARC record */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include data1_marctab *data1_read_marctab(data1_handle dh, const char *file) { FILE *f; NMEM mem = data1_nmem_get (dh); data1_marctab *res = (data1_marctab *)nmem_malloc(mem, sizeof(*res)); char line[512], *argv[50]; int lineno = 0; int argc; if (!(f = data1_path_fopen(dh, file, "r"))) return 0; res->name = 0; res->oid = 0; res->next = 0; res->length_data_entry = 4; res->length_starting = 5; res->length_implementation = 0; strcpy(res->future_use, "4"); strcpy(res->record_status, "n"); strcpy(res->implementation_codes, " "); res->indicator_length = 2; res->identifier_length = 2; res->force_indicator_length = -1; res->force_identifier_length = -1; strcpy(res->user_systems, "z "); while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) if (!strcmp(*argv, "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d:Missing arg for %s", file, lineno, *argv); continue; } res->name = nmem_strdup(mem, argv[1]); } else if (!strcmp(*argv, "reference")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_TAGSET, argv[1], mem); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown tagset reference '%s'", file, lineno, argv[1]); continue; } } else if (!strcmp(*argv, "length-data-entry")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->length_data_entry = atoi(argv[1]); } else if (!strcmp(*argv, "length-starting")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->length_starting = atoi(argv[1]); } else if (!strcmp(*argv, "length-implementation")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->length_implementation = atoi(argv[1]); } else if (!strcmp(*argv, "future-use")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->future_use[0] = argv[1][0]; /* use[1] already \0 */ } else if (!strcmp(*argv, "force-indicator-length")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->force_indicator_length = atoi(argv[1]); } else if (!strcmp(*argv, "force-identifier-length")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } res->force_identifier_length = atoi(argv[1]); } else if (!strcmp(*argv, "implementation-codes")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, *argv); continue; } /* up to 4 characters .. space pad */ if (strlen(argv[1]) > 4) yaz_log(YLOG_WARN, "%s:%d: Max 4 characters for " "implementation-codes", file, lineno); else memcpy(res->implementation_codes, argv[1], strlen(argv[1])); } else yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, *argv); fclose(f); return res; } static void get_data2(data1_node *n, int *len, char *dst, size_t max) { *len = 0; while (n) { if (n->which == DATA1N_data) { if (dst && *len < max) { size_t copy_len = max - *len; if (copy_len > n->u.data.len) copy_len = n->u.data.len; memcpy(dst + *len, n->u.data.data, copy_len); } *len += n->u.data.len; } if (n->which == DATA1N_tag && *len == 0) n = n->child; else if (n->which == DATA1N_data) n = n->next; else break; } } static void memint(char *p, int val, int len) { char buf[10]; if (len == 1) *p = val + '0'; else { yaz_snprintf(buf, sizeof(buf), "%08d", val); memcpy(p, buf+8-len, len); } } /* check for indicator. non MARCXML only */ static int is_indicator(data1_marctab *p, data1_node *subf) { if (p->indicator_length != 2 || (subf && subf->which == DATA1N_tag && strlen(subf->u.tag.tag) == 2)) return 1; return 0; } static int nodetomarc(data1_handle dh, data1_marctab *p, data1_node *n, int selected, char **buf, int *size) { char leader[24]; int len = 26; int dlen; int base_address = 25; int entry_p, data_p; char *op; data1_node *field, *subf; #if 0 data1_pr_tree(dh, n, stdout); #endif yaz_log(YLOG_DEBUG, "nodetomarc"); memcpy(leader+5, p->record_status, 1); memcpy(leader+6, p->implementation_codes, 4); memint(leader+10, p->indicator_length, 1); memint(leader+11, p->identifier_length, 1); memcpy(leader+17, p->user_systems, 3); memint(leader+20, p->length_data_entry, 1); memint(leader+21, p->length_starting, 1); memint(leader+22, p->length_implementation, 1); memcpy(leader+23, p->future_use, 1); for (field = n->child; field; field = field->next) { int control_field = 0; /* 00X fields - usually! */ int marc_xml = 0; if (field->which != DATA1N_tag) continue; if (selected && !field->u.tag.node_selected) continue; subf = field->child; if (!subf) continue; if (!yaz_matchstr(field->u.tag.tag, "mc?")) continue; else if (!strcmp(field->u.tag.tag, "leader")) { int dlen = 0; get_data2(subf, &dlen, leader, 24); continue; } else if (!strcmp(field->u.tag.tag, "controlfield")) { control_field = 1; marc_xml = 1; } else if (!strcmp(field->u.tag.tag, "datafield")) { control_field = 0; marc_xml = 1; } else if (subf->which == DATA1N_data) { control_field = 1; marc_xml = 0; } else { control_field = 0; marc_xml = 0; } len += 4 + p->length_data_entry + p->length_starting + p->length_implementation; base_address += 3 + p->length_data_entry + p->length_starting + p->length_implementation; if (!control_field) len += p->indicator_length; /* we'll allow no indicator if length is not 2 */ /* select when old XML format, since indicator is an element */ if (marc_xml == 0 && is_indicator (p, subf)) subf = subf->child; for (; subf; subf = subf->next) { if (!control_field) { if (marc_xml && subf->which != DATA1N_tag) continue; /* we skip comments, cdata .. */ len += p->identifier_length; } get_data2(subf, &dlen, 0, 0); len += dlen; } } if (!*buf) *buf = (char *)xmalloc(*size = len); else if (*size <= len) *buf = (char *)xrealloc(*buf, *size = len); op = *buf; /* we know the base address now */ memint(leader+12, base_address, 5); /* copy temp leader to real output buf op */ memcpy(op, leader, 24); memint(op, len, 5); entry_p = 24; data_p = base_address; for (field = n->child; field; field = field->next) { int control_field = 0; int marc_xml = 0; const char *tag = 0; int data_0 = data_p; char indicator_data[6]; memset(indicator_data, ' ', sizeof(indicator_data) - 1); indicator_data[sizeof(indicator_data)-1] = '\0'; if (field->which != DATA1N_tag) continue; if (selected && !field->u.tag.node_selected) continue; subf = field->child; if (!subf) continue; if (!yaz_matchstr(field->u.tag.tag, "mc?")) continue; else if (!strcmp(field->u.tag.tag, "leader")) continue; else if (!strcmp(field->u.tag.tag, "controlfield")) { control_field = 1; marc_xml = 1; } else if (!strcmp(field->u.tag.tag, "datafield")) { control_field = 0; marc_xml = 1; } else if (subf->which == DATA1N_data) { control_field = 1; marc_xml = 0; } else { control_field = 0; marc_xml = 0; } if (marc_xml == 0 && is_indicator(p, subf)) { if (strlen(subf->u.tag.tag) < sizeof(indicator_data)) strcpy(indicator_data, subf->u.tag.tag); subf = subf->child; } else if (marc_xml == 1 && !control_field) { data1_xattr *xa; for (xa = field->u.tag.attributes; xa; xa = xa->next) { if (!strcmp(xa->name, "ind1")) indicator_data[0] = xa->value[0]; if (!strcmp(xa->name, "ind2")) indicator_data[1] = xa->value[0]; if (!strcmp(xa->name, "ind3")) indicator_data[2] = xa->value[0]; } } if (!control_field) { memcpy(op + data_p, indicator_data, p->indicator_length); data_p += p->indicator_length; } for (; subf; subf = subf->next) { if (!control_field) { const char *identifier = "a"; if (marc_xml) { data1_xattr *xa; if (subf->which != DATA1N_tag) continue; if (strcmp(subf->u.tag.tag, "subfield")) yaz_log(YLOG_WARN, "Unhandled tag %s", subf->u.tag.tag); for (xa = subf->u.tag.attributes; xa; xa = xa->next) if (!strcmp(xa->name, "code")) identifier = xa->value; } else if (subf->which != DATA1N_tag) yaz_log(YLOG_WARN, "Malformed fields for marc output."); else identifier = subf->u.tag.tag; op[data_p] = ISO2709_IDFS; memcpy(op + data_p+1, identifier, p->identifier_length-1); data_p += p->identifier_length; } get_data2(subf, &dlen, op + data_p, 100000); data_p += dlen; } op[data_p++] = ISO2709_FS; if (marc_xml) { data1_xattr *xa; for (xa = field->u.tag.attributes; xa; xa = xa->next) if (!strcmp(xa->name, "tag")) tag = xa->value; } else tag = field->u.tag.tag; if (!tag || strlen(tag) != 3) tag = "000"; memcpy(op + entry_p, tag, 3); entry_p += 3; memint(op + entry_p, data_p - data_0, p->length_data_entry); entry_p += p->length_data_entry; memint(op + entry_p, data_0 - base_address, p->length_starting); entry_p += p->length_starting; entry_p += p->length_implementation; } op[entry_p++] = ISO2709_FS; assert (entry_p == base_address); op[data_p++] = ISO2709_RS; assert (data_p == len); return len; } char *data1_nodetomarc(data1_handle dh, data1_marctab *p, data1_node *n, int selected, int *len) { int *size; char **buf = data1_get_map_buf(dh, &size); n = data1_get_root_tag(dh, n); if (!n) return 0; *len = nodetomarc(dh, p, n, selected, buf, size); return *buf; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_soif.c0000664000175000017500000000513514754717556014357 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This module generates SOIF (Simple Object Interchange Format) records * from d1-nodes. nested elements are flattened out, depth first, by * concatenating the tag names at each level. */ #if HAVE_CONFIG_H #include #endif #include #include #include static int nodetoelement(data1_node *n, int select, const char *prefix, WRBUF b) { data1_node *c; char tmp[1024]; for (c = n->child; c; c = c->next) { char *tag; if (c->which == DATA1N_tag) { if (select && !c->u.tag.node_selected) continue; if (c->u.tag.element && c->u.tag.element->tag) tag = c->u.tag.element->tag->names->name; /* first name */ else tag = c->u.tag.tag; /* local string tag */ if (prefix) yaz_snprintf(tmp, sizeof(tmp), "%s-%s", prefix, tag); else yaz_snprintf(tmp, sizeof(tmp), "%s", tag); if (nodetoelement(c, select, tmp, b) < 0) return 0; } else if (c->which == DATA1N_data) { char *p = c->u.data.data; int l = c->u.data.len; wrbuf_puts(b, prefix); wrbuf_printf(b, "{%d}:\t", l); wrbuf_write(b, p, l); wrbuf_putc(b, '\n'); } } return 0; } char *data1_nodetosoif(data1_handle dh, data1_node *n, int select, int *len) { WRBUF b = data1_get_wrbuf(dh); wrbuf_rewind(b); if (n->which != DATA1N_root) return 0; wrbuf_printf(b, "@%s{\n", n->u.root.type); if (nodetoelement(n, select, 0, b)) return 0; wrbuf_puts(b, "}\n"); *len = wrbuf_len(b); return wrbuf_buf(b); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_absyn.c0000664000175000017500000010361414754717556014534 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #define D1_MAX_NESTING 128 struct data1_hash_table { NMEM nmem; int size; struct data1_hash_entry **ar; }; struct data1_hash_entry { void *clientData; char *str; struct data1_hash_entry *next; }; unsigned data1_hash_calc(struct data1_hash_table *ht, const char *str) { unsigned v = 0; assert(str); while (*str) { if (*str >= 'a' && *str <= 'z') v = v*65509 + *str -'a'+10; else if (*str >= 'A' && *str <= 'Z') v = v*65509 + *str -'A'+10; else if (*str >= '0' && *str <= '9') v = v*65509 + *str -'0'; str++; } return v % ht->size; } struct data1_hash_table *data1_hash_open(int size, NMEM nmem) { int i; struct data1_hash_table *ht = nmem_malloc(nmem, sizeof(*ht)); ht->nmem = nmem; ht->size = size; if (ht->size <= 0) ht->size = 29; ht->ar = nmem_malloc(nmem, sizeof(*ht->ar) * ht->size); for (i = 0; isize; i++) ht->ar[i] = 0; return ht; } void data1_hash_insert(struct data1_hash_table *ht, const char *str, void *clientData, int copy) { char *dstr = copy ? nmem_strdup(ht->nmem, str) : (char*) str; if (strchr(str, '?') || strchr(str, '.')) { int i; for (i = 0; isize; i++) { struct data1_hash_entry **he = &ht->ar[i]; for (; *he && strcmp(str, (*he)->str); he = &(*he)->next) ; if (!*he) { *he = nmem_malloc(ht->nmem, sizeof(**he)); (*he)->str = dstr; (*he)->next = 0; } (*he)->clientData = clientData; } } else { struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)]; for (; *he && strcmp(str, (*he)->str); he = &(*he)->next) ; if (!*he) { *he = nmem_malloc(ht->nmem, sizeof(**he)); (*he)->str = dstr; (*he)->next = 0; } (*he)->clientData = clientData; } } void *data1_hash_lookup(struct data1_hash_table *ht, const char *str) { struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)]; for (; *he && yaz_matchstr(str, (*he)->str); he = &(*he)->next) ; if (*he) return (*he)->clientData; return 0; } struct data1_systag { char *name; char *value; struct data1_systag *next; }; struct data1_absyn_cache_info { char *name; data1_absyn *absyn; data1_absyn_cache next; }; struct data1_attset_cache_info { char *name; data1_attset *attset; data1_attset_cache next; }; data1_element *data1_mk_element(data1_handle dh) { data1_element *e = nmem_malloc(data1_nmem_get(dh), sizeof(*e)); e->name = 0; e->tag = 0; e->termlists = 0; e->next = e->children = 0; e->sub_name = 0; e->hash = 0; return e; } data1_absyn *data1_absyn_search(data1_handle dh, const char *name) { data1_absyn_cache p = *data1_absyn_cache_get(dh); while (p) { if (!yaz_matchstr(name, p->name)) return p->absyn; p = p->next; } return 0; } /* *ostrich* We need to destroy DFAs, in xp_element (xelm) definitions pop, 2002-12-13 */ void data1_absyn_destroy(data1_handle dh) { data1_absyn_cache p = *data1_absyn_cache_get(dh); while (p) { data1_absyn *abs = p->absyn; if (abs) { data1_xpelement *xpe = abs->xp_elements; while (xpe) { yaz_log (YLOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr); if (xpe->dfa) dfa_delete (&xpe->dfa); xpe = xpe->next; } } p = p->next; } } void data1_absyn_trav(data1_handle dh, void *handle, void (*fh)(data1_handle dh, void *h, data1_absyn *a)) { data1_absyn_cache p = *data1_absyn_cache_get(dh); while (p) { (*fh)(dh, handle, p->absyn); p = p->next; } } static data1_absyn *data1_read_absyn(data1_handle dh, const char *file, enum DATA1_XPATH_INDEXING en); static data1_absyn *data1_absyn_add(data1_handle dh, const char *name, enum DATA1_XPATH_INDEXING en) { char fname[512]; NMEM mem = data1_nmem_get(dh); data1_absyn_cache p = (data1_absyn_cache)nmem_malloc(mem, sizeof(*p)); data1_absyn_cache *pp = data1_absyn_cache_get(dh); yaz_snprintf(fname, sizeof(fname), "%s.abs", name); p->absyn = data1_read_absyn(dh, fname, en); p->name = nmem_strdup(mem, name); p->next = *pp; *pp = p; return p->absyn; } data1_absyn *data1_get_absyn(data1_handle dh, const char *name, enum DATA1_XPATH_INDEXING en) { data1_absyn *absyn; if (!(absyn = data1_absyn_search(dh, name))) absyn = data1_absyn_add(dh, name, en); return absyn; } data1_attset *data1_attset_search_name(data1_handle dh, const char *name) { data1_attset_cache p = *data1_attset_cache_get(dh); while (p) { if (!yaz_matchstr(name, p->name)) return p->attset; p = p->next; } return 0; } data1_attset *data1_attset_search_id(data1_handle dh, const Odr_oid *oid) { data1_attset_cache p = *data1_attset_cache_get(dh); while (p) { if (p->attset->oid && !oid_oidcmp(oid, p->attset->oid)) return p->attset; p = p->next; } return 0; } data1_attset *data1_attset_add(data1_handle dh, const char *name) { NMEM mem = data1_nmem_get(dh); data1_attset *attset; attset = data1_read_attset(dh, name); if (!attset) yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't load attribute set %s", name); else { data1_attset_cache p = (data1_attset_cache) nmem_malloc (mem, sizeof(*p)); data1_attset_cache *pp = data1_attset_cache_get(dh); attset->name = p->name = nmem_strdup(mem, name); p->attset = attset; p->next = *pp; *pp = p; } return attset; } data1_attset *data1_get_attset(data1_handle dh, const char *name) { data1_attset *attset; if (!(attset = data1_attset_search_name(dh, name))) attset = data1_attset_add(dh, name); return attset; } data1_esetname *data1_getesetbyname(data1_handle dh, data1_absyn *a, const char *name) { data1_esetname *r; for (r = a->esetnames; r; r = r->next) if (!data1_matchstr(r->name, name)) return r; return 0; } /* we have multiple versions of data1_getelementbyname */ #define DATA1_GETELEMENTBYTAGNAME_VERSION 1 data1_element *data1_getelementbytagname(data1_handle dh, data1_absyn *abs, data1_element *parent, const char *tagname) { data1_element *r; struct data1_hash_table *ht; /* It's now possible to have a data1 tree with no abstract syntax */ if (abs == 0) return 0; if (!parent) r = abs->main_elements; else r = parent->children; #if DATA1_GETELEMENTBYTAGNAME_VERSION==1 /* using hash search */ if (!r) return 0; ht = r->hash; if (!ht) { /* build hash table (the first time) */ ht = r->hash = data1_hash_open(29, data1_nmem_get(dh)); for (; r; r = r->next) { data1_name *n; for (n = r->tag->names; n; n = n->next) data1_hash_insert(ht, n->name, r, 0); } } return data1_hash_lookup(ht, tagname); #else /* using linear search */ for (; r; r = r->next) { data1_name *n; for (n = r->tag->names; n; n = n->next) if (!data1_matchstr(tagname, n->name)) return r; } return 0; #endif } data1_element *data1_getelementbyname(data1_handle dh, data1_absyn *absyn, const char *name) { data1_element *r; /* It's now possible to have a data1 tree with no abstract syntax */ if (absyn == 0) return 0; for (r = absyn->main_elements; r; r = r->next) if (!data1_matchstr(r->name, name)) return r; return 0; } void fix_element_ref(data1_handle dh, data1_absyn *absyn, data1_element *e) { /* It's now possible to have a data1 tree with no abstract syntax */ if (absyn == 0) return; for (; e; e = e->next) { if (!e->sub_name) { if (e->children) fix_element_ref(dh, absyn, e->children); } else { data1_sub_elements *sub_e = absyn->sub_elements; while (sub_e && strcmp(e->sub_name, sub_e->name)) sub_e = sub_e->next; if (sub_e) e->children = sub_e->elements; else yaz_log(YLOG_WARN, "Unresolved reference to sub-elements %s", e->sub_name); } } } /* *ostrich* New function, a bit dummy now... I've seen it in zrpn.c... We should build more clever regexps... //a -> ^a/.*$ //a/b -> ^b/a/.*$ /a -> ^a/$ /a/b -> ^b/a/$ / -> none pop, 2002-12-13 Now [] predicates are supported pop, 2003-01-17 */ static const char * mk_xpath_regexp(data1_handle dh, const char *expr) { const char *p = expr; int abs = 1; int e = 0; char *stack[32]; char *res_p, *res = 0; size_t res_size = 1; if (*p != '/') return (""); p++; if (*p == '/') { abs = 0; p++; } while (*p && e < 30) { int is_predicate = 0; char *s; int i, j; for (i = 0; *p && !strchr("/",*p); i++, p++) ; res_size += (i+3); /* we'll add / between later .. */ s = stack[e] = (char *) nmem_malloc(data1_nmem_get(dh), i + 1); for (j = 0; j < i; j++) { const char *pp = p-i+j; if (*pp == '[') is_predicate = 1; else if (*pp == ']') is_predicate = 0; else { if (!is_predicate) { if (*pp == '*') *s++ = '.'; *s++ = *pp; } } } *s = 0; e++; if (*p) p++; } res_p = res = nmem_malloc(data1_nmem_get(dh), res_size + 10); if (stack[e-1][0] == '@') /* path/@attr spec (leaf is attribute) */ strcpy(res_p, "/"); else strcpy(res_p, "[^@]*/"); /* path .. (index all cdata below it) */ res_p = res_p + strlen(res_p); while (--e >= 0) { strcpy(res_p, stack[e]); strcat(res_p, "/"); res_p += strlen(stack[e]) + 1; } if (!abs) { strcpy(res_p, ".*"); res_p += 2; } strcpy(res_p, "$"); res_p++; yaz_log(YLOG_DEBUG, "Got regexp: %s", res); return res; } static int parse_termlists(data1_handle dh, data1_termlist ***tpp, char *cp, const char *file, int lineno, const char *element_name, data1_absyn *res, int xpelement, data1_attset *attset) { data1_termlist **tp = *tpp; while(1) { char attname[512], structure[512]; char *source; int r, i; int level = 0; structure[0] = '\0'; for (i = 0; cp[i] && inext = 0; if (*attname == '!') { if (!xpelement && element_name) strcpy(attname, element_name); else if (xpelement) strcpy(attname, ZEBRA_XPATH_CDATA); } if (attset) { if (!data1_getattbyname(dh, attset, attname)) { yaz_log(YLOG_WARN, "Index '%s' not found in attset(s)", attname); } } (*tp)->index_name = nmem_strdup(data1_nmem_get(dh), attname); assert (*(*tp)->index_name != '!'); if (r == 2 && (source = strchr(structure, ':'))) *source++ = '\0'; /* cut off structure .. */ else source = "data"; /* ok: default is leaf data */ (*tp)->source = nmem_strdup(data1_nmem_get (dh), source); if (r < 2) /* is the structure qualified? */ (*tp)->structure = "w"; else (*tp)->structure = nmem_strdup(data1_nmem_get (dh), structure); tp = &(*tp)->next; } *tpp = tp; return 0; } /* quinn * Converts a 'melm' field[$subfield] pattern to a simple xpath */ static int melm2xpath(char *melm, char *buf) { char *dollar; char *field = melm; char *subfield; char *fieldtype; if ((dollar = strchr(melm, '$'))) { *dollar = '\0'; subfield = ++dollar; } else subfield = ""; if (field[0] == '0' && field[1] == '0') fieldtype = "controlfield"; else fieldtype = "datafield"; yaz_snprintf(buf, 60, "/*/%s[@tag=\"%s\"]", fieldtype, field); if (*subfield) yaz_snprintf(buf + strlen(buf), 60, "/subfield[@code=\"%s\"]", subfield); else if (field[0] != '0' || field[1] != '0') strcat(buf, "/subfield"); yaz_log(YLOG_DEBUG, "Created xpath: '%s'", buf); return 0; } const char *data1_systag_lookup(data1_absyn *absyn, const char *tag, const char *default_value) { struct data1_systag *p = absyn->systags; for (; p; p = p->next) if (!strcmp(p->name, tag)) return p->value; return default_value; } #define l_isspace(c) ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r') int read_absyn_line(FILE *f, int *lineno, char *line, int len, char *argv[], int num) { char *p; int argc; int quoted = 0; while ((p = fgets(line, len, f))) { (*lineno)++; while (*p && l_isspace(*p)) p++; if (*p && *p != '#') break; } if (!p) return 0; for (argc = 0; *p ; argc++) { if (*p == '#') /* trailing comment */ break; argv[argc] = p; while (*p && !(l_isspace(*p) && !quoted)) { if (*p =='"') quoted = 1 - quoted; if (*p =='[') quoted = 1; if (*p ==']') quoted = 0; p++; } if (*p) { *(p++) = '\0'; while (*p && l_isspace(*p)) p++; } } return argc; } data1_marctab *data1_absyn_getmarctab(data1_handle dh, data1_node *root) { if (root->u.root.absyn) return root->u.root.absyn->marc; return 0; } data1_element *data1_absyn_getelements(data1_handle dh, data1_node *root) { if (root->u.root.absyn) return root->u.root.absyn->main_elements; return 0; } static data1_absyn *data1_read_absyn(data1_handle dh, const char *file, enum DATA1_XPATH_INDEXING default_xpath) { data1_sub_elements *cur_elements = NULL; data1_xpelement **cur_xpelement = NULL; data1_attset *attset_list = data1_empty_attset(dh); data1_attset_child **attset_childp = &attset_list->children; data1_absyn *res = 0; FILE *f; data1_element **ppl[D1_MAX_NESTING]; data1_esetname **esetpp; data1_maptab **maptabp; data1_marctab **marcp; data1_termlist *all = 0; data1_tagset **tagset_childp; struct data1_systag **systagsp; int level = 0; int lineno = 0; int argc; char *argv[50], line[512]; f = data1_path_fopen(dh, file, "r"); res = (data1_absyn *) nmem_malloc(data1_nmem_get(dh), sizeof(*res)); res->name = 0; res->oid = 0; res->tagset = 0; res->encoding = 0; res->xpath_indexing = (f ? DATA1_XPATH_INDEXING_DISABLE : default_xpath); res->systags = 0; systagsp = &res->systags; tagset_childp = &res->tagset; res->varset = 0; res->esetnames = 0; esetpp = &res->esetnames; res->maptabs = 0; maptabp = &res->maptabs; res->marc = 0; marcp = &res->marc; res->sub_elements = NULL; res->main_elements = NULL; res->xp_elements = NULL; cur_xpelement = &res->xp_elements; while (f && (argc = read_absyn_line(f, &lineno, line, 512, argv, 50))) { char *cmd = *argv; if (!strcmp(cmd, "elm") || !strcmp(cmd, "element")) { data1_element *new_element; int i; char *p, *sub_p, *path, *name, *termlists; int type, value; data1_termlist **tp; if (argc < 4) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to elm", file, lineno); continue; } path = argv[1]; name = argv[2]; termlists = argv[3]; if (!cur_elements) { cur_elements = (data1_sub_elements *) nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements)); cur_elements->next = res->sub_elements; cur_elements->elements = NULL; cur_elements->name = "main"; res->sub_elements = cur_elements; level = 0; ppl[level] = &cur_elements->elements; } p = path; for (i = 1;; i++) { char *e; if ((e = strchr(p, '/'))) p = e+1; else break; } if (i > level+1) { yaz_log(YLOG_WARN, "%s:%d: Bad level increase", file, lineno); fclose(f); return 0; } level = i; new_element = *ppl[level-1] = data1_mk_element(dh); tp = &new_element->termlists; ppl[level-1] = &new_element->next; ppl[level] = &new_element->children; /* consider subtree (if any) ... */ if ((sub_p = strchr (p, ':')) && sub_p[1]) { *sub_p++ = '\0'; new_element->sub_name = nmem_strdup (data1_nmem_get(dh), sub_p); } /* well-defined tag */ if (sscanf(p, "(%d,%d)", &type, &value) == 2) { if (!res->tagset) { yaz_log(YLOG_WARN, "%s:%d: No tagset loaded", file, lineno); fclose(f); return 0; } if (!(new_element->tag = data1_gettagbynum(dh, res->tagset, type, value))) { yaz_log(YLOG_WARN, "%s:%d: Couldn't find tag %s in tagset", file, lineno, p); fclose(f); return 0; } } /* private tag */ else if (*p) { data1_tag *nt = new_element->tag = (data1_tag *) nmem_malloc(data1_nmem_get (dh), sizeof(*new_element->tag)); nt->which = DATA1T_string; nt->value.string = nmem_strdup(data1_nmem_get(dh), p); nt->names = (data1_name *) nmem_malloc(data1_nmem_get(dh), sizeof(*new_element->tag->names)); nt->names->name = nt->value.string; nt->names->next = 0; nt->kind = DATA1K_string; nt->next = 0; nt->tagset = 0; } else { yaz_log(YLOG_WARN, "%s:%d: Bad element", file, lineno); fclose(f); return 0; } /* parse termList definitions */ p = termlists; if (*p != '-') { if (parse_termlists(dh, &tp, p, file, lineno, name, res, 0, attset_list)) { fclose (f); return 0; } *tp = all; /* append any ALL entries to the list */ } new_element->name = nmem_strdup(data1_nmem_get(dh), name); } /* *ostrich* New code to support xelm directive for each xelm a dfa is built. xelms are stored in res->xp_elements maybe we should use a simple sscanf instead of dfa? pop, 2002-12-13 Now [] predicates are supported. regexps and xpath structure is a bit redundant, however it's comfortable later... pop, 2003-01-17 */ else if (!strcmp(cmd, "xelm") || !strcmp(cmd, "melm")) { int i; char *p, *xpath_expr, *termlists; const char *regexp; struct DFA *dfa = 0; data1_termlist **tp; char melm_xpath[128]; data1_xpelement *xp_ele = 0; data1_xpelement *last_match = 0; if (argc != 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to %s", file, lineno, cmd); continue; } if (!strcmp(cmd, "melm")) { if (melm2xpath(argv[1], melm_xpath) < 0) continue; xpath_expr = melm_xpath; } else { xpath_expr = argv[1]; } termlists = argv[2]; regexp = mk_xpath_regexp(dh, xpath_expr); #if OPTIMIZE_MELM /* get last of existing regulars with same regexp */ for (xp_ele = res->xp_elements; xp_ele; xp_ele = xp_ele->next) if (!strcmp(xp_ele->regexp, regexp)) last_match = xp_ele; #endif if (!last_match) { /* new regular expression . Parse + generate */ const char *regexp_ptr = regexp; dfa = dfa_init(); i = dfa_parse (dfa, ®exp_ptr); if (i || *regexp_ptr) { yaz_log(YLOG_WARN, "%s:%d: Bad xpath to xelm", file, lineno); dfa_delete (&dfa); continue; } } *cur_xpelement = (data1_xpelement *) nmem_malloc(data1_nmem_get(dh), sizeof(**cur_xpelement)); (*cur_xpelement)->next = 0; (*cur_xpelement)->match_next = 0; if (last_match) last_match->match_next = *cur_xpelement; #if OPTIMIZE_MELM (*cur_xpelement)->regexp = regexp; #endif (*cur_xpelement)->xpath_expr = nmem_strdup(data1_nmem_get (dh), xpath_expr); if (dfa) dfa_mkstate (dfa); (*cur_xpelement)->dfa = dfa; #ifdef ENHANCED_XELM (*cur_xpelement)->xpath_len = zebra_parse_xpath_str( xpath_expr, (*cur_xpelement)->xpath, XPATH_STEP_COUNT, data1_nmem_get(dh)); #endif (*cur_xpelement)->termlists = 0; tp = &(*cur_xpelement)->termlists; /* parse termList definitions */ p = termlists; if (*p != '-') { if (parse_termlists(dh, &tp, p, file, lineno, xpath_expr, res, 1, attset_list)) { fclose (f); return 0; } *tp = all; /* append any ALL entries to the list */ } cur_xpelement = &(*cur_xpelement)->next; } else if (!strcmp(cmd, "section")) { char *name; if (argc < 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to section", file, lineno); continue; } name = argv[1]; cur_elements = (data1_sub_elements *) nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements)); cur_elements->next = res->sub_elements; cur_elements->elements = NULL; cur_elements->name = nmem_strdup(data1_nmem_get(dh), name); res->sub_elements = cur_elements; level = 0; ppl[level] = &cur_elements->elements; } else if (!strcmp(cmd, "xpath")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'xpath' directive", file, lineno); continue; } if (!strcmp(argv[1], "enable")) res->xpath_indexing = DATA1_XPATH_INDEXING_ENABLE; else if (!strcmp (argv[1], "disable")) res->xpath_indexing = DATA1_XPATH_INDEXING_DISABLE; else { yaz_log(YLOG_WARN, "%s:%d: Expecting disable/enable " "after 'xpath' directive", file, lineno); } } else if (!strcmp(cmd, "all")) { data1_termlist **tp = &all; if (all) { yaz_log(YLOG_WARN, "%s:%d: Too many 'all' directives - ignored", file, lineno); continue; } if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'all' directive", file, lineno); continue; } if (parse_termlists(dh, &tp, argv[1], file, lineno, 0, res, 0, attset_list)) { fclose (f); return 0; } } else if (!strcmp(cmd, "name")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to name directive", file, lineno); continue; } res->name = nmem_strdup(data1_nmem_get(dh), argv[1]); } else if (!strcmp(cmd, "reference")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to reference", file, lineno); continue; } name = argv[1]; res->oid = yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_SCHEMA, name, data1_nmem_get(dh)); if (!res->oid) { yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'", file, lineno, name); continue; } } else if (!strcmp(cmd, "attset")) { char *name; data1_attset *attset; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to attset", file, lineno); continue; } name = argv[1]; if (!(attset = data1_get_attset(dh, name))) { yaz_log(YLOG_WARN, "%s:%d: Couldn't find attset %s", file, lineno, name); continue; } *attset_childp = (data1_attset_child *) nmem_malloc(data1_nmem_get(dh), sizeof(**attset_childp)); (*attset_childp)->child = attset; (*attset_childp)->next = 0; attset_childp = &(*attset_childp)->next; } else if (!strcmp(cmd, "tagset")) { char *name; int type = 0; if (argc < 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args to tagset", file, lineno); continue; } name = argv[1]; if (argc == 3) type = atoi(argv[2]); *tagset_childp = data1_read_tagset(dh, name, type); if (!(*tagset_childp)) { yaz_log(YLOG_WARN, "%s:%d: Couldn't load tagset %s", file, lineno, name); continue; } tagset_childp = &(*tagset_childp)->next; } else if (!strcmp(cmd, "varset")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args in varset", file, lineno); continue; } name = argv[1]; if (!(res->varset = data1_read_varset(dh, name))) { yaz_log(YLOG_WARN, "%s:%d: Couldn't load Varset %s", file, lineno, name); continue; } } else if (!strcmp(cmd, "esetname")) { char *name, *fname; if (argc != 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args in esetname", file, lineno); continue; } name = argv[1]; fname = argv[2]; *esetpp = (data1_esetname *) nmem_malloc(data1_nmem_get(dh), sizeof(**esetpp)); (*esetpp)->name = nmem_strdup(data1_nmem_get(dh), name); (*esetpp)->next = 0; if (*fname == '@') (*esetpp)->spec = 0; else if (!((*esetpp)->spec = data1_read_espec1(dh, fname))) { yaz_log(YLOG_WARN, "%s:%d: Espec-1 read failed for %s", file, lineno, fname); continue; } esetpp = &(*esetpp)->next; } else if (!strcmp(cmd, "maptab")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # of args for maptab", file, lineno); continue; } name = argv[1]; if (!(*maptabp = data1_read_maptab(dh, name))) { yaz_log(YLOG_WARN, "%s:%d: Couldn't load maptab %s", file, lineno, name); continue; } maptabp = &(*maptabp)->next; } else if (!strcmp(cmd, "marc")) { char *name; if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # or args for marc", file, lineno); continue; } name = argv[1]; if (!(*marcp = data1_read_marctab(dh, name))) { yaz_log(YLOG_WARN, "%s:%d: Couldn't read marctab %s", file, lineno, name); continue; } marcp = &(*marcp)->next; } else if (!strcmp(cmd, "encoding")) { if (argc != 2) { yaz_log(YLOG_WARN, "%s:%d: Bad # or args for encoding", file, lineno); continue; } res->encoding = nmem_strdup(data1_nmem_get(dh), argv[1]); } else if (!strcmp(cmd, "systag")) { if (argc != 3) { yaz_log(YLOG_WARN, "%s:%d: Bad # or args for systag", file, lineno); continue; } *systagsp = nmem_malloc(data1_nmem_get(dh), sizeof(**systagsp)); (*systagsp)->name = nmem_strdup(data1_nmem_get(dh), argv[1]); (*systagsp)->value = nmem_strdup(data1_nmem_get(dh), argv[2]); systagsp = &(*systagsp)->next; } else { yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); continue; } } if (f) fclose(f); for (cur_elements = res->sub_elements; cur_elements; cur_elements = cur_elements->next) { if (!strcmp(cur_elements->name, "main")) res->main_elements = cur_elements->elements; fix_element_ref(dh, res, cur_elements->elements); } *systagsp = 0; return res; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/data1/d1_write.c0000664000175000017500000001653114754717556014553 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* converts data1 tree to XML record */ #if HAVE_CONFIG_H #include #endif #include #include #include #define IDSGML_MARGIN 75 #define PRETTY_FORMAT 0 static int wordlen(char *b, int max) { int l = 0; while (l < max && !d1_isspace(*b)) l++, b++; return l; } static void indent(WRBUF b, int col) { int i; for (i = 0; i < col; i++) wrbuf_putc(b, ' '); } static void wrbuf_put_xattr(WRBUF b, data1_xattr *p) { for (; p; p = p->next) { wrbuf_putc (b, ' '); if (p->what == DATA1I_xmltext) wrbuf_puts(b, p->name); else wrbuf_xmlputs(b, p->name); if (p->value) { wrbuf_putc(b, '='); wrbuf_putc(b, '"'); if (p->what == DATA1I_text) wrbuf_xmlputs(b, p->value); else wrbuf_puts(b, p->value); wrbuf_putc(b, '"'); } } } static void wrbuf_write_tag(WRBUF b, const char *tag, int opening) { int i, fixup = 0; /* see if we must fix the tag.. The grs.marc filter produces a data1 tree with not well-formed XML */ if (*tag >= '0' && *tag <= '9') fixup = 1; for (i = 0; tag[i]; i++) if (strchr( " <>$,()[]", tag[i])) fixup = 1; if (fixup) { wrbuf_puts(b, "tag"); if (opening) { wrbuf_puts(b, " value=\""); wrbuf_xmlputs(b, tag); wrbuf_puts(b, "\""); } } else wrbuf_puts(b, tag); } static int nodetoidsgml(data1_node *n, int select, WRBUF b, int col, int pretty_format) { data1_node *c; for (c = n->child; c; c = c->next) { char *tag; if (c->which == DATA1N_preprocess) { if (pretty_format) indent(b, col); wrbuf_puts(b, "u.preprocess.target); wrbuf_put_xattr(b, c->u.preprocess.attributes); if (c->child) wrbuf_puts(b, " "); if (nodetoidsgml(c, select, b, (col > 40) ? 40 : col+2, pretty_format) < 0) return -1; wrbuf_puts(b, "?>\n"); } else if (c->which == DATA1N_tag) { if (select && !c->u.tag.node_selected) continue; tag = c->u.tag.tag; if (!data1_matchstr(tag, "wellknown")) /* skip wellknown */ { if (nodetoidsgml(c, select, b, col, pretty_format) < 0) return -1; } else { if (pretty_format) indent (b, col); wrbuf_puts(b, "<"); wrbuf_write_tag(b, tag, 1); wrbuf_put_xattr(b, c->u.tag.attributes); wrbuf_puts(b, ">"); if (pretty_format) wrbuf_puts(b, "\n"); if (nodetoidsgml(c, select, b, (col > 40) ? 40 : col+2, pretty_format) < 0) return -1; if (pretty_format) indent (b, col); wrbuf_puts(b, ""); if (pretty_format) wrbuf_puts(b, "\n"); } } else if (c->which == DATA1N_data || c->which == DATA1N_comment) { char *p = c->u.data.data; int l = c->u.data.len; int first = 1; int lcol = col; if (pretty_format && !c->u.data.formatted_text) indent(b, col); if (c->which == DATA1N_comment) wrbuf_puts(b, ""); if (pretty_format) wrbuf_puts(b, "\n"); } } } return 0; } char *data1_nodetoidsgml(data1_handle dh, data1_node *n, int select, int *len) { WRBUF b = data1_get_wrbuf(dh); wrbuf_rewind(b); if (!data1_is_xmlmode(dh)) { wrbuf_puts(b, "<"); wrbuf_write_tag(b, n->u.root.type, 1); wrbuf_puts(b, ">\n"); } if (nodetoidsgml(n, select, b, 0, 0 /* no pretty format */)) return 0; if (!data1_is_xmlmode(dh)) { wrbuf_puts(b, "u.root.type, 0); wrbuf_puts(b, ">\n"); } *len = wrbuf_len(b); return wrbuf_buf(b); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/idzebra-config-2.0.in0000775000175000017500000000504214754717556015405 0ustar00adamadam#!/bin/sh version=@VERSION@ prefix="@prefix@" exec_prefix="@exec_prefix@" libdir="@libdir@" echo_cflags=no echo_libs=no echo_help=no echo_tab=no echo_source=yes echo_lalibs=no echo_modules=no package_suffix=@PACKAGE_SUFFIX@ extralibs="@YAZLIB@ @TCL_LIBS@ @EXPAT_LIBS@ @LIBS@ " extralalibs="@YAZLALIB@ @TCL_LIBS@ @EXPAT_LIBS@ @LIBS@" usage() { cat <&2 fi if test "$echo_cflags" = "yes"; then echo $IDZEBRAINC fi if test "$echo_libs" = "yes"; then echo $IDZEBRALIB fi if test "$echo_lalibs" = "yes"; then echo $IDZEBRALALIB fi if test "$echo_tab" = "yes"; then echo $IDZEBRATAB fi if test "$echo_modules" = "yes"; then echo $IDZEBRAMOD fi # Local Variables: # mode:shell-script # sh-indentation: 2 # sh-basic-offset: 4 # End: idzebra-2.2.10/rpm/0000755000175000017500000000000015136704660012450 5ustar00adamadamidzebra-2.2.10/rpm/zebrasrv.sysconfig0000644000175000017500000000060115136704660016231 0ustar00adamadam# Defaults for zebrasrv systemd service # This is a POSIX shell fragment # zebra.cfg (will be supplied with option -c) CONFIG="/etc/idzebra/zebra.cfg" # Full path to zebra server. Referred to in zebrasrv.service DAEMON="/usr/bin/zebrasrv-2.0" # Options that are passed to the Daemon and used in zebrasrv.service OPTIONS="-l /var/log/zebrasrv.log -u nobody -c ${CONFIG} tcp:@6:2100" idzebra-2.2.10/rpm/zebrasrv.logrotate0000644000175000017500000000033715136704660016233 0ustar00adamadam/var/log/zebrasrv.log { weekly missingok rotate 4 compress delaycompress notifempty postrotate if [ -d /run/systemd/system ]; then /usr/bin/systemctl try-reload-or-restart zebrasrv > /dev/null fi endscript } idzebra-2.2.10/rpm/zebrasrv.service0000644000175000017500000000054215136704660015671 0ustar00adamadam# idzebra systemd-style configuration [Unit] Description=Index Data Zebra server Documentation=man:zebrasrv(8) After=network.target [Service] Type=forking EnvironmentFile=/etc/sysconfig/zebrasrv ExecStart=/bin/sh -c "exec ${DAEMON} ${OPTIONS} -p /run/zebrasrv.pid -D" PIDFile=/run/zebrasrv.pid Restart=on-abnormal [Install] WantedBy=multi-user.target idzebra-2.2.10/tab/0000755000175000017500000000000015136704657012426 5ustar00adamadamidzebra-2.2.10/tab/usmarc-b.est0000664000175000017500000000021214754717556014660 0ustar00adamadamsimpleelement (3,'001) simpleelement (3,'035) simpleelement (3,'245) simpleelement (3,'100) simpleelement (3,'710) simpleelement (3,'700) idzebra-2.2.10/tab/tagsetg.tag0000664000175000017500000000212014754717556014565 0ustar00adamadam# TagSet-G Tags name tagsetg reference TagsetG type 2 tag 1 title string tag 2 author string tag 3 publicationPlace string tag 4 publicationDate/date-of-publication string tag 5 documentId string tag 6 abstract string tag 7 name string tag 8 dateTime generalizedtime tag 9 displayObject octetstring tag 10 organization/organisation string tag 11 postalAddress string tag 12 networkAddress string tag 13 eMailAddress string tag 14 phoneNumber/telephone string tag 15 faxNumber/fax string tag 16 country string tag 17 description string tag 18 time intunit tag 19 documentcontent octetstring tag 20 language string tag 21 subject string tag 22 resourceType string tag 23 city string tag 24 stateOrProvince string tag 25 zipOrPostalCode string tag 26 cost string tag 27 format string tag 28 identifier string tag 29 rights string tag 30 relation string tag 31 publisher string tag 32 contributor string tag 33 source string tag 34 coverage string tag 35 private string tag 36 sourceDb string idzebra-2.2.10/tab/gils-variant.est0000664000175000017500000000061014754717556015551 0ustar00adamadam# # This is the WAIS VARIANT element set description. # The empty variant parameters to the simpleelement statements simply # override the default. # defaultvariantrequest (9,1,@) (6,5,@) # No data; variant list. simpleelement (1,10) variant simpleelement (1,12) variant simpleelement (2,1) variant simpleelement (2,6) simpleelement (1,14) variant simpleelement (4,1) simpleelement (4,52) idzebra-2.2.10/tab/gils-usmarc.map0000664000175000017500000000466214754717556015374 0ustar00adamadam# This table maps records in the GILS abstract syntax to the USMARC one targetname usmarc targetref USmarc map rank /(3,999)/(3,r) map localControlNumber /(3,001) map dateLastModified /(3,005) map ControlIdentifier /(3,035)/(3,a) map title /(3,245)/(3,a) map abstract /(3,520)/(3,a) map purpose /(3,500)/(3,a) map originator /(3,710)/(3,a) map accessConstraints /(3,506)/(3,a) map useConstraints /(3,540)/(3,a) map distributor /(3,270):new nodata map distributorName /(3,270)/(3,p) map distributorOrganization /(3,270)/(3,p) map distributorStreetAddress /(3,270)/(3,a) map distributorCity /(3,270)/(3,b) map distributorState /(3,270)/(3,c) map distributorZipCode /(3,270)/(3,e) map distributorCountry /(3,270)/(3,d) map distributorNetworkAddress /(3,270)/(3,m) map distributorHoursOfService /(3,301)/(3,a) map distributorTelephone /(3,270)/(3,k) map distributorFax /(3,270)/(3,l) map resourceDescription /(3,037)/(3,f) map orderProcess /(3,037)/(3,c) map technicalPrerequisite /(3,538)/(3,a) map availableTimePeriodStructured /(3,045)/(3,c) map availableTimePeriodTextual /(3,037)/(3,n) # Unhandled conditional map linkage /(3,856)/(3,u) map linkageType /(3,856)/(3,2) #map pointOfContact /(3,856)/(3,m) # Look into this map pointOfContact /(3,270):new nodata map contactName /(3,270)/(3,p) map contactOrganization /(3,270)/(3,p) map contactStreetAddress /(3,270)/(3,a) map contactCity /(3,270)/(3,b) map contactState /(3,270)/(3,c) map contactZipCode /(3,270)/(3,e) map contactCountry /(3,270)/(3,d) map contactNetworkAddress /(3,270)/(3,m) map contactHoursOfService /(3,301)/(3,a) map contactTelephone /(3,270)/(3,k) map contactFax /(3,270)/(3,l) map recordSource /(3,040)/(3,a) map agencyProgram /(3,500)/(3,a) map sourcesOfData /(3,537)/(3,a) map controlledTerm /(3,650)/(3,a) map thesaurus /(3,650)/(3,2) map localSubjectTerm /(3,653)/(3,a) map methodology /(3,567)/(3,a) map boundingrectangle /(3,034):new nodata map westernMost /(3,034)/(3,d) map easternMost /(3,034)/(3,e) map northernMost /(3,034)/(3,f) map southernMost /(3,034)/(3,g) map geographicKeywordName /(3,651)/(3,a) map geographicKeywordType /(3,655)/(3,z) # Probably incorrect map timeperiodStructured /(3,045)/(3,c) map timeperiodTextual /(3,513)/(3,b) map crossReference /(3,787):new nodata map crossReferenceTitle /(3,787)/(3,t) map crossReferenceLinkage /(3,787)/(3,w) map supplementalInformation /(3,500)/(3,a) idzebra-2.2.10/tab/default.idx0000664000175000017500000000205714754717556014575 0ustar00adamadam# Zebra indexes as referred to from the *.abs-files. # # Traditional word index # Used if completeness is 'incomplete field' (@attr 6=1) and # structure is word/phrase/word-list/free-form-text/document-text index w completeness 0 position 1 alwaysmatches 1 firstinfield 1 charmap string.chr # Phrase index # Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=3) # and structure is word/phrase/word-list/free-form-text/document-text index p completeness 1 charmap string.chr # URX (URL) index # Used if structure=urx (@attr 4=104) index u completeness 0 charmap urx.chr # Numeric index # Used if structure=numeric (@attr 4=109) index n completeness 0 charmap numeric.chr # Null map index (no mapping at all) # Used if structure=key (@attr 4=3) index 0 completeness 0 position 1 charmap @ # Year # Used if structure=year (@attr 4=4) index y completeness 0 charmap @ # Date # Used if structure=date (@attr 4=5) index d completeness 0 charmap @ # Sort register sort s completeness 1 charmap string.chr # Staticrank (uncomment to enable) #staticrank r idzebra-2.2.10/tab/generic.tag0000664000175000017500000000015014754717556014544 0ustar00adamadam# Generic tags - including tagsetM and tagsetG. # name generic include tagsetm.tag include tagsetg.tag idzebra-2.2.10/tab/gils-b.est0000664000175000017500000000030114754717556014323 0ustar00adamadamsimpleelement (1,1) simpleelement (1,10) simpleelement (1,12) simpleelement (2,1) simpleelement (1,14) simpleelement (1,16) simpleelement (4,1) simpleelement (4,52) simpleelement (4,70)/(4,17) idzebra-2.2.10/tab/refer.flt0000664000175000017500000000137414754717556014256 0ustar00adamadam# # Experimental format for the HCI bibliography # BEGIN { begin record meta } /^%T / { end element; begin element title } /^%A / { end element; begin element author } /^%X / { end element; begin element abstract } /^%B / { end element; begin element source } /^%I / { end element; begin element publicationPlace } /^%D / { end element; begin element publicationDate } /^%S / { end element; begin element subject } # /^%K / { end element; begin element subject } /^%Z / { end element; begin element relation } /^%. / { end element } /^$/ { end record } /\n/ { data " " } idzebra-2.2.10/tab/words-icu.xml0000664000175000017500000000031114754717556015070 0ustar00adamadam idzebra-2.2.10/tab/Makefile.in0000644000175000017500000003763115136704635014501 0ustar00adamadam# 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@ subdir = tab ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_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)$(tabdatadir)" DATA = $(tabdata_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ tabdatadir = $(datadir)/$(PACKAGE)$(PACKAGE_SUFFIX)/tab tabdata_DATA = bib1.att dan1.att danmarc.abs danmarc.mar \ default.idx explain.abs explain.att explain.tag generic.tag gils.abs \ gils-a.est gils.att gils-b.est gils-f.est gils-g.est gils-summary.map \ gils.tag gils-usmarc.map gils-variant.est hci.flt idxpath.att mail.flt \ meta.abs meta-b.est meta.tag meta-usmarc.map news.flt numeric.chr \ nwi.flt refer.flt scan.chr sgml.flt soif.flt string.chr summary.abs \ summary.tag tagsetg.tag tagsetm.tag urx.chr usmarc.abs usmarc-b.est \ usmarc.flt usmarc.mar usmarc.tag var1.var wais.abs wais-b.est \ wais-variant.est marc21.abs words-icu.xml phrases-icu.xml words-icu-da.xml \ icu.idx EXTRA_DIST = $(tabdata_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tab/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tab/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-tabdataDATA: $(tabdata_DATA) @$(NORMAL_INSTALL) @list='$(tabdata_DATA)'; test -n "$(tabdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tabdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tabdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(tabdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(tabdatadir)" || exit $$?; \ done uninstall-tabdataDATA: @$(NORMAL_UNINSTALL) @list='$(tabdata_DATA)'; test -n "$(tabdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tabdatadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(tabdatadir)"; 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-tabdataDATA 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-tabdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-tabdataDATA installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-tabdataDATA .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.% idzebra-2.2.10/tab/wais-b.est0000664000175000017500000000017114754717556014335 0ustar00adamadam# # WAIS eset. # simpleelement (2,1) simpleelement (2,7) simpleelement (1,16) simpleelement (1,18) simpleelement (1,14) idzebra-2.2.10/tab/gils.att0000664000175000017500000000533414754717556014114 0ustar00adamadamname gils reference GILS-attset include bib1.att att 2000 Distributor att 2001 Distributor-Name att 2002 Index-Terms # Subject-Terms-Contr. att 2003 Purpose att 2004 General-Access-Constraints att 2005 Use-Constraints att 2006 Distributor-Organization att 2007 Distributor-Street-Address att 2008 Distributor-City att 2009 Distributor-State-or-Province att 2010 Distributor-Zip-or-Postal-Code att 2011 Distributor-Country att 2012 Distributor-Network-Address att 2013 Distributor-Hours-of-Service att 2014 Distributor-Telephone att 2015 Distributor-Fax att 2016 Resource-Description att 2017 Order-Information att 2018 Technical-Prerequisites att 2019 Available-Time-Structured att 2020 Available-Time-Textual att 2021 Linkage att 2022 Linkage-Type att 2023 Contact-Name att 2024 Contact-Organization att 2025 Contact-Street-Address att 2026 Contact-City att 2027 Contact-State-or-Province att 2028 Contact-Zip-or-Postal-Code att 2029 Contact-Country att 2030 Contact-Network-Address att 2031 Contact-Hours-of-Service att 2032 Contact-Telephone att 2033 Contact-Fax att 2034 Agency-Program att 2035 Sources-of-Data att 2036 Subject-Thesaurus att 2037 Methodology att 2038 West-Bounding-Coordinate att 2039 East-Bounding-Coordinate att 2040 North-Bounding-Coordinate att 2041 South-Bounding-Coordinate att 2042 Place-Keyword att 2043 Place-Keyword-Thesaurus att 2044 Time-Period-Structured att 2045 Time-Period-Textual att 2046 Cross-Reference-Title att 2047 Cross-Reference-Linkage att 2049 Original-Control-Identifier att 2050 Supplemental-Information att 2051 Record-Review-Date att 2052 Originator-Dissemination-Control att 2053 Security-Classification-Control att 2054 Cost att 2055 Cost-Information att 2056 Schedule-Number att 2057 Controlled-Subject-Index att 2058 Uncontrolled-Term att 2059 Spatial-Domain att 2060 Bounding-Coordinates att 2061 Place att 2062 Time-Period att 2063 Availability att 2064 Order-Process att 2065 Available-Time-Period att 2066 Access-Constraints att 2067 Point-of-Contact att 2068 Cross-Reference att 2069 Available-Linkage att 2070 Cross-Reference-Relationship att 2071 Language-of-Record att 2072 Beginning-Date att 2073 Ending-Date att 2074 Controlled-Term idzebra-2.2.10/tab/marc21.abs0000664000175000017500000000365014754717556014217 0ustar00adamadam # This is a fairly simple example of a set of MARC21 indexing rules. It # results in a server which provides a passable Bath level 0 and 1 service # (author, title, subject, keyword and exact services). Feel free to # elaborate on it, and if you do, please consider sharing your additions. # NOTE: This is designed to be used with the grs.marcxml input filter # for ISO2709 (ANSI Z39.2) or grs.xml for MARCXML-formatted records. It # won't work for the old grs.marc input filter, which yields a different # internal structure. name marc21 attset bib1.att esetname F @ esetname B @ marc usmarc.mar xpath disable all any melm 008 Date-of-publication:w:range(data,7,4),Date-publication:w:range(data,15,3),Code-language:w:range(data,35,3) melm 100 author,author:p melm 110 author melm 111 author melm 130 title melm 240 title,title:p melm 242 title,title:p melm 243 title,title:p melm 245$c author melm 245 title,title:p melm 246 title,title:p melm 247 title,title:p melm 400$t title,author melm 400 author melm 410$t title,author melm 410 author melm 411$t title,author melm 411 author melm 440$a title,title:p melm 440 title melm 490$a title,title:p melm 490 title melm 600$t title melm 600 subject-heading,subject-heading:p melm 610$t title melm 610 subject-heading melm 611$t title melm 611 subject-heading melm 630 subject-heading melm 650 subject-heading,subject-heading:p melm 651 subject-heading,subject-heading:p melm 653 subject-heading,subject-heading:p melm 654 subject-heading melm 655 subject-heading melm 656 subject-heading melm 657 subject-heading melm 700$t title,author melm 700$a author,author:p melm 700 author melm 710$t title,author melm 710$a author,author:p melm 710 author melm 711$t title,author melm 711 author melm 730 title melm 740 title melm 800$t title,author melm 800 author melm 810$t title,author melm 810 author melm 811$t title,author melm 811 author melm 830 title idzebra-2.2.10/tab/idxpath.att0000664000175000017500000000034414754717556014613 0ustar00adamadam# The Zebra special IDXPATH Attribute Set # name idxpath reference idxpath att 1 _XPATH_BEGIN att 2 _XPATH_END att 3 _XPATH_ATTR_NAME att 1015 _XPATH_ATTR_CDATA att 1016 _XPATH_CDATA idzebra-2.2.10/tab/mail.flt0000664000175000017500000000050214754717556014065 0ustar00adamadamBEGIN { begin record wais } /^From:/ BODY /$/ { data -element name $1 } /^Subject:/ BODY /$/ { data -element title $1 } /^Date:/ BODY /$/ { data -element date $1 } /^$/ BODY /^From / { data -text -element Body $1 unread 2 end record } idzebra-2.2.10/tab/Makefile.am0000664000175000017500000000133114754717556014471 0ustar00adamadam tabdatadir = $(datadir)/$(PACKAGE)$(PACKAGE_SUFFIX)/tab tabdata_DATA = bib1.att dan1.att danmarc.abs danmarc.mar \ default.idx explain.abs explain.att explain.tag generic.tag gils.abs \ gils-a.est gils.att gils-b.est gils-f.est gils-g.est gils-summary.map \ gils.tag gils-usmarc.map gils-variant.est hci.flt idxpath.att mail.flt \ meta.abs meta-b.est meta.tag meta-usmarc.map news.flt numeric.chr \ nwi.flt refer.flt scan.chr sgml.flt soif.flt string.chr summary.abs \ summary.tag tagsetg.tag tagsetm.tag urx.chr usmarc.abs usmarc-b.est \ usmarc.flt usmarc.mar usmarc.tag var1.var wais.abs wais-b.est \ wais-variant.est marc21.abs words-icu.xml phrases-icu.xml words-icu-da.xml \ icu.idx EXTRA_DIST = $(tabdata_DATA) idzebra-2.2.10/tab/wais.abs0000664000175000017500000000056114754717556014073 0ustar00adamadam# WAIS profile # name wais reference WAIS-schema attset bib1.att tagset generic.tag varset var1.var esetname B wais-b.est esetname F @ esetname VARIANT wais-variant.est elm (2,1) Title !:p,!:w elm (2,7) Name !:p,!:w elm (2,8) Date ! elm (1,18) Score - elm (1,14) RecordId Local-number # Tags below this point are unofficial. elm Body BodyOfText ! idzebra-2.2.10/tab/icu.idx0000664000175000017500000000121214754717556013721 0ustar00adamadam# ICU indexing for words and phrases.. Otherwise similar # to default.idx . # Traditional word index # Used if completeness is 'incomplete field' (@attr 6=1) and # structure is word/phrase/word-list/free-form-text/document-text index w completeness 0 position 1 alwaysmatches 1 firstinfield 1 icuchain words-icu.xml # debug 1 # Phrase index # Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=3) # and structure is word/phrase/word-list/free-form-text/document-text index p completeness 1 icuchain phrases-icu.xml # debug 1 # Sort register sort s completeness 1 charmap string.chr # Staticrank (uncomment to enable) #staticrank r idzebra-2.2.10/tab/gils-a.est0000664000175000017500000000022014754717556014322 0ustar00adamadamsimpleelement (1,10) simpleelement (1,12) simpleelement (2,1) simpleelement (1,14) simpleelement (4,1) simpleelement (4,52) simpleelement (2,6) idzebra-2.2.10/tab/meta.abs0000664000175000017500000000137314754717556014060 0ustar00adamadam# This is a simple profile based on the Dublin Core of metadata elements. # name meta attset bib1.att tagset meta.tag varset var1.var esetname F @ esetname B meta-b.est maptab meta-usmarc.map elm (2,1) title Title:w,Title:p elm (2,2) creator Author:w,Author:p elm (2,21) subject Subject-heading elm (2,17) description - elm (2,31) publisher Publisher elm (2,32) contributor - elm (2,4) date Date elm (2,22) type Content-type elm (2,27) format Material-type elm (2,28) identifier - elm (2,33) source - elm (2,20) language Code-language elm (2,30) relation - elm (2,34) coverage - elm (2,29) rights - # These tags are required by Zebra for GRS-1 generation elm (1,10) rank - elm (1,14) localControlNumber Local-number idzebra-2.2.10/tab/usmarc.tag0000664000175000017500000000022414754717556014424 0ustar00adamadam# Pseudo-tagset for USMARC # name usmarc type 4 include tagsetm.tag #tag 1 a string #tag 2 b string tag 245 245 string tag 100 100 string idzebra-2.2.10/tab/news.flt0000664000175000017500000000041414754717556014121 0ustar00adamadamBEGIN { begin record wais } /^From:/ BODY /$/ { data -element name $1 } /^Subject:/ BODY /$/ { data -element title $1 } /^Date:/ BODY /$/ { data -element dateOfLastModification $1 } /^$/ BODY END { begin element Body data -text $1 end record } idzebra-2.2.10/tab/sgml.flt0000664000175000017500000000050714754717556014112 0ustar00adamadamBEGIN /\n*\n*/ { begin record $2 } /\n*<[Vv][Aa][Rr][ ]+/ /[^ >]+/ /[ ]+/ /[^ >]+/ /[ ]+/ /[^ >]+/ /[ ]*>/ { begin variant $1 $3 $5 } /\n*\n*/ { begin element $1 } /\n*<\// BODY />\n*/ { end element -record } /[ \n\t]+/ { data " " } idzebra-2.2.10/tab/summary.tag0000664000175000017500000000102214754717556014624 0ustar00adamadam# Tagset for Summary profile # name summary type 4 tag 0 title string tag 1 author string tag 2 callNumber string tag 3 recordType string tag 4 bibliographicLevel string tag 5 formats structured tag 6 format structured tag 7 type string tag 8 size numeric tag 9 bestPosn numeric tag 10 publicationPlace string tag 11 publicationDate string tag 12 targetSystemKey string tag 13 satisfyingElement string tag 14 rank numeric tag 15 documentId string tag 16 abstract string tag 17 otherInformation structured idzebra-2.2.10/tab/bib1.att0000664000175000017500000000665714754717556014004 0ustar00adamadam# Bib-1 Attribute Set name bib1 reference Bib-1 att 1 Personal-name att 2 Corporate-name att 3 Conference-name att 4 Title att 5 Title-series att 6 Title-uniform att 7 ISBN att 8 ISSN att 9 LC-card-number att 10 BNB-card-number att 11 BGF-number att 12 Local-number att 13 Dewey-classification att 14 UDC-classification att 15 Bliss-classification att 16 LC-call-number att 17 NLM-call-number att 18 NAL-call-number att 19 MOS-call-number att 20 Local-classification att 21 Subject-heading att 22 Subject-Rameau att 23 BDI-index-subject att 24 INSPEC-subject att 25 MESH-subject att 26 PA-subject att 27 LC-subject-heading att 28 RVM-subject-heading att 29 Local-subject-index att 30 Date att 31 Date-of-publication att 32 Date-of-acquisition att 33 Title-key att 34 Title-collective att 35 Title-parallel att 36 Title-cover att 37 Title-added-title-page att 38 Title-caption att 39 Title-running att 40 Title-spine att 41 Title-other-variant att 42 Title-former att 43 Title-abbreviated att 44 Title-expanded att 45 Subject-precis att 46 Subject-rswk att 47 Subject-subdivision att 48 Number-natl-biblio att 49 Number-legal-deposit att 50 Number-govt-pub att 51 Number-music-publisher att 52 Number-db att 53 Number-local-call att 54 Code-language att 55 Code-geographic att 56 Code-institution att 57 Name-and-title att 58 Name-geographic att 59 Place-publication att 60 CODEN att 61 Microform-generation att 62 Abstract att 63 Note att 1000 Author-title att 1001 Record-type att 1002 Name att 1003 Author att 1004 Author-name-personal att 1005 Author-name-corporate att 1006 Author-name-conference att 1007 Identifier-standard att 1008 Subject-LC-childrens att 1009 Subject-name-personal att 1010 Body-of-text att 1011 Date/time-added-to-db att 1012 Date/time-last-modified att 1013 Authority/format-id att 1014 Concept-text att 1015 Concept-reference att 1016 Any att 1017 Server-choice att 1018 Publisher att 1019 Record-source att 1020 Editor att 1021 Bib-level att 1022 Geographic-class att 1023 Indexed-by att 1024 Map-scale att 1025 Music-key att 1026 Related-periodical att 1027 Report-number att 1028 Stock-number att 1030 Thematic-number att 1031 Material-type att 1032 Doc-id att 1033 Host-item att 1034 Content-type att 1035 Anywhere att 1036 Author-Title-Subject idzebra-2.2.10/tab/explain.tag0000664000175000017500000001211414754717556014573 0ustar00adamadam# Tag set for internal Explain-data management # name explain reference Explain-tagset type 4 include tagsetm.tag # # Explain categories # tag 1 categoryList structured tag 2 targetInfo structured tag 3 databaseInfo structured tag 4 schemaInfo structured tag 5 tagSetInfo structured tag 6 recordSyntaxInfo structured tag 7 attributeSetInfo structured tag 8 termListInfo structured tag 9 extendedServicesInfo structured tag 10 attributeDetails structured tag 11 termListDetails structured tag 12 elementSetDetails structured tag 13 retrievalRecordDetails structured tag 14 sortDetails structured tag 15 processing structured tag 16 variants structured tag 17 units structured # # TargetInfo # tag 102 name string tag 103 recentNews string tag 104 icon structured tag 105 namedResultSets bool tag 106 multipleDbSearch bool tag 107 maxResultSets numeric tag 108 maxResultSize numeric tag 109 maxTerms numeric tag 110 timeoutInterval intunit tag 111 welcomeMessage string tag 112 contactInfo structured tag 113 description string tag 114 nicknames structured tag 115 usageRest string tag 116 paymentAddr string tag 117 hours string tag 118 dbCombinations structured tag 119 addresses structured tag 120 internetAddress structured tag 121 host string tag 122 port numeric tag 123 otherAddress structured tag 124 addressType string tag 125 languages structured tag 126 language string tag 127 address string tag 128 email string tag 129 phone string # # DatabaseInfo # tag 201 userFee bool tag 202 available bool tag 203 titleString string tag 205 associatedDbs structured tag 206 subDbs structured tag 207 disclaimers string tag 209 recordCount structured tag 210 recordCountActual numeric tag 211 recordCountApprox numeric tag 212 defaultOrder string tag 213 avRecordSize numeric tag 214 maxRecordSize numeric tag 215 hours string tag 216 bestTime string tag 217 lastUpdate generalizedtime tag 218 updateInterval intunit tag 219 coverage string tag 220 proprietary bool tag 221 copyrightText string tag 222 copyrightNotice string tag 223 producerContactInfo structured tag 224 supplierContactInfo structured tag 225 submissionContactInfo structured tag 226 explainDatabase null tag 227 keywords string # CategoryList tag 300 categories structured tag 301 category structured tag 302 originalName string tag 303 asn1Module string # # AccessInfo # tag 500 accessinfo structured tag 501 queryTypesSupported structured tag 503 diagnosticSets structured tag 505 attributeSetIds structured tag 507 schemas structured tag 509 recordSyntaxes structured tag 511 resourceChallenges structured tag 513 restrictedAccess structured tag 514 costInfo structured tag 515 variantSets structured tag 516 elementSetNames structured tag 517 unitSystems structured tag 518 queryTypeDetails structured tag 519 rpnCapabilities structured tag 520 Iso8777Capabilities structured tag 521 privateCapabilities structured tag 550 rpnOperators structured tag 551 rpnOperator numeric tag 552 resultSetAsOperandSupported bool tag 553 restrictionOperandSupported bool tag 554 proximitySupport structured tag 555 anySupport bool tag 556 proximityUnitsSupported structured tag 557 proximityUnitSupported structured tag 558 proximityUnitVal numeric tag 559 proximityUnitPrivate structured tag 560 proximityUnitDescription string # CommonInfo tag 600 commonInfo structured tag 601 dateAdded generalizedtime tag 602 dateChanged generalizedtime tag 603 expiry generalizedtime tag 604 languageCode string tag 605 databaseList structured # AttributeDetails, AttributeSetDetails tag 700 attributesBySet structured tag 701 attributeSetDetails structured tag 702 attributesByType structured tag 703 attributeTypeDetails structured tag 704 type numeric tag 705 defaultIfOmitted structured tag 706 defaultValue structured tag 708 attributeValues structured tag 709 attributeValue structured tag 710 value structured tag 711 partialSupport string tag 712 subAttributes structured tag 713 subAttribute structured tag 714 superAttributes structured tag 715 superAttribute structured tag 716 attributeCombinations structured tag 717 legalAttributeCombinations structured tag 718 attributeCombination structured tag 719 attributeOccurrence structured tag 720 mustBeSupplied bool tag 721 anyOrNone string tag 722 specific structured # # AttributeSetInfo # tag 750 attributes structured tag 751 attributeType structured tag 752 equivalentAttribute structured # # General tags for list members, etc. # tag 1000 oid oid tag 1001 string string tag 1002 numeric numeric idzebra-2.2.10/tab/hci.flt0000664000175000017500000000132014754717556013705 0ustar00adamadam# # Experimental format for the HCI bibliography # BEGIN { begin record meta } /^%T / { end element; begin element title } /^%A / { end element; begin element author } /^%X / { end element; begin element abstract } /^%B / { end element; begin element source } /^%I / { end element; begin element publicationPlace } /^%D / { end element; begin element publicationDate } /^%S / { end element; begin element subject } /^%K / { end element; begin element subject } /^%Z / { end element; begin element relation } # /./ { data } END { end record } idzebra-2.2.10/tab/usmarc.flt0000664000175000017500000000065014754717556014441 0ustar00adamadam# # Rather dummy input-filter for MARC # BEGIN { begin record usmarc } /^00./ / / BODY /\n/ { begin element $0 data -element @ $2 end element } /^.../ / / /../ { begin element $0 } /[$*]/ /./ / / BODY / *[$*\n]/ { data -element $1 $3; unread 4 } /\n/ { end element } /./ { } idzebra-2.2.10/tab/phrases-icu.xml0000664000175000017500000000024214754717556015402 0ustar00adamadam idzebra-2.2.10/tab/gils-g.est0000664000175000017500000000045014754717556014335 0ustar00adamadamsimpleelement (1,1) simpleelement (1,10) simpleelement (1,12) simpleelement (2,1) simpleelement (1,14) simpleelement (1,16) simpleelement (4,1) simpleelement (4,52) simpleelement (4,98) # # These are not formally required by GILS # simpleelement (4,59) simpleelement (4,70) simpleelement (4,97) idzebra-2.2.10/tab/danmarc.mar0000664000175000017500000000003714754717556014545 0ustar00adamadamname danmarc reference danmarc idzebra-2.2.10/tab/meta-usmarc.map0000664000175000017500000000105514754717556015355 0ustar00adamadam# Meta to USMARC conversion targetname usmarc targetref USmarc map localControlNumber /(3,001) map dateLastModified /(3,005) map subject /(3,653)/(3,a) map title /(3,245)/(3,a) map author /(3,700)/(3,a) map publisher /(3,260)/(3,b) map otheragent /(3,710)/(3,a) map date /(3,260)/(3,c) map identifier /(3,024)/(3,a) # objectType skipped for now map form /(3,538)/(3,a) map relation /(3,787)/(3,a) # complexity here map language /(3,041)/(3,a) map source /(3,786)/(3,a) # coverage skipped for now map abstract /(3,520)/(3,a) idzebra-2.2.10/tab/explain.abs0000664000175000017500000001747514754717556014604 0ustar00adamadam# This Explain schema is used for our internal management and processing of # explain data. On request, records are mapped to the proper Explain ASN.1 # before transmission. # name explain reference Explain-schema attset explain.att tagset explain.tag esetname B @ esetname F @ section rpnCapabilities elm (4,550) rpnOperators - elm (4,550)/(4,551) rpnOperator - elm (4,552) resultSetAsOperandSupported - elm (4,553) restrictionOperandSupported - elm (4,554) proximitySupport - elm (4,554)/(4,555) anySupport - elm (4,554)/(4,556) unitsSupported - elm (4,554)/(4,556)/(4,557) unitSupported - elm (4,554)/(4,556)/(4,557)/(4,558) known - elm (4,554)/(4,556)/(4,557)/(4,559) private - elm (4,554)/(4,556)/(4,557)/(4,559)/(4,558) privateUnit - elm (4,554)/(4,556)/(4,557)/(4,559)/(4,560) description - section accessInfo elm (4,501) queryTypesSupported - elm (4,501)/(4,518) queryTypeDetails - elm (4,501)/(4,518)/(4,519):rpnCapabilities rpnCapabilities - elm (4,501)/(4,518)/(4,520) iso8777Capabilities - elm (4,501)/(4,518)/(4,521) privateCapabilities - elm (4,503) diagnosticSets - elm (4,503)/(4,1000) diagnosticSet - elm (4,505) attributeSetIds - elm (4,505)/(4,1000) attributeSetId - elm (4,507) schemas - elm (4,507)/(4,1000) schema - elm (4,509) recordSyntaxes - elm (4,509)/(4,1000) recordSyntax - elm (4,511) resourceChallenges - elm (4,511)/(4,1000) resourceChallenge - elm (4,513) restrictedAccess - elm (4,514) costInfo - elm (4,515) variantSets - elm (4,515)/(4,1000) variantSets - elm (4,516) elementSetNames - elm (4,516)/(4,1001) elementSetName - elm (4,517) unitSystems - elm (4,517)/(4,1001) unitSystem - section commonInfo elm (4,601) dateAdded ! elm (4,602) dateChanged ! elm (4,603) expiry DateExpired elm (4,604) languageCode HumanStringLanguage section contactInfo elm (4,102) name - elm (4,113) description - elm (4,127) address - elm (4,128) email - elm (4,129) phone - section stringOrNumeric elm (4,1001) string - elm (4,1002) numeric - section attributeSetDetailsValue elm (4,709) attributeValue - elm (4,709)/(4,710):stringOrNumeric value - elm (4,709)/(4,113) description - elm (4,709)/(4,712) subAttributes - elm (4,709)/(4,712)/(4,713):stringOrNumeric subAttribute - elm (4,709)/(4,714) superAttributes - elm (4,709)/(4,714)/(4,715):stringOrNumeric superAttributes - elm (4,709)/(4,711) partialSupport - section attributeSetDetails elm (4,1000) attributeSet - elm (4,702) attributesByType - elm (4,702)/(4,703) attributeTypeDetails - elm (4,702)/(4,703)/(4,704) attributeType - elm (4,702)/(4,703)/(4,705) defaultIfOmitted - elm (4,702)/(4,703)/(4,705)/(4,706):stringOrNumeric defaultValue - elm (4,702)/(4,703)/(4,705)/(4,113) defaultDescription - elm (4,702)/(4,703)/(4,708):attributeSetDetailsValue attributeValues - section attributeCombinations elm (4,1000) attributeSet - elm (4,717) legalCombinations - elm (4,717)/(4,718) legalCombination - elm (4,717)/(4,718)/(4,719) attributeOccurrence - elm (4,717)/(4,718)/(4,719)/(4,1000) attributeSetId - elm (4,717)/(4,718)/(4,719)/(4,704) attributeType - elm (4,717)/(4,718)/(4,719)/(4,720) mustBeSupplied - elm (4,717)/(4,718)/(4,719)/(4,721) anyOrNone - elm (4,717)/(4,718)/(4,719)/(4,722) specific - elm (4,717)/(4,718)/(4,719)/(4,722)/(4,710):stringOrNumeric value - section attributeType elm (4,751) attributeType - elm (4,751)/(4,102) attributeName - elm (4,751)/(4,113) attributeDescription - elm (4,751)/(4,704) type - elm (4,751)/(4,708) attributeValues - elm (4,751)/(4,708)/(4,709) attributeValue - elm (4,751)/(4,708)/(4,709)/(4,102) name - elm (4,751)/(4,708)/(4,709)/(4,113) description - elm (4,751)/(4,708)/(4,709)/(4,710):stringOrNumeric attributeValue - elm (4,751)/(4,708)/(4,709)/(4,752):stringOrNumeric equivalentAttribute - section main # # CategoryList # elm (4,1) categoryList ExplainCategory elm (4,1)/(4,600):commonInfo categoryListCommonInfo - elm (4,1)/(4,300) categories - elm (4,1)/(4,300)/(4,301) category - elm (4,1)/(4,300)/(4,301)/(4,102) categoryName - elm (4,1)/(4,300)/(4,301)/(4,302) originalName - elm (4,1)/(4,300)/(4,301)/(4,113) description - elm (4,1)/(4,300)/(4,301)/(4,303) asn1Module - # # TargetInfo # elm (4,2) targetInfo ExplainCategory elm (4,2)/(4,600):commonInfo targetCommonInfo - elm (4,2)/(4,102) targetName TargetName elm (4,2)/(4,103) recentNews - elm (4,2)/(4,104) icon - elm (4,2)/(4,105) namedResultSets - elm (4,2)/(4,106) multipleDbSearch - elm (4,2)/(4,107) maxResultSets - elm (4,2)/(4,108) maxResultSize - elm (4,2)/(4,109) maxTerms - elm (4,2)/(4,110) timeoutInterval - elm (4,2)/(4,111) welcomeMessage - elm (4,2)/(4,112):contactInfo contactInfo - elm (4,2)/(4,113) description - elm (4,2)/(4,114) nicknames - elm (4,2)/(4,114)/(4,102) nickname - elm (4,2)/(4,115) usageRestrictions - elm (4,2)/(4,116) paymentAddr - elm (4,2)/(4,117) hours - elm (4,2)/(4,118) dbCombinations - elm (4,2)/(4,118)/(4,605) databaseList - elm (4,2)/(4,118)/(4,605)/(4,102) databaseName - elm (4,2)/(4,119) addresses - elm (4,2)/(4,119)/(4,120) internetAddress - elm (4,2)/(4,119)/(4,120)/(4,121) host - elm (4,2)/(4,119)/(4,120)/(4,122) port - elm (4,2)/(4,119)/(4,123) otherAddress - elm (4,2)/(4,119)/(4,123)/(4,124) addressType - elm (4,2)/(4,119)/(4,123)/(4,121) address - elm (4,2)/(4,125) languages - elm (4,2)/(4,125)/(4,126) language - elm (4,2)/(4,500):accessInfo commonAccessInfo - # # DatabaseInfo # elm (4,3) databaseInfo ExplainCategory elm (4,3)/(4,600):commonInfo databaseCommonInfo - elm (4,3)/(4,102) databaseName DatabaseName elm (4,3)/(4,226) explainDatabase - elm (4,3)/(4,114) nicknames - elm (4,3)/(4,114)/(4,102) nickname - elm (4,3)/(4,104) icon - elm (4,3)/(4,201) userFee - elm (4,3)/(4,202) available Availability elm (4,3)/(4,203) titleString - elm (4,3)/(4,227) keywords - elm (4,3)/(4,227)/(4,1000) keyword - elm (4,3)/(4,113) description - elm (4,3)/(4,205) associatedDbs - elm (4,3)/(4,205)/(4,605) databaseList - elm (4,3)/(4,205)/(4,605)/(4,102) databaseName - elm (4,3)/(4,206) subDbs - elm (4,3)/(4,206)/(4,605) databaseList - elm (4,3)/(4,206)/(4,605)/(4,102) databaseName - elm (4,3)/(4,207) disclaimers - elm (4,3)/(4,103) recentNews - elm (4,3)/(4,209) recordCount - elm (4,3)/(4,209)/(4,210) recordCountActual - elm (4,3)/(4,209)/(4,211) recordCountApprox - elm (4,3)/(4,212) defaultOrder - elm (4,3)/(4,213) avRecordSize - elm (4,3)/(4,214) maxRecordSize - elm (4,3)/(4,215) hours - elm (4,3)/(4,216) bestTime - elm (4,3)/(4,217) lastUpdate - elm (4,3)/(4,218) updateInterval - elm (4,3)/(4,219) coverage - elm (4,3)/(4,220) proprietary - elm (4,3)/(4,221) copyrightText - elm (4,3)/(4,222) copyrightNotice - elm (4,3)/(4,223):contactInfo producerContactInfo - elm (4,3)/(4,224):contactInfo supplierContactInfo - elm (4,3)/(4,225):contactInfo submissionContactInfo - elm (4,3)/(4,500):accessInfo databaseAccessInfo - # # AttributeSetInfo # elm (4,7) attributeSetInfo ExplainCategory elm (4,7)/(4,600):commonInfo attributeSetInfoCommonInfo - elm (4,7)/(4,1000) attributeSet AttributeSetOID elm (4,7)/(4,113) description - elm (4,7)/(4,102) name - elm (4,7)/(4,750):attributeType attributes - # # AttributeDetails # elm (4,10) attributeDetails ExplainCategory elm (4,10)/(4,600):commonInfo attributeDetailsCommonInfo - elm (4,10)/(4,102) databaseName DatabaseName elm (4,10)/(4,700) attributesBySet - elm (4,10)/(4,700)/(4,701):attributeSetDetails attributeSetDetails - elm (4,10)/(4,716):attributeCombinations attributeCombinations - idzebra-2.2.10/tab/usmarc.mar0000664000175000017500000000014714754717556014434 0ustar00adamadamname usmarc reference USmarc # Defines implementation codes (offset 6..9) #implementation-codes ABCD idzebra-2.2.10/tab/gils-f.est0000664000175000017500000000002014754717556014325 0ustar00adamadamsimpleelement ? idzebra-2.2.10/tab/string.chr0000664000175000017500000000140214754717556014440 0ustar00adamadam# Generic character map. encoding utf-8 # Define the basic value-set. *Beware* of changing this without re-indexing # your databases. lowercase {0-9}{a-y}üzæäøöå uppercase {0-9}{A-Y}ÜZÆÄØÖÅ # Breaking characters space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~ # Characters to be considered equivalent for searching purposes. # equivalent æä(ae) # equivalent øö(oe) # equivalent Ã¥(aa) # equivalent uü # Supplemental mappings #map (ä) ä #map (æ) æ #map (ø) ø #map (å) Ã¥ #map (ö) ö #map (Ä) Ä #map (&Aelig;) Æ #map (Ø) Ø #map (Å) Ã… #map (Ö) Ö #map éÉ e #map á a #map ó o #map í i #map (Aa) (AA) #map (aa) a idzebra-2.2.10/tab/usmarc.abs0000664000175000017500000000167514754717556014431 0ustar00adamadamname usmarc reference USmarc attset bib1.att tagset usmarc.tag marc usmarc.mar esetname B usmarc-b.est esetname F @ all any elm 008 other Date:w:range(data,7,10) # All 245 subfields mapped to title (word) and # 245 subfield a mapped to tile (phrase). elm 245 title - elm 245/? title !:w elm 245/?/a title !:w,!:p # 100 mapped to Author-name-personal and Author. elm 100 Author-name-personal - elm 100/? Author-name-personal !:w,!:p,Author:w,Author:p # 110 mapped to Author-name-corporate and Author elm 110 Author-name-corporate - elm 110/? Author-name-corporate !:w,!:p,Author:w,Author:p # 111 mapped to Author-name-conference and Author elm 111 Author-name-conference - elm 111/? Author-name-conference !:w,!:p,Author:w,Author:p # Tag 260 subfield a mapped to Place-publication elm 260 Place-publication - elm 260/? Place-publication - elm 260/?/a Place-publication !:w elm 260/?/b Publisher !:w elm 260/?/c Date !:w idzebra-2.2.10/tab/wais-variant.est0000664000175000017500000000052614754717556015564 0ustar00adamadam# # WAIS variant eset. # # # Default is no data, variant-list, please. # simpleelement ?:all variant (9,1,@) (6,5,@) # # Empty variant-requests for the well-known elements to override default. # simpleelement (2,1) variant simpleelement (2,7) variant simpleelement (1,16) variant simpleelement (1,18) variant simpleelement (1,14) variant idzebra-2.2.10/tab/words-icu-da.xml0000664000175000017500000000031414754717556015455 0ustar00adamadam idzebra-2.2.10/tab/dan1.att0000664000175000017500000000305514754717556013777 0ustar00adamadamname dan1 reference 1.2.840.10003.3.15 att 1 Classification-DK5-alfa-subdivision # au Alfabetisk underdeling DK-5 att 2 Subject-controlled # ke Kontrollerede emneord att 3 Subject-DBC # db DBC emneord att 4 Subject-DBC-non-fiction # df DBC-faglitterære emneord att 5 Subject-DBC-fiction # ds DBC-skønlitterære emneord att 6 Subject-DBC-music # me DBC-Musikemneord att 7 Form-as-subject # fm Form betegnelse som emneord att 8 Level-as-subject # nb Niveau-emneord att 9 Shelf-mark # po Opstillingselement att 10 Classification-DK5-number # dk DK5 att 11 Classification-as-shelf-mark # ok Klassifikation som opstilling att 12 Obsolete-shelf-mark # gd Forældet dk-klassemærke att 13 Subject-FUI # fg FUI-Koder att 14 Catalogue-code # kk Katalogkode att 15 LIX-number # ix LIX att 16 Music-notation # nm Musikalsk notation att 17 Item-number # nr Numre att 18 Local-item-number # en Numre pÃ¥ ens materiale att 19 Previous-FAUST-code # tf Tidligere og lokale faustnumre att 20 Title-host-publication # lvx Værtspublikationstitel (uden nummer) idzebra-2.2.10/tab/tagsetm.tag0000664000175000017500000000157414754717556014607 0ustar00adamadam# TagSet-M Tags # name tagsetm reference TagsetM type 1 tag 1 schemaIdentifier oid tag 2 elementsOrdered bool tag 3 elementOrdering int tag 4 defaultTagType int tag 5 defaultVariantSetId oid tag 6 defaultVariantSpec structured tag 7 processingInstructions string tag 8 recordUsage int tag 9 restriction string tag 10 rank int tag 11 userMessage string tag 12 url string tag 13 record structured tag 14 local-control-number string tag 15 creation-date generalizedtime tag 16 dateOfLastModification/lastModified generalizedtime tag 17 dateOfLastReview generalizedtime tag 18 score int tag 19 wellKnown string tag 20 recordWrapper structured tag 21 defaultTagSetId oid tag 22 languageOfRecord string tag 23 type string tag 24 scheme string tag 25 costInfo string tag 26 costFlag bool tag 27 termCreatedBy string tag 28 termModifiedBy string idzebra-2.2.10/tab/explain.att0000664000175000017500000000100614754717556014606 0ustar00adamadam# The Explain Attribute Set # name explain reference Exp-1 att 1 ExplainCategory att 2 HumanStringLanguage att 3 DatabaseName att 4 Targetname att 5 AttributeSetOID att 6 RecordSyntaxOID att 7 TagSetOID att 8 ExtendedServicesOID att 9 DateAdded att 10 DateChanged att 11 DateExpired att 12 ElementSetName att 13 ProcessingContext att 14 ProcessingName att 15 TermListName att 16 SchemaOID att 17 Producer att 18 Supplier att 19 Availability att 20 Proprietary att 21 UserFee idzebra-2.2.10/tab/nwi.flt0000664000175000017500000000323214754717556013743 0ustar00adamadam# # Input-filter for the Nordic Web Index record syntax. Output is 'gils-like'. # # // { begin record gils } # Ignore meta tags /.*$/ {} / */ BODY /$/ { data -element title $1 } / */ BODY /$/ { data -element dateOfLastModification $1 } / */ BODY /$/ { data -element controlIdentifier $1 } // { begin element supplementalInformation } / */ BODY /$/ { data -element lastChecked $1 } / */ BODY /$/ { data -element bytes $1 } // { begin element availability } / */ BODY /$/ { data -element linkage $1 } / */ BODY /$/ { data -element linkageType $1 } // { begin element localSubjectIndex } / */ BODY /$/ { data -element localSubjectTerm $1 } # Don't want to have inside of LocalSubjectIndex # Since we end localsubjectindex, we consume the end-tag for that as well. #/[ \n]*/ BODY /<\/ip>[ \n]*<\/lsi>/ { # end element; # data -element sampleText $1 # } /[ \n]*/ BODY /<\/ip>/ { end element; data -element sampleText $1 } // { begin element crossReference } /
  • */ BODY /$/ { data -element linkage $1 } / */ BODY /$/ { data -element title $1 } /<\/nwi>/ { end record } # Generic end-marker /<\/[^>]*>/ { end element } /\n/ { } /./ {} idzebra-2.2.10/tab/urx.chr0000664000175000017500000000031314754717556013750 0ustar00adamadam# URX character map encoding utf-8 # Basic character(s) lowercase {0-9}{a-y}üzæäøöå/.~:-,#!?=<;\{|}+ uppercase {0-9}{A-Y}ÜZÆÄØÖÅ/.~:-,#!?=>;\{|}+ # Breaking characters space {\001-\040} idzebra-2.2.10/tab/danmarc.abs0000664000175000017500000011715114754717556014541 0ustar00adamadamname danmarc reference DANmarc attset bib1.att attset dan1.att marc danmarc.mar esetname B @ esetname F @ elm 10 DanBib-ID-nummer - elm 10/? DanBib-ID-nummer Item-number elm 10/?/a DanBib-ID-nummer Item-number elm 10/?/b Dataproducentens-biblioteksnummer - elm 11 ID-nummer-på-hovedmaterialets-post - elm 11/? ID-nummer-på-hovedmaterialets-post - elm 11/?/a ID-nummer-på-hovedmaterialets-post - elm 14 ID-nummer-på-post-på-højere-niveau - elm 14/? ID-nummer-på-post-på-højere-niveau - elm 14/?/a ID-nummer-på-post-på-højere-niveau - elm 14/?/x ID-nummer-på-post-på-højere-niveau Item-number elm 15 ID-nummer-på-post-på-lavere-niveau - elm 15/? ID-nummer-på-post-på-lavere-niveau Item-number elm 15/?/a ID-nummer-på-post-på-lavere-niveau Item-number elm 16 ID-nummer-på-værtspublikation - elm 16/? ID-nummer-på-værtspublikation - elm 16/?/a ID-nummer-på-værtspublikation - elm 17 ID-nummer-på-første-udgave - elm 17/? ID-nummer-på-første-udgave Item-number,Local-item-number elm 17/?/a ID-nummer-på-første-udgave Item-number,Local-item-number elm 18 ID-nummer-på-anden-post-for-samme-materiale - elm 18/? ID-nummer-på-anden-post-for-samme-materiale Item-number,Local-item-number elm 18/?/a ID-nummer-på-anden-post-for-samme-materiale Item-number,Local-item-number elm 20 Nationalbibliografisk-nummer - elm 20/? Nationalbibliografisk-nummer Item-number elm 20/?/a Landekode-for-nationalbibliografi - elm 20/?/b Nationalbibliografisk-nummer Item-number elm 21 ISBN - elm 21/? ISBN ISBN,Identifier-standard,Item-number elm 21/?/a ISBN ISBN,Identifier-standard,Item-number elm 21/?/b Tilføjelse - elm 21/?/c Bindtype - elm 21/?/d Anskaffelsesvilkår/pris - elm 21/?/n Bestillingsnummer Item-number elm 21/?/x Fejltryk-eller-fejlagtigt-anvendt-ISBN ISBN,Identifier-standard,Item-number elm 22 ISSN - elm 22/? ISSN ISBN,Identifier-standard,Item-number elm 22/?/a ISSN ISBN,Identifier-standard,Item-number elm 22/?/b Tilføjelse - elm 22/?/c Bindtype - elm 22/?/d Anskaffelsesvilkår/pris - elm 22/?/z Fejlagtigt-tildelt-ISSN ISBN,Identifier-standard,Item-number elm 28 ISMN - elm 28/? ISMN ISBN,Identifier-standard,Item-number elm 28/?/a ISMN ISBN,Identifier-standard,Item-number elm 28/?/b Tilføjelse - elm 28/?/c Bindtype - elm 28/?/d Anskaffelsesvilkår/pris - elm 28/?/n Bestillingsnummer Item-number elm 30 CODEN - elm 30/? CODEN CODEN,Item-number elm 30/?/a CODEN CODEN,Item-number elm 32 Kode-for-natio-eller-fagbibliografi - elm 32/? Kode-for-natio-eller-fagbibliografi Catalogue-code elm 32/?/a Kode-for-nationalbibliografi Catalogue-code elm 32/?/x Kode-for-fagbibliografi Catalogue-code #elm 34 Kodede-matematiske-oplysninger - #elm 34/? Kodede-matematiske-oplysninger Code-map-scale #elm 34/?/a Målestokstype Code-map-scale #elm 34/?/b Konstant-lineær-vandret-målestok Code-map-scale #elm 34/?/d Koordinater Code-map-scale #elm 34/?/e Koordinater Code-map-scale #elm 34/?/f Koordinater Code-map-scale #elm 34/?/g Koordinater Code-map-scale elm 38 Opstillingskode-for-børnelitteratur - elm 38/? Opstillingskode-for-børnelitteratur - elm 38/?/a Opstillingskode-for-børnelitteratur - elm 39 Opstillingskode-for-musikoptagelser - elm 39/? Opstillingskode-for-musikoptagelser - elm 39/?/a Opstillingskode-for-musikoptagelser - elm 41 Sprogkode - elm 41/? Sprogkode - elm 41/?/a Materialets-sprog Code-language #elm 41/?/b Mellemoriginalens-sprog Code-language-original #elm 41/?/c Originaludgavens-sprog Code-language-original elm 41/?/d Sprog-i-resuméer Code-language elm 41/?/e Sprog-i-mindre-dele-af-materialet Code-language elm 41/?/p Sprog-i-parallel-tekst Code-language elm 41/?/u Sprog-i-undertekster-til-film/video Code-language elm 42 Lix-tal - elm 42/? Lix-tal - elm 42/?/a Samlet-lix-tal LIX-number elm 42/?/b Specifikation-af-lix-tal - elm 43 Kode-for-geografisk-område - elm 43/? Kode-for-geografisk-område - elm 43/?/a Kode-for-geografisk-område - elm 44 Pædagogisk-fagkode - elm 44/? Pædagogisk-fagkode Subject-FUI elm 44/?/a Kode-for-skoleretning Subject-FUI elm 44/?/b Kode-for-fag-og-undervisningsmateriale Subject-FUI elm 50 LC-klassifikation - #elm 50/? LC-klassifikation Classification-LC elm 50/? LC-klassifikation - elm 50/?/a LC-klassifikation - elm 50/?/b Materialenummer - elm 60 NLM-klassifikation - #elm 60/? NLM-klassifikation Classification-NLM elm 60/? NLM-klassifikation - elm 60/?/a NLM-klassifikation - elm 60/?/b Materialenummer - elm 70 NAL-klassifikation - #elm 70/? NAL-klassifikation Classification-NAL elm 70/? NAL-klassifikation - elm 70/?/a Materialenummer - elm 79 DB-klassifikation - elm 79/? DB-klassifikation - #elm 79/? DB-klassifikation Classification-DB elm 79/?/a Systemkode - elm 80 UDK - #elm 80/? UDK Classification-UDC elm 80/? UDK - elm 80/?/a UDK-notation - elm 82 DDC - elm 82/? DDC - #elm 82/? DDC Classification-Dewey elm 82/?/a Basisnummer - elm 82/?/b Udgivelse - elm 82/?/c DDC-udgave - elm 83 Felt-083 - elm 83/? Felt-083 - elm 83/?/a Felt-083 - elm 83/?/b Felt-083 - elm 85 BCM-klassifikation - elm 85/? BCM-klassifikation - #elm 85/? BCM-klassifikation Classification-BCM elm 85/?/a BCM-klassifikation - elm 85/?/b BCM-klassifikation - elm 85/?/c BCM-klassifikation - elm 87 Lokal-klassifikationsnotation-1 - elm 87/? Lokal-klassifikationsnotation-1 - #elm 87/?/a Lokal-klassifikationsnotation-1 Classification-local elm 87/?/b Lokal-klassifikationsnotation-1 - elm 88 Lokal-klassifikationsnotation-2 - elm 88/? Lokal-klassifikationsnotation-2 - #elm 88/?/a Lokal-klassifikationsnotation-2 Classification-local elm 88/?/b Lokal-klassifikationsnotation-2 - elm 88/?/c Lokal-klassifikationsnotation-2 - elm 88/?/d Lokal-klassifikationsnotation-2 - elm 88/?/e Lokal-klassifikationsnotation-2 - elm 88/?/f Lokal-klassifikationsnotation-2 - elm 88/?/n Lokal-klassifikationsnotation-2 - elm 88/?/p Lokal-klassifikationsnotation-2 - elm 88/?/q Lokal-klassifikationsnotation-2 - elm 88/?/t Lokal-klassifikationsnotation-2 - elm 88/?/u Lokal-klassifikationsnotation-2 - elm 89 Lokal-klassifikationsnotation-3 - elm 89/? Lokal-klassifikationsnotation-3 - #elm 89/?/a Lokal-klassifikationsnotation-3 Classification-local elm 89/?/b Lokal-klassifikationsnotation-3 - elm 89/?/c Lokal-klassifikationsnotation-3 - elm 96 Lokal-opstillingssignatur - elm 96/? Lokal-opstillingssignatur - elm 96/?/a Opstilling - elm 96/?/n Lokal-opstillingssignatur - elm 96/?/z Lokaliseringskode - elm 100 Personnavn - elm 100/? Personnavn Personal-name:w,Personal-name:p,Shelf-mark #elm 100/?/a Efternavn/fornavn-alene Personal-name:w,Personal-name:p,Personal-name-personal:w,Personal-name-personal:p,Shelf-mark #elm 100/?/c Fødselsår Personal-name:w,Personal-name:p,Personal-name-personal:w,Personal-name-personal:p,Shelf-mark #elm 100/?/f Tilføjelse Personal-name:w,Personal-name:p,Personal-name-personal:w,Personal-name-personal:p,Shelf-mark #elm 100/?/h Fornavn Personal-name:w,Personal-name:p,Personal-name-personal:w,Personal-name-personal:p,Shelf-mark #elm 100/?/k Fuldt-udskrevet-fornavn Personal-name:w,Personal-name:p,Personal-name-personal:w,Personal-name-personal:p,Shelf-mark elm 110 Korporationsnavn-opstillingselement - elm 110/? Korporationsnavn-opstillingselement Personal-name:w,Personal-name:p,Corporate-name:w,Corporate-name:p,Shelf-mark #elm 110/?/a Korporationsnavn Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark #elm 110/?/c Underkorporation Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark #elm 110/?/e Tilføjelse Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark #elm 110/?/i Nummer-på-konference Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark #elm 110/?/j Sted-for-konference Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark #elm 110/?/k År-for-konference Personal-name:w,Personal-name:p,Personal-name-corporate:w,Personal-name-corporate:p,Shelf-mark elm 210 Forkortet-nøgletitel - elm 210/? Forkortet-nøgletitel Title-key,Title,Title:p elm 210/?/a Forkortet-nøgletitel Title-key,Title,Title:p elm 210/?/b Forkortet-identificerende-tilføjelse Title-key,Title,Title:p elm 222 Nøgletitel - elm 222/? Nøgletitel Title-key,Title,Title:p elm 222/?/a Nøgletitel Title-key,Title,Title:p elm 222/?/b Identificerende-tilføjelse Title-key,Title,Title:p elm 239 Uniform-titel/standardtitel-opstillingselement - elm 239/? Uniform-titel/standardtitel-opstillingselement Title-uniform,Title,Title:p elm 239/?/t Uniform-titel Title-uniform,Title,Title:p elm 239/?/u Almindeligt-kendt-tilnavn Title-uniform,Title,Title:p elm 239/?/v Uddragstitel Title-uniform,Title,Title:p elm 239/?/Ø Uniform-titel/standardtitel-opstillingselement - elm 239/?/ø Identificerende-tilføjelser Title-uniform,Title elm 240 Uniform-titel-opstillingselement - elm 240/? Uniform-titel-opstillingselement Title-uniform,Title,Title:p elm 240/?/a Uniform-titel Title-uniform,Title,Title:p elm 240/?/j Andet-identificerende-element Title-uniform,Title,Title:p elm 240/?/r Sprog-i-oversættelse/version - elm 240/?/u Udgivelsesår - elm 240/?/ø Identificerende-tilføjelser Title-uniform,Title elm 241 Originaltitel - elm 241/? Originaltitel Title,Title:p elm 241/?/a Originaltitel Title,Title:p elm 241/?/r Sprog - elm 245 Originaltitel-og-ophavsangivelse - elm 245/? Originaltitel-og-ophavsangivelse Title,Title:p elm 245/?/A Originaltitel-og-ophavsangivelse - elm 245/?/G Originaltitel-og-ophavsangivelse - elm 245/?/a Titel Title,Title:p elm 245/?/b Rest-af-titel-eller-alternativ-titel Title,Title:p elm 245/?/c Undertitel-og-anden-titelinformation Title,Title:p elm 245/?/e Ophavsangivelser-opslag - elm 245/?/f Ophavsangivelser - elm 245/?/g Numerisk-eller-alfabetisk-betegnelse-for-bind Title,Title:p elm 245/?/i Anden-primær/sekundær-ophavsangivelse-kun-i-nationalbibliogafien - elm 245/?/j Anden-primær/sekundær-ophavsangivelse-ikke-i-nationalbibliogafien - elm 245/?/o Titel-på-supplement/sektion - elm 245/?/p Paralleltitel Title-parallel,Title,Title:p elm 245/?/s Parallel-undertitel Title-parallel,Title,Title:p elm 245/?/u Markant-undertitel Title,Title:p elm 245/?/x Hovedtitel-på-tilføjet-værk-af-andet-ophav Title,Title:p elm 245/?/y Titel-på-supplement Title,Title:p elm 245/?/Ø Originaltitel-og-ophavsangivelse - elm 245/?/æ Identificerende-ophavsangivelse-til-titel - elm 245/?/ø Identificerende-tilføjelser-til-titel - elm 248 Bindspecifikation - elm 248/? Bindspecifikation Title elm 248/?/a Bindtitel/supplementstitel Title,Title:p elm 248/?/c Undertitel-og-anden-titelinformation Title,Title:p elm 248/?/e Ophavsangivelse - elm 248/?/g Bindnummer/supplementsbetegnelse Title elm 248/?/j Udgivelsesår - elm 248/?/l Generel-note Note elm 248/?/w Udgavebetegnelse - elm 250 Udgavebetegnelse - elm 250/? Udgavebetegnelse - elm 250/?/a Udgavebetegnelse - elm 250/?/b Kort-udgavebetegnelse/sonderingselement - elm 250/?/c Ophavsangivelse-opslag - elm 250/?/d Ophavsangivelse - elm 250/?/x Oplagsbetegnelse - elm 255 Nummereringer-og-dateringer - elm 255/? Nummereringer-og-dateringer - elm 255/?/a Nummereringer-og-dateringer - elm 256 Matematiske-oplysninger-for-kartografiske-materialer - #elm 256/? Matematiske-oplysninger-for-kartografiske-materialer Code-map-scale #elm 256/?/a Målestok Code-map-scale #elm 256/?/c Projektion Code-map-scale elm 260 Publicering/distribution - elm 260/? Publicering/distribution - elm 260/?/a Hjemsted-for-forlag Place-publication elm 260/?/b Navn-på-forlag Publisher elm 260/?/c Udgivelsesår Date-of-Publication elm 260/?/d Adresse-på-forlag - elm 260/?/e Funktionsangivelse-på-forlag - elm 260/?/f Hjemsted-for-distributør Place-publication elm 260/?/g Navn-på-distributør - elm 260/?/k Trykkerioplysninger - elm 260/?/p Navn-på-forlag/distributør-på-andet-sprog/alfabet publisher elm 300 Fysisk-beskrivelse - elm 300/? Fysisk-beskrivelse - elm 300/?/D Fysisk-beskrivelse - elm 300/?/a Omfang-uden-specifik-materialebetegnelse - elm 300/?/b Yderligere-fysisk-beskrivelse - elm 300/?/c Størrelse - elm 300/?/d Bilag - elm 300/?/e Tekniske-oplysninger - elm 300/?/l Spilletid - elm 300/?/n Specifik-materialebetegnelse - elm 440 Seriebetegnelse-i-materialets-form - elm 440/? Seriebetegnelse-i-materialets-form - elm 440/?/A Seriebetegnelse-i-materialets-form - elm 440/?/V Seriebetegnelse-i-materialets-form - elm 440/?/a Seriens-hovedtitel Title,Title-series,Title:p elm 440/?/c Undertitel-eller-anden-titelinformation Title,Title-series,Title:p elm 440/?/e Ophavsangivelse - elm 440/?/n Numerisk/alfabetisk-betegnelse-for-sektion Title,Title-series elm 440/?/o Titel-på-sektion Title,Title-series,Title:p elm 440/?/p Seriens-paralleltitel Title,Title-series,Title:p elm 440/?/v Nummerering-og-datering-i-serien Title,Title-series elm 440/?/y Seriebetegnelse-i-materialets-form - elm 440/?/z Seriens-ISSN ISSN elm 440/?/å Seriebetegnelse-i-materialets-form - elm 440/?/æ Identificerende-ophavsangivelse-til-seriens-titel - elm 440/?/ø Identificerende-tilføjelse-til-seriens-titel Title,Title-series,Title:p elm 500 Periodicums-frekvens - elm 500/? Periodicums-frekvens - elm 500/?/a Periodicums-frekvens - elm 501 Systemkrav/adgangsmåde - elm 501/? Systemkrav Note elm 501/?/a Adgangsmåde Note elm 502 Originaltitel/oversættelse - elm 502/? Originaltitel/oversættelse Note elm 502/?/a Originaltitel/oversættelse Note elm 504 Indholdsbeskrivelse - elm 504/? Indholdsbeskrivelse Note elm 504/?/a Indholdsbeskrivelse Note elm 505 Art/form - elm 505/? Art/form Note elm 505/?/a Art/form Note elm 506 Disputats/afhandling - elm 506/? Disputats/afhandling Note elm 506/?/a Disputats/afhandling Note elm 507 Anledning-til-udgivelse - elm 507/? Anledning-til-udgivelse Note elm 507/?/a Anledning-til-udgivelse Note elm 508 Sprog-og-alfabet - elm 508/? Sprog-og-alfabet Note elm 508/?/a Sprog-og-alfabet Note elm 509 Besætning - elm 509/? Besætning Note elm 509/?/a Besætning Note elm 512 Beskrivelse - elm 512/? Beskrivelse - elm 512/?/a Generel-note-til-beskrivelse Note elm 512/?/b Supplerende-tekst - elm 512/?/e Ophavsangivelse - elm 512/?/i Indledende-tekst - elm 512/?/t Titel Title,Title:p elm 513 Fælles-ophavsangivelse - elm 513/? Fælles-ophavsangivelse - elm 513/?/e Primær-ophavsangivelse - elm 517 Målgruppe-og-anvendelighed - elm 517/? Målgruppe-og-anvendelighed Note elm 517/?/a Målgruppe-og-anvendelighed Note elm 520 Værkets-bibliografiske-historie - elm 520/? Værkets-bibliografiske-historie - elm 520/?/a Værkets-bibliografiske-historie - elm 520/?/b Supplerende-tekst - elm 520/?/i Indledende-tekst - elm 520/?/t Titel Title,Title:p elm 521 Udgavens-oplag - elm 521/? Udgavens-oplag - elm 521/?/a Oplagsbetegnelse - elm 521/?/b Seneste-oplag - elm 521/?/c Oplagets-udgivelsesår Date-of-publication elm 526 Sammenhæng-med-andre-værker - elm 526/? Sammenhæng-med-andre-værker - elm 526/?/a Sammenhæng-med-andre-værker Note elm 526/?/b Supplerende-tekst - elm 526/?/d Ophavsangivelse-foran-titel - elm 526/?/e Ophavsangivelse - elm 526/?/i Indledende-tekst - elm 526/?/t Titel Title,Title:p elm 530 Indholdsnote - elm 530/? Indholdsnote - elm 530/?/a Indholdsnote Note elm 530/?/e Ophavsangivelse - elm 530/?/t Titel Title,Title:p elm 531 Indledende-tekst-til-maskingenereret-indholdsnote - elm 531/? Indledende-tekst-til-maskingenereret-indholdsnote - elm 531/?/a Indledende-tekst-til-maskingenereret-indholdsnote - elm 532 Litteraturhenvisninger-og-registre - elm 532/? Litteraturhenvisninger-og-registre - elm 532/?/a Litteraturhenvisninger-og-registre - elm 534 Partielt-indhold - elm 534/? Partielt-indhold Note elm 534/?/a Partielt-indhold Note elm 538 Numre-der-indgår-i-materialet - elm 538/? Numre-der-indgår-i-materialet Item-number elm 538/?/a Nummer Item-number elm 538/?/b Editionsnummer Item-number elm 538/?/c Pladenummer Item-number elm 538/?/d Editions-og-pladenummer Item-number elm 538/?/f Forlag Publisher elm 538/?/g Forlagsnummer Item-number elm 539 Grundlaget-for-katalogiseringen - elm 539/? Grundlaget-for-katalogiseringen - elm 539/?/a Grundlaget-for-katalogiseringen - elm 557 Periodicum-som-værtspublikation-for-I-analyse - elm 557/? Periodicum-som-værtspublikation-for-I-analyse - elm 557/?/V Periodicum-som-værtspublikation-for-I-analyse - elm 557/?/a Titel - # Title,Title-host-item,Title:p elm 557/?/j Udgivelsesår - elm 557/?/v Nummerering/datering - # Title,Title-host-item,Title:p elm 559 Generel-note - elm 559/? Generel-note - elm 559/?/a Generel-note Note elm 600 Personnavn-emneord - #elm 600/? Personnavn-emneord Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/a Efternavn/fornavn-alene Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/c Fødselsår Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/e Romertal Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/f Tilføjelse Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/h Fornavn Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/k Fuldt-udskrevet-fornavn Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/x Underdeling-emne/art Subject-controlled,Subject-name-personal,Subject:p #elm 600/?/å Personnavn-emneord Subject-controlled,Subject-name-personal,Subject:p elm 610 Korporationsnavn-emneord - #elm 610/? Korporationsnavn-emneord Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/a Korporationsnavn Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/c Underkorporation Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/e Tilføjelse Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/t Titel Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/x Underdeling-emne/art Subject-controlled,Subject-name-corporate,Subject:p #elm 610/?/y Underdeling-periode Subject-controlled,Subject-name-corporate,Subject:p elm 621 Emnedata-for-kartografisk-materiale - #elm 621/? Emnedata-for-kartografisk-materiale Subject elm 621/? Emnedata-for-kartografisk-materiale - #elm 621/?/a Stednavn Subject #elm 621/?/b Land/stat Subject elm 630 Kontrolleret-emneord - #elm 630/? Kontrolleret-emneord Subject-controlled,Subject-controlled,Subject:p,Subject-controlled:p #elm 630/?/a Kontrolleret-emneord Subject-controlled,Subject-controlled,Subject:p,Subject-controlled:p #elm 630/?/b Andre-bibliotekers-kontrollerede-emneord Subject-controlled,Subject-controlled,Subject:p,Subject-controlled:p # #elm 631 Ukontrolleret-emneord - #elm 631/? Ukontrolleret-emneord Subject-controlled,Subject-uncontrolled,Subject:p,Subject-uncontrolled:p #elm 631/?/a Ukontrolleret-emneord Subject-controlled,Subject-uncontrolled,Subject:p,Subject-uncontrolled:p #elm 631/?/b Andre-bibliotekers-ukontrollerede-emneord Subject-controlled,Subject-uncontrolled,Subject:p,Subject-uncontrolled:p #elm 631/?/f Ukontrolleret-faglitterært-emneord Subject-controlled,Subject-uncontrolled,Subject:p,Subject-uncontrolled:p # elm 633 Stednavn - #elm 633/? Stednavn Subject-controlled,Subject-controlled,Subject:p,Subject-controlled:p #elm 633/?/a Stednavn Subject-controlled,Subject-controlled,Subject:p,Subject-controlled:p # elm 645 Titel - elm 645/? Titel Subject-controlled,Subject-controlled:p elm 645/?/c Titel Subject-controlled,Subject-controlled:p elm 650 LC-emneord subject-controlled #elm 650/? LC-emneord Subject-controlled #elm 650/?/a LC-emneord Subject-controlled #elm 650/?/v LC-emneord - #elm 650/?/x Underdeling-emne/art Subject-controlled #elm 650/?/y Underdeling-periode Subject #elm 650/?/z Underdeling-lokalitet Subject elm 651 LC-geografisk-emneord subject-controlled #elm 651/? LC-geografisk-emneord Subject #elm 651/?/a LC-geografisk-emneord Subject #elm 651/?/x Underdeling-emne/art Subject #elm 651/?/z Underdeling-lokalitet Subject elm 652 DK5-klassemærke - elm 652/? DK5-klassemærke - elm 652/?/a Efternavn/navn/korporationsnavn-som-alfabetisk-underdeling Classification-DK5-alfa-subdivision elm 652/?/b Andet-som-alfabetisk-underdeling Classification-DK5-alfa-subdivision,Subject-controlled elm 652/?/c Fødselsår Classification-DK5-alfa-subdivision elm 652/?/h Fornavn Classification-DK5-alfa-subdivision,Subject-controlled elm 652/?/i Analytisk-klassemærke Classification-DK5-number elm 652/?/m Opstillings-og-hovedplacering Classification-DK5-number,Classification-as-shelf-mark elm 652/?/n Nationalbibliografisk-hovedplacering Classification-DK5-number elm 652/?/o Opstillingsklassemærkeog-bibliotekshovedplacering Classification-DK5-number elm 652/?/p Biplacering Classification-DK5-number elm 652/?/q Nationalbibliografisk-biplacering Classification-DK5-number elm 652/?/r Biblioteksbiplacering Classification-DK5-number elm 652/?/v Tilføjede-cifre-efter-kolon - elm 652/?/z Tilføjede-cifre-efter-bindestreg - elm 652/?/å Feltnumerator - elm 654 Forældet-DK5-klassemærke - #elm 654/? Forældet-DK5-klassemærke Classification #elm 654/?/p Biplacering Classification elm 660 MeSH-emneord - elm 660/? MeSH-emneord Subject-controlled,Subject-controlled,MESH-Subject elm 660/?/a MeSH-emneord Subject-controlled,Subject-controlled,MESH-Subject elm 660/?/x Generel-underdeling Subject-controlled,Subject-controlled,MESH-Subject elm 661 Europæisk-pædagogisk-tesaurus - elm 661/? Europæisk-pædagogisk-tesaurus Subject-controlled,Subject-controlled elm 661/?/a Kontrolleret-dansk-emneord Subject-controlled,Subject-controlled elm 661/?/b Kontrolleret-engelsk-emneord Subject-controlled,Subject-controlled elm 661/?/c Ukontrolleret-dansk-emneord Subject-controlled,Subject-controlled elm 666 Kontrolleret-DBC-emneord - elm 666/? Kontrolleret-DBC-emneord - elm 666/?/e Stednavn-som-emneord-faglitteratur Subject-DBC,Subject-controlled,Subject-DBC-non-fiction,Subject-controlled elm 666/?/f Kontrolleret-faglitterært-emneord Subject-DBC,Subject-controlled,Subject-DBC-non-fiction,Subject-controlled elm 666/?/i Tidsangivelse Subject-DBC,Subject-controlled,Subject-DBC-non-fiction,Subject-controlled elm 666/?/l Stednavn Subject-DBC,Subject-controlled elm 666/?/m Musikalsk-genre-som-emneord Subject-DBC,Subject-controlled,Subject-DBC-music elm 666/?/n Musikalsk-besætning-som-emneord Subject-DBC,Subject-controlled,Subject-DBC-music elm 666/?/o Formbetegnelse Subject-DBC,Subject-controlled,Form-as-subject elm 666/?/p Periodebetegnelse Subject-DBC,Subject-controlled,Subject-DBC-music elm 666/?/q Stednavn-som-emneord-skønlitteratur Subject-DBC,Subject-controlled,Subject-DBC-fiction,Subject-controlled elm 666/?/s Kontrolleret-skønlitterært-emneord Subject-DBC,Subject-controlled,Subject-DBC-fiction,Subject-controlled elm 666/?/u Niveau/brugerkategori Subject-DBC,Subject-controlled,Level-as-subject elm 666/?/å Kontrolleret-DBC-emneord Subject-DBC,Subject-controlled elm 668 Genrebetegnelse - elm 668/? Genrebetegnelse Subject-controlled elm 668/?/a Genrebetegnelse Subject-controlled elm 668/?/b Underdeling Subject-controlled #elm 670 NAL-emneord - #elm 670/? NAL-emneord Subject-NAL #elm 670/?/a NAL-emneord Subject elm 690 COMPASS-emneord - elm 690/? COMPASS-emneord - # Subject-controlled,Subject-COMPASS elm 690/?/a Enkeltord - # Subject-controlled,Subject-COMPASS elm 690/?/b Flere-ord - # Subject-controlled,Subject-COMPASS elm 690/?/c Forbindende-tekst - elm 690/?/d Underdeling-periode - # Subject-controlled,Subject-COMPASS elm 690/?/h COMPASS-emneord - # Subject-controlled,Subject-COMPASS elm 690/?/i COMPASS-emneord - elm 690/?/m COMPASS-emneord - elm 690/?/v COMPASS-emneord - elm 690/?/w COMPASS-emneord - elm 690/?/x COMPASS-emneord - elm 690/?/y COMPASS-emneord - elm 690/?/z COMPASS-emneord - elm 700 Personnavn - elm 700/? Personnavn Personal-name elm 700/?/A Personnavn Personal-name elm 700/?/a Efternavn/fornavn-alene Personal-name elm 700/?/b Funktionsbetegnelse - elm 700/?/c Fødselsår Personal-name elm 700/?/f Tilføjelse Personal-name elm 700/?/h Fornavn Personal-name elm 700/?/k Fuldt-udskrevet-fornavn Personal-name elm 700/?/å Personnavn - elm 710 Korporationsnavn - elm 710/? Korporationsnavn Personal-name elm 710/?/A Korporationsnavn Personal-name elm 710/?/a Korporationsnavn Personal-name elm 710/?/c Underkorporation Personal-name elm 710/?/e Tilføjelse Personal-name elm 710/?/i Nummer-på-konference Personal-name elm 710/?/j Sted-for-konference Personal-name elm 710/?/k År-for-konference Personal-name elm 710/?/å Korporationsnavn - elm 739 Uniform-titel/standardtitel - elm 739/? Uniform-titel/standardtitel Title-uniform elm 739/?/t Uniform-titel/standardtitel Title-uniform elm 740 Uniform-titel - elm 740/? Uniform-titel Title,Title-uniform elm 740/?/a Uniform-titel Title,Title-uniform elm 740/?/s Titel-på-del-af-værket Title,Title-uniform elm 745 Varianttitel - elm 745/? Varianttitel - elm 745/?/A Varianttitel - elm 745/?/a Titel Title elm 745/?/o Titel-på-afhængig-publikation/supplement - elm 770 Personnavn-analyse - elm 770/? Personnavn-analyse Personal-name elm 770/?/A Personnavn-analyse - elm 770/?/a Efternavn/fornavn-alene Personal-name elm 770/?/c Fødselsår Personal-name elm 770/?/f Tilføjelse Personal-name elm 770/?/h Fornavn Personal-name elm 770/?/å Feltnumerator - elm 780 Korporationsnavn-analyse - elm 780/? Korporationsnavn-analyse Personal-name,Corporate-name elm 780/?/a Korporationsnavn Personal-name,Corporate-name elm 780/?/å Feltnumerator Personal-name,Corporate-name elm 795 Analytisk-titel - elm 795/? Analytisk-titel Title elm 795/?/A Analytisk-titel - elm 795/?/a Analytisk-titel Title elm 795/?/b Rest-af-analytisk-titel/alternativ-titel Title elm 795/?/c Undertitel/anden-titelinformation Title elm 795/?/e Ophavsangivelse-opslag - elm 795/?/i Anden-primær/sekundær-ophavsangivelse - elm 795/?/p Paralleltitel Title elm 795/?/u Almindeligt-kendt-tilnavn Title elm 795/?/v Uddragstitel Title elm 795/?/y Kode - elm 795/?/å Feltnumerator - elm 840 Serietitel - elm 840/? Serietitel - elm 840/?/V Serietitel - elm 840/?/a Seriens-hovedtitel Title,Title-series elm 840/?/v Seriens-nummerering/datering Title,Title-series elm 840/?/z Seriens-ISSN Identifier-standard,ISSN,Item-number elm 840/?/ø Identificerende-tilføjelser-til-seriens-titel Title elm 860 Tidligere-titel - elm 860/? Tidligere-titel - elm 860/?/c Tilføjelse-til-titel Related-periodical,Title-former elm 860/?/t Hovedtitel Title-former elm 860/?/z ISSN Identifier-standard,ISSN,Item-number elm 861 Senere-titel - elm 861/? Senere-titel - elm 861/?/c Tilføjelse-til-titel Related-periodical,Title-added-title-page elm 861/?/i Indledende-tekst - elm 861/?/t Hovedtitel Related-periodical,Title-added-title-page elm 861/?/z ISSN Identifier-standard,ISSN,Item-number elm 863 Udgivet-sammen-med - elm 863/? Udgivet-sammen-med - elm 863/?/t Hovedtitel Title-other-variant elm 863/?/z ISSN Identifier-standard,ISSN,Item-number elm 867 Hovedudgave-på-andet-sprog/andet-indhold - elm 867/? Hovedudgave-på-andet-sprog/andet-indhold - elm 867/?/t Hovedtitel Title-other-variant elm 867/?/z ISSN Identifier-standard,ISSN,Item-number elm 868 Udgave-på-andet-sprog/andet-indhold - elm 868/? Udgave-på-andet-sprog/andet-indhold - elm 868/?/t Hovedtitel Title-other-variant elm 868/?/z ISSN Identifier-standard,ISSN,Item-number elm 870 Hovedpublikation-til-supplement - elm 870/? Hovedpublikation-til-supplement - elm 870/?/t Hovedtitel Title-other-variant elm 870/?/z ISSN Identifier-standard,ISSN,Item-number elm 871 Supplement-til-hovedpublikation - elm 871/? Supplement-til-hovedpublikation - elm 871/?/c Tilføjelse-til-titel - elm 871/?/t Hovedtitel Title-other-variant elm 874 Underserie - elm 874/? Underserie - elm 874/?/t Hovedtitel Title-other-variant elm 874/?/z ISSN Identifier-standard,ISSN,Item-number elm 900 Henvisning-fra-personnavn - elm 900/? Henvisning-fra-personnavn Personal-name elm 900/?/A Henvisning-fra-personnavn - elm 900/?/a Efternavnet/fornavnet-alene Personal-name elm 900/?/c Fødselsår Personal-name elm 900/?/f Tilføjelse Personal-name elm 900/?/h Fornavn Personal-name elm 900/?/k Fuldt-udskrevet-fornavn Personal-name elm 900/?/w Ord-hvortil-der-henvises - elm 900/?/x Forbindende-tekst - elm 900/?/z Felt/delfeltkode-hvortil-der-henvises - elm 900/?/å Feltnumerator - elm 910 Henvisning-fra-korporationsnavn - elm 910/? Henvisning-fra-korporationsnavn Personal-name elm 910/?/A Henvisning-fra-korporationsnavn - elm 910/?/a Korporationsnavn Personal-name elm 910/?/c Underkorporation Personal-name elm 910/?/e Tilføjelse Personal-name elm 910/?/g Resten-af-korporationsnavn Personal-name elm 910/?/h Forbogstaver/fornavnsforkortelser Personal-name elm 910/?/w Ord-hvortil-der-henvises - elm 910/?/x Forbindende-tekst - elm 910/?/z Felt/delfeltkode-hvortil-der-henvises - elm 910/?/å Feltnumerator - elm 945 Henvisning-fra-titel - elm 945/? Henvisning-fra-titel - elm 945/?/a Title Title elm 945/?/w Ord-hvortil-der-henvises - elm 945/?/x Forbindende-tekst - elm 945/?/z Felt/delfeltkode-hvortil-der-henvises - elm 980 Bibliotekets-beholdning-af-et-periodicum - elm 980/? Bibliotekets-beholdning-af-et-periodicum - elm 980/?/d Første-år - elm 980/?/g Kode-for-fuldstændighed - elm s01 felt-s01 - elm s01/? felt-s01 - elm s01/?/a felt-s01 - elm s01/?/b felt-s01 - elm s06 felt-s06 - elm s06/? felt-s06 - elm s06/?/a felt-s06 - elm s06/?/b felt-s06 - elm s10 felt-s10 - elm s10/? felt-s10 - elm s10/?/a felt-s10 - elm s45 felt-s45 - elm s45/? felt-s45 - elm s45/?/a felt-s45 - idzebra-2.2.10/tab/summary.abs0000664000175000017500000000113314754717556014621 0ustar00adamadam# Summary record abstract syntax # name summary tagset summary.tag attset bib1.att reference Summary elm (4,0) title ! elm (4,1) author ! elm (4,2) callNumber - elm (4,3) recordType - elm (4,4) bibliographicLevel - elm (4,5) formats - elm (4,5)/(4,6) format - elm (4,5)/(4,6)/(4,7) format-type - elm (4,5)/(4,6)/(4,8) format-size - elm (4,5)/(4,6)/(4,9) format-bestPosn - elm (4,10) publicationPlace - elm (4,11) publicationDate - elm (4,12) targetSystemKey - elm (4,13) satisfyingElement - elm (4,14) rank - elm (4,15) documentId - elm (4,16) otherInformation - idzebra-2.2.10/tab/gils-summary.map0000664000175000017500000000033514754717556015570 0ustar00adamadam# # This table maps GILS-records to the Summary (abstract) syntax # targetname summary targetref Summary map title /(4,0) map originator /(4,1) map localControlNumber /(4,12) map rank /(4,14) map abstract /(4,16) idzebra-2.2.10/tab/meta.tag0000664000175000017500000000007114754717556014060 0ustar00adamadamname meta type 4 include tagsetg.tag include tagsetm.tag idzebra-2.2.10/tab/numeric.chr0000664000175000017500000000035314754717556014600 0ustar00adamadam# Numeric character map # # Define the basic value-set. *Beware* of changing this without re-indexing # your databases. lowercase -{0-9}., uppercase -{0-9}., # Breaking characters space {\001-\040}!"#$%&'\()*+/:;<=>?@\[\\]^_`\{|}~ idzebra-2.2.10/tab/gils.tag0000664000175000017500000000536714754717556014105 0ustar00adamadam# Tag set for GILS version 2. # name gils type 4 include tagsetm.tag include tagsetg.tag tag 1 controlIdentifier string tag 2 streetAddress string tag 3 city string tag 4 stateOrProvince string tag 5 zipOrPostalCode string tag 6 hoursOfService string tag 7 resourceDescription string tag 8 technicalPrerequisites string tag 9 westBoundingCoordinate intUnit tag 10 eastBoundingCoordinate intUnit tag 11 northBoundingCoordinate intUnit tag 12 southBoundingCoordinate intUnit tag 13 placeKeyword string tag 14 placeKeywordThesaurus string tag 15 beginningDate GeneralizedTime tag 16 timePeriodTextual string tag 17 linkage string tag 18 linkageType string tag 19 recordSource string tag 20 controlledTerm string tag 21 subjectThesaurus string tag 22 uncontrolledTerm string tag 23 originalControlIdentifier string tag 24 recordReviewDate GeneralizedTime tag 25 generalAccessConstraints string tag 26 originatorDisseminationControl string tag 27 securityClassificationControl string tag 28 orderInformation string tag 29 cost bool tag 30 costInformation string tag 31 scheduleNumber string tag 32 languageOfResource string tag 33 medium string tag 34 languageOfRecord string tag 35 relationship string tag 36 endingDate GeneralizedTime tag 51 purpose structured tag 52 originator structured tag 53 accessConstraints structured tag 54 useConstraints structured tag 55 orderProcess structured tag 56 agencyProgram structured tag 57 sourcesOfData structured tag 58 methodology structured tag 59 supplementalInformation structured tag 70 availability structured tag 71 spatialDomain structured tag 90 distributor structured tag 91 boundingCoordinates structured tag 92 place structured tag 93 timePeriod structured tag 94 pointOfContact structured tag 95 controlledSubjectIndex structured tag 96 subjectTermsControlled structured tag 97 subjectTermsUncontrolled structured tag 98 crossReference structured tag 99 availableLinkage structured tag 100 crossReferenceLinkage structured tag 101 timePeriodStructured structured tag 102 availableTimeStructured structured idzebra-2.2.10/tab/meta-b.est0000664000175000017500000000022314754717556014316 0ustar00adamadamsimpleelement (1,10) simpleelement (1,12) simpleelement (2,1) simpleelement (1,14) simpleelement (4,5) simpleelement (2,3) simpleelement (2,2):all idzebra-2.2.10/tab/gils.abs0000664000175000017500000001532414754717556014071 0ustar00adamadam# This is the abstract syntax (and most of the top-level profile info) # for GILS version 2. # name gils reference GILS-schema attset gils.att tagset gils.tag varset var1.var maptab gils-usmarc.map maptab gils-summary.map # Element set names esetname VARIANT gils-variant.est # for WAIS-compliance esetname B gils-b.est esetname G gils-g.est esetname W gils-b.est # We don't really do bodyOfDisplay yet. esetname F @ systag sysno none all Any elm (1,1) schemaIdentifier - elm (1,10) rank - elm (1,12) url - elm (1,14) localControlNumber - elm (2,1) title !:w,!:p,!:s elm (4,52) originator author-name-corporate # # Additional structuring of originator non-standard. # elm (4,52)/(2,7) originatorName author-name-corporate elm (4,52)/(2,10) originatorOrganization author-name-corporate elm (4,52)/(4,2) originatorStreetAddress author-name-corporate elm (4,52)/(4,3) originatorCity author-name-corporate elm (4,52)/(4,4) originatorStateOrProvince author-name-corporate elm (4,52)/(4,5) originatorZipOrPostalCode author-name-corporate elm (4,52)/(2,16) originatorCountry author-name-corporate elm (4,52)/(2,12) originatorNetworkAddress author-name-corporate elm (4,52)/(4,6) originatorHoursofService author-name-corporate elm (4,52)/(2,14) originatorTelephone author-name-corporate elm (4,52)/(2,15) originatorFax author-name-corporate elm (2,2) author ! # # Additional structuring of author non-standard. # elm (2,2)/(2,7) authorName author elm (2,2)/(2,10) authorOrganization author elm (2,2)/(4,2) authorStreetAddress author elm (2,2)/(4,3) authorCity author elm (2,2)/(4,4) authorStateOrProvince author elm (2,2)/(4,5) authorZipOrPostalCode author elm (2,2)/(2,16) authorCountry author elm (2,2)/(2,12) authorNetworkAddress author elm (2,2)/(4,6) authorHoursofService author elm (2,2)/(2,14) authorTelephone author elm (2,2)/(2,15) authorFax author elm (2,4) dateOfPublication ! elm (2,3) placeOfPublication place-publication elm (4,32) languageOfResource code-language elm (2,6) abstract ! elm (4,95) controlledSubjectIndex - elm (4,95)/(4,21) subjectThesaurus - elm (4,95)/(4,96) subjectTermsControlled controlled-subject-index elm (4,95)/(4,96)/(4,20) controlledTerm index-terms elm (4,97) subjectTermsUncontrolled uncontrolled-term elm (4,97)/(4,22) uncontrolledTerm uncontrolled-term elm (4,71) spatialDomain ! elm (4,71)/(4,91) boundingCoordinates ! elm (4,71)/(4,91)/(4,9) westBoundingCoordinate !:n elm (4,71)/(4,91)/(4,10) eastBoundingCoordinate !:n elm (4,71)/(4,91)/(4,11) northBoundingCoordinate !:n elm (4,71)/(4,91)/(4,12) southBoundingCoordinate !:n elm (4,71)/(4,92) place ! elm (4,71)/(4,92)/(4,14) placeKeywordThesaurus - elm (4,71)/(4,92)/(4,13) placeKeyword place elm (4,93) timePeriod ! elm (4,93)/(4,16) timePeriodTextual ! elm (4,93)/(4,101) timePeriodStructured ! elm (4,93)/(4,101)/(4,15) beginningDate ! elm (4,93)/(4,101)/(4,36) endingDate ! elm (4,70) availability ! elm (4,70)/(4,33) medium material-type elm (4,70)/(4,90) distributor ! elm (4,70)/(4,90)/(2,7) distributorName ! elm (4,70)/(4,90)/(2,10) distributorOrganization ! elm (4,70)/(4,90)/(4,2) distributorStreetAddress ! elm (4,70)/(4,90)/(4,3) distributorCity ! elm (4,70)/(4,90)/(4,4) distributorStateOrProvince ! elm (4,70)/(4,90)/(4,5) distributorZipOrPostalCode ! elm (4,70)/(4,90)/(2,16) distributorCountry ! elm (4,70)/(4,90)/(2,12) distributorNetworkAddress ! elm (4,70)/(4,90)/(4,6) distributorHoursofService ! elm (4,70)/(4,90)/(2,14) distributorTelephone ! elm (4,70)/(4,90)/(2,15) distributorFax ! elm (4,70)/(4,7) resourceDescription ! elm (4,70)/(4,55) orderProcess ! elm (4,70)/(4,55)/(4,28) orderInformation ! elm (4,70)/(4,55)/(4,29) cost ! elm (4,70)/(4,55)/(4,30) costInformation ! elm (4,70)/(4,8) technicalPrerequisites ! elm (4,70)/(4,93) availableTimePeriod ! elm (4,70)/(4,93)/(4,16) availableTimeTextual ! elm (4,70)/(4,93)/(4,102) availableTimeStructured ! elm (4,70)/(4,93)/(4,102)/(4,15) beginningDate available-time-structured elm (4,70)/(4,93)/(4,102)/(4,36) endingDate available-time-structured elm (4,70)/(4,99) availableLinkage ! elm (4,70)/(4,99)/(4,18) linkageType ! elm (4,70)/(4,99)/(4,17) linkage available-linkage:u,linkage:u elm (4,57) sourcesOfData ! elm (4,58) methodology ! elm (4,53) accessConstraints ! elm (4,53)/(4,25) generalAccessConstraints ! elm (4,53)/(4,26) originatorDisseminationControl ! elm (4,53)/(4,27) securityClassificationControl ! elm (4,54) useConstraints ! elm (4,94) pointOfContact ! elm (4,94)/(2,7) contactName ! elm (4,94)/(2,10) contactOrganization ! elm (4,94)/(4,2) contactStreetAddress ! elm (4,94)/(4,3) contactCity ! elm (4,94)/(4,4) contactStateOrProvince ! elm (4,94)/(4,5) contactZipOrPostalCode ! elm (4,94)/(2,16) contactCountry ! elm (4,94)/(2,12) contactNetworkAddress ! elm (4,94)/(4,6) contactHoursOfService ! elm (4,94)/(2,14) contactTelephone ! elm (4,94)/(2,15) contactFax ! elm (4,59) supplementalInformation - elm (4,51) purpose ! elm (4,56) agencyProgram ! elm (4,98) crossReference ! elm (4,98)/(2,1) crossReferenceTitle ! elm (4,98)/(4,35) crossReferenceRelationship ! elm (4,98)/(4,100) crossReferenceLinkage ! elm (4,98)/(4,100)/(4,18) linkageType - elm (4,98)/(4,100)/(4,17) linkage cross-reference-linkage:u elm (4,31) scheduleNumber ! elm (4,1) controlIdentifier identifier-standard elm (4,23) originalControlIdentifier ! elm (4,19) recordSource ! elm (4,34) languageOfRecord ! elm (1,16) dateOfLastModification date/time-last-modified:w,date/time-last-modified:s elm (4,24) recordReviewDate ! idzebra-2.2.10/tab/soif.flt0000664000175000017500000000656414754717556014121 0ustar00adamadam# Crude input-filter for SOIF records -- one record per file. # Author: Peter Valkenburg / TERENA (valkenburg@terena.nl) # Version 0.2 (09/09/1998). # This sort of follows the Nordic Web Index convention of GILS attribute use. # Modified by Kang-Jin Lee (lee@arco.de) # 07/10/1999 # We'll use GILS structured records. BEGIN { begin record gils } # URL will be GILS' availability/linkage /^@[A-Za-z](-|[.A-Za-z_])* { / BODY /$/ { begin element availability data -element linkage $1 end element } # Type will be GILS' availability/linkageType /^[tT]ype{[0-9]+}:\t/ BODY /$/ { begin element availability data -element linkageType $1 end element } # Last modification time will be Bib-1 Use Attribute 1012 /^[lL]ast-[mM]odification-[tT]ime{[0-9]+}:\t/ BODY /$/ { data -element dateOfLastModification $1 } # The MD5 checksum is used as a unique identifier under Bib-1 Use Attribute 1007 /^[mM][dD]5{[0-9]+}:\t/ BODY /$/ { data -element controlIdentifier $1 } # Description will be Bib-1 Use Attribute 62 /^[dD]escription{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { data -element abstract $1 unread 2 } # Author will be Bib-1 Use Attribute 1003 (if gils.abs maps originator to it!!) /^[aA]uthor{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { data -element author $1 unread 2 } # Keywords will be GILS' localSubjectIndex/localSubjectTerm /^[kK]eywords{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { begin element localSubjectIndex data -element localSubjectTerm $1 unread 2 end element } # File-size will be GILS' supplementalInformation/bytes /^[fF]ile-[sS]ize{[0-9]+}:\t/ BODY /$/ { begin element supplementalInformation data -element bytes $1 unread 2 end element } # Update-Time will be GILS' supplementalInformation/lastChecked /^[uU]pdate-[tT]ime{[0-9]+}:\t/ BODY /$/ { begin element supplementalInformation data -element lastChecked $1 unread 2 end element } # url-references will be GILS' crossReference/linkage /^[uU]rl-[rR]eferences{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { begin element crossReference data -element linkage $1 unread 2 end element } # Title will be Bib-1 Use Attribute 4 /^[tT]itle{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { data -element Title $1 unread 2 } # Body and Partial-Text will be Bib-1 Use Attribute 1010 # Is Body really commonly used in SOIF? Anyway, Full-Text is used by Harvest. #/^[bB]ody{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { # data -element sampleText $1 # unread 2 # } /^[fF]ull-[tT]ext{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { data -element sampleText $1 unread 2 } /^[pP]artial-[tT]ext{[0-9]+}:\t/ BODY /^((-|[._A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { data -element sampleText $1 unread 2 } /^(-|[a-zA-Z0-9])+{[0-9]+}:\t/ BODY /^((-|[_A-Za-z0-9])+{[0-9]+}:\t.*|})$/ { unread 2 } END { end record } idzebra-2.2.10/tab/scan.chr0000664000175000017500000000142014754717556014056 0ustar00adamadam# Danish/Swedish character map. encoding utf-8 # Define the basic value-set. *Beware* of changing this without re-indexing # your databases. lowercase {0-9}{a-y}üzæäøöå uppercase {0-9}{A-Y}ÜZÆÄØÖÅ # Breaking characters space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~ # Characters to be considered equivalent for searching purposes. # equivalent æä(ae) # equivalent øö(oe) # equivalent Ã¥(aa) # equivalent uü # Supplemental mappings map (ä) ä map (æ) æ map (ø) ø map (å) Ã¥ map (ö) ö map (Ä) Ä map (&Aelig;) Æ map (Ø) Ø map (Å) Ã… map (Ö) Ö map éÉ e map á a map ó o map í i map (Aa) (AA) map (aa) a #qmap (ies) (ie) idzebra-2.2.10/tab/var1.var0000664000175000017500000000226614754717556014030 0ustar00adamadam# Definition of the variant set Variant-1. # Variant triple syntax is ''. Eg. # or . # name variant-1 reference Variant-1 class 1 variantId type 1 variantId octetstring class 2 body type 1 iana string type 2 z39.50 string type 3 other string class 3 format type 1 characters-per-line int type 2 line-length int # More types here...... class 4 lang type 1 lang string type 2 charset int type 3 charset-id oid type 4 encoding-id oid type 5 private-string string class 5 piece type 1 fragment-wanted int type 2 fragment-returned int type 3 start intunit type 4 end intunit type 5 howmuch intunit type 6 step intunit type 7 targettoken octetstring class 6 metadata-requested type 1 cost intunit type 2 size intunit type 3 hitsvar null type 4 hitsnonvar null type 5 variantlist null type 6 isvariantsupported null type 7 documentdescriptor null type 8 surrogateinformation null type 998 allmetadata null type 999 othermetadata oid class 7 metadata-returned type 1 cost intunit # More... # More classes, too... idzebra-2.2.10/buildconf.sh0000755000175000017500000000232015127472712014153 0ustar00adamadam#!/bin/sh if [ -d .git ]; then git submodule init git submodule update fi . m4/id-config.sh if $enable_help; then cat <&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@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.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) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = idzebra-config-2.0 zebra.pc Doxyfile \ win/version.nsi CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive 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)$(aclocaldir)" \ "$(DESTDIR)$(pkgconfigdir)" DATA = $(aclocal_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \ $(srcdir)/idzebra-config-2.0.in $(srcdir)/zebra.pc.in \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/win/version.nsi.in \ NEWS README.md TODO config/compile config/config.guess \ config/config.sub config/install-sh config/ltmain.sh \ config/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) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" 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@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = util bfile dfa dict isams isamb isamc rset data1 \ tab index test examples include doc aclocaldir = $(datadir)/aclocal aclocal_DATA = m4/idzebra-2.0.m4 pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = zebra.pc SPEC_FILE = idzebra.spec EXTRA_DIST = README.md NEWS IDMETA $(SPEC_FILE) m4/id-config.sh \ idzebra-config-2.0.in m4/idzebra-2.0.m4 m4/yaz.m4 buildconf.sh Doxyfile.in \ m4/common.nsi m4/mk_version.tcl all: all-recursive .SUFFIXES: 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): idzebra-config-2.0: $(top_builddir)/config.status $(srcdir)/idzebra-config-2.0.in cd $(top_builddir) && $(SHELL) ./config.status $@ zebra.pc: $(top_builddir)/config.status $(srcdir)/zebra.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $@ win/version.nsi: $(top_builddir)/config.status $(top_srcdir)/win/version.nsi.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-aclocalDATA: $(aclocal_DATA) @$(NORMAL_INSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ done uninstall-aclocalDATA: @$(NORMAL_UNINSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(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-recursive 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-recursive 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -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-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-aclocalDATA install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-aclocalDATA uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-bzip3 dist-gzip dist-hook dist-lzip \ dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ distclean distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-aclocalDATA 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-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-aclocalDATA \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile dist-hook: if test -x /usr/bin/git -a -d .git; then git log >ChangeLog ; cp ChangeLog $(distdir); fi cp $(srcdir)/LICENSE* $(distdir) test -d $(distdir)/win || mkdir $(distdir)/win for i in $(srcdir)/win/*; do \ if test -f $$i; then \ cp $$i $(distdir)/win; \ fi; \ done mkdir $(distdir)/rpm -cp $(srcdir)/rpm/* $(distdir)/rpm dox: doxygen showdox: doxygen firefox -new-window file:///`pwd`/$(top_srcdir)/dox/html/index.html & .PHONY: dox showdox # 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.% idzebra-2.2.10/dict/0000755000175000017500000000000015136704657012603 5ustar00adamadamidzebra-2.2.10/dict/drdwr.c0000664000175000017500000001463314754717556014111 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include "dict-p.h" void dict_pr_lru(Dict_BFile bf) { struct Dict_file_block *p; for (p=bf->lru_back; p; p = p->lru_next) { printf(" %d", p->no); } printf("\n"); fflush(stdout); } static struct Dict_file_block *find_block(Dict_BFile bf, int no) { struct Dict_file_block *p; for (p=bf->hash_array[no% bf->hash_size]; p; p=p->h_next) if (p->no == no) break; return p; } static void release_block(Dict_BFile bf, struct Dict_file_block *p) { assert(p); /* remove from lru queue */ if (p->lru_prev) p->lru_prev->lru_next = p->lru_next; else bf->lru_back = p->lru_next; if (p->lru_next) p->lru_next->lru_prev = p->lru_prev; else bf->lru_front = p->lru_prev; /* remove from hash chain */ *p->h_prev = p->h_next; if (p->h_next) p->h_next->h_prev = p->h_prev; /* move to list of free blocks */ p->h_next = bf->free_list; bf->free_list = p; } void dict_bf_flush_blocks(Dict_BFile bf, int no_to_flush) { struct Dict_file_block *p; int i; for (i=0; i != no_to_flush && bf->lru_back; i++) { p = bf->lru_back; if (p->dirty) { if (!bf->compact_flag) bf_write(bf->bf, p->no, 0, 0, p->data); else { int effective_block = p->no / bf->block_size; int effective_offset = p->no - effective_block * bf->block_size; int remain = bf->block_size - effective_offset; if (remain >= p->nbytes) { bf_write(bf->bf, effective_block, effective_offset, p->nbytes, p->data); #if 0 yaz_log(YLOG_LOG, "bf_write no=%d offset=%d size=%d", effective_block, effective_offset, p->nbytes); #endif } else { #if 0 yaz_log(YLOG_LOG, "bf_write1 no=%d offset=%d size=%d", effective_block, effective_offset, remain); #endif bf_write(bf->bf, effective_block, effective_offset, remain, p->data); #if 0 yaz_log(YLOG_LOG, "bf_write2 no=%d offset=%d size=%d", effective_block+1, 0, p->nbytes - remain); #endif bf_write(bf->bf, effective_block+1, 0, p->nbytes - remain, (char*)p->data + remain); } } } release_block(bf, p); } } static struct Dict_file_block *alloc_block(Dict_BFile bf, int no) { struct Dict_file_block *p, **pp; if (!bf->free_list) dict_bf_flush_blocks(bf, 1); assert(bf->free_list); p = bf->free_list; bf->free_list = p->h_next; p->dirty = 0; p->no = no; /* insert at front in lru chain */ p->lru_next = NULL; p->lru_prev = bf->lru_front; if (bf->lru_front) bf->lru_front->lru_next = p; else bf->lru_back = p; bf->lru_front = p; /* insert in hash chain */ pp = bf->hash_array + (no % bf->hash_size); p->h_next = *pp; p->h_prev = pp; if (*pp) (*pp)->h_prev = &p->h_next; *pp = p; return p; } static void move_to_front(Dict_BFile bf, struct Dict_file_block *p) { /* Already at front? */ if (!p->lru_next) return ; /* Remove */ if (p->lru_prev) p->lru_prev->lru_next = p->lru_next; else bf->lru_back = p->lru_next; p->lru_next->lru_prev = p->lru_prev; /* Insert at front */ p->lru_next = NULL; p->lru_prev = bf->lru_front; if (bf->lru_front) bf->lru_front->lru_next = p; else bf->lru_back = p; bf->lru_front = p; } int dict_bf_readp(Dict_BFile bf, int no, void **bufp) { struct Dict_file_block *p; int i; if ((p = find_block(bf, no))) { *bufp = p->data; move_to_front(bf, p); bf->hits++; return 1; } bf->misses++; p = alloc_block(bf, no); if (!bf->compact_flag) i = bf_read(bf->bf, no, 0, 0, p->data); else { int effective_block = no / bf->block_size; int effective_offset = no - effective_block * bf->block_size; i = bf_read(bf->bf, effective_block, effective_offset, bf->block_size - effective_offset, p->data); if (i > 0 && effective_offset > 0) i = bf_read(bf->bf, effective_block+1, 0, effective_offset, (char*) p->data + bf->block_size - effective_offset); i = 1; } if (i > 0) { *bufp = p->data; return i; } release_block(bf, p); *bufp = NULL; return i; } int dict_bf_newp(Dict_BFile dbf, int no, void **bufp, int nbytes) { struct Dict_file_block *p; if (!(p = find_block(dbf, no))) p = alloc_block(dbf, no); else move_to_front(dbf, p); *bufp = p->data; memset(p->data, 0, dbf->block_size); p->dirty = 1; p->nbytes = nbytes; #if 0 printf("bf_newp of %d:", no); dict_pr_lru(dbf); #endif return 1; } int dict_bf_touch(Dict_BFile dbf, int no) { struct Dict_file_block *p; if ((p = find_block(dbf, no))) { p->dirty = 1; return 0; } return -1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/lookgrep.c0000664000175000017500000003323114754717556014604 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "dict-p.h" typedef unsigned MatchWord; #define WORD_BITS 32 #define MAX_LENGTH 1024 /* This code is based * Sun Wu and Udi Manber: Fast Text Searching Allowing Errors. * Communications of the ACM, pp. 83-91, Vol. 35, No. 10, Oct. 1992, USA. * PostScript version of the paper in its submitted form: agrep1.ps) * recommended reading to understand AGREP ! * * http://www.tgries.de/agrep/#AGREP1PS * http://www.tgries.de/agrep/doc/agrep1ps.zip */ typedef struct { int n; /* no of MatchWord needed */ int range; /* max no. of errors */ int fact; /* (range+1)*n */ MatchWord *match_mask; /* match_mask */ } MatchContext; #define INLINE static INLINE void set_bit(MatchContext *mc, MatchWord *m, int ch, int state) { int off = state & (WORD_BITS-1); int wno = state / WORD_BITS; m[mc->n * ch + wno] |= 1<n * ch + wno] & (1<n = (dfa->no_states+WORD_BITS) / WORD_BITS; mc->range = range; mc->fact = (range+1)*mc->n; mc->match_mask = (MatchWord *) xcalloc(mc->n, sizeof(*mc->match_mask)); for (s = 0; sno_states; s++) if (dfa->states[s]->rule_no) set_bit(mc, mc->match_mask, 0, s); return mc; } static void rm_MatchContext(MatchContext **mc) { xfree((*mc)->match_mask); xfree(*mc); *mc = NULL; } static void mask_shift(MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc, struct DFA *dfa, int ch) { int j, s = 0; MatchWord *Rsrc_p = Rsrc, mask; for (j = 0; jn; j++) Rdst[j] = 0; while (1) { mask = *Rsrc_p++; for (j = 0; jstates[s]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 2) { struct DFA_state *state = dfa->states[s+1]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 4) { struct DFA_state *state = dfa->states[s+2]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 8) { struct DFA_state *state = dfa->states[s+3]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit(mc, Rdst, 0, state->trans[i].to); } } s += 4; if (s >= dfa->no_states) return; mask >>= 4; } } } static void shift(MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc, struct DFA *dfa) { int j, s = 0; MatchWord *Rsrc_p = Rsrc, mask; for (j = 0; jn; j++) Rdst[j] = 0; while (1) { mask = *Rsrc_p++; for (j = 0; jstates[s]; int i = state->tran_no; while (--i >= 0) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 2) { struct DFA_state *state = dfa->states[s+1]; int i = state->tran_no; while (--i >= 0) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 4) { struct DFA_state *state = dfa->states[s+2]; int i = state->tran_no; while (--i >= 0) set_bit(mc, Rdst, 0, state->trans[i].to); } if (mask & 8) { struct DFA_state *state = dfa->states[s+3]; int i = state->tran_no; while (--i >= 0) set_bit(mc, Rdst, 0, state->trans[i].to); } } s += 4; if (s >= dfa->no_states) return; mask >>= 4; } } } static void or(MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc1, MatchWord *Rsrc2) { int i; for (i = 0; in; i++) Rdst[i] = Rsrc1[i] | Rsrc2[i]; } static INLINE int move(MatchContext *mc, MatchWord *Rj1, MatchWord *Rj, Dict_char ch, struct DFA *dfa, MatchWord *Rtmp, int range) { int d; MatchWord *Rtmp_2 = Rtmp + mc->n; mask_shift(mc, Rj1, Rj, dfa, ch); for (d = 1; d <= mc->range; d++) { or(mc, Rtmp, Rj, Rj1); /* 2,3 */ shift(mc, Rtmp_2, Rtmp, dfa); mask_shift(mc, Rtmp, Rj+mc->n, dfa, ch); /* 1 */ or(mc, Rtmp, Rtmp_2, Rtmp); /* 1,2,3*/ Rj1 += mc->n; or(mc, Rj1, Rtmp, Rj); /* 1,2,3,4 */ Rj += mc->n; } return 1; } static int grep(Dict dict, Dict_ptr ptr, MatchContext *mc, MatchWord *Rj, int pos, void *client, int (*userfunc)(char *, const char *, void *), Dict_char *prefix, struct DFA *dfa, int *max_pos, int init_pos) { int lo, hi, d; void *p; short *indxp; char *info; dict_bf_readp(dict->dbf, ptr, &p); lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { if (indxp[-lo] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ int j; int was_match = 0; info = (char*)p + indxp[-lo]; for (j=0; ; j++) { Dict_char ch; MatchWord *Rj0 = Rj + j *mc->fact; MatchWord *Rj1 = Rj + (j+1)*mc->fact; MatchWord *Rj_tmp = Rj + (j+2)*mc->fact; int range; memcpy(&ch, info+j*sizeof(Dict_char), sizeof(Dict_char)); prefix[pos+j] = ch; if (pos+j > *max_pos) *max_pos = pos+j; if (ch == DICT_EOS) { if (was_match) { int ret = userfunc((char*) prefix, info+(j+1)*sizeof(Dict_char), client); if (ret) return ret; } break; } if (pos+j >= init_pos) range = mc->range; else range = 0; move(mc, Rj1, Rj0, ch, dfa, Rj_tmp, range); for (d = mc->n; --d >= 0; ) if (Rj1[range*mc->n + d]) break; if (d < 0) break; was_match = 0; for (d = mc->n; --d >= 0; ) if (Rj1[range*mc->n + d] & mc->match_mask[d]) { was_match = 1; break; } } } else { MatchWord *Rj1 = Rj+ mc->fact; MatchWord *Rj_tmp = Rj+2*mc->fact; Dict_char ch; int range; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-lo]; memcpy(&ch, info+sizeof(Dict_ptr), sizeof(Dict_char)); prefix[pos] = ch; if (pos > *max_pos) *max_pos = pos; if (pos >= init_pos) range = mc->range; else range = 0; move(mc, Rj1, Rj, ch, dfa, Rj_tmp, range); for (d = mc->n; --d >= 0; ) if (Rj1[range*mc->n + d]) break; if (d >= 0) { Dict_ptr subptr; if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { for (d = mc->n; --d >= 0; ) if (Rj1[range*mc->n + d] & mc->match_mask[d]) { int ret; prefix[pos+1] = DICT_EOS; ret = userfunc((char*) prefix, info+sizeof(Dict_ptr)+ sizeof(Dict_char), client); if (ret) return ret; break; } } memcpy(&subptr, info, sizeof(Dict_ptr)); if (subptr) { int ret = grep(dict, subptr, mc, Rj1, pos+1, client, userfunc, prefix, dfa, max_pos, init_pos); if (ret) return ret; dict_bf_readp(dict->dbf, ptr, &p); indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); } } } lo++; } return 0; } int dict_lookup_grep(Dict dict, const char *pattern, int range, void *client, int *max_pos, int init_pos, int (*userfunc)(char *name, const char *info, void *client)) { MatchWord *Rj; Dict_char prefix[MAX_LENGTH+1]; const char *this_pattern = pattern; MatchContext *mc; struct DFA *dfa = dfa_init(); int i, d, ret = 0; #if 0 debug_dfa_trav = 1; debug_dfa_tran = 1; debug_dfa_followpos = 1; dfa_verbose = 1; #endif dfa_anyset_includes_nl(dfa); yaz_log(YLOG_DEBUG, "dict_lookup_grep range=%d", range); for (i = 0; pattern[i]; i++) { yaz_log(YLOG_DEBUG, " %2d %3d %c", i, pattern[i], (pattern[i] > ' ' && pattern[i] < 127) ? pattern[i] : '?'); } dfa_set_cmap(dfa, dict->grep_cmap_data, dict->grep_cmap); i = dfa_parse(dfa, &this_pattern); if (i || *this_pattern) { yaz_log(YLOG_WARN, "dfa_parse fail=%d", i); dfa_delete(&dfa); return -1; } dfa_mkstate(dfa); mc = mk_MatchContext(dfa, range); Rj = (MatchWord *) xcalloc((MAX_LENGTH+2) * mc->fact, sizeof(*Rj)); set_bit (mc, Rj, 0, 0); for (d = 1; d<=mc->range; d++) { int s; memcpy(Rj + mc->n * d, Rj + mc->n * (d-1), mc->n * sizeof(*Rj)); for (s = 0; s < dfa->no_states; s++) { if (get_bit(mc, Rj, d-1, s)) { struct DFA_state *state = dfa->states[s]; int i = state->tran_no; while (--i >= 0) set_bit(mc, Rj, d, state->trans[i].to); } } } *max_pos = 0; if (dict->head.root) ret = grep(dict, dict->head.root, mc, Rj, 0, client, userfunc, prefix, dfa, max_pos, init_pos); yaz_log(YLOG_DEBUG, "max_pos = %d", *max_pos); dfa_delete(&dfa); xfree(Rj); rm_MatchContext(&mc); return ret; } void dict_grep_cmap(Dict dict, void *vp, const char **(*cmap)(void *vp, const char **from, int len)) { dict->grep_cmap = cmap; dict->grep_cmap_data = vp; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/open.c0000664000175000017500000000716614754717556013733 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include "dict-p.h" void dict_clean(Dict dict) { int page_size = dict->head.page_size; void *head_buf; int compact_flag = dict->head.compact_flag; memset(dict->head.magic_str, 0, sizeof(dict->head.magic_str)); strcpy(dict->head.magic_str, DICT_MAGIC); dict->head.last = 1; dict->head.root = 0; dict->head.freelist = 0; dict->head.page_size = page_size; dict->head.compact_flag = compact_flag; /* create header with information (page 0) */ if (dict->rw) dict_bf_newp(dict->dbf, 0, &head_buf, page_size); } Dict dict_open(BFiles bfs, const char *name, int cache, int rw, int compact_flag, int page_size) { Dict dict; void *head_buf; dict = (Dict) xmalloc(sizeof(*dict)); if (cache < 5) cache = 5; dict->grep_cmap = NULL; page_size = DICT_DEFAULT_PAGESIZE; if (page_size < 2048) { yaz_log(YLOG_WARN, "Page size for dict %s %d<2048. Set to 2048", name, page_size); page_size = 2048; } dict->dbf = dict_bf_open(bfs, name, page_size, cache, rw); dict->rw = rw; dict->no_split = 0; dict->no_insert = 0; dict->no_lookup = 0; if(!dict->dbf) { yaz_log(YLOG_WARN, "Cannot open `%s'", name); xfree(dict); return NULL; } if (dict_bf_readp(dict->dbf, 0, &head_buf) <= 0) { dict->head.page_size = page_size; dict->head.compact_flag = compact_flag; dict_clean(dict); } else /* header was there, check magic and page size */ { memcpy(&dict->head, head_buf, sizeof(dict->head)); if (strcmp(dict->head.magic_str, DICT_MAGIC)) { yaz_log(YLOG_WARN, "Bad magic of `%s'", name); dict_bf_close(dict->dbf); xfree(dict); return 0; } if (dict->head.page_size != page_size) { yaz_log(YLOG_WARN, "Page size for existing dict %s is %d. Current is %d", name, dict->head.page_size, page_size); } } if (dict->head.compact_flag) dict_bf_compact(dict->dbf); return dict; } int dict_strcmp(const Dict_char *s1, const Dict_char *s2) { return strcmp((const char *) s1, (const char *) s2); } int dict_strncmp(const Dict_char *s1, const Dict_char *s2, size_t n) { return strncmp((const char *) s1, (const char *) s2, n); } int dict_strlen(const Dict_char *s) { return strlen((const char *) s); } zint dict_get_no_lookup(Dict dict) { return dict->no_lookup; } zint dict_get_no_insert(Dict dict) { return dict->no_insert; } zint dict_get_no_split(Dict dict) { return dict->no_split; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/Makefile.in0000644000175000017500000011651415136704635014654 0ustar00adamadam# 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 = dicttest$(EXEEXT) dictext$(EXEEXT) check_PROGRAMS = scantest$(EXEEXT) inserttest$(EXEEXT) subdir = dict ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) libidzebra_dict_la_LIBADD = am_libidzebra_dict_la_OBJECTS = dopen.lo dclose.lo drdwr.lo open.lo \ close.lo insert.lo lookup.lo lookupec.lo lookgrep.lo delete.lo \ scan.lo dcompact.lo libidzebra_dict_la_OBJECTS = $(am_libidzebra_dict_la_OBJECTS) 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 = am_dictext_OBJECTS = dictext.$(OBJEXT) dictext_OBJECTS = $(am_dictext_OBJECTS) dictext_LDADD = $(LDADD) am__DEPENDENCIES_1 = dictext_DEPENDENCIES = libidzebra-dict.la ../bfile/libidzebra-bfile.la \ ../dfa/libidzebra-dfa.la ../util/libidzebra-util.la \ $(am__DEPENDENCIES_1) am_dicttest_OBJECTS = dicttest.$(OBJEXT) dicttest_OBJECTS = $(am_dicttest_OBJECTS) dicttest_LDADD = $(LDADD) dicttest_DEPENDENCIES = libidzebra-dict.la \ ../bfile/libidzebra-bfile.la ../dfa/libidzebra-dfa.la \ ../util/libidzebra-util.la $(am__DEPENDENCIES_1) am_inserttest_OBJECTS = inserttest.$(OBJEXT) inserttest_OBJECTS = $(am_inserttest_OBJECTS) inserttest_LDADD = $(LDADD) inserttest_DEPENDENCIES = libidzebra-dict.la \ ../bfile/libidzebra-bfile.la ../dfa/libidzebra-dfa.la \ ../util/libidzebra-util.la $(am__DEPENDENCIES_1) am_scantest_OBJECTS = scantest.$(OBJEXT) scantest_OBJECTS = $(am_scantest_OBJECTS) scantest_LDADD = $(LDADD) scantest_DEPENDENCIES = libidzebra-dict.la \ ../bfile/libidzebra-bfile.la ../dfa/libidzebra-dfa.la \ ../util/libidzebra-util.la $(am__DEPENDENCIES_1) 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 = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/close.Plo ./$(DEPDIR)/dclose.Plo \ ./$(DEPDIR)/dcompact.Plo ./$(DEPDIR)/delete.Plo \ ./$(DEPDIR)/dictext.Po ./$(DEPDIR)/dicttest.Po \ ./$(DEPDIR)/dopen.Plo ./$(DEPDIR)/drdwr.Plo \ ./$(DEPDIR)/insert.Plo ./$(DEPDIR)/inserttest.Po \ ./$(DEPDIR)/lookgrep.Plo ./$(DEPDIR)/lookup.Plo \ ./$(DEPDIR)/lookupec.Plo ./$(DEPDIR)/open.Plo \ ./$(DEPDIR)/scan.Plo ./$(DEPDIR)/scantest.Po am__mv = mv -f 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 = $(libidzebra_dict_la_SOURCES) $(dictext_SOURCES) \ $(dicttest_SOURCES) $(inserttest_SOURCES) $(scantest_SOURCES) DIST_SOURCES = $(libidzebra_dict_la_SOURCES) $(dictext_SOURCES) \ $(dicttest_SOURCES) $(inserttest_SOURCES) $(scantest_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ noinst_LTLIBRARIES = libidzebra-dict.la TESTS = $(check_PROGRAMS) AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) LDADD = libidzebra-dict.la \ ../bfile/libidzebra-bfile.la \ ../dfa/libidzebra-dfa.la \ ../util/libidzebra-util.la \ $(YAZLALIB) libidzebra_dict_la_SOURCES = dopen.c dclose.c drdwr.c open.c close.c \ insert.c lookup.c lookupec.c lookgrep.c delete.c scan.c dcompact.c \ dict-p.h dicttest_SOURCES = dicttest.c inserttest_SOURCES = inserttest.c dictext_SOURCES = dictext.c scantest_SOURCES = scantest.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dict/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dict/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libidzebra-dict.la: $(libidzebra_dict_la_OBJECTS) $(libidzebra_dict_la_DEPENDENCIES) $(EXTRA_libidzebra_dict_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libidzebra_dict_la_OBJECTS) $(libidzebra_dict_la_LIBADD) $(LIBS) dictext$(EXEEXT): $(dictext_OBJECTS) $(dictext_DEPENDENCIES) $(EXTRA_dictext_DEPENDENCIES) @rm -f dictext$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dictext_OBJECTS) $(dictext_LDADD) $(LIBS) dicttest$(EXEEXT): $(dicttest_OBJECTS) $(dicttest_DEPENDENCIES) $(EXTRA_dicttest_DEPENDENCIES) @rm -f dicttest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dicttest_OBJECTS) $(dicttest_LDADD) $(LIBS) inserttest$(EXEEXT): $(inserttest_OBJECTS) $(inserttest_DEPENDENCIES) $(EXTRA_inserttest_DEPENDENCIES) @rm -f inserttest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inserttest_OBJECTS) $(inserttest_LDADD) $(LIBS) scantest$(EXEEXT): $(scantest_OBJECTS) $(scantest_DEPENDENCIES) $(EXTRA_scantest_DEPENDENCIES) @rm -f scantest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(scantest_OBJECTS) $(scantest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dclose.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcompact.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dictext.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dicttest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dopen.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drdwr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insert.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inserttest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookgrep.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookupec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scantest.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? scantest.log: scantest$(EXEEXT) @p='scantest$(EXEEXT)'; \ b='scantest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) inserttest.log: inserttest$(EXEEXT) @p='inserttest$(EXEEXT)'; \ b='inserttest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @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 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) installdirs: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) 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-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/close.Plo -rm -f ./$(DEPDIR)/dclose.Plo -rm -f ./$(DEPDIR)/dcompact.Plo -rm -f ./$(DEPDIR)/delete.Plo -rm -f ./$(DEPDIR)/dictext.Po -rm -f ./$(DEPDIR)/dicttest.Po -rm -f ./$(DEPDIR)/dopen.Plo -rm -f ./$(DEPDIR)/drdwr.Plo -rm -f ./$(DEPDIR)/insert.Plo -rm -f ./$(DEPDIR)/inserttest.Po -rm -f ./$(DEPDIR)/lookgrep.Plo -rm -f ./$(DEPDIR)/lookup.Plo -rm -f ./$(DEPDIR)/lookupec.Plo -rm -f ./$(DEPDIR)/open.Plo -rm -f ./$(DEPDIR)/scan.Plo -rm -f ./$(DEPDIR)/scantest.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: 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 ./$(DEPDIR)/close.Plo -rm -f ./$(DEPDIR)/dclose.Plo -rm -f ./$(DEPDIR)/dcompact.Plo -rm -f ./$(DEPDIR)/delete.Plo -rm -f ./$(DEPDIR)/dictext.Po -rm -f ./$(DEPDIR)/dicttest.Po -rm -f ./$(DEPDIR)/dopen.Plo -rm -f ./$(DEPDIR)/drdwr.Plo -rm -f ./$(DEPDIR)/insert.Plo -rm -f ./$(DEPDIR)/inserttest.Po -rm -f ./$(DEPDIR)/lookgrep.Plo -rm -f ./$(DEPDIR)/lookup.Plo -rm -f ./$(DEPDIR)/lookupec.Plo -rm -f ./$(DEPDIR)/open.Plo -rm -f ./$(DEPDIR)/scan.Plo -rm -f ./$(DEPDIR)/scantest.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: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile clean-local: -rm -rf *.LCK -rm -rf *.log -rm -rf *.mf # 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.% idzebra-2.2.10/dict/dicttest.c0000664000175000017500000002325214754717556014607 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include char *prog; static Dict dict; static int look_hits; static int grep_handler (char *name, const char *info, void *client) { look_hits++; printf("%s\n", name); return 0; } static int scan_handler (char *name, const char *info, int pos, void *client) { printf("%s\n", name); return 0; } int main (int argc, char **argv) { Res my_resource = 0; BFiles bfs; const char *name = NULL; const char *inputfile = NULL; const char *config = NULL; const char *delete_term = NULL; int scan_the_thing = 0; int do_delete = 0; int range = -1; int srange = 0; int rw = 0; int infosize = 4; int cache = 10; int ret; int unique = 0; char *grep_pattern = NULL; char *arg; int no_of_iterations = 0; int no_of_new = 0, no_of_same = 0, no_of_change = 0; int no_of_hits = 0, no_of_misses = 0, no_not_found = 0, no_of_deleted = 0; int max_pos; prog = argv[0]; if (argc < 2) { fprintf(stderr, "usage:\n " " %s [-d] [-D t] [-S] [-r n] [-p n] [-u] [-g pat] [-s n] " "[-v n] [-i f] [-w] [-c n] config file\n\n", prog); fprintf(stderr, " -d delete instead of insert\n"); fprintf(stderr, " -D t delete subtree instead of insert\n"); fprintf(stderr, " -r n set regular match range\n"); fprintf(stderr, " -p n set regular match start range\n"); fprintf(stderr, " -u report if keys change during insert\n"); fprintf(stderr, " -g p try pattern n (see -r)\n"); fprintf(stderr, " -s n set info size to n (instead of 4)\n"); fprintf(stderr, " -v n set logging level\n"); fprintf(stderr, " -i f read file with words\n"); fprintf(stderr, " -w insert/delete instead of lookup\n"); fprintf(stderr, " -c n cache size (number of pages)\n"); fprintf(stderr, " -S scan the dictionary\n"); exit(1); } while ((ret = options ("D:Sdr:p:ug:s:v:i:wc:", argv, argc, &arg)) != -2) { if (ret == 0) { if (!config) config = arg; else if (!name) name = arg; else { yaz_log (YLOG_FATAL, "too many files specified\n"); exit (1); } } else if (ret == 'D') { delete_term = arg; } else if (ret == 'd') do_delete = 1; else if (ret == 'g') { grep_pattern = arg; } else if (ret == 'r') { range = atoi (arg); } else if (ret == 'p') { srange = atoi (arg); } else if (ret == 'u') { unique = 1; } else if (ret == 'c') { cache = atoi(arg); if (cache<2) cache = 2; } else if (ret == 'w') rw = 1; else if (ret == 'i') inputfile = arg; else if (ret == 'S') scan_the_thing = 1; else if (ret == 's') { infosize = atoi(arg); } else if (ret == 'v') { yaz_log_init (yaz_log_mask_str(arg), prog, NULL); } else { yaz_log (YLOG_FATAL, "Unknown option '-%s'", arg); exit (1); } } if (!config || !name) { yaz_log (YLOG_FATAL, "no config and/or dictionary specified"); exit (1); } my_resource = res_open(0, 0); if (!my_resource) { yaz_log (YLOG_FATAL, "cannot open resource `%s'", config); exit (1); } res_read_file(my_resource, config); bfs = bfs_create (res_get(my_resource, "register"), 0); if (!bfs) { yaz_log (YLOG_FATAL, "bfs_create fail"); exit (1); } dict = dict_open (bfs, name, cache, rw, 0, 4096); if (!dict) { yaz_log (YLOG_FATAL, "dict_open fail of `%s'", name); exit (1); } if (inputfile) { FILE *ipf; char ipf_buf[1024]; int line = 1; char infobytes[120]; memset(infobytes, 0, sizeof(infobytes)); if (!(ipf = fopen(inputfile, "r"))) { yaz_log (YLOG_FATAL|YLOG_ERRNO, "cannot open %s", inputfile); exit (1); } while (fgets (ipf_buf, 1023, ipf)) { char *ipf_ptr = ipf_buf; yaz_snprintf(infobytes, sizeof(infobytes), "%d", line); for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++) { if (isalpha(*ipf_ptr) || *ipf_ptr == '_') { int i = 1; while (ipf_ptr[i] && (isalnum(ipf_ptr[i]) || ipf_ptr[i] == '_')) i++; if (ipf_ptr[i]) ipf_ptr[i++] = '\0'; if (rw) { if (do_delete) switch (dict_delete (dict, ipf_ptr)) { case 0: no_not_found++; break; case 1: no_of_deleted++; } else switch(dict_insert (dict, ipf_ptr, infosize, infobytes)) { case 0: no_of_new++; break; case 1: no_of_change++; if (unique) yaz_log (YLOG_LOG, "%s change\n", ipf_ptr); break; case 2: if (unique) yaz_log (YLOG_LOG, "%s duplicate\n", ipf_ptr); no_of_same++; break; } } else if(range < 0) { char *cp; cp = dict_lookup (dict, ipf_ptr); if (cp && *cp) no_of_hits++; else no_of_misses++; } else { look_hits = 0; dict_lookup_grep (dict, ipf_ptr, range, NULL, &max_pos, srange, grep_handler); if (look_hits) no_of_hits++; else no_of_misses++; } ++no_of_iterations; if ((no_of_iterations % 10000) == 0) { printf ("."); fflush(stdout); } ipf_ptr += (i-1); } } ++line; } fclose (ipf); } if (rw && delete_term) { yaz_log (YLOG_LOG, "dict_delete_subtree %s", delete_term); dict_delete_subtree (dict, delete_term, 0, 0); } if (grep_pattern) { if (range < 0) range = 0; yaz_log (YLOG_LOG, "Grepping '%s'", grep_pattern); dict_lookup_grep (dict, grep_pattern, range, NULL, &max_pos, srange, grep_handler); } if (rw) { yaz_log (YLOG_LOG, "Iterations.... %d", no_of_iterations); if (do_delete) { yaz_log (YLOG_LOG, "No of deleted. %d", no_of_deleted); yaz_log (YLOG_LOG, "No not found.. %d", no_not_found); } else { yaz_log (YLOG_LOG, "No of new..... %d", no_of_new); yaz_log (YLOG_LOG, "No of change.. %d", no_of_change); } } else { yaz_log (YLOG_LOG, "Lookups....... %d", no_of_iterations); yaz_log (YLOG_LOG, "No of hits.... %d", no_of_hits); yaz_log (YLOG_LOG, "No of misses.. %d", no_of_misses); } if (scan_the_thing) { char term_dict[1024]; int before = 1000000; int after = 1000000; yaz_log (YLOG_LOG, "dict_scan"); term_dict[0] = 1; term_dict[1] = 0; dict_scan (dict, term_dict, &before, &after, 0, scan_handler); } dict_close (dict); bfs_destroy (bfs); res_close (my_resource); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/dcompact.c0000664000175000017500000001113714754717556014555 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map) { int i, slen, no = 0; short *from_indxp, *to_indxp; char *from_info, *to_info; from_indxp = (short*) ((char*) from_p+DICT_bsize(from_p)); to_indxp = (short*) ((char*) to_p+DICT_bsize(to_p)); to_info = (char*) to_p + DICT_infoffset; for (i = DICT_nodir(from_p); --i >= 0; ) { if (*--from_indxp > 0) /* tail string here! */ { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ from_info = (char*) from_p + *from_indxp; *--to_indxp = to_info - to_p; slen = (dict_strlen((Dict_char*) from_info)+1)*sizeof(Dict_char); memcpy(to_info, from_info, slen); from_info += slen; to_info += slen; } else { Dict_ptr subptr; Dict_char subchar; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ *--to_indxp = -(to_info - to_p); from_info = (char*) from_p - *from_indxp; memcpy(&subptr, from_info, sizeof(subptr)); subptr = map[subptr]; from_info += sizeof(Dict_ptr); memcpy(&subchar, from_info, sizeof(subchar)); from_info += sizeof(Dict_char); memcpy(to_info, &subptr, sizeof(Dict_ptr)); to_info += sizeof(Dict_ptr); memcpy(to_info, &subchar, sizeof(Dict_char)); to_info += sizeof(Dict_char); } assert(to_info < (char*) to_indxp); slen = *from_info+1; memcpy(to_info, from_info, slen); to_info += slen; ++no; } DICT_size(to_p) = to_info - to_p; DICT_type(to_p) = 0; DICT_nodir(to_p) = no; } int dict_copy_compact(BFiles bfs, const char *from_name, const char *to_name) { int no_dir = 0; Dict dict_from, dict_to; int *map, i; dict_from = dict_open(bfs, from_name, 0, 0, 0, 4096); if (!dict_from) return -1; map = (int *) xmalloc((dict_from->head.last+1) * sizeof(*map)); for (i = 0; i <= (int)(dict_from->head.last); i++) map[i] = -1; dict_to = dict_open(bfs, to_name, 0, 1, 1, 4096); if (!dict_to) return -1; map[0] = 0; map[1] = dict_from->head.page_size; for (i = 1; i < (int) (dict_from->head.last); i++) { void *buf; int size; #if 0 yaz_log(YLOG_LOG, "map[%d] = %d", i, map[i]); #endif dict_bf_readp(dict_from->dbf, i, &buf); size = ((DICT_size(buf)+sizeof(short)-1)/sizeof(short) + DICT_nodir(buf))*sizeof(short); map[i+1] = map[i] + size; no_dir += DICT_nodir(buf); } #if 0 yaz_log(YLOG_LOG, "map[%d] = %d", i, map[i]); yaz_log(YLOG_LOG, "nodir = %d", no_dir); #endif dict_to->head.root = map[1]; dict_to->head.last = map[i]; for (i = 1; i< (int) (dict_from->head.last); i++) { void *old_p, *new_p; dict_bf_readp(dict_from->dbf, i, &old_p); yaz_log(YLOG_LOG, "dict_bf_newp no=%d size=%d", map[i], map[i+1] - map[i]); dict_bf_newp(dict_to->dbf, map[i], &new_p, map[i+1] - map[i]); DICT_type(new_p) = 0; DICT_backptr(new_p) = map[i-1]; DICT_bsize(new_p) = map[i+1] - map[i]; dict_copy_page(dict_from, (char*) new_p, (char*) old_p, map); } dict_close(dict_from); dict_close(dict_to); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/insert.c0000664000175000017500000003544714754717556014301 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" static int dict_ins(Dict dict, const Dict_char *str, Dict_ptr back_ptr, int userlen, void *userinfo); static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out, Dict_ptr subptr, char *userinfo); static void checkPage(Dict dict, void *p); static Dict_ptr new_page(Dict dict, Dict_ptr back_ptr, void **pp) { void *p; Dict_ptr ptr = dict->head.last; if (!dict->head.freelist) { dict_bf_newp(dict->dbf, dict->head.last, &p, dict->head.page_size); (dict->head.last)++; } else { ptr = dict->head.freelist; dict_bf_readp(dict->dbf, ptr, &p); dict->head.freelist = DICT_backptr(p); } assert(p); DICT_type(p) = 0; DICT_backptr(p) = back_ptr; DICT_nodir(p) = 0; DICT_size(p) = DICT_infoffset; DICT_bsize(p) = dict->head.page_size; if (pp) *pp = p; return ptr; } static int split_page(Dict dict, Dict_ptr ptr, void *p) { void *subp; char *info_here; Dict_ptr subptr; int i, j; short *indxp, *best_indxp = NULL; Dict_char best_char = 0; Dict_char prev_char = 0; int best_no = 0, no_current = 0; int current_size = 0; int best_size = 0; checkPage(dict, p); dict->no_split++; /* determine splitting char... */ indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); for (i = DICT_nodir(p); --i >= 0; --indxp) { if (*indxp > 0) /* tail string here! */ { const Dict_char *term = (Dict_char*) p + *indxp; Dict_char dc = *term; if (dc != prev_char) { current_size = 0; no_current = 0; prev_char = dc; } no_current++; current_size += 2 + dict_strlen(term); if (current_size > best_size) { best_size = current_size; best_char = dc; best_indxp = indxp; best_no = no_current; } } } assert(best_no > 0); /* we didn't find any tail string entry at all! */ j = best_indxp - (short*) p; i = DICT_nodir(p); subptr = new_page(dict, ptr, &subp); assert(i == DICT_nodir(p)); /* scan entries to see if there is a string with */ /* length 1. info_here indicates if such entry exist */ info_here = NULL; char info_char = 0; for (i=0; i 1); if (slen == 2) { assert(!info_here); info_here = info+slen*sizeof(Dict_char); info_char = *info_here; } else { info1 = info+slen*sizeof(Dict_char); /* info start */ dict_ins(dict, (Dict_char*) (info+sizeof(Dict_char)), subptr, *info1, info1+1); dict_bf_readp(dict->dbf, ptr, &p); assert(info_here == NULL); } } assert(info_here == NULL || info_char == *info_here); /* now clean the page ... */ checkPage(dict, p); clean_page(dict, ptr, p, &best_char, subptr, info_here); return 0; } static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out, Dict_ptr subptr, char *userinfo) { char *np = (char *) xmalloc(dict->head.page_size); int i, slen, no = 0; short *indxp1, *indxp2; char *info1, *info2; checkPage(dict, p); DICT_bsize(np) = dict->head.page_size; indxp1 = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); indxp2 = (short*) ((char*) np+DICT_bsize(np)); info2 = (char*) np + DICT_infoffset; for (i = DICT_nodir(p); --i >= 0; --indxp1) { if (*indxp1 > 0) /* tail string here! */ { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info1 = (char*) p + *indxp1; if (out && memcmp(out, info1, sizeof(Dict_char)) == 0) { if (subptr == 0) continue; *--indxp2 = -(info2 - np); memcpy(info2, &subptr, sizeof(Dict_ptr)); info2 += sizeof(Dict_ptr); memcpy(info2, out, sizeof(Dict_char)); info2 += sizeof(Dict_char); if (userinfo) { memcpy(info2, userinfo, *userinfo+1); info2 += *userinfo + 1; } else *info2++ = 0; subptr = 0; ++no; continue; } *--indxp2 = info2 - np; slen = (dict_strlen((Dict_char*) info1)+1)*sizeof(Dict_char); memcpy(info2, info1, slen); info1 += slen; info2 += slen; } else { /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ assert(*indxp1 < 0); *--indxp2 = -(info2 - np); info1 = (char*) p - *indxp1; memcpy(info2, info1, sizeof(Dict_ptr)+sizeof(Dict_char)); info1 += sizeof(Dict_ptr)+sizeof(Dict_char); info2 += sizeof(Dict_ptr)+sizeof(Dict_char); } slen = *info1+1; memcpy(info2, info1, slen); info2 += slen; ++no; } #if 1 memcpy((char*)p+DICT_infoffset, (char*)np+DICT_infoffset, info2 - ((char*)np+DICT_infoffset)); memcpy((char*)p + ((char*)indxp2 - (char*)np), indxp2, ((char*) np+DICT_bsize(p)) - (char*)indxp2); #else memcpy((char*)p+DICT_infoffset, (char*)np+DICT_infoffset, DICT_pagesize(dict)-DICT_infoffset); #endif DICT_size(p) = info2 - np; DICT_type(p) = 0; DICT_nodir(p) = no; checkPage(dict, p); xfree(np); dict_bf_touch(dict->dbf, ptr); } static void checkPage(Dict dict, void *p) { int check = DICT_size(p) <= (int)(DICT_bsize(p) - (DICT_nodir(p))*sizeof(short)); if (!check) { yaz_log(YLOG_LOG, "checkPage failed"); yaz_log(YLOG_LOG, "DICT_size(p)=%ld", (long) DICT_size(p)); yaz_log(YLOG_LOG, "DICT_bsize(p)=%ld", (long) DICT_bsize(p)); yaz_log(YLOG_LOG, "DICT_nodir(p)=%ld", (long) DICT_nodir(p)); } assert(check); } /* return 0 if new */ /* return 1 if before but change of info */ /* return 2 if same as before */ static int dict_ins(Dict dict, const Dict_char *str, Dict_ptr ptr, int userlen, void *userinfo) { int hi, lo, mid, slen, cmp = 1; short *indxp; char *info; void *p; dict_bf_readp(dict->dbf, ptr, &p); assert(p); assert(ptr); mid = lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { mid = (lo+hi)/2; if (indxp[-mid] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info = (char*)p + indxp[-mid]; cmp = dict_strcmp((Dict_char*) info, str); if (!cmp) { info += (dict_strlen((Dict_char*) info)+1)*sizeof(Dict_char); /* consider change of userinfo length... */ if (*info == userlen) { /* change of userinfo ? */ if (memcmp(info+1, userinfo, userlen)) { dict_bf_touch(dict->dbf, ptr); memcpy(info+1, userinfo, userlen); return 1; } /* same userinfo */ return 2; } else if (*info > userlen) { /* room for new userinfo */ DICT_type(p) = 1; *info = userlen; dict_bf_touch(dict->dbf, ptr); memcpy(info+1, userinfo, userlen); return 1; } break; } } else { Dict_char dc; Dict_ptr subptr; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-mid]; memcpy(&dc, info+sizeof(Dict_ptr), sizeof(Dict_char)); cmp = dc- *str; if (!cmp) { memcpy(&subptr, info, sizeof(Dict_ptr)); if (*++str == DICT_EOS) { /* finish of string. Store userinfo here... */ int xlen = info[sizeof(Dict_ptr)+sizeof(Dict_char)]; if (xlen == userlen) { if (memcmp(info+sizeof(Dict_ptr)+sizeof(Dict_char)+1, userinfo, userlen)) { dict_bf_touch(dict->dbf, ptr); memcpy(info+sizeof(Dict_ptr)+sizeof(Dict_char)+1, userinfo, userlen); return 1; } return 2; } else if (xlen > userlen) { DICT_type(p) = 1; info[sizeof(Dict_ptr)+sizeof(Dict_char)] = userlen; memcpy(info+sizeof(Dict_ptr)+sizeof(Dict_char)+1, userinfo, userlen); dict_bf_touch(dict->dbf, ptr); return 1; } /* xlen < userlen, expanding needed ... */ if (DICT_size(p)+sizeof(Dict_char)+sizeof(Dict_ptr)+ userlen >= DICT_bsize(p) - (1+DICT_nodir(p))*sizeof(short)) { /* not enough room - split needed ... */ if (DICT_type(p) == 1) { clean_page(dict, ptr, p, NULL, 0, NULL); return dict_ins(dict, str-1, ptr, userlen, userinfo); } if (split_page(dict, ptr, p)) { yaz_log(YLOG_FATAL, "Unable to split page %d\n", ptr); assert(0); } return dict_ins(dict, str-1, ptr, userlen, userinfo); } else { /* enough room - no split needed ... */ info = (char*)p + DICT_size(p); memcpy(info, &subptr, sizeof(subptr)); memcpy(info+sizeof(Dict_ptr), &dc, sizeof(Dict_char)); info[sizeof(Dict_char)+sizeof(Dict_ptr)] = userlen; memcpy(info+sizeof(Dict_char)+sizeof(Dict_ptr)+1, userinfo, userlen); indxp[-mid] = -DICT_size(p); DICT_size(p) += sizeof(Dict_char)+sizeof(Dict_ptr) +1+userlen; DICT_type(p) = 1; dict_bf_touch(dict->dbf, ptr); } if (xlen) return 1; return 0; } else { if (subptr == 0) { subptr = new_page(dict, ptr, NULL); memcpy(info, &subptr, sizeof(subptr)); dict_bf_touch(dict->dbf, ptr); } return dict_ins(dict, str, subptr, userlen, userinfo); } } } if (cmp < 0) lo = mid+1; else hi = mid-1; } indxp = indxp-mid; if (lo>hi && cmp < 0) --indxp; slen = (dict_strlen(str)+1)*sizeof(Dict_char); if (DICT_size(p)+slen+userlen >= (int)(DICT_bsize(p) - (1+DICT_nodir(p))*sizeof(short)))/* overflow? */ { if (DICT_type(p)) { clean_page(dict, ptr, p, NULL, 0, NULL); return dict_ins(dict, str, ptr, userlen, userinfo); } split_page(dict, ptr, p); return dict_ins(dict, str, ptr, userlen, userinfo); } if (cmp) { short *indxp1; (DICT_nodir(p))++; indxp1 = (short*)((char*) p + DICT_bsize(p) - DICT_nodir(p)*sizeof(short)); for (; indxp1 != indxp; indxp1++) indxp1[0] = indxp1[1]; } else DICT_type(p) = 1; info = (char*)p + DICT_size(p); memcpy(info, str, slen); info += slen; *info++ = userlen; memcpy(info, userinfo, userlen); info += userlen; *indxp = DICT_size(p); DICT_size(p) = info- (char*) p; dict_bf_touch(dict->dbf, ptr); if (cmp) return 0; return 1; } int dict_insert(Dict dict, const char *str, int userlen, void *userinfo) { if (!dict->rw) return -1; dict->no_insert++; if (!dict->head.root) { void *p; dict->head.root = new_page(dict, 0, &p); if (!dict->head.root) return -1; } assert(strlen(str) > 0); return dict_ins(dict, (const Dict_char *) str, dict->head.root, userlen, userinfo); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/dopen.c0000664000175000017500000000513614754717556014072 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #if HAVE_UNISTD_H #include #endif #include #include #include "dict-p.h" static void common_init(Dict_BFile bf, int block_size, int cache) { int i; bf->block_size = block_size; bf->compact_flag = 0; bf->cache = cache; bf->hash_size = 31; bf->hits = bf->misses = 0; /* Allocate all blocks in one chunk. */ bf->all_data = xmalloc(block_size * cache); /* Allocate and initialize hash array (as empty) */ bf->hash_array = (struct Dict_file_block **) xmalloc(sizeof(*bf->hash_array) * bf->hash_size); for (i=bf->hash_size; --i >= 0; ) bf->hash_array[i] = NULL; /* Allocate all block descriptors in one chunk */ bf->all_blocks = (struct Dict_file_block *) xmalloc(sizeof(*bf->all_blocks) * cache); /* Initialize the free list */ bf->free_list = bf->all_blocks; for (i=0; iall_blocks[i].h_next = bf->all_blocks+(i+1); bf->all_blocks[i].h_next = NULL; /* Initialize the data for each block. Will never be moved again */ for (i=0; iall_blocks[i].data = (char*) bf->all_data + i*block_size; /* Initialize lru queue */ bf->lru_back = NULL; bf->lru_front = NULL; } Dict_BFile dict_bf_open(BFiles bfs, const char *name, int block_size, int cache, int rw) { Dict_BFile dbf; dbf = (Dict_BFile) xmalloc(sizeof(*dbf)); dbf->bf = bf_open(bfs, name, block_size, rw); if (!dbf->bf) { xfree(dbf); return 0; } common_init(dbf, block_size, cache); return dbf; } void dict_bf_compact(Dict_BFile dbf) { dbf->compact_flag = 1; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/dclose.c0000664000175000017500000000232414754717556014232 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" int dict_bf_close(Dict_BFile dbf) { dict_bf_flush_blocks(dbf, -1); xfree(dbf->all_blocks); xfree(dbf->all_data); xfree(dbf->hash_array); bf_close(dbf->bf); xfree(dbf); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/Makefile.am0000664000175000017500000000122614754717556014651 0ustar00adamadam noinst_LTLIBRARIES = libidzebra-dict.la noinst_PROGRAMS = dicttest dictext check_PROGRAMS = scantest inserttest TESTS = $(check_PROGRAMS) AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) LDADD = libidzebra-dict.la \ ../bfile/libidzebra-bfile.la \ ../dfa/libidzebra-dfa.la \ ../util/libidzebra-util.la \ $(YAZLALIB) libidzebra_dict_la_SOURCES = dopen.c dclose.c drdwr.c open.c close.c \ insert.c lookup.c lookupec.c lookgrep.c delete.c scan.c dcompact.c \ dict-p.h dicttest_SOURCES = dicttest.c inserttest_SOURCES = inserttest.c dictext_SOURCES = dictext.c scantest_SOURCES = scantest.c clean-local: -rm -rf *.LCK -rm -rf *.log -rm -rf *.mf idzebra-2.2.10/dict/dict-p.h0000664000175000017500000000701114754717556014144 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DICT_P_H #define DICT_P_H #include #include #include YAZ_BEGIN_CDECL #define DICT_MAGIC "dict01" #define DICT_DEFAULT_PAGESIZE 4096 typedef unsigned char Dict_char; typedef unsigned Dict_ptr; struct Dict_head { char magic_str[8]; int page_size; int compact_flag; Dict_ptr root, last, freelist; }; struct Dict_file_block { struct Dict_file_block *h_next, **h_prev; struct Dict_file_block *lru_next, *lru_prev; void *data; int dirty; int no; int nbytes; }; typedef struct Dict_file_struct { int cache; BFile bf; struct Dict_file_block *all_blocks; struct Dict_file_block *free_list; struct Dict_file_block **hash_array; struct Dict_file_block *lru_back, *lru_front; int hash_size; void *all_data; int block_size; int hits; int misses; int compact_flag; } *Dict_BFile; struct Dict_struct { int rw; Dict_BFile dbf; const char **(*grep_cmap)(void *vp, const char **from, int len); void *grep_cmap_data; /** number of split page operations, since dict_open */ zint no_split; /** number of insert operations, since dict_open */ zint no_insert; /** number of lookup operations, since dict_open */ zint no_lookup; struct Dict_head head; }; int dict_bf_readp (Dict_BFile bf, int no, void **bufp); int dict_bf_newp (Dict_BFile bf, int no, void **bufp, int nbytes); int dict_bf_touch (Dict_BFile bf, int no); void dict_bf_flush_blocks (Dict_BFile bf, int no_to_flush); Dict_BFile dict_bf_open (BFiles bfs, const char *name, int block_size, int cache, int rw); int dict_bf_close (Dict_BFile dbf); void dict_bf_compact (Dict_BFile dbf); int dict_strcmp (const Dict_char *s1, const Dict_char *s2); int dict_strncmp (const Dict_char *s1, const Dict_char *s2, size_t n); int dict_strlen (const Dict_char *s); #define DICT_EOS 0 #define DICT_type(x) 0[(Dict_ptr*) x] #define DICT_backptr(x) 1[(Dict_ptr*) x] #define DICT_bsize(x) 2[(short*)((char*)(x)+2*sizeof(Dict_ptr))] #define DICT_nodir(x) 0[(short*)((char*)(x)+2*sizeof(Dict_ptr))] #define DICT_size(x) 1[(short*)((char*)(x)+2*sizeof(Dict_ptr))] #define DICT_infoffset (2*sizeof(Dict_ptr)+3*sizeof(short)) #define DICT_xxxxpagesize(x) ((x)->head.page_size) #define DICT_to_str(x) sizeof(Dict_info)+sizeof(Dict_ptr) /* type type of page backptr pointer to parent nextptr pointer to next page (if any) nodir no of words size size of strings,info,ptr entries dir[0..nodir-1] ptr,info,string */ YAZ_END_CDECL #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/delete.c0000664000175000017500000002164514754717556014232 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" static void dict_del_subtree(Dict dict, Dict_ptr ptr, void *client, int (*f)(const char *, void *)) { void *p = 0; short *indxp; int i, hi; if (!ptr) return; dict_bf_readp(dict->dbf, ptr, &p); indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); hi = DICT_nodir(p)-1; for (i = 0; i <= hi; i++) { if (indxp[-i] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ char *info = (char*)p + indxp[-i]; if (f) (*f)(info + (dict_strlen((Dict_char*) info)+1) *sizeof(Dict_char), client); } else { Dict_ptr subptr; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ char *info = (char*)p - indxp[-i]; memcpy(&subptr, info, sizeof(Dict_ptr)); if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { if (f) (*f)(info+sizeof(Dict_ptr)+sizeof(Dict_char), client); } if (subptr) { dict_del_subtree(dict, subptr, client, f); /* page may be gone. reread it .. */ dict_bf_readp(dict->dbf, ptr, &p); indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); } } } DICT_backptr(p) = dict->head.freelist; dict->head.freelist = ptr; dict_bf_touch(dict->dbf, ptr); } static int dict_del_string(Dict dict, const Dict_char *str, Dict_ptr ptr, int sub_flag, void *client, int (*f)(const char *, void *)) { int mid, lo, hi; int cmp; void *p; short *indxp; char *info; int r = 0; Dict_ptr subptr = 0; if (!ptr) return 0; dict_bf_readp(dict->dbf, ptr, &p); mid = lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { mid = (lo+hi)/2; if (indxp[-mid] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info = (char*)p + indxp[-mid]; cmp = dict_strcmp((Dict_char*) info, str); if (sub_flag) { /* determine if prefix match */ if (!dict_strncmp(str, (Dict_char*) info, dict_strlen(str))) { if (f) (*f)(info + (dict_strlen((Dict_char*) info)+1) *sizeof(Dict_char), client); hi = DICT_nodir(p)-1; while (mid < hi) { indxp[-mid] = indxp[-mid-1]; mid++; } DICT_type(p) = 1; (DICT_nodir(p))--; dict_bf_touch(dict->dbf, ptr); --hi; mid = lo = 0; r = 1; /* signal deleted */ /* start again (may not be the most efficient way to go)*/ continue; } } else { /* normal delete: delete if equal */ if (!cmp) { hi = DICT_nodir(p)-1; while (mid < hi) { indxp[-mid] = indxp[-mid-1]; mid++; } DICT_type(p) = 1; (DICT_nodir(p))--; dict_bf_touch(dict->dbf, ptr); r = 1; break; } } } else { Dict_char dc; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-mid]; memcpy(&dc, info+sizeof(Dict_ptr), sizeof(Dict_char)); cmp = dc- *str; if (!cmp) { memcpy(&subptr, info, sizeof(Dict_ptr)); if (*++str == DICT_EOS) { if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { /* entry does exist. Wipe it out */ info[sizeof(Dict_ptr)+sizeof(Dict_char)] = 0; DICT_type(p) = 1; dict_bf_touch(dict->dbf, ptr); if (f) (*f)(info+sizeof(Dict_ptr)+sizeof(Dict_char), client); r = 1; } if (sub_flag) { /* must delete all suffixes (subtrees) as well */ hi = DICT_nodir(p)-1; while (mid < hi) { indxp[-mid] = indxp[-mid-1]; mid++; } (DICT_nodir(p))--; DICT_type(p) = 1; dict_bf_touch(dict->dbf, ptr); } } else { /* subptr may be 0 */ r = dict_del_string(dict, str, subptr, sub_flag, client, f); /* recover */ dict_bf_readp(dict->dbf, ptr, &p); indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); info = (char*)p - indxp[-mid]; subptr = 0; /* avoid dict_del_subtree (end of function)*/ if (r == 2) { /* subptr page became empty and is removed */ /* see if this entry is a real one or if it just serves as pointer to subptr */ if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { /* this entry do exist, set subptr to 0 */ memcpy(info, &subptr, sizeof(subptr)); } else { /* this entry ONLY points to subptr. remove it */ hi = DICT_nodir(p)-1; while (mid < hi) { indxp[-mid] = indxp[-mid-1]; mid++; } (DICT_nodir(p))--; } dict_bf_touch(dict->dbf, ptr); r = 1; } } break; } } if (cmp < 0) lo = mid+1; else hi = mid-1; } if (DICT_nodir(p) == 0 && ptr != dict->head.root) { DICT_backptr(p) = dict->head.freelist; dict->head.freelist = ptr; dict_bf_touch(dict->dbf, ptr); r = 2; } if (subptr && sub_flag) dict_del_subtree(dict, subptr, client, f); return r; } int dict_delete(Dict dict, const char *p) { return dict_del_string(dict, (const Dict_char*) p, dict->head.root, 0, 0, 0); } int dict_delete_subtree(Dict dict, const char *p, void *client, int (*f)(const char *info, void *client)) { return dict_del_string(dict, (const Dict_char*) p, dict->head.root, 1, client, f); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/inserttest.c0000644000175000017500000000532315127472715015153 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #define TERM_SIZE 150 #define USERINFO_SIZE 4 int main(int argc, char **argv) { BFiles bfs = 0; Dict dict = 0; long no = 1000L; YAZ_CHECK_INIT(argc, argv); if (argc > 1) no = atol(argv[1]); bfs = bfs_create(".:40G", 0); YAZ_CHECK(bfs); if (bfs) { bf_reset(bfs); dict = dict_open(bfs, "inserttest", 50, 1, 0, 4096); YAZ_CHECK(dict); } if (dict) { int pass; for (pass = 0; pass < 2; pass++) { long i; srand(9); for (i = 0; i < no; i++) { char userinfo[USERINFO_SIZE + 1]; int userlen = USERINFO_SIZE; char lex[TERM_SIZE + 1]; int sz = 1 + (rand() % (TERM_SIZE- 1)); int j; for (j = 0; j < sz; j++) { lex[j] = 1 + (rand() & 127L); } lex[j] = 0; for (j = 0; j < userlen; j++) { userinfo[j] = sz + 1; } if (pass == 0) { dict_insert(dict, lex, userlen, userinfo); } else { char *info = dict_lookup(dict, lex); YAZ_CHECK(info); if (!info) { break; } YAZ_CHECK_EQ(userlen, info[0]); YAZ_CHECK(memcmp(userinfo, info + 1, userlen) == 0); } } } dict_close(dict); } if (bfs) bfs_destroy(bfs); YAZ_CHECK_TERM; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/dictext.c0000664000175000017500000000561614754717556014434 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include char *prog; int main(int argc, char **argv) { char *arg; int ret; int use8 = 0; char *inputfile = NULL; FILE *ipf = stdin; char ipf_buf[1024]; prog = *argv; while ((ret = options("8vh", argv, argc, &arg)) != -2) { if (ret == 0) { if (!inputfile) inputfile = arg; else { yaz_log(YLOG_FATAL, "too many files specified\n"); exit(1); } } else if (ret == 'v') { yaz_log_init(yaz_log_mask_str(arg), prog, NULL); } else if (ret == 'h') { fprintf(stderr, "usage:\n" " %s [-8] [-h] [-v n] [file]\n", prog); exit(1); } else if (ret == '8') use8 = 1; else { yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg); exit(1); } } if (inputfile) { ipf = fopen(inputfile, "r"); if (!ipf) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "cannot open '%s'", inputfile); exit(1); } } while (fgets(ipf_buf, 1023, ipf)) { char *ipf_ptr = ipf_buf; for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++) { if ((use8 && *ipf_ptr<0) || (*ipf_ptr > 0 && isalpha(*ipf_ptr)) || *ipf_ptr == '_') { int i = 1; while (ipf_ptr[i] && ((use8 && ipf_ptr[i] < 0) || (ipf_ptr[i]>0 && isalnum(ipf_ptr[i])) || ipf_ptr[i] == '_')) i++; if (ipf_ptr[i]) ipf_ptr[i++] = '\0'; printf("%s\n", ipf_ptr); ipf_ptr += (i-1); } } } return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/close.c0000664000175000017500000000250514754717556014067 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" int dict_close(Dict dict) { if (!dict) return 0; if (dict->rw) { void *head_buf; dict_bf_readp(dict->dbf, 0, &head_buf); memcpy(head_buf, &dict->head, sizeof(dict->head)); dict_bf_touch(dict->dbf, 0); } dict_bf_close(dict->dbf); xfree(dict); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/scan.c0000664000175000017500000002067114754717556013712 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" static void scan_direction(Dict dict, Dict_ptr ptr, int pos, Dict_char *str, int start, int *count, void *client, int (*userfunc)(char *, const char *, int, void *), int dir) { int lo, hi, j; void *p; short *indxp; char *info; dict_bf_readp(dict->dbf, ptr, &p); hi = DICT_nodir(p)-1; if (start != -1) lo = start; else { if (dir == -1) lo = hi; else lo = 0; } indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi && lo >= 0 && *count > 0) { if (indxp[-lo] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info = (char*)p + indxp[-lo]; for (j = 0; info[j] != DICT_EOS; j++) str[pos+j] = info[j]; str[pos+j] = DICT_EOS; if ((*userfunc)((char*) str, info+(j+1)*sizeof(Dict_char), *count * dir, client)) { *count = 0; } else --(*count); } else { Dict_char dc; Dict_ptr subptr; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-lo]; memcpy(&dc, info+sizeof(Dict_ptr), sizeof(Dict_char)); str[pos] = dc; memcpy(&subptr, info, sizeof(Dict_ptr)); if (dir>0 && info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { str[pos+1] = DICT_EOS; if ((*userfunc)((char*) str, info+sizeof(Dict_ptr)+sizeof(Dict_char), *count * dir, client)) { *count = 0; } else --(*count); } if (*count>0 && subptr) { scan_direction(dict, subptr, pos+1, str, -1, count, client, userfunc, dir); dict_bf_readp(dict->dbf, ptr, &p); indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); } if (*count>0 && dir<0 && info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { str[pos+1] = DICT_EOS; if ((*userfunc)((char*) str, info+sizeof(Dict_ptr)+sizeof(Dict_char), *count * dir, client)) { *count = 0; } else --(*count); } } lo += dir; } } void dict_scan_r(Dict dict, Dict_ptr ptr, int pos, Dict_char *str, int *before, int *after, void *client, int (*userfunc)(char *, const char *, int, void *)) { int cmp = 0, mid, lo, hi; void *p; short *indxp; char *info; dict_bf_readp(dict->dbf, ptr, &p); if (!p) return; mid = lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { mid = (lo+hi)/2; if (indxp[-mid] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info = (char*)p + indxp[-mid]; cmp = dict_strcmp((Dict_char*) info, str + pos); if (!cmp) { if (*after) { if ((*userfunc)((char *) str, info+ (dict_strlen((Dict_char*) info)+1) *sizeof(Dict_char), *after, client)) { *after = 0; } else --(*after); } break; } } else { Dict_char dc; Dict_ptr subptr; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-mid]; memcpy(&dc, info+sizeof(Dict_ptr), sizeof(Dict_char)); cmp = dc - str[pos]; if (!cmp) { memcpy(&subptr, info, sizeof(Dict_ptr)); if (str[pos+1] == DICT_EOS) { if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { if (*after) { if ((*userfunc)((char*) str, info+sizeof(Dict_ptr)+ sizeof(Dict_char), *after, client)) { *after = 0; } else --(*after); } } if (*after && subptr) scan_direction(dict, subptr, pos+1, str, -1, after, client, userfunc, 1); } else { if (subptr) dict_scan_r(dict, subptr, pos+1, str, before, after, client, userfunc); if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) { if (*before) { str[pos+1] = DICT_EOS; if ((*userfunc)((char*) str, info+sizeof(Dict_ptr)+ sizeof(Dict_char), - *before, client)) { *before = 0; } else --(*before); } } } break; } } if (cmp < 0) lo = mid+1; else hi = mid-1; } if (lo>hi && cmp < 0) ++mid; if (*after) scan_direction(dict, ptr, pos, str, cmp ? mid : mid+1, after, client, userfunc, 1); if (*before && mid > 0) scan_direction(dict, ptr, pos, str, mid-1, before, client, userfunc, -1); } int dict_scan(Dict dict, char *str, int *before, int *after, void *client, int (*f)(char *name, const char *info, int pos, void *client)) { int i; yaz_log(YLOG_DEBUG, "dict_scan"); for (i = 0; str[i]; i++) { yaz_log(YLOG_DEBUG, "start_term pos %d %3d %c", i, str[i], (str[i] > ' ' && str[i] < 127) ? str[i] : '?'); } if (!dict->head.root) return 0; dict_scan_r(dict, dict->head.root, 0, (Dict_char *) str, before, after, client, f); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/lookupec.c0000664000175000017500000001221514754717556014602 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" typedef unsigned MatchWord; typedef struct { MatchWord *s; int m; } MatchInfo; #define SH(x) (((x)<<1)+1) static int lookup_ec(Dict dict, Dict_ptr ptr, MatchInfo *mi, MatchWord *ri_base, int pos, int (*userfunc)(char *), int range, Dict_char *prefix) { int lo, hi; void *p; short *indxp; char *info; MatchWord match_mask = 1<<(mi->m-1); dict_bf_readp(dict->dbf, ptr, &p); lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { if (indxp[-lo] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ MatchWord *ri = ri_base, sc; int i, j; info = (char*)p + indxp[-lo]; for (j=0; ; j++) { Dict_char ch; memcpy(&ch, info+j*sizeof(Dict_char), sizeof(Dict_char)); prefix[pos+j] = ch; if (ch == DICT_EOS) { if (ri[range] & match_mask) (*userfunc)((char*) prefix); break; } if (j+pos >= mi->m+range) break; sc = mi->s[ch & 255]; ri[1+range] = SH(ri[0]) & sc; for (i=1; i<=range; i++) ri[i+1+range] = (SH(ri[i]) & sc) | SH(ri[i-1]) | SH(ri[i+range]) | ri[i-1]; ri += 1+range; if (!(ri[range] & (1<<(pos+j)))) break; } } else { Dict_char ch; MatchWord *ri = ri_base, sc; int i; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-lo]; memcpy(&ch, info+sizeof(Dict_ptr), sizeof(Dict_char)); prefix[pos] = ch; sc = mi->s[ch & 255]; ri[1+range] = SH(ri[0]) & sc; for (i=1; i<=range; i++) ri[i+1+range] = (SH(ri[i]) & sc) | SH(ri[i-1]) | SH(ri[i+range]) | ri[i-1]; ri += 1+range; if (ri[range] & (1<dbf, ptr, &p); indxp = (short*) ((char*) p + DICT_bsize(p)-sizeof(short)); } } } lo++; } return 0; } static MatchInfo *prepare_match(Dict_char *pattern) { int i; MatchWord *s; MatchInfo *mi; mi = (MatchInfo *) xmalloc(sizeof(*mi)); mi->m = dict_strlen(pattern); mi->s = s = (MatchWord *) xmalloc(sizeof(*s)*256); /* 256 !!! */ for (i = 0; i < 256; i++) s[i] = 0; for (i = 0; pattern[i]; i++) s[pattern[i]&255] += 1<head.root) return 0; mi = prepare_match((Dict_char*) pattern); ri = (MatchWord *) xmalloc((dict_strlen((Dict_char*) pattern)+range+2) * (range+1)*sizeof(*ri)); for (i = 0; i <= range; i++) ri[i] = (2<head.root, mi, ri, 0, userfunc, range, prefix); xfree(ri); return ret; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/lookup.c0000664000175000017500000000635114754717556014276 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dict-p.h" static char *dict_look(Dict dict, const Dict_char *str, Dict_ptr ptr) { int mid, lo, hi; int cmp; void *p; short *indxp; char *info; dict_bf_readp(dict->dbf, ptr, &p); mid = lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); while (lo <= hi) { mid = (lo+hi)/2; if (indxp[-mid] > 0) { /* string (Dict_char *) DICT_EOS terminated */ /* unsigned char length of information */ /* char * information */ info = (char*)p + indxp[-mid]; cmp = dict_strcmp((Dict_char*) info, str); if (!cmp) return info+(dict_strlen ((Dict_char*) info)+1) *sizeof(Dict_char); } else { Dict_char dc; Dict_ptr subptr; /* Dict_ptr subptr */ /* Dict_char sub char */ /* unsigned char length of information */ /* char * information */ info = (char*)p - indxp[-mid]; memcpy(&dc, info+sizeof(Dict_ptr), sizeof(Dict_char)); cmp = dc- *str; if (!cmp) { memcpy(&subptr, info, sizeof(Dict_ptr)); if (*++str == DICT_EOS) { if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) return info+sizeof(Dict_ptr)+sizeof(Dict_char); return NULL; } else { if (subptr == 0) return NULL; ptr = subptr; dict_bf_readp(dict->dbf, ptr, &p); mid = lo = 0; hi = DICT_nodir(p)-1; indxp = (short*) ((char*) p+DICT_bsize(p)-sizeof(short)); continue; } } } if (cmp < 0) lo = mid+1; else hi = mid-1; } return NULL; } char *dict_lookup(Dict dict, const char *p) { dict->no_lookup++; if (!dict->head.root) return NULL; return dict_look(dict, (const Dict_char *) p, dict->head.root); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dict/scantest.c0000664000175000017500000001735314754717556014615 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include struct handle_info { int b; int a; int start_cut; int end_cut; char **ar; }; static int handler(char *name, const char *info, int pos, void *client) { struct handle_info *hi = (struct handle_info *) client; int idx; if (pos > 0) idx = hi->a - pos + hi->b; else idx = -pos - 1; if (idx < 0) return 0; if (idx < hi->start_cut || idx > hi->end_cut) { return 1; } hi->ar[idx] = malloc(strlen(name)+1); strcpy(hi->ar[idx], name); return 0; } int do_scan(Dict dict, int before, int after, const char *sterm, char **cmp_strs, int verbose, int start_cut, int end_cut) { struct handle_info hi; char scan_term[1024]; int i; int errors = 0; strcpy(scan_term, sterm); hi.start_cut = start_cut; hi.end_cut = end_cut; hi.a = after; hi.b = before; hi.ar = malloc(sizeof(char*) * (after+before+1)); for (i = 0; i <= after+before; i++) hi.ar[i] = 0; yaz_log(YLOG_DEBUG, "dict_scan before=%d after=%d term=%s", before, after, scan_term); dict_scan (dict, scan_term, &before, &after, &hi, handler); for (i = 0; i < hi.a+hi.b; i++) { if (!cmp_strs) { if (i >= start_cut && i <= end_cut) { if (!hi.ar[i]) { printf("--> FAIL i=%d hi.ar[i] == NULL\n", i); errors++; } } else { if (hi.ar[i]) { printf("--> FAIL i=%d hi.ar[i] = %s\n", i, hi.ar[i]); errors++; } } } else { if (i >= start_cut && i <= end_cut) { if (!hi.ar[i]) { printf("--> FAIL i=%d strs == NULL\n", i); errors++; } else if (!cmp_strs[i]) { printf("--> FAIL i=%d cmp_strs == NULL\n", i); errors++; } else if (strcmp(cmp_strs[i], hi.ar[i])) { printf("--> FAIL i=%d expected %s\n", i, cmp_strs[i]); errors++; } } else { if (hi.ar[i]) { printf("--> FAIL i=%d hi.ar[i] != NULL\n", i); errors++; } } } if (verbose || errors) { if (i == hi.b) printf("* "); else printf(" "); if (hi.ar[i]) printf("%s", hi.ar[i]); else printf("NULL"); putchar('\n'); } if (hi.ar[i]) free(hi.ar[i]); } free(hi.ar); return errors; } static void tst(Dict dict, int start, int number) { int i; /* insert again with original value again */ for (i = start; i < number; i += 100) { int v = i; char w[32]; yaz_snprintf(w, sizeof(w), "%d", i); YAZ_CHECK_EQ(dict_insert(dict, w, sizeof(v), &v), 2); } /* insert again with different value */ for (i = start; i < number; i += 100) { int v = i-1; char w[32]; yaz_snprintf(w, sizeof(w), "%d", i); YAZ_CHECK_EQ(dict_insert(dict, w, sizeof(v), &v), 1); } /* insert again with original value again */ for (i = start; i < number; i += 100) { int v = i; char w[32]; yaz_snprintf(w, sizeof(w), "%d", i); YAZ_CHECK_EQ(dict_insert(dict, w, sizeof(v), &v), 1); } #if 1 { char *cs[] = { "4497", "4498", "4499", "45"}; YAZ_CHECK_EQ(do_scan(dict, 2, 2, "4499", cs, 0, 0, 3), 0); } #endif #if 1 { char *cs[] = { "4498", "4499", "45", "450"}; YAZ_CHECK_EQ(do_scan(dict, 2, 2, "45", cs, 0, 0, 3), 0); } #endif #if 1 /* bug 4592 */ { char *cs[] = { "4499", "45", /* missing entry ! */ "450", "4500"}; YAZ_CHECK_EQ(do_scan(dict, 4, 0, "4501", cs, 0, 0, 4), 0); } #endif #if 1 { char *cs[] = { "9996", "9997", "9998", "9999"}; YAZ_CHECK_EQ(do_scan(dict, 4, 0, "a", cs, 0, 0, 4), 0); YAZ_CHECK_EQ(do_scan(dict, 3, 1, "9999", cs, 0, 0, 4), 0); } #endif #if 1 { char *cs[] = { "10", "100", "1000", "1001" }; YAZ_CHECK_EQ(do_scan(dict, 0, 4, "10", cs, 0, 0, 4), 0); YAZ_CHECK_EQ(do_scan(dict, 0, 4, "1", cs, 0, 0, 4), 0); YAZ_CHECK_EQ(do_scan(dict, 0, 4, " ", cs, 0, 0, 4), 0); YAZ_CHECK_EQ(do_scan(dict, 0, 4, "", cs, 0, 0, 4), 0); } #endif #if 1 for (i = 0; i < 20; i++) YAZ_CHECK_EQ(do_scan(dict, 20, 20, "45", 0, 0, 20-i, 20+i), 0); #endif } int main(int argc, char **argv) { BFiles bfs = 0; Dict dict = 0; int i; int ret; int before = 0, after = 0, number = 10000; char scan_term[1024]; char *arg; YAZ_CHECK_INIT(argc, argv); strcpy(scan_term, "1004"); while ((ret = options("b:a:t:n:v:", argv, argc, &arg)) != -2) { switch(ret) { case 0: break; case 'b': before = atoi(arg); break; case 'a': after = atoi(arg); break; case 't': if (strlen(arg) >= sizeof(scan_term)-1) { fprintf(stderr, "scan term too long\n"); exit(1); } strcpy(scan_term, arg); break; case 'n': number = atoi(arg); break; case 'v': yaz_log_init_level(yaz_log_mask_str(arg)); } } bfs = bfs_create(".:100M", 0); YAZ_CHECK(bfs); if (bfs) { bf_reset(bfs); dict = dict_open(bfs, "scantest", 100, 1, 0, 0); YAZ_CHECK(dict); } if (dict) { int start = 10; /* Insert "10", "11", "12", .. "99", "100", ... number */ for (i = start; i 0 || before > 0) do_scan(dict, before, after, scan_term, 0, 1, 0, after+1); else tst(dict, start, number); dict_close(dict); } if (bfs) bfs_destroy(bfs); YAZ_CHECK_TERM; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/configure0000755000175000017500000205174515136704635013601 0ustar00adamadam#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for idzebra 2.2.10. # # 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 -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 test \$(( 1 + 1 )) = 2 || 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 info@indexdata.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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='idzebra' PACKAGE_TARNAME='idzebra' PACKAGE_VERSION='2.2.10' PACKAGE_STRING='idzebra 2.2.10' PACKAGE_BUGREPORT='info@indexdata.com' PACKAGE_URL='' ac_unique_file="configure.ac" # 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_year2038=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS VERSION_SHA1 VERSION_HEX WIN_FILEVERSION IDZEBRA_BUILD_ROOT IDZEBRA_SRC_ROOT STATIC_MODULE_LADD STATIC_MODULE_OBJ SHARED_MODULE_LA EXPAT_LIBS EXPAT_CFLAGS TCL_LIBS TCL_CFLAGS XSL_DIR DSSSL_DIR DTD_DIR PDF_COMPILE TKL_COMPILE HTML_COMPILE MAN_COMPILE XSLTPROC_COMPILE yazconfig YAZ_LIBS YAZ_CFLAGS YAZVERSION YAZINC YAZLALIB YAZLIB PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG 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 GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL CPP 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 AR_FLAGS ZEBRA_CFLAGS main_zebralib ZEBRALIBS_VERSION_INFO PACKAGE_SUFFIX 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_cxx_stdlib enable_fast_install enable_aix_soname with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_yaz with_docbook_dtd with_docbook_dsssl with_docbook_xsl with_iconv enable_largefile enable_mod_text enable_mod_grs_regx enable_mod_grs_marc enable_mod_grs_xml enable_mod_dom enable_mod_alvis enable_mod_safari enable_year2038 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR YAZ_CFLAGS YAZ_LIBS TCL_CFLAGS TCL_LIBS EXPAT_CFLAGS EXPAT_LIBS' # 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 idzebra 2.2.10 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/idzebra] --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 idzebra 2.2.10:";; 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=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-cxx-stdlib[=PKGS] let the compiler frontend decide what standard libraries to link when building C++ shared libraries and modules [default=no] --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) --disable-largefile omit support for large files --enable-mod-text Text filter --enable-mod-grs-regx REGX/TCL filter --enable-mod-grs-marc MARC filter --enable-mod-grs-xml XML filter (Expat based) --enable-mod-dom XML/XSLT filter (Requires libxslt) --enable-mod-alvis ALVIS filter (Requires libxslt) --enable-mod-safari Safari filter (DBC) --enable-year2038 support timestamps after 2038 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). --with-yaz=DIR use yaz-config in DIR; DIR=pkg to use pkg-config --with-docbook-dtd=DIR use docbookx.dtd in DIR --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml} --with-iconv=DIR iconv library in DIR 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 CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path YAZ_CFLAGS C compiler flags for YAZ, overriding pkg-config YAZ_LIBS linker flags for YAZ, overriding pkg-config TCL_CFLAGS C compiler flags for TCL, overriding pkg-config TCL_LIBS linker flags for TCL, overriding pkg-config EXPAT_CFLAGS C compiler flags for EXPAT, overriding pkg-config EXPAT_LIBS linker flags for EXPAT, overriding pkg-config 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 idzebra configure 2.2.10 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_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_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_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_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 idzebra $as_me 2.2.10, 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; } " 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="config.guess config.sub ltmain.sh compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/config" # 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 ac_config_headers="$ac_config_headers include/config.h" 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='idzebra' VERSION='2.2.10' 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 printf "%s\n" "#define _POSIX_C_SOURCE 200809L" >>confdefs.h PACKAGE_SUFFIX="-2.0" ZEBRALIBS_VERSION_INFO=0:2:0 main_zebralib=index/libidzebra${PACKAGE_SUFFIX}.la AR_FLAGS=cr 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=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 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.6.0' macro_revision='2.6.0' ltmain=$ac_aux_dir/ltmain.sh # 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 { 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 # 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 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 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; } case $host in #( *-*-mingw* | *-*-windows* | *-*-cygwin*) : case $build in #( *-*-mingw* | *-*-windows* | *-*-cygwin*) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether cygpath is installed" >&5 printf %s "checking whether cygpath is installed... " >&6; } if test ${lt_cv_cygpath_installed+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_cygpath_installed=ignoring cygpath --help &> /dev/null _lt_result=$? if test 0 = "$_lt_result" then : lt_cv_cygpath_installed=yes else case e in #( e) lt_cv_cygpath_installed=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cygpath_installed" >&5 printf "%s\n" "$lt_cv_cygpath_installed" >&6; } if test "xyes" != "x$lt_cv_cygpath_installed" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use cmd with one slash or two slashes" >&5 printf %s "checking whether to use cmd with one slash or two slashes... " >&6; } if test ${lt_cv_cmd_slashes+y} then : printf %s "(cached) " >&6 else case e in #( e) _lt_result=`cmd /c echo one-slash works. Not checked //c echo two-slashes 2>/dev/null` if test 0 != $? then : as_fn_error $? "Do not know how to convert paths" "$LINENO" 5 fi case $_lt_result in #( one-slash*) : lt_cv_cmd_slashes="one" ;; #( two-slashes*) : lt_cv_cmd_slashes="two" ;; #( *) : as_fn_error $? "Do not know how to convert paths" "$LINENO" 5 ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cmd_slashes" >&5 printf "%s\n" "$lt_cv_cmd_slashes" >&6; } fi ;; #( *) : ;; esac ;; #( *) : ;; esac { 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 $stdlibflag $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 ;; *-mlibc) 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 ;; 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 .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib[a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"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 .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/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* .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"\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[a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \([a-zA-Z_][a-zA-Z0-9_]*\)$/ {\"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 ?. And Cygwin gawk-4.1.4-3 and newer # treats input as binary, have to drop carriage return first. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {sub(/\\r\$/,\"\")};"\ " {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 # 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 stdlibflag=-nostdlib # Check whether --enable-cxx-stdlib was given. if test ${enable_cxx_stdlib+y} then : enableval=$enable_cxx_stdlib; p=${PACKAGE-default} case $enableval in yes) enable_cxx_stdlib=yes ;; no) enable_cxx_stdlib=no ;; *) enable_cxx_stdlib=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_cxx_stdlib=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_cxx_stdlib=no ;; esac fi if test yes = "$enable_cxx_stdlib"; then stdlibflag= 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 ;; power*-*-aix[5-9]*,'') { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: for $host, specify if building shared libraries for versioning (svr4|both)" >&5 printf "%s\n" "$as_me: WARNING: for $host, specify if building shared libraries for versioning (svr4|both)" >&2;} { 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; } with_aix_soname=aix { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (default) $with_aix_soname" >&5 printf "%s\n" "(default) $with_aix_soname" >&6; } ;; *) { 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; } with_aix_soname=aix { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (default) $with_aix_soname" >&5 printf "%s\n" "(default) $with_aix_soname" >&6; } ;; 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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.expsym 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.expsym' 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' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | freebsd*) 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' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort* | icx* | ifx*) 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' ;; *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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.expsym 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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.expsym 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.expsym $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.expsym 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.expsym $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.expsym 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 ;; 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' ;; *-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' ;; 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* | ifx*) # 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 ;; 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* | icx* | icpx*) # Native MSVC and Intel compilers 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. # A check exists to verify if there are linker flags, which will use # different commands when linking. 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.expsym"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.expsym; fi~ if test -z "$linker_flags"; then $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.expsym" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"; else $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.expsym" -Wl,$linker_flags-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"; fi~ 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 -Fe$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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.expsym 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 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 ;; *-mlibc) ;; 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 ;; 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.expsym; done; printf "%s\\n" "-hidden">> $lib.expsym~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.expsym $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.expsym' # 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.expsym~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.expsym~echo "local: *; };" >> $lib.expsym~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.expsym $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.expsym' 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.expsym~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.expsym~echo "local: *; };" >> $lib.expsym~ $LD -G$allow_undefined_flag -M $lib.expsym -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.expsym' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.expsym~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.expsym~echo "local: *; };" >> $lib.expsym~ $CC -G$allow_undefined_flag -M $lib.expsym -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.expsym' ;; 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* | *,icx*) # Native MSVC and Intel compilers 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 ;; *-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 ;; # 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' enable_cxx_stdlib=yes stdlibflag= ;; 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 enable_cxx_stdlib=yes stdlibflag= ;; 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.expsym' 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' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | freebsd*) 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' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort* | icx* | ifx*) 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' ;; *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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.expsym 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.expsym $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.expsym 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-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_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_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_PKG_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 PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&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_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-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_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_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_ac_pt_PKG_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 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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; } PKG_CONFIG="" fi fi if test -z "$PKG_CONFIG"; then as_fn_error $? "pkg-config not found" "$LINENO" 5 fi ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" if test "x$ac_cv_header_sys_resource_h" = xyes then : printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes then : printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" if test "x$ac_cv_header_sys_utsname_h" = xyes then : printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 printf %s "checking for crypt in -lcrypt... " >&6; } if test ${ac_cv_lib_crypt_crypt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 crypt (void); int main (void) { return crypt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_crypt_crypt=yes else case e in #( e) ac_cv_lib_crypt_crypt=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_crypt_crypt" >&5 printf "%s\n" "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = xyes then : printf "%s\n" "#define HAVE_LIBCRYPT 1" >>confdefs.h LIBS="-lcrypt $LIBS" fi if test "$ac_cv_lib_crypt_crypt" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" if test "x$ac_cv_header_crypt_h" = xyes then : printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h fi fi yazconfig=NONE yazpath=NONE # Check whether --with-yaz was given. if test ${with_yaz+y} then : withval=$with_yaz; yazpath=$withval fi if test "x$yazpath" = "xpkg"; then COMP=yaz for i in server icu; do if test "$i" != "static"; then COMP="$COMP yaz-$i" fi done pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $COMP" >&5 printf %s "checking for $COMP... " >&6; } if test -n "$YAZ_CFLAGS"; then pkg_cv_YAZ_CFLAGS="$YAZ_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$COMP\""; } >&5 ($PKG_CONFIG --exists --print-errors "$COMP") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_YAZ_CFLAGS=`$PKG_CONFIG --cflags "$COMP" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$YAZ_LIBS"; then pkg_cv_YAZ_LIBS="$YAZ_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$COMP\""; } >&5 ($PKG_CONFIG --exists --print-errors "$COMP") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_YAZ_LIBS=`$PKG_CONFIG --libs "$COMP" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then YAZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$COMP" 2>&1` else YAZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$COMP" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$YAZ_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($COMP) were not met: $YAZ_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables YAZ_CFLAGS and YAZ_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { 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 $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables YAZ_CFLAGS and YAZ_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See 'config.log' for more details" "$LINENO" 5; } else YAZ_CFLAGS=$pkg_cv_YAZ_CFLAGS YAZ_LIBS=$pkg_cv_YAZ_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } YAZLIB=$YAZ_LIBS YAZLALIB=$YAZLIB YAZINC=$YAZ_CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for YAZ version" >&5 printf %s "checking for YAZ version... " >&6; } YAZVERSION=`$PKG_CONFIG --modversion yaz` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YAZVERSION" >&5 printf "%s\n" "$YAZVERSION" >&6; } if test "3.0.47"; then if ! $PKG_CONFIG --atleast-version=3.0.47 yaz; then as_fn_error $? "$YAZVERSION. Requires YAZ 3.0.47 or later" "$LINENO" 5 fi fi fi else if test "x$yazpath" != "xNONE"; then yazconfig=$yazpath/yaz-config else if test "x$srcdir" = "x"; then yazsrcdir=. else yazsrcdir=$srcdir fi for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz-* ${yazsrcdir}/../yaz; do if test -d $i; then if test -r $i/yaz-config; then yazconfig=$i/yaz-config fi fi done if test "x$yazconfig" = "xNONE"; then # Extract the first word of "yaz-config", so it can be a program name with args. set dummy yaz-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_yazconfig+y} then : printf %s "(cached) " >&6 else case e in #( e) case $yazconfig in [\\/]* | ?:[\\/]*) ac_cv_path_yazconfig="$yazconfig" # 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_yazconfig="$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_yazconfig" && ac_cv_path_yazconfig="NONE" ;; esac ;; esac fi yazconfig=$ac_cv_path_yazconfig if test -n "$yazconfig"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $yazconfig" >&5 printf "%s\n" "$yazconfig" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for YAZ via yaz-config" >&5 printf %s "checking for YAZ via yaz-config... " >&6; } if $yazconfig --version >/dev/null 2>&1; then YAZLIB=`$yazconfig --libs server icu` # if this is empty, it's a simple version YAZ 1.6 script # so we have to source it instead... if test "X$YAZLIB" = "X"; then . $yazconfig else YAZLALIB=`$yazconfig --lalibs server icu` YAZINC=`$yazconfig --cflags server icu` YAZVERSION=`$yazconfig --version` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $yazconfig" >&5 printf "%s\n" "$yazconfig" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 printf "%s\n" "Not found" >&6; } YAZVERSION=NONE fi if test "X$YAZVERSION" != "XNONE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for YAZ version" >&5 printf %s "checking for YAZ version... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YAZVERSION" >&5 printf "%s\n" "$YAZVERSION" >&6; } if test "3.0.47"; then have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` req_yaz_version=`echo "3.0.47" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` if test "$have_yaz_version" -lt "$req_yaz_version"; then as_fn_error $? "$YAZVERSION. Requires YAZ 3.0.47 or later" "$LINENO" 5 fi fi fi fi if test "$YAZVERSION" = "NONE"; then as_fn_error $? "YAZ development libraries required" "$LINENO" 5 fi if test -n "$docdir"; then docdir="${datadir}/doc/${PACKAGE}" fi XSLTPROC_COMPILE='xsltproc --xinclude -path ".:$(srcdir)"' MAN_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.man.xsl' HTML_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.htmlhelp.xsl' TKL_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.tkl.xsl' PDF_COMPILE='dblatex -P latex.class.options=a4paper,12pt,twoside,openright' # Check whether --with-docbook-dtd was given. if test ${with_docbook_dtd+y} then : withval=$with_docbook_dtd; if test -f "$withval/docbookx.dtd"; then DTD_DIR=$withval fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for docbookx.dtd" >&5 printf %s "checking for docbookx.dtd... " >&6; } DTD_DIR="" for d in /usr/lib/sgml/dtd/docbook-xml \ /usr/share/sgml/docbook/dtd/4.2 \ /usr/share/sgml/docbook/dtd/xml/4.* \ /usr/share/sgml/docbook/xml-dtd-4.* \ /usr/local/share/xml/docbook/4.* do if test -f $d/docbookx.dtd; then DTD_DIR=$d fi done if test -z "$DTD_DIR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 printf "%s\n" "Not found" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $d" >&5 printf "%s\n" "$d" >&6; } fi ;; esac fi # Check whether --with-docbook-dsssl was given. if test ${with_docbook_dsssl+y} then : withval=$with_docbook_dsssl; if test -f "$withval/html/docbook.dsl"; then DSSSL_DIR=$withval fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for docbook.dsl" >&5 printf %s "checking for docbook.dsl... " >&6; } DSSSL_DIR="" for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \ /usr/share/sgml/docbook/dsssl-stylesheets-1.* \ /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh \ /usr/local/share/sgml/docbook/dsssl/modular do if test -f $d/html/docbook.dsl; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $d" >&5 printf "%s\n" "$d" >&6; } DSSSL_DIR=$d break fi done if test -z "$DSSSL_DIR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 printf "%s\n" "Not found" >&6; } fi ;; esac fi # Check whether --with-docbook-xsl was given. if test ${with_docbook_xsl+y} then : withval=$with_docbook_xsl; if test -f "$withval/htmlhelp/htmlhelp.xsl"; then XSL_DIR=$withval fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for htmlhelp.xsl" >&5 printf %s "checking for htmlhelp.xsl... " >&6; } for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \ /usr/local/share/xsl/docbook \ /usr/share/sgml/docbook/xsl-stylesheets-1.* do if test -f $d/htmlhelp/htmlhelp.xsl; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $d" >&5 printf "%s\n" "$d" >&6; } XSL_DIR=$d break fi done if test -z "$XSL_DIR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 printf "%s\n" "Not found" >&6; } fi ;; esac fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tcl" >&5 printf %s "checking for tcl... " >&6; } if test -n "$TCL_CFLAGS"; then pkg_cv_TCL_CFLAGS="$TCL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tcl\""; } >&5 ($PKG_CONFIG --exists --print-errors "tcl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TCL_CFLAGS=`$PKG_CONFIG --cflags "tcl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TCL_LIBS"; then pkg_cv_TCL_LIBS="$TCL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tcl\""; } >&5 ($PKG_CONFIG --exists --print-errors "tcl") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TCL_LIBS=`$PKG_CONFIG --libs "tcl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TCL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "tcl" 2>&1` else TCL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "tcl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TCL_PKG_ERRORS" >&5 havetcl=0 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } havetcl=0 else TCL_CFLAGS=$pkg_cv_TCL_CFLAGS TCL_LIBS=$pkg_cv_TCL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } havetcl=1 fi printf "%s\n" "#define HAVE_TCL_H $havetcl" >>confdefs.h ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes then : printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "atoll" "ac_cv_func_atoll" if test "x$ac_cv_func_atoll" = xyes then : printf "%s\n" "#define HAVE_ATOLL 1" >>confdefs.h fi # Check whether --with-iconv was given. if test ${with_iconv+y} then : withval=$with_iconv; fi if test "$with_iconv" != "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 printf %s "checking for iconv... " >&6; } oldLIBS="$LIBS" oldCPPFLAGS="${CPPFLAGS}" if test "$with_iconv" != "yes" -a "$with_iconv" != ""; then LIBS="$LIBS -L${with_iconv}/lib" CPPFLAGS="${CPPFLAGS} -I${with_iconv}/include" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { iconv_t t = iconv_open("", ""); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : printf "%s\n" "#define HAVE_ICONV_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) LIBS="$LIBS -liconv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { iconv_t t = iconv_open("", ""); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : printf "%s\n" "#define HAVE_ICONV_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) LIBS="$oldLIBS" CPPFLAGS="$oldCPPFLAGS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; 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 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bzCompressInit in -lbz2" >&5 printf %s "checking for bzCompressInit in -lbz2... " >&6; } if test ${ac_cv_lib_bz2_bzCompressInit+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $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 bzCompressInit (void); int main (void) { return bzCompressInit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bz2_bzCompressInit=yes else case e in #( e) ac_cv_lib_bz2_bzCompressInit=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_bz2_bzCompressInit" >&5 printf "%s\n" "$ac_cv_lib_bz2_bzCompressInit" >&6; } if test "x$ac_cv_lib_bz2_bzCompressInit" = xyes then : printf "%s\n" "#define HAVE_LIBBZ2 1" >>confdefs.h LIBS="-lbz2 $LIBS" fi if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" if test "x$ac_cv_header_bzlib_h" = xyes then : printf "%s\n" "#define HAVE_BZLIB_H 1" >>confdefs.h fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompressInit in -lbz2" >&5 printf %s "checking for BZ2_bzCompressInit in -lbz2... " >&6; } if test ${ac_cv_lib_bz2_BZ2_bzCompressInit+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $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 BZ2_bzCompressInit (void); int main (void) { return BZ2_bzCompressInit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bz2_BZ2_bzCompressInit=yes else case e in #( e) ac_cv_lib_bz2_BZ2_bzCompressInit=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_bz2_BZ2_bzCompressInit" >&5 printf "%s\n" "$ac_cv_lib_bz2_BZ2_bzCompressInit" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzCompressInit" = xyes then : printf "%s\n" "#define HAVE_LIBBZ2 1" >>confdefs.h LIBS="-lbz2 $LIBS" fi if test "$ac_cv_lib_bz2_BZ2_bzCompressInit" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" if test "x$ac_cv_header_bzlib_h" = xyes then : printf "%s\n" "#define HAVE_BZLIB_H 1" >>confdefs.h fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 printf %s "checking for compress2 in -lz... " >&6; } if test ${ac_cv_lib_z_compress2+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lz $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 compress2 (void); int main (void) { return compress2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_z_compress2=yes else case e in #( e) ac_cv_lib_z_compress2=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_z_compress2" >&5 printf "%s\n" "$ac_cv_lib_z_compress2" >&6; } if test "x$ac_cv_lib_z_compress2" = xyes then : printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h LIBS="-lz $LIBS" fi if test "$ac_cv_lib_z_compress2" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes then : printf "%s\n" "#define HAVE_ZLIB_H 1" >>confdefs.h fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 printf %s "checking for sqrt in -lm... " >&6; } if test ${ac_cv_lib_m_sqrt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. 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 sqrt (void); int main (void) { return sqrt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_sqrt=yes else case e in #( e) ac_cv_lib_m_sqrt=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_m_sqrt" >&5 printf "%s\n" "$ac_cv_lib_m_sqrt" >&6; } if test "x$ac_cv_lib_m_sqrt" = xyes then : printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h LIBS="-lm $LIBS" fi { 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 : printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h LIBS="-ldl $LIBS" fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for expat" >&5 printf %s "checking for expat... " >&6; } if test -n "$EXPAT_CFLAGS"; then pkg_cv_EXPAT_CFLAGS="$EXPAT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"expat\""; } >&5 ($PKG_CONFIG --exists --print-errors "expat") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXPAT_CFLAGS=`$PKG_CONFIG --cflags "expat" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$EXPAT_LIBS"; then pkg_cv_EXPAT_LIBS="$EXPAT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"expat\""; } >&5 ($PKG_CONFIG --exists --print-errors "expat") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXPAT_LIBS=`$PKG_CONFIG --libs "expat" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then EXPAT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "expat" 2>&1` else EXPAT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "expat" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EXPAT_PKG_ERRORS" >&5 have_expat="no" elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } have_expat="no" else EXPAT_CFLAGS=$pkg_cv_EXPAT_CFLAGS EXPAT_LIBS=$pkg_cv_EXPAT_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } have_expat="yes" fi if test "$have_expat" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5 printf %s "checking for XML_ParserCreate in -lexpat... " >&6; } if test ${ac_cv_lib_expat_XML_ParserCreate+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $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 XML_ParserCreate (void); int main (void) { return XML_ParserCreate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_expat_XML_ParserCreate=yes else case e in #( e) ac_cv_lib_expat_XML_ParserCreate=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_expat_XML_ParserCreate" >&5 printf "%s\n" "$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate" = xyes then : EXPAT_LIBS="-lexpat"; have_expat=yes fi fi if test "$have_expat" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" if test "x$ac_cv_header_expat_h" = xyes then : printf "%s\n" "#define HAVE_EXPAT_H 1" >>confdefs.h fi fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile,$enable_year2038" != no,no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 printf %s "checking for $CC option to enable large file support... " >&6; } if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CC="$CC" ac_opt_found=no for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do if test x"$ac_opt" != x"none needed" then : CC="$ac_save_CC $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef FTYPE # define FTYPE off_t #endif /* Check that FTYPE can represent 2**63 - 1 correctly. We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_opt" = x"none needed" then : # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) CC="$CC -D_FILE_OFFSET_BITS=64" if ac_fn_c_try_compile "$LINENO" then : ac_opt='-D_FILE_OFFSET_BITS=64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam fi ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CC="$ac_save_CC" test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } ac_have_largefile=yes case $ac_cv_sys_largefile_opts in #( "none needed") : ;; #( "supported through gnulib") : ;; #( "support not detected") : ac_have_largefile=no ;; #( "-D_FILE_OFFSET_BITS=64") : printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h ;; #( "-D_LARGE_FILES=1") : printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h ;; #( "-n32") : CC="$CC -n32" ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac if test "$enable_year2038" != no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 printf %s "checking for $CC option for timestamps after 2038... " >&6; } if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do if test x"$ac_opt" != x"none needed" then : CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that time_t can represent 2**32 - 1 correctly. */ #define LARGE_TIME_T \\ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_year2038_opts="$ac_opt" ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test $ac_opt_found = no || break done CPPFLAGS="$ac_save_CPPFLAGS" test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } ac_have_year2038=yes case $ac_cv_sys_year2038_opts in #( "none needed") : ;; #( "support not detected") : ac_have_year2038=no ;; #( "-D_TIME_BITS=64") : printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h ;; #( "-D__MINGW_USE_VC2005_COMPAT") : printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h ;; #( "-U_USE_32_BIT_TIME_T"*) : { { 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 $? "the 'time_t' type is currently forced to be 32-bit. It will stop working after mid-January 2038. Remove _USE_32BIT_TIME_T from the compiler flags. See 'config.log' for more details" "$LINENO" 5; } ;; #( *) : as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac fi fi ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" if test "x$ac_cv_type_long_long" = xyes then : printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h fi if test "${ac_cv_type_long_long}" = "yes"; then ZINT_VALUE=1 else ZINT_VALUE=0 fi ZEBRA_CFLAGS="-DZEBRA_ZINT=${ZINT_VALUE}" printf "%s\n" "#define ZEBRA_ZINT ${ZINT_VALUE}" >>confdefs.h SHARED_MODULE_LA="" STATIC_MODULE_OBJ="" STATIC_MODULE_LADD="" printf "%s\n" "#define IDZEBRA_STATIC_GRS_SGML 1" >>confdefs.h printf "%s\n" "#define IDZEBRA_STATIC_TEXT 0" >>confdefs.h # Check whether --enable-mod-text was given. if test ${enable_mod_text+y} then : enableval=$enable_mod_text; myen=$enableval else case e in #( e) myen=shared ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module text" >&5 printf %s "checking for module text... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo text|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "shared" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-text because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-text.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo text|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-text value. Use on,off,static or shared" "$LINENO" 5 fi printf "%s\n" "#define IDZEBRA_STATIC_GRS_REGX 0" >>confdefs.h # Check whether --enable-mod-grs-regx was given. if test ${enable_mod_grs_regx+y} then : enableval=$enable_mod_grs_regx; myen=$enableval else case e in #( e) myen=shared ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module grs-regx" >&5 printf %s "checking for module grs-regx... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo grs-regx|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "shared" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-grs-regx because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-grs-regx.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo grs-regx|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-grs-regx value. Use on,off,static or shared" "$LINENO" 5 fi printf "%s\n" "#define IDZEBRA_STATIC_GRS_MARC 0" >>confdefs.h # Check whether --enable-mod-grs-marc was given. if test ${enable_mod_grs_marc+y} then : enableval=$enable_mod_grs_marc; myen=$enableval else case e in #( e) myen=shared ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module grs-marc" >&5 printf %s "checking for module grs-marc... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo grs-marc|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "shared" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-grs-marc because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-grs-marc.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo grs-marc|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-grs-marc value. Use on,off,static or shared" "$LINENO" 5 fi if test "$ac_cv_header_expat_h" = "yes"; then def="shared" else def="disabled" fi printf "%s\n" "#define IDZEBRA_STATIC_GRS_XML 0" >>confdefs.h # Check whether --enable-mod-grs-xml was given. if test ${enable_mod_grs_xml+y} then : enableval=$enable_mod_grs_xml; myen=$enableval else case e in #( e) myen=$def ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module grs-xml" >&5 printf %s "checking for module grs-xml... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo grs-xml|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "$def" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-grs-xml because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-grs-xml.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo grs-xml|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-grs-xml value. Use on,off,static or shared" "$LINENO" 5 fi oldCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $YAZINC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if YAZ_HAVE_XSLT #include #include #include #include #include #include #else #error Libxslt not available #endif int main (void) { #if LIBXML_VERSION < 20615 #error Libxml2 version < 2.6.15. xmlreader not reliable/present #endif ; return 0; } _ACEOF if ac_fn_c_try_cpp "$LINENO" then : def="shared" else case e in #( e) def="disabled" ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS=$oldCPPFLAGS printf "%s\n" "#define IDZEBRA_STATIC_DOM 0" >>confdefs.h # Check whether --enable-mod-dom was given. if test ${enable_mod_dom+y} then : enableval=$enable_mod_dom; myen=$enableval else case e in #( e) myen=$def ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module dom" >&5 printf %s "checking for module dom... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo dom|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "$def" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-dom because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-dom.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo dom|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-dom value. Use on,off,static or shared" "$LINENO" 5 fi printf "%s\n" "#define IDZEBRA_STATIC_ALVIS 0" >>confdefs.h # Check whether --enable-mod-alvis was given. if test ${enable_mod_alvis+y} then : enableval=$enable_mod_alvis; myen=$enableval else case e in #( e) myen=$def ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module alvis" >&5 printf %s "checking for module alvis... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo alvis|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "$def" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-alvis because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-alvis.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo alvis|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-alvis value. Use on,off,static or shared" "$LINENO" 5 fi printf "%s\n" "#define IDZEBRA_STATIC_SAFARI 0" >>confdefs.h # Check whether --enable-mod-safari was given. if test ${enable_mod_safari+y} then : enableval=$enable_mod_safari; myen=$enableval else case e in #( e) myen=shared ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for module safari" >&5 printf %s "checking for module safari... " >&6; } if test "$myen" = "yes"; then myen="shared" fi if test "$enable_shared" != "yes"; then if test "$myen" = "shared"; then myen="static" fi fi m=`echo safari|tr .- __` if test "$myen" = "no" -o "$myen" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } elif test "shared" = "disabled"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } as_fn_error $? "Cannot enable mod-safari because of missing libs (XML, etc)" "$LINENO" 5 elif test "$myen" = "shared"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_MODULE_LA="${SHARED_MODULE_LA} mod-safari.la" elif test "$myen" = "static"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } STATIC_MODULE_OBJ="${STATIC_MODULE_OBJ} \$(mod_${m}_la_OBJECTS)" STATIC_MODULE_LADD="${STATIC_MODULE_LADD} \$(mod_${m}_la_LADD)" modcpp=`echo safari|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` printf "%s\n" "#define IDZEBRA_STATIC_$modcpp 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $myen" >&5 printf "%s\n" "$myen" >&6; } as_fn_error $? "invalid --enable-mod-safari value. Use on,off,static or shared" "$LINENO" 5 fi IDZEBRA_SRC_ROOT=`cd ${srcdir}; pwd` IDZEBRA_BUILD_ROOT=`pwd` WIN_FILEVERSION=`echo $PACKAGE_VERSION | $AWK 'BEGIN { FS = "."; } { m = $4; printf("%d,%d,%d,%d", $1, $2, $3 == "" ? "0" : $3, $4 == "" ? "1" : $4);}'` VERSION_HEX=`echo $PACKAGE_VERSION | $AWK 'BEGIN { FS = "."; } { printf("%x", ($1 * 256 + $2) * 256 + $3);}'` if test -d ${srcdir}/.git; then VERSION_SHA1=`git show --pretty=format:%H|head -1` else VERSION_SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'` fi ac_config_files="$ac_config_files Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isamb/Makefile isams/Makefile isamc/Makefile rset/Makefile data1/Makefile index/Makefile include/Makefile include/idzebra/Makefile tab/Makefile doc/Makefile doc/local0.ent doc/common/Makefile doc/common/print.dsl test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile test/xslt/Makefile test/xpath/Makefile test/rusmarc/Makefile test/cddb/Makefile test/malxml/Makefile test/mbox/Makefile test/config/Makefile test/dmoz/Makefile test/marcxml/Makefile test/charmap/Makefile test/codec/Makefile test/espec/Makefile test/filters/Makefile examples/Makefile examples/gils/Makefile examples/marc21/Makefile examples/marcxml/Makefile examples/oai-pmh/Makefile examples/zthes/Makefile idzebra-config-2.0 zebra.pc Doxyfile win/version.nsi include/idzebra/version.h" ac_config_commands="$ac_config_commands default" 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 # Check whether --enable-year2038 was given. if test ${enable_year2038+y} then : enableval=$enable_year2038; 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 idzebra $as_me 2.2.10, 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="\\ idzebra config.status 2.2.10 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_cxx_stdlib='`$ECHO "$enable_cxx_stdlib" | $SED "$delay_single_quote_subst"`' stdlibflag='`$ECHO "$stdlibflag" | $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"`' lt_cv_cygpath_installed='`$ECHO "$lt_cv_cygpath_installed" | $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"`' 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 \ lt_ar_flags \ 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; 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; 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 "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; "bfile/Makefile") CONFIG_FILES="$CONFIG_FILES bfile/Makefile" ;; "dfa/Makefile") CONFIG_FILES="$CONFIG_FILES dfa/Makefile" ;; "dict/Makefile") CONFIG_FILES="$CONFIG_FILES dict/Makefile" ;; "isamb/Makefile") CONFIG_FILES="$CONFIG_FILES isamb/Makefile" ;; "isams/Makefile") CONFIG_FILES="$CONFIG_FILES isams/Makefile" ;; "isamc/Makefile") CONFIG_FILES="$CONFIG_FILES isamc/Makefile" ;; "rset/Makefile") CONFIG_FILES="$CONFIG_FILES rset/Makefile" ;; "data1/Makefile") CONFIG_FILES="$CONFIG_FILES data1/Makefile" ;; "index/Makefile") CONFIG_FILES="$CONFIG_FILES index/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/idzebra/Makefile") CONFIG_FILES="$CONFIG_FILES include/idzebra/Makefile" ;; "tab/Makefile") CONFIG_FILES="$CONFIG_FILES tab/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/local0.ent") CONFIG_FILES="$CONFIG_FILES doc/local0.ent" ;; "doc/common/Makefile") CONFIG_FILES="$CONFIG_FILES doc/common/Makefile" ;; "doc/common/print.dsl") CONFIG_FILES="$CONFIG_FILES doc/common/print.dsl" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/gils/Makefile") CONFIG_FILES="$CONFIG_FILES test/gils/Makefile" ;; "test/usmarc/Makefile") CONFIG_FILES="$CONFIG_FILES test/usmarc/Makefile" ;; "test/api/Makefile") CONFIG_FILES="$CONFIG_FILES test/api/Makefile" ;; "test/xslt/Makefile") CONFIG_FILES="$CONFIG_FILES test/xslt/Makefile" ;; "test/xpath/Makefile") CONFIG_FILES="$CONFIG_FILES test/xpath/Makefile" ;; "test/rusmarc/Makefile") CONFIG_FILES="$CONFIG_FILES test/rusmarc/Makefile" ;; "test/cddb/Makefile") CONFIG_FILES="$CONFIG_FILES test/cddb/Makefile" ;; "test/malxml/Makefile") CONFIG_FILES="$CONFIG_FILES test/malxml/Makefile" ;; "test/mbox/Makefile") CONFIG_FILES="$CONFIG_FILES test/mbox/Makefile" ;; "test/config/Makefile") CONFIG_FILES="$CONFIG_FILES test/config/Makefile" ;; "test/dmoz/Makefile") CONFIG_FILES="$CONFIG_FILES test/dmoz/Makefile" ;; "test/marcxml/Makefile") CONFIG_FILES="$CONFIG_FILES test/marcxml/Makefile" ;; "test/charmap/Makefile") CONFIG_FILES="$CONFIG_FILES test/charmap/Makefile" ;; "test/codec/Makefile") CONFIG_FILES="$CONFIG_FILES test/codec/Makefile" ;; "test/espec/Makefile") CONFIG_FILES="$CONFIG_FILES test/espec/Makefile" ;; "test/filters/Makefile") CONFIG_FILES="$CONFIG_FILES test/filters/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "examples/gils/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gils/Makefile" ;; "examples/marc21/Makefile") CONFIG_FILES="$CONFIG_FILES examples/marc21/Makefile" ;; "examples/marcxml/Makefile") CONFIG_FILES="$CONFIG_FILES examples/marcxml/Makefile" ;; "examples/oai-pmh/Makefile") CONFIG_FILES="$CONFIG_FILES examples/oai-pmh/Makefile" ;; "examples/zthes/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zthes/Makefile" ;; "idzebra-config-2.0") CONFIG_FILES="$CONFIG_FILES idzebra-config-2.0" ;; "zebra.pc") CONFIG_FILES="$CONFIG_FILES zebra.pc" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "win/version.nsi") CONFIG_FILES="$CONFIG_FILES win/version.nsi" ;; "include/idzebra/version.h") CONFIG_FILES="$CONFIG_FILES include/idzebra/version.h" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) 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) 2025 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='' # 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 to let the compiler frontend decide what standard libraries to link when building C++ shared libraries and modules. enable_cxx_stdlib=$enable_cxx_stdlib # Flag used for specifying not to link standard libraries. stdlibflag=$stdlibflag # 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 # whether cygpath is installed. cygpath_installed=$lt_cv_cygpath_installed # 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_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 # ### 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" ;; "default":C) sed -e 's%echo_source=yes%echo_source=no%g; s%src_root=.*$%%g; s%build_root=.*%%g' \ < idzebra-config-2.0 > util/idzebra-config-2.0 \ && chmod +x idzebra-config-2.0 util/idzebra-config-2.0 diff doc/local.ent doc/local0.ent >/dev/null 2>/dev/null \ || cp doc/local0.ent doc/local.ent ;; 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 echo \ "------------------------------------------------------------------------ ZEBRA Package: ${PACKAGE} ZEBRA Version: ${VERSION} Source code location: ${srcdir} C Preprocessor: ${CPP} C Preprocessor flags: ${CPPFLAGS} C Compiler: ${CC} C Compiler flags: ${CFLAGS} Linker flags: ${LDFLAGS} Linked libs: ${LIBS} Host System Type: ${host} Install path: ${prefix} Automake: ${AUTOMAKE} Archiver: ${AR} Ranlib: ${RANLIB} YAZ Version: ${YAZVERSION} YAZ Include: ${YAZINC} YAZ La Lib: ${YAZLALIB} YAZ Lib: ${YAZLIB} Bugreport: ${PACKAGE_BUGREPORT} ------------------------------------------------------------------------" idzebra-2.2.10/dfa/0000755000175000017500000000000015136704657012412 5ustar00adamadamidzebra-2.2.10/dfa/Makefile.in0000644000175000017500000011254415136704635014462 0ustar00adamadam# 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 = agrep$(EXEEXT) lexer$(EXEEXT) grepper$(EXEEXT) check_PROGRAMS = test_dfa$(EXEEXT) subdir = dfa ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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)/m4/yaz.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) libidzebra_dfa_la_LIBADD = am_libidzebra_dfa_la_OBJECTS = dfa.lo imalloc.lo states.lo set.lo \ bset.lo libidzebra_dfa_la_OBJECTS = $(am_libidzebra_dfa_la_OBJECTS) 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 = am_agrep_OBJECTS = agrep.$(OBJEXT) agrep_OBJECTS = $(am_agrep_OBJECTS) agrep_LDADD = $(LDADD) am__DEPENDENCIES_1 = agrep_DEPENDENCIES = libidzebra-dfa.la ../util/libidzebra-util.la \ $(am__DEPENDENCIES_1) am_grepper_OBJECTS = grepper.$(OBJEXT) grepper_OBJECTS = $(am_grepper_OBJECTS) grepper_LDADD = $(LDADD) grepper_DEPENDENCIES = libidzebra-dfa.la ../util/libidzebra-util.la \ $(am__DEPENDENCIES_1) am_lexer_OBJECTS = lexer.$(OBJEXT) readfile.$(OBJEXT) lexer_OBJECTS = $(am_lexer_OBJECTS) lexer_LDADD = $(LDADD) lexer_DEPENDENCIES = libidzebra-dfa.la ../util/libidzebra-util.la \ $(am__DEPENDENCIES_1) am_test_dfa_OBJECTS = test_dfa.$(OBJEXT) test_dfa_OBJECTS = $(am_test_dfa_OBJECTS) test_dfa_LDADD = $(LDADD) test_dfa_DEPENDENCIES = libidzebra-dfa.la ../util/libidzebra-util.la \ $(am__DEPENDENCIES_1) 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 = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/agrep.Po ./$(DEPDIR)/bset.Plo \ ./$(DEPDIR)/dfa.Plo ./$(DEPDIR)/grepper.Po \ ./$(DEPDIR)/imalloc.Plo ./$(DEPDIR)/lexer.Po \ ./$(DEPDIR)/readfile.Po ./$(DEPDIR)/set.Plo \ ./$(DEPDIR)/states.Plo ./$(DEPDIR)/test_dfa.Po am__mv = mv -f 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 = $(libidzebra_dfa_la_SOURCES) $(agrep_SOURCES) \ $(grepper_SOURCES) $(lexer_SOURCES) $(test_dfa_SOURCES) DIST_SOURCES = $(libidzebra_dfa_la_SOURCES) $(agrep_SOURCES) \ $(grepper_SOURCES) $(lexer_SOURCES) $(test_dfa_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HTML_COMPILE = @HTML_COMPILE@ IDZEBRA_BUILD_ROOT = @IDZEBRA_BUILD_ROOT@ IDZEBRA_SRC_ROOT = @IDZEBRA_SRC_ROOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ 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_SUFFIX = @PACKAGE_SUFFIX@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_MODULE_LA = @SHARED_MODULE_LA@ SHELL = @SHELL@ STATIC_MODULE_LADD = @STATIC_MODULE_LADD@ STATIC_MODULE_OBJ = @STATIC_MODULE_OBJ@ STRIP = @STRIP@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_LIBS = @TCL_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YAZINC = @YAZINC@ YAZLALIB = @YAZLALIB@ YAZLIB = @YAZLIB@ YAZVERSION = @YAZVERSION@ YAZ_CFLAGS = @YAZ_CFLAGS@ YAZ_LIBS = @YAZ_LIBS@ ZEBRALIBS_VERSION_INFO = @ZEBRALIBS_VERSION_INFO@ ZEBRA_CFLAGS = @ZEBRA_CFLAGS@ 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_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@ main_zebralib = @main_zebralib@ 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@ yazconfig = @yazconfig@ noinst_LTLIBRARIES = libidzebra-dfa.la TESTS = $(check_PROGRAMS) test_dfa_SOURCES = test_dfa.c AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) LDADD = libidzebra-dfa.la ../util/libidzebra-util.la $(YAZLALIB) agrep_SOURCES = agrep.c lexer_SOURCES = lexer.c readfile.c grepper_SOURCES = grepper.c libidzebra_dfa_la_SOURCES = dfa.c imalloc.c states.c set.c bset.c \ dfap.h imalloc.h lexer.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dfa/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dfa/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libidzebra-dfa.la: $(libidzebra_dfa_la_OBJECTS) $(libidzebra_dfa_la_DEPENDENCIES) $(EXTRA_libidzebra_dfa_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libidzebra_dfa_la_OBJECTS) $(libidzebra_dfa_la_LIBADD) $(LIBS) agrep$(EXEEXT): $(agrep_OBJECTS) $(agrep_DEPENDENCIES) $(EXTRA_agrep_DEPENDENCIES) @rm -f agrep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(agrep_OBJECTS) $(agrep_LDADD) $(LIBS) grepper$(EXEEXT): $(grepper_OBJECTS) $(grepper_DEPENDENCIES) $(EXTRA_grepper_DEPENDENCIES) @rm -f grepper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(grepper_OBJECTS) $(grepper_LDADD) $(LIBS) lexer$(EXEEXT): $(lexer_OBJECTS) $(lexer_DEPENDENCIES) $(EXTRA_lexer_DEPENDENCIES) @rm -f lexer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lexer_OBJECTS) $(lexer_LDADD) $(LIBS) test_dfa$(EXEEXT): $(test_dfa_OBJECTS) $(test_dfa_DEPENDENCIES) $(EXTRA_test_dfa_DEPENDENCIES) @rm -f test_dfa$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dfa_OBJECTS) $(test_dfa_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agrep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfa.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grepper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imalloc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/states.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dfa.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_dfa.log: test_dfa$(EXEEXT) @p='test_dfa$(EXEEXT)'; \ b='test_dfa'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @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 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) installdirs: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) 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-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/agrep.Po -rm -f ./$(DEPDIR)/bset.Plo -rm -f ./$(DEPDIR)/dfa.Plo -rm -f ./$(DEPDIR)/grepper.Po -rm -f ./$(DEPDIR)/imalloc.Plo -rm -f ./$(DEPDIR)/lexer.Po -rm -f ./$(DEPDIR)/readfile.Po -rm -f ./$(DEPDIR)/set.Plo -rm -f ./$(DEPDIR)/states.Plo -rm -f ./$(DEPDIR)/test_dfa.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: 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 ./$(DEPDIR)/agrep.Po -rm -f ./$(DEPDIR)/bset.Plo -rm -f ./$(DEPDIR)/dfa.Plo -rm -f ./$(DEPDIR)/grepper.Po -rm -f ./$(DEPDIR)/imalloc.Plo -rm -f ./$(DEPDIR)/lexer.Po -rm -f ./$(DEPDIR)/readfile.Po -rm -f ./$(DEPDIR)/set.Plo -rm -f ./$(DEPDIR)/states.Plo -rm -f ./$(DEPDIR)/test_dfa.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: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile clean-local: -rm -f *.log # 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.% idzebra-2.2.10/dfa/states.c0000664000175000017500000001221014754717556014066 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "dfap.h" #include "imalloc.h" #define DFA_CHUNK 40 #define TRAN_CHUNK 100 int init_DFA_states (struct DFA_states **dfasp, DFASetType st, int hash) { struct DFA_states *dfas; struct DFA_trans *tm; int i; dfas = (struct DFA_states *) imalloc (sizeof(struct DFA_states)); assert (dfas); dfas->hasharray = (struct DFA_state **) imalloc (sizeof(struct DFA_state*) * hash); assert (dfas->hasharray); *dfasp = dfas; dfas->freelist = dfas->unmarked = dfas->marked = NULL; dfas->statemem = NULL; dfas->hash = hash; dfas->st = st; dfas->no = 0; dfas->transmem = tm = (struct DFA_trans *) imalloc (sizeof(struct DFA_trans)); assert (tm); tm->next = NULL; tm->size = TRAN_CHUNK; tm->ptr = 0; tm->tran_block = (struct DFA_tran *) imalloc (sizeof(struct DFA_tran) * tm->size); assert (tm->tran_block); dfas->sortarray = NULL; for (i=0; ihash; i++) dfas->hasharray[i] = NULL; return 0; } int rm_DFA_states (struct DFA_states **dfasp) { struct DFA_states *dfas = *dfasp; DFA_stateb *sm, *sm1; struct DFA_trans *tm, *tm1; assert (dfas); if (dfas->hasharray) ifree (dfas->hasharray); ifree (dfas->sortarray); for (tm=dfas->transmem; tm; tm=tm1) { ifree (tm->tran_block); tm1 = tm->next; ifree (tm); } for (sm=dfas->statemem; sm; sm=sm1) { ifree (sm->state_block); sm1 = sm->next; ifree (sm); } ifree (dfas); *dfasp = NULL; return 0; } int add_DFA_state (struct DFA_states *dfas, DFASet *s, struct DFA_state **sp) { int i; struct DFA_state *si, **sip; DFA_stateb *sb; assert (dfas); assert (*s); assert (dfas->hasharray); sip = dfas->hasharray + (hash_DFASet (dfas->st, *s) % dfas->hash); for (si = *sip; si; si=si->link) if (eq_DFASet (dfas->st, si->set, *s)) { *sp = si; *s = rm_DFASet (dfas->st, *s); return 0; } if (!dfas->freelist) { sb = (DFA_stateb *) imalloc (sizeof(*sb)); sb->next = dfas->statemem; dfas->statemem = sb; sb->state_block = si = dfas->freelist = (struct DFA_state *) imalloc (sizeof(struct DFA_state)*DFA_CHUNK); for (i = 0; inext = si+1; si->next = NULL; } si = dfas->freelist; dfas->freelist = si->next; si->next = dfas->unmarked; dfas->unmarked = si; si->link = *sip; *sip = si; si->no = (dfas->no)++; si->tran_no = 0; si->set = *s; *s = NULL; *sp = si; return 1; } void add_DFA_tran (struct DFA_states *dfas, struct DFA_state *s, int ch0, int ch1, int to) { struct DFA_trans *tm; struct DFA_tran *t; tm = dfas->transmem; if (tm->ptr == tm->size) { tm = (struct DFA_trans *) imalloc (sizeof(struct DFA_trans)); assert (tm); tm->next = dfas->transmem; dfas->transmem = tm; tm->size = s->tran_no >= TRAN_CHUNK ? s->tran_no+8 : TRAN_CHUNK; tm->tran_block = (struct DFA_tran *) imalloc (sizeof(struct DFA_tran) * tm->size); assert (tm->tran_block); if (s->tran_no) memcpy (tm->tran_block, s->trans, s->tran_no*sizeof (struct DFA_tran)); tm->ptr = s->tran_no; s->trans = tm->tran_block; } s->tran_no++; t = tm->tran_block + tm->ptr++; t->ch[0] = ch0; t->ch[1] = ch1; t->to = to; } struct DFA_state *get_DFA_state (struct DFA_states *dfas) { struct DFA_state *si; assert (dfas); if (!(si = dfas->unmarked)) return NULL; dfas->unmarked = si->next; si->next = dfas->marked; dfas->marked = si; si->trans = dfas->transmem->tran_block + dfas->transmem->ptr; return si; } void sort_DFA_states (struct DFA_states *dfas) { struct DFA_state *s; assert (dfas); dfas->sortarray = (struct DFA_state **) imalloc (sizeof(struct DFA_state *)*dfas->no); for (s = dfas->marked; s; s=s->next) dfas->sortarray[s->no] = s; ifree (dfas->hasharray); dfas->hasharray = NULL; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/readfile.c0000664000175000017500000000744514754717556014354 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "lexer.h" #define MAXLINE 512 static FILE *inf; static FILE *outf; static const char *inf_name; static int line_no; static int err_no; static void prep (char **s), read_defs (void), read_rules (struct DFA *dfap), read_tail (void); static char *read_line (void); static void prep (char **s) { static char expr_buf[MAXLINE+1]; char *dst = expr_buf; const char *src = *s; int c; while ((c = *src++)) *dst++ = c; *dst = '\0'; *s = expr_buf; } static char *read_line (void) { static char linebuf[MAXLINE+1]; ++line_no; return fgets (linebuf, MAXLINE, inf); } static void read_defs (void) { const char *s; while ((s=read_line())) { if (*s == '%' && s[1] == '%') return; else if (*s == '\0' || isspace (*s)) fputs (s, outf); } error ("missing rule section"); } static void read_rules (struct DFA *dfa) { char *s; const char *sc; int i; int no = 0; fputs ("\n#ifndef YY_BREAK\n#define YY_BREAK break;\n#endif\n", outf); fputs ("void lexact (int no)\n{\n", outf); fputs ( "\tswitch (no)\n\t{\n", outf); while ((s=read_line())) { if (*s == '%' && s[1] == '%') break; else if (*s == '\0' || isspace (*s)) /* copy rest of line to output */ fputs (s, outf); else { /* preprocess regular expression */ prep (&s); /* now parse regular expression */ sc = s; i = dfa_parse (dfa, &sc); if (i) { fprintf (stderr, "%s #%d: regular expression syntax error\n", inf_name, line_no); assert (0); err_no++; } else { if (no) fputs ("\t\tYY_BREAK\n", outf); no++; fprintf (outf, "\tcase %d:\n#line %d\n\t\t", no, line_no); } while (*sc == '\t' || *sc == ' ') sc++; fputs (sc, outf); } } fputs ("\tYY_BREAK\n\t}\n}\n", outf); if (!no) error ("no regular expressions in rule section"); } static void read_tail (void) { const char *s; while ((s=read_line())) fputs (s, outf); } int read_file (const char *s, struct DFA *dfa) { inf_name = s; if (!(inf=fopen (s,"r"))) { error ("cannot open `%s'", s); return -1; } if (!(outf=fopen ("lex.yy.c", "w"))) { error ("cannot open `%s'", "lex.yy.c"); return -2; } line_no = 0; err_no = 0; read_defs (); read_rules (dfa); read_tail (); fclose (outf); fclose (inf); return err_no; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/Makefile.am0000664000175000017500000000075114754717556014462 0ustar00adamadam noinst_LTLIBRARIES = libidzebra-dfa.la noinst_PROGRAMS = agrep lexer grepper check_PROGRAMS = test_dfa TESTS = $(check_PROGRAMS) test_dfa_SOURCES = test_dfa.c AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) LDADD = libidzebra-dfa.la ../util/libidzebra-util.la $(YAZLALIB) agrep_SOURCES = agrep.c lexer_SOURCES = lexer.c readfile.c grepper_SOURCES = grepper.c libidzebra_dfa_la_SOURCES = dfa.c imalloc.c states.c set.c bset.c \ dfap.h imalloc.h lexer.h clean-local: -rm -f *.log idzebra-2.2.10/dfa/grepper.c0000664000175000017500000002632614754717556014244 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "imalloc.h" char *prog; static int show_line = 0; typedef unsigned MatchWord; #define WORD_BITS 32 typedef struct { int n; /* no of MatchWord needed */ int range; /* max no. of errors */ MatchWord *Sc; /* Mask Sc */ } MatchContext; #define INFBUF_SIZE 16384 #define INLINE static INLINE void set_bit (MatchContext *mc, MatchWord *m, int ch, int state) { int off = state & (WORD_BITS-1); int wno = state / WORD_BITS; m[mc->n * ch + wno] |= 1<n * ch + wno] &= ~(1<n * ch + wno] & (1<n = (dfa->no_states+WORD_BITS) / WORD_BITS; mc->range = range; mc->Sc = icalloc (sizeof(*mc->Sc) * 256 * mc->n); for (i=0; ino_states; i++) { int j; struct DFA_state *state = dfa->states[i]; for (j=0; jtran_no; j++) { int ch; int ch0 = state->trans[j].ch[0]; int ch1 = state->trans[j].ch[1]; assert (ch0 >= 0 && ch1 >= 0); for (ch = ch0; ch <= ch1; ch++) set_bit (mc, mc->Sc, ch, i); } } return mc; } static void mask_shift (MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc, struct DFA *dfa, int ch) { int j, s = 0; MatchWord *Rsrc_p = Rsrc, mask; Rdst[0] = 1; for (j = 1; jn; j++) Rdst[j] = 0; while (1) { mask = *Rsrc_p++; for (j = 0; jstates[s]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 2) { struct DFA_state *state = dfa->states[s+1]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 4) { struct DFA_state *state = dfa->states[s+2]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 8) { struct DFA_state *state = dfa->states[s+3]; int i = state->tran_no; while (--i >= 0) if (ch >= state->trans[i].ch[0] && ch <= state->trans[i].ch[1]) set_bit (mc, Rdst, 0, state->trans[i].to); } } s += 4; if (s >= dfa->no_states) return; mask >>= 4; } } } static void shift (MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc, struct DFA *dfa) { int j, s = 0; MatchWord *Rsrc_p = Rsrc, mask; for (j = 0; jn; j++) Rdst[j] = 0; while (1) { mask = *Rsrc_p++; for (j = 0; jstates[s]; int i = state->tran_no; while (--i >= 0) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 2) { struct DFA_state *state = dfa->states[s+1]; int i = state->tran_no; while (--i >= 0) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 4) { struct DFA_state *state = dfa->states[s+2]; int i = state->tran_no; while (--i >= 0) set_bit (mc, Rdst, 0, state->trans[i].to); } if (mask & 8) { struct DFA_state *state = dfa->states[s+3]; int i = state->tran_no; while (--i >= 0) set_bit (mc, Rdst, 0, state->trans[i].to); } } s += 4; if (s >= dfa->no_states) return; mask >>= 4; } } } static void or (MatchContext *mc, MatchWord *Rdst, MatchWord *Rsrc1, MatchWord *Rsrc2) { int i; for (i = 0; in; i++) Rdst[i] = Rsrc1[i] | Rsrc2[i]; } static int go (MatchContext *mc, struct DFA *dfa, FILE *inf) { MatchWord *Rj, *Rj1, *Rj_a, *Rj_b, *Rj_c; int s, d, ch; int lineno = 1; char *infbuf; int inf_ptr = 1; int no_match = 0; infbuf = imalloc (INFBUF_SIZE); infbuf[0] = '\n'; Rj = icalloc (mc->n * (mc->range+1) * sizeof(*Rj)); Rj1 = icalloc (mc->n * (mc->range+1) * sizeof(*Rj)); Rj_a = icalloc (mc->n * sizeof(*Rj)); Rj_b = icalloc (mc->n * sizeof(*Rj)); Rj_c = icalloc (mc->n * sizeof(*Rj)); set_bit (mc, Rj, 0, 0); for (d = 1; d<=mc->range; d++) { int s; memcpy (Rj + mc->n * d, Rj + mc->n * (d-1), mc->n * sizeof(*Rj)); for (s = 0; sno_states; s++) { if (get_bit (mc, Rj, d-1, s)) { struct DFA_state *state = dfa->states[s]; int i = state->tran_no; while (--i >= 0) set_bit (mc, Rj, d, state->trans[i].to); } } } while ((ch = getc (inf)) != EOF) { MatchWord *Rj_t; infbuf[inf_ptr] = ch; if (ch == '\n') { if (no_match) { int i = inf_ptr; if (show_line) printf ("%5d:", lineno); do { if (--i < 0) i = INFBUF_SIZE-1; } while (infbuf[i] != '\n'); do { if (++i == INFBUF_SIZE) i = 0; putchar (infbuf[i]); } while (infbuf[i] != '\n'); no_match = 0; } lineno++; } if (++inf_ptr == INFBUF_SIZE) inf_ptr = 0; mask_shift (mc, Rj1, Rj, dfa, ch); for (d = 1; d <= mc->range; d++) { mask_shift (mc, Rj_b, Rj+d*mc->n, dfa, ch); /* 1 */ or (mc, Rj_a, Rj+(d-1)*mc->n, Rj1+(d-1)*mc->n); /* 2,3 */ shift (mc, Rj_c, Rj_a, dfa); or (mc, Rj_a, Rj_b, Rj_c); /* 1,2,3*/ or (mc, Rj1+d*mc->n, Rj_a, Rj+(d-1)*mc->n); /* 1,2,3,4 */ } for (s = 0; sno_states; s++) { if (dfa->states[s]->rule_no) if (get_bit (mc, Rj1+mc->range*mc->n, 0, s)) no_match++; } for (d = 0; d <= mc->range; d++) reset_bit (mc, Rj1+d*mc->n, 0, dfa->no_states); Rj_t = Rj1; Rj1 = Rj; Rj = Rj_t; } ifree (Rj); ifree (Rj1); ifree (Rj_a); ifree (Rj_b); ifree (Rj_c); ifree (infbuf); return 0; } static int grep_file (struct DFA *dfa, const char *fname, int range) { FILE *inf; MatchContext *mc; if (fname) { inf = fopen (fname, "r"); if (!inf) { yaz_log (YLOG_FATAL|YLOG_ERRNO, "cannot open `%s'", fname); exit (1); } } else inf = stdin; mc = mk_MatchContext (dfa, range); go (mc, dfa, inf); if (fname) fclose (inf); return 0; } int main (int argc, char **argv) { int ret; int range = 0; char *arg; const char *pattern = NULL; int no_files = 0; struct DFA *dfa = dfa_init(); prog = argv[0]; while ((ret = options ("nr:dsv:", argv, argc, &arg)) != -2) { if (ret == 0) { if (!pattern) { int i; pattern = arg; i = dfa_parse (dfa, &pattern); if (i || *pattern) { fprintf (stderr, "%s: illegal pattern\n", prog); return 1; } dfa_mkstate (dfa); } else { no_files++; grep_file (dfa, arg, range); } } else if (ret == 'v') { yaz_log_init (yaz_log_mask_str(arg), prog, NULL); } else if (ret == 's') { dfa_verbose = 1; } else if (ret == 'd') { debug_dfa_tran = 1; debug_dfa_followpos = 1; debug_dfa_trav = 1; } else if (ret == 'r') { range = atoi (arg); } else if (ret == 'n') { show_line = 1; } else { yaz_log (YLOG_FATAL, "Unknown option '-%s'", arg); exit (1); } } if (!pattern) { fprintf (stderr, "usage:\n " " %s [-d] [-n] [-r n] [-s] [-v n] pattern file ..\n", prog); exit (1); } else if (no_files == 0) { grep_file (dfa, NULL, range); } dfa_delete (&dfa); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/imalloc.c0000664000175000017500000000731114754717556014211 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "imalloc.h" #if MEMDEBUG #define MAG1 0x8fe1 #define MAG2 0x91 #define MAG3 0xee long alloc = 0L; long max_alloc = 0L; int alloc_calls = 0; int free_calls = 0; #endif void *imalloc (size_t size) { #if MEMDEBUG size_t words = (4*sizeof(unsigned) -1 + size)/sizeof(unsigned); char *p = (char *)xmalloc( words*sizeof(unsigned) ); if( !p ) yaz_log (YLOG_FATAL, "No memory: imalloc(%u); c/f %d/%d; %ld/%ld", size, alloc_calls, free_calls, alloc, max_alloc ); *((unsigned *)p) = size; ((unsigned *)p)[1] = MAG1; p += sizeof(unsigned)*2; size[(unsigned char *) p] = MAG2; size[(unsigned char *) p+1] = MAG3; if( (alloc+=size) > max_alloc ) max_alloc = alloc; ++alloc_calls; return (void *) p; #else void *p = (void *)xmalloc( size ); if( !p ) yaz_log (YLOG_FATAL, "Out of memory (imalloc)" ); return p; #endif } void *icalloc (size_t size) { #if MEMDEBUG unsigned words = (4*sizeof(unsigned) -1 + size)/sizeof(unsigned); char *p = (char *) xcalloc( words*sizeof(unsigned), 1 ); if( !p ) yaz_log (YLOG_FATAL, "No memory: icalloc(%u); c/f %d/%d; %ld/%ld", size, alloc_calls, free_calls, alloc, max_alloc ); ((unsigned *)p)[0] = size; ((unsigned *)p)[1] = MAG1; p += sizeof(unsigned)*2; size[(unsigned char *) p] = MAG2; size[(unsigned char *) p+1] = MAG3; if( (alloc+=size) > max_alloc ) max_alloc = alloc; ++alloc_calls; return (void *)p; #else void *p = (void *) xcalloc( size, 1 ); if( !p ) yaz_log (YLOG_FATAL, "Out of memory (icalloc)" ); return p; #endif } void ifree (void *p) { #if MEMDEBUG size_t size; if( !p ) return; ++free_calls; size = (-2)[(unsigned *) p]; if( (-1)[(unsigned *) p] != MAG1 ) yaz_log (YLOG_FATAL,"Internal: ifree(%u) magic 1 corrupted", size ); if( size[(unsigned char *) p] != MAG2 ) yaz_log (YLOG_FATAL,"Internal: ifree(%u) magic 2 corrupted", size ); if( (size+1)[(unsigned char *) p] != MAG3 ) yaz_log (YLOG_FATAL,"Internal: ifree(%u) magic 3 corrupted", size ); alloc -= size; if( alloc < 0L ) yaz_log (YLOG_FATAL,"Internal: ifree(%u) negative alloc.", size ); xfree( (unsigned *) p-2 ); #else xfree (p); #endif } #if MEMDEBUG void imemstat (void) { fprintf( stdout, "imalloc: calls malloc/free %d/%d, ", alloc_calls, free_calls ); if( alloc ) fprintf( stdout, "memory cur/max %ld/%ld : unreleased", alloc, max_alloc ); else fprintf( stdout, "memory max %ld", max_alloc ); fputc( '\n', stdout ); } #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/agrep.c0000644000175000017500000001637515135645513013662 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #ifdef WIN32 #include #endif #if HAVE_UNISTD_H #include #endif #include #include #include #include "imalloc.h" #ifndef O_BINARY #define O_BINARY 0 #endif static char *prog; void error (const char *format, ...) { va_list argptr; va_start (argptr, format); fprintf (stderr, "%s error: ", prog); (void) vfprintf (stderr, format, argptr); putc ('\n', stderr); exit (1); } static int show_lines = 0; int agrep_options (int argc, char **argv) { char version_str[16]; zebra_get_version(version_str, NULL); while (--argc > 0) if (**++argv == '-') while (*++*argv) { switch (**argv) { case 'V': fprintf (stderr, "%s: %s\n", prog, version_str); continue; case 'v': dfa_verbose = 1; continue; case 'n': show_lines = 1; continue; case 'd': switch (*++*argv) { case 's': debug_dfa_tran = 1; break; case 't': debug_dfa_trav = 1; break; case 'f': debug_dfa_followpos = 1; break; default: --*argv; debug_dfa_tran = 1; debug_dfa_followpos = 1; debug_dfa_trav = 1; } continue; default: fprintf (stderr, "%s: unknown option `-%s'\n", prog, *argv); return 1; } break; } return 0; } #define INF_BUF_SIZE 32768U static char *inf_buf; static char *inf_ptr, *inf_flsh; static int inf_eof, line_no; static int inf_flush (int fd) { char *p; unsigned b, r; r = (unsigned) (inf_buf+INF_BUF_SIZE - inf_ptr); /* no of `wrap' bytes */ if (r) memcpy (inf_buf, inf_ptr, r); inf_ptr = p = inf_buf + r; b = INF_BUF_SIZE - r; do if ((r = read (fd, p, b)) == (unsigned) -1) return -1; else if (r) p += r; else { *p++ = '\n'; inf_eof = 1; break; } while ((b -= r) > 0); while (p != inf_buf && *--p != '\n') ; while (p != inf_buf && *--p != '\n') ; inf_flsh = p+1; return 0; } static char *prline (char *p) { char *p0; --p; while (p != inf_buf && p[-1] != '\n') --p; p0 = p; while (*p++ != '\n') ; p[-1] = '\0'; if (show_lines) printf ("%5d:\t%s\n", line_no, p0); else puts (p0); p[-1] = '\n'; return p; } static int go (int fd, struct DFA_state **dfaar) { struct DFA_state *s = dfaar[0]; struct DFA_tran *t; char *p; int i; unsigned char c; int start_line = 1; while (1) { for (c = *inf_ptr++, t=s->trans, i=s->tran_no; --i >= 0; t++) if (c >= t->ch[0] && c <= t->ch[1]) { p = inf_ptr; do { if ((s = dfaar[t->to])->rule_no && (start_line || s->rule_nno)) { inf_ptr = prline (inf_ptr); c = '\n'; break; } for (t=s->trans, i=s->tran_no; --i >= 0; t++) if ((unsigned) *p >= t->ch[0] && (unsigned) *p <= t->ch[1]) break; p++; } while (i >= 0); s = dfaar[0]; break; } if (c == '\n') { start_line = 1; ++line_no; if (inf_ptr == inf_flsh) { if (inf_eof) break; ++line_no; if (inf_flush (fd)) { fprintf (stderr, "%s: read error\n", prog); return -1; } } } else start_line = 0; } return 0; } int agrep (struct DFA_state **dfas, int fd) { inf_buf = imalloc (sizeof(char)*INF_BUF_SIZE); inf_eof = 0; inf_ptr = inf_buf+INF_BUF_SIZE; inf_flush (fd); line_no = 1; go (fd, dfas); ifree (inf_buf); return 0; } int main (int argc, char **argv) { const char *pattern = NULL; char outbuf[BUFSIZ]; int fd, i, no = 0; struct DFA *dfa = dfa_init(); prog = *argv; if (argc < 2) { fprintf (stderr, "usage: agrep [options] pattern file..\n"); fprintf (stderr, " -v dfa verbose\n"); fprintf (stderr, " -n show lines\n"); fprintf (stderr, " -d debug\n"); fprintf (stderr, " -V show version\n"); exit (1); } setbuf (stdout, outbuf); i = agrep_options (argc, argv); if (i) return i; while (--argc > 0) if (**++argv != '-' && **argv) { if (!pattern) { pattern = *argv; i = dfa_parse (dfa, &pattern); if (i || *pattern) { fprintf (stderr, "%s: illegal pattern\n", prog); return 1; } dfa_mkstate (dfa); } else { ++no; fd = open (*argv, O_RDONLY | O_BINARY); if (fd == -1) { fprintf (stderr, "%s: couldn't open `%s'\n", prog, *argv); return 1; } i = agrep (dfa->states, fd); close (fd); if (i) return i; } } if (!no) { fprintf (stderr, "usage:\n " " %s [-d] [-v] [-n] [-f] pattern file ..\n", prog); return 2; } fflush(stdout); dfa_delete (&dfa); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/set.c0000664000175000017500000001244214754717556013365 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "imalloc.h" static DFASet mk_DFASetElement (DFASetType st, int n); DFASetType mk_DFASetType (int chunk) { DFASetType st; assert (chunk > 8 && chunk < 8000); st = (DFASetType) imalloc (sizeof(*st)); assert (st); st->alloclist = st->freelist = NULL; st->used = 0; st->chunk = chunk; return st; } int inf_DFASetType (DFASetType st, long *used, long *allocated) { DFASet s; assert (st); *used = st->used; *allocated = 0; for (s = st->alloclist; s; s = s->next) *allocated += st->chunk; return sizeof (DFASetElement); } DFASetType rm_DFASetType (DFASetType st) { DFASet s, s1; for (s = st->alloclist; (s1 = s);) { s = s->next; ifree (s1); } ifree (st); return NULL; } DFASet mk_DFASet (DFASetType st) { assert (st); return NULL; } static DFASet mk_DFASetElement (DFASetType st, int n) { DFASet s; int i; assert (st); assert (st->chunk > 8); if (! st->freelist) { s = (DFASet) imalloc (sizeof(*s) * (1+st->chunk)); assert (s); s->next = st->alloclist; st->alloclist = s; st->freelist = ++s; for (i=st->chunk; --i > 0; s++) s->next = s+1; s->next = NULL; } st->used++; s = st->freelist; st->freelist = s->next; s->value = n; return s; } #if 0 static void rm_DFASetElement (DFASetType st, DFASetElement *p) { assert (st); assert (st->used > 0); p->next = st->freelist; st->freelist = p; st->used--; } #endif DFASet rm_DFASet (DFASetType st, DFASet s) { DFASet s1 = s; int i = 1; if (s) { while (s->next) { s = s->next; ++i; } s->next = st->freelist; st->freelist = s1; st->used -= i; assert (st->used >= 0); } return NULL; } DFASet add_DFASet (DFASetType st, DFASet s, int n) { DFASetElement dummy; DFASet p = &dummy, snew; p->next = s; while (p->next && p->next->value < n) p = p->next; assert (p); if (!(p->next && p->next->value == n)) { snew = mk_DFASetElement (st, n); snew->next = p->next; p->next = snew; } return dummy.next; } DFASet union_DFASet (DFASetType st, DFASet s1, DFASet s2) { DFASetElement dummy; DFASet p; assert (st); for (p = &dummy; s1 && s2;) if (s1->value < s2->value) { p = p->next = s1; s1 = s1->next; } else if (s1->value > s2->value) { p = p->next = mk_DFASetElement (st, s2->value); s2 = s2->next; } else { p = p->next = s1; s1 = s1->next; s2 = s2->next; } if (s1) p->next = s1; else { while (s2) { p = p->next = mk_DFASetElement (st, s2->value); s2 = s2->next; } p->next = NULL; } return dummy.next; } DFASet cp_DFASet (DFASetType st, DFASet s) { return merge_DFASet (st, s, NULL); } DFASet merge_DFASet (DFASetType st, DFASet s1, DFASet s2) { DFASetElement dummy; DFASet p; assert (st); for (p = &dummy; s1 && s2; p = p->next) if (s1->value < s2->value) { p->next = mk_DFASetElement (st, s1->value); s1 = s1->next; } else if (s1->value > s2->value) { p->next = mk_DFASetElement (st, s2->value); s2 = s2->next; } else { p->next = mk_DFASetElement (st, s1->value); s1 = s1->next; s2 = s2->next; } if (!s1) s1 = s2; while (s1) { p = p->next = mk_DFASetElement (st, s1->value); s1 = s1->next; } p->next = NULL; return dummy.next; } void pr_DFASet (DFASetType st, DFASet s) { assert (st); while (s) { printf (" %d", s->value); s = s->next; } putchar ('\n'); } unsigned hash_DFASet (DFASetType st, DFASet s) { unsigned n = 0; while (s) { n += 11*s->value; s = s->next; } return n; } int eq_DFASet (DFASetType st, DFASet s1, DFASet s2) { for (; s1 && s2; s1=s1->next, s2=s2->next) if (s1->value != s2->value) return 0; return s1 == s2; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/dfa.c0000664000175000017500000007777614754717556013351 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "dfap.h" #include "imalloc.h" #define CAT 16000 #define OR 16001 #define STAR 16002 #define PLUS 16003 #define EPSILON 16004 struct Tnode { union { struct Tnode *p[2]; /* CAT,OR,STAR,PLUS (left,right) */ short ch[2]; /* if ch[0] >= 0 then this Tnode represents */ /* a character in range [ch[0]..ch[1]] */ /* otherwise ch[0] represents */ /* accepting no (-acceptno) */ } u; unsigned pos : 15; /* CAT/OR/STAR/EPSILON or non-neg. position */ unsigned nullable : 1; DFASet firstpos; /* first positions */ DFASet lastpos; /* last positions */ }; struct Tblock { /* Tnode bucket (block) */ struct Tblock *next; /* pointer to next bucket */ struct Tnode *tarray; /* array of nodes in bucket */ }; #define TADD 64 #define STATE_HASH 199 #define POSET_CHUNK 100 int debug_dfa_trav = 0; int debug_dfa_tran = 0; int debug_dfa_followpos = 0; int dfa_verbose = 0; static struct Tnode *mk_Tnode (struct DFA_parse *parse_info); static struct Tnode *mk_Tnode_cset (struct DFA_parse *parse_info, BSet charset); static void term_Tnode (struct DFA_parse *parse_info); static void del_followpos (struct DFA_parse *parse_info), init_pos (struct DFA_parse *parse_info), del_pos (struct DFA_parse *parse_info), mk_dfa_tran (struct DFA_parse *parse_info, struct DFA_states *dfas), add_follow (struct DFA_parse *parse_info, DFASet lastpos, DFASet firstpos), dfa_trav (struct DFA_parse *parse_info, struct Tnode *n), init_followpos (struct DFA_parse *parse_info), pr_tran (struct DFA_parse *parse_info, struct DFA_states *dfas), pr_verbose (struct DFA_parse *parse_info, struct DFA_states *dfas), pr_followpos (struct DFA_parse *parse_info), out_char (int c), lex (struct DFA_parse *parse_info); static int nextchar (struct DFA_parse *parse_info, int *esc), read_charset (struct DFA_parse *parse_info); static const char *str_char (unsigned c); #define L_LP 1 #define L_RP 2 #define L_CHAR 3 #define L_CHARS 4 #define L_ANY 5 #define L_ALT 6 #define L_ANYZ 7 #define L_WILD 8 #define L_QUEST 9 #define L_CLOS1 10 #define L_CLOS0 11 #define L_END 12 #define L_START 13 static struct Tnode *expr_1 (struct DFA_parse *parse_info), *expr_2 (struct DFA_parse *parse_info), *expr_3 (struct DFA_parse *parse_info), *expr_4 (struct DFA_parse *parse_info); static struct Tnode *expr_1 (struct DFA_parse *parse_info) { struct Tnode *t1, *t2, *tn; if (!(t1 = expr_2 (parse_info))) return t1; while (parse_info->lookahead == L_ALT) { lex (parse_info); if (!(t2 = expr_2 (parse_info))) return t2; tn = mk_Tnode (parse_info); tn->pos = OR; tn->u.p[0] = t1; tn->u.p[1] = t2; t1 = tn; } return t1; } static struct Tnode *expr_2 (struct DFA_parse *parse_info) { struct Tnode *t1, *t2, *tn; if (!(t1 = expr_3 (parse_info))) return t1; while (parse_info->lookahead == L_WILD || parse_info->lookahead == L_ANYZ || parse_info->lookahead == L_ANY || parse_info->lookahead == L_LP || parse_info->lookahead == L_CHAR || parse_info->lookahead == L_CHARS) { if (!(t2 = expr_3 (parse_info))) return t2; tn = mk_Tnode (parse_info); tn->pos = CAT; tn->u.p[0] = t1; tn->u.p[1] = t2; t1 = tn; } return t1; } static struct Tnode *expr_3 (struct DFA_parse *parse_info) { struct Tnode *t1, *tn; if (!(t1 = expr_4 (parse_info))) return t1; if (parse_info->lookahead == L_CLOS0) { lex (parse_info); tn = mk_Tnode (parse_info); tn->pos = STAR; tn->u.p[0] = t1; t1 = tn; } else if (parse_info->lookahead == L_CLOS1) { lex (parse_info); tn = mk_Tnode (parse_info); tn->pos = PLUS; tn->u.p[0] = t1; t1 = tn; } else if (parse_info->lookahead == L_QUEST) { lex (parse_info); tn = mk_Tnode(parse_info); tn->pos = OR; tn->u.p[0] = t1; tn->u.p[1] = mk_Tnode(parse_info); tn->u.p[1]->pos = EPSILON; t1 = tn; } return t1; } static struct Tnode *expr_4 (struct DFA_parse *parse_info) { struct Tnode *t1; switch (parse_info->lookahead) { case L_LP: lex (parse_info); if (!(t1 = expr_1 (parse_info))) return t1; if (parse_info->lookahead == L_RP) lex (parse_info); else return NULL; break; case L_CHAR: t1 = mk_Tnode(parse_info); t1->pos = ++parse_info->position; t1->u.ch[1] = t1->u.ch[0] = parse_info->look_ch; lex (parse_info); break; case L_CHARS: t1 = mk_Tnode_cset (parse_info, parse_info->look_chars); lex (parse_info); break; case L_ANY: t1 = mk_Tnode_cset (parse_info, parse_info->anyset); lex (parse_info); break; case L_ANYZ: t1 = mk_Tnode(parse_info); t1->pos = OR; t1->u.p[0] = mk_Tnode_cset (parse_info, parse_info->anyset); t1->u.p[1] = mk_Tnode(parse_info); t1->u.p[1]->pos = EPSILON; lex (parse_info); break; case L_WILD: t1 = mk_Tnode(parse_info); t1->pos = STAR; t1->u.p[0] = mk_Tnode_cset (parse_info, parse_info->anyset); lex (parse_info); default: t1 = NULL; } return t1; } static void do_parse (struct DFA_parse *parse_info, const char **s, struct Tnode **tnp) { int start_anchor_flag = 0; struct Tnode *t1, *t2, *tn; parse_info->err_code = 0; parse_info->expr_ptr = * (const unsigned char **) s; parse_info->inside_string = 0; lex (parse_info); if (parse_info->lookahead == L_START) { start_anchor_flag = 1; lex (parse_info); } if (parse_info->lookahead == L_END) { t1 = mk_Tnode (parse_info); t1->pos = ++parse_info->position; t1->u.ch[1] = t1->u.ch[0] = '\n'; lex (parse_info); } else { t1 = expr_1 (parse_info); if (t1 && parse_info->lookahead == L_END) { t2 = mk_Tnode (parse_info); t2->pos = ++parse_info->position; t2->u.ch[1] = t2->u.ch[0] = '\n'; tn = mk_Tnode (parse_info); tn->pos = CAT; tn->u.p[0] = t1; tn->u.p[1] = t2; t1 = tn; lex (parse_info); } } if (t1 && parse_info->lookahead == 0) { t2 = mk_Tnode(parse_info); t2->pos = ++parse_info->position; t2->u.ch[0] = -(++parse_info->rule); t2->u.ch[1] = start_anchor_flag ? 0 : -(parse_info->rule); *tnp = mk_Tnode(parse_info); (*tnp)->pos = CAT; (*tnp)->u.p[0] = t1; (*tnp)->u.p[1] = t2; } else { if (!parse_info->err_code) { if (parse_info->lookahead == L_RP) parse_info->err_code = DFA_ERR_RP; else if (parse_info->lookahead == L_LP) parse_info->err_code = DFA_ERR_LP; else parse_info->err_code = DFA_ERR_SYNTAX; } } *s = (const char *) parse_info->expr_ptr; } static int nextchar (struct DFA_parse *parse_info, int *esc) { *esc = 0; if (*parse_info->expr_ptr == '\0') return 0; else if (*parse_info->expr_ptr != '\\') return *parse_info->expr_ptr++; *esc = 1; switch (*++parse_info->expr_ptr) { case '\r': case '\n': case '\0': return '\\'; case '\t': ++parse_info->expr_ptr; return ' '; case 'n': ++parse_info->expr_ptr; return '\n'; case 't': ++parse_info->expr_ptr; return '\t'; case 'r': ++parse_info->expr_ptr; return '\r'; case 'f': ++parse_info->expr_ptr; return '\f'; default: return *parse_info->expr_ptr++; } } static int nextchar_set (struct DFA_parse *parse_info, int *esc) { if (*parse_info->expr_ptr == ' ') { *esc = 0; return *parse_info->expr_ptr++; } return nextchar (parse_info, esc); } static int read_charset (struct DFA_parse *parse_info) { int i, ch0, esc0, cc = 0; parse_info->look_chars = mk_BSet (&parse_info->charset); res_BSet (parse_info->charset, parse_info->look_chars); ch0 = nextchar_set (parse_info, &esc0); if (!esc0 && ch0 == '^') { cc = 1; ch0 = nextchar_set (parse_info, &esc0); } /** ch0 is last met character ch1 is "next" char */ while (ch0 != 0) { int ch1, esc1; if (!esc0 && ch0 == ']') break; if (!esc0 && ch0 == '-') { ch1 = ch0; esc1 = esc0; ch0 = 1; add_BSet (parse_info->charset, parse_info->look_chars, ch0); } else { if (ch0 == 1) { ch0 = nextchar(parse_info, &esc0); } else { if (parse_info->cmap) { const char **mapto; char mapfrom[2]; const char *mcp = mapfrom; mapfrom[0] = ch0; mapto = parse_info->cmap(parse_info->cmap_data, &mcp, 1); assert (mapto); ch0 = mapto[0][0]; } } add_BSet (parse_info->charset, parse_info->look_chars, ch0); ch1 = nextchar_set (parse_info, &esc1); } if (!esc1 && ch1 == '-') { int open_range = 0; if ((ch1 = nextchar_set (parse_info, &esc1)) == 0) break; if (!esc1 && ch1 == ']') { ch1 = 255; open_range = 1; } else if (ch1 == 1) { ch1 = nextchar(parse_info, &esc1); } else if (parse_info->cmap) { const char **mapto; char mapfrom[2]; const char *mcp = mapfrom; mapfrom[0] = ch1; mapto = (*parse_info->cmap) (parse_info->cmap_data, &mcp, 1); assert (mapto); ch1 = mapto[0][0]; } for (i = ch0; ++i <= ch1;) add_BSet (parse_info->charset, parse_info->look_chars, i); if (open_range) break; ch0 = nextchar_set (parse_info, &esc0); } else { esc0 = esc1; ch0 = ch1; } } if (cc) com_BSet (parse_info->charset, parse_info->look_chars); return L_CHARS; } static int map_l_char (struct DFA_parse *parse_info) { const char **mapto; const char *cp0 = (const char *) (parse_info->expr_ptr-1); int i = 0, len = strlen(cp0); if (cp0[0] == 1 && cp0[1]) { parse_info->expr_ptr++; parse_info->look_ch = ((unsigned char *) cp0)[1]; return L_CHAR; } if (!parse_info->cmap) return L_CHAR; mapto = (*parse_info->cmap) (parse_info->cmap_data, &cp0, len); assert (mapto); parse_info->expr_ptr = (const unsigned char *) cp0; parse_info->look_ch = ((unsigned char **) mapto)[i][0]; yaz_log (YLOG_DEBUG, "map from %c to %d", parse_info->expr_ptr[-1], parse_info->look_ch); return L_CHAR; } static int lex_sub(struct DFA_parse *parse_info) { int esc; while ((parse_info->look_ch = nextchar (parse_info, &esc)) != 0) if (parse_info->look_ch == '\"') { if (esc) return map_l_char (parse_info); parse_info->inside_string = !parse_info->inside_string; } else if (esc || parse_info->inside_string) return map_l_char (parse_info); else if (parse_info->look_ch == '[') return read_charset(parse_info); else { const int *cc; for (cc = parse_info->charMap; *cc; cc += 2) if (*cc == (int) (parse_info->look_ch)) { if (!cc[1]) --parse_info->expr_ptr; return cc[1]; } return map_l_char (parse_info); } return 0; } static void lex (struct DFA_parse *parse_info) { parse_info->lookahead = lex_sub (parse_info); } static const char *str_char (unsigned c) { static char s[6]; s[0] = '\\'; if (c < 32 || c >= 127) switch (c) { case '\r': strcpy (s+1, "r"); break; case '\n': strcpy (s+1, "n"); break; case '\t': strcpy (s+1, "t"); break; default: yaz_snprintf(s + 1, sizeof(s) - 1, "x%02x", c); break; } else switch (c) { case '\"': strcpy (s+1, "\""); break; case '\'': strcpy (s+1, "\'"); break; case '\\': strcpy (s+1, "\\"); break; default: s[0] = c; s[1] = '\0'; } return s; } static void out_char (int c) { printf ("%s", str_char (c)); } static void term_Tnode (struct DFA_parse *parse_info) { struct Tblock *t, *t1; for (t = parse_info->start; (t1 = t);) { t=t->next; ifree (t1->tarray); ifree (t1); } } static struct Tnode *mk_Tnode (struct DFA_parse *parse_info) { struct Tblock *tnew; if (parse_info->use_Tnode == parse_info->max_Tnode) { tnew = (struct Tblock *) imalloc (sizeof(struct Tblock)); tnew->tarray = (struct Tnode *) imalloc (TADD*sizeof(struct Tnode)); if (!tnew->tarray) return NULL; if (parse_info->use_Tnode == 0) parse_info->start = tnew; else parse_info->end->next = tnew; parse_info->end = tnew; tnew->next = NULL; parse_info->max_Tnode += TADD; } return parse_info->end->tarray+(parse_info->use_Tnode++ % TADD); } struct Tnode *mk_Tnode_cset (struct DFA_parse *parse_info, BSet charset) { struct Tnode *tn1, *tn0 = mk_Tnode(parse_info); int ch1, ch0 = trav_BSet (parse_info->charset, charset, 0); if (ch0 == -1) tn0->pos = EPSILON; else { tn0->u.ch[0] = ch0; tn0->pos = ++parse_info->position; ch1 = travi_BSet (parse_info->charset, charset, ch0+1) ; if (ch1 == -1) tn0->u.ch[1] = parse_info->charset->size; else { tn0->u.ch[1] = ch1-1; while ((ch0=trav_BSet (parse_info->charset, charset, ch1)) != -1) { tn1 = mk_Tnode(parse_info); tn1->pos = OR; tn1->u.p[0] = tn0; tn0 = tn1; tn1 = tn0->u.p[1] = mk_Tnode(parse_info); tn1->u.ch[0] = ch0; tn1->pos = ++(parse_info->position); if ((ch1 = travi_BSet (parse_info->charset, charset, ch0+1)) == -1) { tn1->u.ch[1] = parse_info->charset->size; break; } tn1->u.ch[1] = ch1-1; } } } return tn0; } static void del_followpos (struct DFA_parse *parse_info) { ifree (parse_info->followpos); } static void init_pos (struct DFA_parse *parse_info) { parse_info->posar = (struct Tnode **) imalloc (sizeof(struct Tnode*) * (1+parse_info->position)); } static void del_pos (struct DFA_parse *parse_info) { ifree (parse_info->posar); } static void add_follow (struct DFA_parse *parse_info, DFASet lastpos, DFASet firstpos) { while (lastpos) { parse_info->followpos[lastpos->value] = union_DFASet (parse_info->poset, parse_info->followpos[lastpos->value], firstpos); lastpos = lastpos->next; } } static void dfa_trav (struct DFA_parse *parse_info, struct Tnode *n) { struct Tnode **posar = parse_info->posar; DFASetType poset = parse_info->poset; switch (n->pos) { case CAT: dfa_trav (parse_info, n->u.p[0]); dfa_trav (parse_info, n->u.p[1]); n->nullable = n->u.p[0]->nullable & n->u.p[1]->nullable; n->firstpos = mk_DFASet (poset); n->firstpos = union_DFASet (poset, n->firstpos, n->u.p[0]->firstpos); if (n->u.p[0]->nullable) n->firstpos = union_DFASet (poset, n->firstpos, n->u.p[1]->firstpos); n->lastpos = mk_DFASet (poset); n->lastpos = union_DFASet (poset, n->lastpos, n->u.p[1]->lastpos); if (n->u.p[1]->nullable) n->lastpos = union_DFASet (poset, n->lastpos, n->u.p[0]->lastpos); add_follow (parse_info, n->u.p[0]->lastpos, n->u.p[1]->firstpos); n->u.p[0]->firstpos = rm_DFASet (poset, n->u.p[0]->firstpos); n->u.p[0]->lastpos = rm_DFASet (poset, n->u.p[0]->lastpos); n->u.p[1]->firstpos = rm_DFASet (poset, n->u.p[1]->firstpos); n->u.p[1]->lastpos = rm_DFASet (poset, n->u.p[1]->lastpos); if (debug_dfa_trav) printf ("CAT"); break; case OR: dfa_trav (parse_info, n->u.p[0]); dfa_trav (parse_info, n->u.p[1]); n->nullable = n->u.p[0]->nullable | n->u.p[1]->nullable; n->firstpos = merge_DFASet (poset, n->u.p[0]->firstpos, n->u.p[1]->firstpos); n->lastpos = merge_DFASet (poset, n->u.p[0]->lastpos, n->u.p[1]->lastpos); n->u.p[0]->firstpos = rm_DFASet (poset, n->u.p[0]->firstpos); n->u.p[0]->lastpos = rm_DFASet (poset, n->u.p[0]->lastpos); n->u.p[1]->firstpos = rm_DFASet (poset, n->u.p[1]->firstpos); n->u.p[1]->lastpos = rm_DFASet (poset, n->u.p[1]->lastpos); if (debug_dfa_trav) printf ("OR"); break; case PLUS: dfa_trav (parse_info, n->u.p[0]); n->nullable = n->u.p[0]->nullable; n->firstpos = n->u.p[0]->firstpos; n->lastpos = n->u.p[0]->lastpos; add_follow (parse_info, n->lastpos, n->firstpos); if (debug_dfa_trav) printf ("PLUS"); break; case STAR: dfa_trav (parse_info, n->u.p[0]); n->nullable = 1; n->firstpos = n->u.p[0]->firstpos; n->lastpos = n->u.p[0]->lastpos; add_follow (parse_info, n->lastpos, n->firstpos); if (debug_dfa_trav) printf ("STAR"); break; case EPSILON: n->nullable = 1; n->lastpos = mk_DFASet (poset); n->firstpos = mk_DFASet (poset); if (debug_dfa_trav) printf ("EPSILON"); break; default: posar[n->pos] = n; n->nullable = 0; n->firstpos = mk_DFASet (poset); n->firstpos = add_DFASet (poset, n->firstpos, n->pos); n->lastpos = mk_DFASet (poset); n->lastpos = add_DFASet (poset, n->lastpos, n->pos); if (debug_dfa_trav) { if (n->u.ch[0] < 0) printf ("#%d (n#%d)", -n->u.ch[0], -n->u.ch[1]); else if (n->u.ch[1] > n->u.ch[0]) { putchar ('['); out_char (n->u.ch[0]); if (n->u.ch[1] > n->u.ch[0]+1) putchar ('-'); out_char (n->u.ch[1]); putchar (']'); } else out_char (n->u.ch[0]); } } if (debug_dfa_trav) { printf ("\n nullable : %c\n", n->nullable ? '1' : '0'); printf (" firstpos :"); pr_DFASet (poset, n->firstpos); printf (" lastpos :"); pr_DFASet (poset, n->lastpos); } } static void init_followpos (struct DFA_parse *parse_info) { DFASet *fa; int i; parse_info->followpos = fa = (DFASet *) imalloc (sizeof(DFASet) * (1+parse_info->position)); for (i = parse_info->position+1; --i >= 0; fa++) *fa = mk_DFASet (parse_info->poset); } static void mk_dfa_tran (struct DFA_parse *parse_info, struct DFA_states *dfas) { int i, j, c; int max_char; short *pos, *pos_i; DFASet tran_set; int char_0, char_1; struct DFA_state *dfa_from, *dfa_to; struct Tnode **posar; DFASetType poset; DFASet *followpos; assert (parse_info); posar = parse_info->posar; max_char = parse_info->charset->size; pos = (short *) imalloc (sizeof(*pos) * (parse_info->position+1)); tran_set = cp_DFASet (parse_info->poset, parse_info->root->firstpos); i = add_DFA_state (dfas, &tran_set, &dfa_from); assert (i); dfa_from->rule_no = 0; poset = parse_info->poset; followpos = parse_info->followpos; while ((dfa_from = get_DFA_state (dfas))) { pos_i = pos; j = i = 0; for (tran_set = dfa_from->set; tran_set; tran_set = tran_set->next) if ((c = posar[tran_set->value]->u.ch[0]) >= 0 && c <= max_char) *pos_i++ = tran_set->value; else if (c < 0) { if (i == 0 || c > i) i = c; c = posar[tran_set->value]->u.ch[1]; if (j == 0 || c > j) j = c; } *pos_i = -1; dfa_from->rule_no = -i; dfa_from->rule_nno = -j; for (char_1 = 0; char_1 <= max_char; char_1++) { char_0 = max_char+1; for (pos_i = pos; (i = *pos_i) != -1; ++pos_i) if (posar[i]->u.ch[1] >= char_1 && (c=posar[i]->u.ch[0]) < char_0) { if (c < char_1) char_0 = char_1; else char_0 = c; } if (char_0 > max_char) break; char_1 = max_char; tran_set = mk_DFASet (poset); for (pos_i = pos; (i = *pos_i) != -1; ++pos_i) { if ((c=posar[i]->u.ch[0]) > char_0 && c <= char_1) char_1 = c - 1; /* forward chunk */ else if ((c=posar[i]->u.ch[1]) >= char_0 && c < char_1) char_1 = c; /* backward chunk */ if (posar[i]->u.ch[1] >= char_0 && posar[i]->u.ch[0] <= char_0) tran_set = union_DFASet (poset, tran_set, followpos[i]); } if (tran_set) { add_DFA_state (dfas, &tran_set, &dfa_to); add_DFA_tran (dfas, dfa_from, char_0, char_1, dfa_to->no); } } } ifree (pos); sort_DFA_states (dfas); } static void pr_tran (struct DFA_parse *parse_info, struct DFA_states *dfas) { struct DFA_state *s; struct DFA_tran *tran; int prev_no, i, c, no; for (no=0; no < dfas->no; ++no) { s = dfas->sortarray[no]; assert (s->no == no); printf ("DFA state %d", no); if (s->rule_no) printf ("#%d", s->rule_no); if (s->rule_nno) printf (" #%d", s->rule_nno); putchar (':'); pr_DFASet (parse_info->poset, s->set); prev_no = -1; for (i=s->tran_no, tran=s->trans; --i >= 0; tran++) { if (prev_no != tran->to) { if (prev_no != -1) printf ("]\n"); printf (" goto %d on [", tran->to); prev_no = tran->to; } for (c = tran->ch[0]; c <= tran->ch[1]; c++) printf ("%s", str_char(c)); } if (prev_no != -1) printf ("]\n"); putchar ('\n'); } } static void pr_verbose (struct DFA_parse *parse_info, struct DFA_states *dfas) { long i, j; int k; printf ("%d/%d tree nodes used, %ld bytes each\n", parse_info->use_Tnode, parse_info->max_Tnode, (long) sizeof (struct Tnode)); k = inf_BSetHandle (parse_info->charset, &i, &j); printf ("%ld/%ld character sets, %ld bytes each\n", i/k, j/k, (long) k*sizeof(BSetWord)); k = inf_DFASetType (parse_info->poset, &i, &j); printf ("%ld/%ld poset items, %d bytes each\n", i, j, k); printf ("%d DFA states\n", dfas->no); } static void pr_followpos (struct DFA_parse *parse_info) { struct Tnode **posar = parse_info->posar; int i; printf ("\nfollowsets:\n"); for (i=1; i <= parse_info->position; i++) { printf ("%3d:", i); pr_DFASet (parse_info->poset, parse_info->followpos[i]); putchar ('\t'); if (posar[i]->u.ch[0] < 0) printf ("#%d", -posar[i]->u.ch[0]); else if (posar[i]->u.ch[1] > posar[i]->u.ch[0]) { putchar ('['); out_char (posar[i]->u.ch[0]); if (posar[i]->u.ch[1] > posar[i]->u.ch[0]+1) putchar ('-'); out_char (posar[i]->u.ch[1]); putchar (']'); } else out_char (posar[i]->u.ch[0]); putchar ('\n'); } putchar ('\n'); } void dfa_parse_cmap_clean (struct DFA *d) { struct DFA_parse *dfa = d->parse_info; assert (dfa); if (!dfa->charMap) { dfa->charMapSize = 7; dfa->charMap = (int *) imalloc (dfa->charMapSize * sizeof(*dfa->charMap)); } dfa->charMap[0] = 0; } void dfa_parse_cmap_new (struct DFA *d, const int *cmap) { struct DFA_parse *dfa = d->parse_info; const int *cp; int size; assert (dfa); for (cp = cmap; *cp; cp += 2) ; size = cp - cmap + 1; if (size > dfa->charMapSize) { if (dfa->charMap) ifree (dfa->charMap); dfa->charMapSize = size; dfa->charMap = (int *) imalloc (size * sizeof(*dfa->charMap)); } memcpy (dfa->charMap, cmap, size * sizeof(*dfa->charMap)); } void dfa_parse_cmap_del (struct DFA *d, int from) { struct DFA_parse *dfa = d->parse_info; int *cc; assert (dfa); for (cc = dfa->charMap; *cc; cc += 2) if (*cc == from) { while ((cc[0] = cc[2])) { cc[1] = cc[3]; cc += 2; } break; } } void dfa_parse_cmap_add (struct DFA *d, int from, int to) { struct DFA_parse *dfa = d->parse_info; int *cc; int indx, size; assert (dfa); for (cc = dfa->charMap; *cc; cc += 2) if (*cc == from) { cc[1] = to; return ; } indx = cc - dfa->charMap; size = dfa->charMapSize; if (indx >= size) { int *cn = (int *) imalloc ((size+16) * sizeof(*dfa->charMap)); memcpy (cn, dfa->charMap, indx*sizeof(*dfa->charMap)); ifree (dfa->charMap); dfa->charMap = cn; dfa->charMapSize = size+16; } dfa->charMap[indx] = from; dfa->charMap[indx+1] = to; dfa->charMap[indx+2] = 0; } void dfa_parse_cmap_thompson (struct DFA *d) { static int thompson_chars[] = { '*', L_CLOS0, '+', L_CLOS1, '|', L_ALT, '^', L_START, '$', L_END, '?', L_QUEST, '.', L_ANY, '(', L_LP, ')', L_RP, ' ', 0, '\t', 0, '\n', 0, 0 }; dfa_parse_cmap_new (d, thompson_chars); } static struct DFA_parse *dfa_parse_init (void) { struct DFA_parse *parse_info = (struct DFA_parse *) imalloc (sizeof (struct DFA_parse)); parse_info->charset = mk_BSetHandle (255, 20); parse_info->position = 0; parse_info->rule = 0; parse_info->root = NULL; /* initialize the anyset which by default does not include \n */ parse_info->anyset = mk_BSet (&parse_info->charset); res_BSet (parse_info->charset, parse_info->anyset); add_BSet (parse_info->charset, parse_info->anyset, '\n'); com_BSet (parse_info->charset, parse_info->anyset); parse_info->use_Tnode = parse_info->max_Tnode = 0; parse_info->start = parse_info->end = NULL; parse_info->charMap = NULL; parse_info->charMapSize = 0; parse_info->cmap = NULL; return parse_info; } static void rm_dfa_parse (struct DFA_parse **dfap) { struct DFA_parse *parse_info = *dfap; assert (parse_info); term_Tnode(parse_info); rm_BSetHandle (&parse_info->charset); ifree (parse_info->charMap); ifree (parse_info); *dfap = NULL; } static struct DFA_states *mk_dfas (struct DFA_parse *dfap, int poset_chunk) { struct DFA_states *dfas; struct DFA_parse *parse_info = dfap; assert (poset_chunk > 10); assert (dfap); parse_info->poset = mk_DFASetType (poset_chunk); init_pos(parse_info); init_followpos(parse_info); assert (parse_info->root); dfa_trav (parse_info, parse_info->root); if (debug_dfa_followpos) pr_followpos(parse_info); init_DFA_states (&dfas, parse_info->poset, (int) (STATE_HASH)); mk_dfa_tran (parse_info, dfas); if (debug_dfa_tran) { pr_tran (parse_info, dfas); } if (dfa_verbose) pr_verbose (parse_info, dfas); del_pos(parse_info); del_followpos(parse_info); rm_DFASetType (parse_info->poset); return dfas; } struct DFA *dfa_init (void) { struct DFA *dfa; dfa = (struct DFA *) imalloc (sizeof(*dfa)); dfa->parse_info = dfa_parse_init (); dfa->state_info = NULL; dfa->states = NULL; dfa_parse_cmap_thompson (dfa); return dfa; } void dfa_anyset_includes_nl(struct DFA *dfa) { add_BSet (dfa->parse_info->charset, dfa->parse_info->anyset, '\n'); } void dfa_set_cmap (struct DFA *dfa, void *vp, const char **(*cmap)(void *vp, const char **from, int len)) { dfa->parse_info->cmap = cmap; dfa->parse_info->cmap_data = vp; } int dfa_get_last_rule (struct DFA *dfa) { return dfa->parse_info->rule; } int dfa_parse (struct DFA *dfa, const char **pattern) { struct Tnode *top; struct DFA_parse *parse_info; assert (dfa); assert (dfa->parse_info); parse_info = dfa->parse_info; do_parse (parse_info, pattern, &top); if (parse_info->err_code) return parse_info->err_code; if ( !dfa->parse_info->root ) dfa->parse_info->root = top; else { struct Tnode *n; n = mk_Tnode (parse_info); n->pos = OR; n->u.p[0] = dfa->parse_info->root; n->u.p[1] = top; dfa->parse_info->root = n; } return 0; } void dfa_mkstate (struct DFA *dfa) { assert (dfa); dfa->state_info = mk_dfas (dfa->parse_info, POSET_CHUNK); dfa->no_states = dfa->state_info->no; dfa->states = dfa->state_info->sortarray; rm_dfa_parse (&dfa->parse_info); } void dfa_delete (struct DFA **dfap) { assert (dfap); assert (*dfap); if ((*dfap)->parse_info) rm_dfa_parse (&(*dfap)->parse_info); if ((*dfap)->state_info) rm_DFA_states (&(*dfap)->state_info); ifree (*dfap); *dfap = NULL; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/imalloc.h0000664000175000017500000000224014754717556014212 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef __cplusplus extern "C" { #endif void *imalloc (size_t); void *icalloc (size_t); void ifree (void *); #if MEMDEBUG void imemstat (void); extern long alloc; extern long max_alloc; extern int alloc_calls; extern int free_calls; #endif #ifdef __cplusplus } #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/lexer.c0000644000175000017500000000705515135645513013676 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "imalloc.h" #include "lexer.h" static char *prog; void error (const char *format, ...) { va_list argptr; va_start (argptr, format); fprintf (stderr, "%s error: ", prog); (void) vfprintf (stderr, format, argptr); putc ('\n', stderr); exit (1); } int ccluse = 0; static int lexer_options (int argc, char **argv) { char version_str[16]; zebra_get_version(version_str, NULL); while (--argc > 0) if (**++argv == '-') while (*++*argv) { switch (**argv) { case 'V': fprintf (stderr, "%s: %s\n", prog, version_str); continue; case 's': dfa_verbose = 1; continue; case 'c': ccluse = 1; continue; case 'd': switch (*++*argv) { case 's': debug_dfa_tran = 1; break; case 't': debug_dfa_trav = 1; break; case 'f': debug_dfa_followpos = 1; break; default: --*argv; debug_dfa_tran = 1; debug_dfa_followpos = 1; debug_dfa_trav = 1; } continue; default: fprintf (stderr, "%s: unknown option `-%s'\n", prog, *argv); return 1; } break; } return 0; } int main (int argc, char **argv) { int i, no = 0; struct DFA *dfa; prog = *argv; dfa = dfa_init (); i = lexer_options (argc, argv); if (i) return i; if (argc < 2) { fprintf (stderr, "usage\n %s [-c] [-V] [-s] [-t] [-d[stf]] file\n", prog); return 1; } else while (--argc > 0) if (**++argv != '-' && **argv) { ++no; i = read_file (*argv, dfa); if (i) return i; dfa_mkstate (dfa); #if MEMDEBUG imemstat(); #endif } dfa_delete (&dfa); #if MEMDEBUG imemstat(); #endif if (!no) { fprintf (stderr, "%s: no files specified\n", prog); return 2; } return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/test_dfa.c0000664000175000017500000000343314754717556014363 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include int test_parse(struct DFA *dfa, const char *pattern) { int i; const char *cp = pattern; i = dfa_parse(dfa, &cp); return i; } static void tst(int argc, char **argv) { struct DFA *dfa = dfa_init(); YAZ_CHECK(dfa); YAZ_CHECK_EQ(test_parse(dfa, ""), 1); YAZ_CHECK_EQ(test_parse(dfa, "a"), 0); YAZ_CHECK_EQ(test_parse(dfa, "ab"), 0); YAZ_CHECK_EQ(test_parse(dfa, "(a)"), 0); YAZ_CHECK_EQ(test_parse(dfa, "(a"), 1); YAZ_CHECK_EQ(test_parse(dfa, "a)"), 3); YAZ_CHECK_EQ(test_parse(dfa, "a\001)"), 0); YAZ_CHECK_EQ(test_parse(dfa, "a\\x01"), 0); YAZ_CHECK_EQ(test_parse(dfa, "(\x01\x02)(CEO3EQC/\\x01\\x0C\\x01\\x0C)"), 0); dfa_delete(&dfa); YAZ_CHECK(!dfa); } int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); YAZ_CHECK_LOG(); tst(argc, argv); YAZ_CHECK_TERM; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/lexer.h0000664000175000017500000000206414754717556013715 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef __cplusplus extern "C" { #endif int read_file ( const char *, struct DFA * ); void error ( const char *, ... ); extern int ccluse; #ifdef __cplusplus } #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/dfap.h0000664000175000017500000000607714754717556013520 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DFAP_H #define DFAP_H #include #ifdef __cplusplus extern "C" { #endif struct DFA_parse { struct Tnode *root; /* root of regular syntax tree */ int position; /* no of positions so far */ int rule; /* no of rules so far */ BSetHandle *charset; /* character set type */ BSet anyset; /* character recognized by `.' */ int use_Tnode; /* used Tnodes */ int max_Tnode; /* allocated Tnodes */ struct Tblock *start; /* start block of Tnodes */ struct Tblock *end; /* end block of Tnodes */ int *charMap; int charMapSize; void *cmap_data; unsigned look_ch; int lookahead; BSet look_chars; int err_code; int inside_string; const unsigned char *expr_ptr; struct Tnode **posar; DFASetType poset; DFASet *followpos; const char **(*cmap)(void *vp, const char **from, int len); }; typedef struct DFA_stateb_ { struct DFA_stateb_ *next; struct DFA_state *state_block; } DFA_stateb; struct DFA_states { struct DFA_state *freelist; /* chain of unused (but allocated) states */ struct DFA_state *unmarked; /* chain of unmarked DFA states */ struct DFA_state *marked; /* chain of marked DFA states */ DFA_stateb *statemem; /* state memory */ int no; /* no of states (unmarked+marked) */ DFASetType st; /* Position set type */ int hash; /* no hash entries in hasharray */ struct DFA_state **hasharray; /* hash pointers */ struct DFA_state **sortarray; /* sorted DFA states */ struct DFA_trans *transmem; /* transition memory */ }; int init_DFA_states (struct DFA_states **dfasp, DFASetType st, int hash); int rm_DFA_states (struct DFA_states **dfasp); int add_DFA_state (struct DFA_states *dfas, DFASet *s, struct DFA_state **sp); struct DFA_state *get_DFA_state (struct DFA_states *dfas); void sort_DFA_states (struct DFA_states *dfas); void add_DFA_tran (struct DFA_states *, struct DFA_state *, int, int, int); #ifdef __cplusplus } #endif #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ idzebra-2.2.10/dfa/bset.c0000664000175000017500000001374414754717556013535 0ustar00adamadam/* This file is part of the Zebra server. Copyright (C) Index Data Zebra 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. Zebra 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "imalloc.h" #define GET_BIT(s,m) (s[(m)/(sizeof(BSetWord)*8)]&(1<<(m&(sizeof(BSetWord)*8-1)))) #define SET_BIT(s,m) (s[(m)/(sizeof(BSetWord)*8)]|=(1<<(m&(sizeof(BSetWord)*8-1)))) BSetHandle *mk_BSetHandle (int size, int chunk) { int wsize = 1+size/(sizeof(BSetWord)*8); BSetHandle *sh; if (chunk <= 1) chunk = 32; sh = (BSetHandle *) imalloc (sizeof(BSetHandle) + chunk*sizeof(BSetWord)*wsize); sh->size = size; sh->wsize = wsize; sh->chunk = chunk * wsize; sh->offset = 0; sh->setchain = NULL; return sh; } void rm_BSetHandle (BSetHandle **shp) { BSetHandle *sh, *sh1; assert (shp); sh = *shp; assert (sh); while (sh) { sh1 = sh->setchain; ifree (sh); sh = sh1; } } int inf_BSetHandle (BSetHandle *sh, long *used, long *allocated) { int wsize; assert (sh); *used = 0; *allocated = 0; wsize = sh->wsize; do { *used += sh->offset; *allocated += sh->chunk; } while ((sh = sh->setchain)); return wsize; } BSet mk_BSet (BSetHandle **shp) { BSetHandle *sh, *sh1; unsigned off; assert (shp); sh = *shp; assert (sh); off = sh->offset; if ((off + sh->wsize) > sh->chunk) { sh1 = (BSetHandle *) imalloc (sizeof(BSetHandle) + sh->chunk*sizeof(BSetWord)); sh1->size = sh->size; sh1->wsize = sh->wsize; sh1->chunk = sh->chunk; off = sh1->offset = 0; sh1->setchain = sh; sh = *shp = sh1; } sh->offset = off + sh->wsize; return sh->setarray + off; } void add_BSet (BSetHandle *sh, BSet dst, unsigned member) { assert (dst); assert (sh); assert (member <= sh->size); SET_BIT(dst, member); } unsigned test_BSet (BSetHandle *sh, BSet src, unsigned member) { assert (src); assert (sh); assert (member <= sh->size); return GET_BIT (src , member) != 0; } BSet cp_BSet (BSetHandle *sh, BSet dst, BSet src) { assert (sh); assert (dst); assert (src); memcpy (dst, src, sh->wsize * sizeof(BSetWord)); return dst; } void res_BSet (BSetHandle *sh, BSet dst) { assert (dst); memset (dst, 0, sh->wsize * sizeof(BSetWord)); } void union_BSet (BSetHandle *sh, BSet dst, BSet src) { int i; assert (sh); assert (dst); assert (src); for (i=sh->wsize; --i >= 0;) *dst++ |= *src++; } unsigned hash_BSet (BSetHandle *sh, BSet src) { int i; unsigned s = 0; assert (sh); assert (src); for (i=sh->wsize; --i >= 0;) s += *src++; return s; } void com_BSet (BSetHandle *sh, BSet dst) { int i; assert (sh); assert (dst); for (i=sh->wsize; --i >= 0; dst++) *dst = ~*dst; } int eq_BSet (BSetHandle *sh, BSet dst, BSet src) { int i; assert (sh); assert (dst); assert (src); for (i=sh->wsize; --i >= 0;) if (*dst++ != *src++) return 0; return 1; } int trav_BSet (BSetHandle *sh, BSet src, unsigned member) { int i = sh->size - member; BSetWord *sw = src+member/(sizeof(BSetWord)*8); unsigned b = member & (sizeof(BSetWord)*8-1); while(i >= 0) if (b == 0 && *sw == 0) { member += sizeof(BSetWord)*8; ++sw; i -= sizeof(BSetWord)*8; } else if (*sw & (1<size - member; BSetWord *sw = src+member/(sizeof(BSetWord)*8); unsigned b = member & (sizeof(BSetWord)*8-1); while(i >= 0) if (b == 0 && *sw == (BSetWord) ~ 0) { member += sizeof(BSetWord)*8; ++sw; i -= sizeof(BSetWord)*8; } else if ((*sw & (1<. # # 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"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # 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] Output the configuration name of the system '$me' is run on. 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.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-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." 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 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still # use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif int main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: idzebra-2.2.10/config/missing0000755000175000017500000001706515034450431014516 0ustar00adamadam#! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2025-06-18.21; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2025 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake|autoreconf) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; *) : ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac program_details "$normalized_program" } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: idzebra-2.2.10/config/ltmain.sh0000644000175000017500000123312515133720177014744 0ustar00adamadam#! /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.6.0 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2025 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.6.0 package_revision=2.6.0 ## ------ ## ## 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=2019-02-19.15; # 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='eval 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. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _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. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes 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 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.6.0' # 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 If a TAG is supplied, it must use one of the tag names below: Tag Name Language Name CC C CXX C++ OBJC Objective-C OBJCXX Objective-C++ GCJ Java F77 Fortran 77 FC Fortran GO Go RC Windows Resource If you do not see a tag name associated with your programming language, then you are using a compiler that $progname does not support. 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 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=: # 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* | *linux*) # 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 with compiler." func_echo "Possible use of unsupported compiler." func_fatal_error "specify a tag with '--tag'. For more information, try '$progname --help'." # 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 # Compatibility for original MSYS if test "Xone" = "X$lt_cv_cmd_slashes"; then func_convert_core_msys_to_w32_result=`( cmd /c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` else # Assume 'lt_cv_cmd_slashes = "two"' func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` fi if test "$?" -ne 0; then # on failure, ensure result is empty func_convert_core_msys_to_w32_result= fi } #end: func_convert_core_msys_to_w32 # func_convert_core_msys_to_w32_with_cygpath ARG # Convert file name or path ARG with cygpath from MSYS format to w32 # format. Return result in func_convert_core_msys_to_w32_with_cygpath_result. func_convert_core_msys_to_w32_with_cygpath () { $debug_cmd # Since MSYS2 is packaged with cygpath, call cygpath in $PATH; no need # to use LT_CYGPATH in this case. func_convert_core_msys_to_w32_result=`cygpath "$@" 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` if test "$?" -ne 0; then # on failure, ensure result is empty func_convert_core_msys_to_w32_result= fi } #end: func_convert_core_msys_to_w32_with_cygpath # 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 if test "Xyes" = "X$cygpath_installed"; then func_convert_core_msys_to_w32_with_cygpath -w "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_with_cygpath_result else func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi 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 if test "Xyes" = "X$cygpath_installed"; then func_convert_core_msys_to_w32_with_cygpath -w "$1" func_cygpath -u "$func_convert_core_msys_to_w32_with_cygpath_result" else func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" fi 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 if test "Xyes" = "X$cygpath_installed"; then func_convert_core_msys_to_w32_with_cygpath -w -p "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_with_cygpath_result else func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result fi 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 if test "Xyes" = "X$cygpath_installed"; then func_convert_core_msys_to_w32_with_cygpath -w -p "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_with_cygpath_result" else func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" fi 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 "After a 'make install' for many GNU/Linux systems, 'ldconfig LIBDIR'" echo "may need to be executed to help locate newly installed libraries," echo "but you should consult with a system administrator before updating" echo "the shared library cache as this should be done with great care" echo "and consideration. (See the 'Platform-specific configuration notes'" echo "section of the documentation for more information.)" 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 | -S | -t) 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.expsym $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.expsym"' eval '$GREP -f "$output_objdir/$outputname.expsym" < "$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 # define MSVC_ISDIR(m)(((m) & S_IFMT) == S_IFDIR) #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) && !MSVC_ISDIR (st.st_mode) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) #else if ((stat (path, &st) >= 0) && !S_ISDIR (st.st_mode) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) #endif 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," # Args in the var 'compiler_flags' causes warnings in MSVC func_cc_basename "$CC" case $func_cc_basename_result in cl|cl.exe) ;; *) func_append compiler_flags " $wl$qarg" ;; esac 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