Merge lp:~ubuntu-branches/ubuntu/oneiric/anjuta/oneiric-201109190609 into lp:ubuntu/oneiric/anjuta

Proposed by Ubuntu Package Importer
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~ubuntu-branches/ubuntu/oneiric/anjuta/oneiric-201109190609
Merge into: lp:ubuntu/oneiric/anjuta
Diff against target: 10171 lines (+10123/-0) (has conflicts)
7 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/.version (+1/-0)
.pc/01_about_license_file.patch/src/about.c (+335/-0)
.pc/99_ltmain_as-needed.patch/ltmain.sh (+9636/-0)
.pc/applied-patches (+2/-0)
debian/control (+147/-0)
Conflict adding file .pc.  Moved existing file to .pc.moved.
Text conflict in debian/control
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/oneiric/anjuta/oneiric-201109190609
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+75953@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archve and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/oneiric/anjuta reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/oneiric/anjuta/oneiric-201109190609. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

73. By Martin Pitt

releasing version 2:3.1.92-0ubuntu1

72. By Martin Pitt

apply patches

71. By Martin Pitt

New upstream release: Some bug fixes, and translation updates.

70. By Martin Pitt

unapply patches

69. By Martin Pitt

debian/watch: Look for unstable versions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc'
2=== renamed directory '.pc' => '.pc.moved'
3=== added file '.pc/.quilt_patches'
4--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
5+++ .pc/.quilt_patches 2011-09-19 06:15:35 +0000
6@@ -0,0 +1,1 @@
7+debian/patches
8
9=== added file '.pc/.quilt_series'
10--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
11+++ .pc/.quilt_series 2011-09-19 06:15:35 +0000
12@@ -0,0 +1,1 @@
13+series
14
15=== added file '.pc/.version'
16--- .pc/.version 1970-01-01 00:00:00 +0000
17+++ .pc/.version 2011-09-19 06:15:35 +0000
18@@ -0,0 +1,1 @@
19+2
20
21=== added directory '.pc/01_about_license_file.patch'
22=== added file '.pc/01_about_license_file.patch/.timestamp'
23=== added directory '.pc/01_about_license_file.patch/src'
24=== added file '.pc/01_about_license_file.patch/src/about.c'
25--- .pc/01_about_license_file.patch/src/about.c 1970-01-01 00:00:00 +0000
26+++ .pc/01_about_license_file.patch/src/about.c 2011-09-19 06:15:35 +0000
27@@ -0,0 +1,335 @@
28+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
29+/*
30+ about.c
31+ Copyright (C) 2002 Naba Kumar <naba@gnome.org>
32+
33+ This program is free software; you can redistribute it and/or modify
34+ it under the terms of the GNU General Public License as published by
35+ the Free Software Foundation; either version 2 of the License, or
36+ (at your option) any later version.
37+
38+ This program is distributed in the hope that it will be useful,
39+ but WITHOUT ANY WARRANTY; without even the implied warranty of
40+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41+ GNU General Public License for more details.
42+
43+ You should have received a copy of the GNU General Public License
44+ along with this program; if not, write to the Free Software
45+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
46+*/
47+
48+#ifdef HAVE_CONFIG_H
49+# include <config.h>
50+#endif
51+
52+#include <gtk/gtk.h>
53+#include <stdlib.h>
54+#include <libanjuta/anjuta-plugin-manager.h>
55+
56+#include "about.h"
57+
58+#define LICENSE_FILE PACKAGE_DOC_DIR "/COPYING"
59+
60+#define ANJUTA_PIXMAP_LOGO "anjuta_logo.png"
61+#define ABOUT_AUTHORS "AUTHORS"
62+#define MAX_CAR 256
63+#define MAX_CREDIT 500
64+
65+static const gchar *authors[MAX_CREDIT];
66+static const gchar *documenters[MAX_CREDIT];
67+static gchar *translators;
68+
69+
70+static gchar*
71+about_read_line(FILE *fp)
72+{
73+ static gchar tpn[MAX_CAR];
74+ char *pt;
75+ char c;
76+
77+ pt = tpn;
78+ while( ((c=getc(fp))!='\n') && (c!=EOF) && ((pt-tpn)<MAX_CAR) )
79+ *(pt++)=c;
80+ *pt = '\0';
81+ if ( c!=EOF)
82+ return tpn;
83+ else
84+ return NULL;
85+}
86+
87+static gchar*
88+about_read_developers(FILE *fp, gchar *line, gint *index, const gchar **tab)
89+{
90+ do
91+ {
92+ if (*index < MAX_CREDIT)
93+ tab[(*index)++] = g_strdup_printf("%s", line);
94+ if ( !(line = about_read_line(fp)))
95+ return NULL;
96+ line = g_strchomp(line);
97+ }
98+ while (!g_str_has_suffix(line, ":") );
99+
100+ return line;
101+}
102+
103+static gchar*
104+read_documenters(FILE *fp, gchar *line, gint *index, const gchar **tab)
105+{
106+ do
107+ {
108+ if (*index < MAX_CREDIT)
109+ tab[(*index)++] = g_strdup_printf("%s", line);
110+ if ( !(line = about_read_line(fp)))
111+ return NULL;
112+ line = g_strchomp(line);
113+ }
114+ while ( !g_str_has_suffix(line, ":") );
115+
116+ return line;
117+}
118+
119+static gchar*
120+read_translators(FILE *fp, gchar *line)
121+{
122+ gboolean found = FALSE;
123+ gchar *env_lang = getenv("LANG");
124+
125+ do
126+ {
127+ if ( !(line = about_read_line(fp)))
128+ return NULL;
129+
130+ line = g_strchug(line);
131+ if (!found && g_str_has_prefix(line, env_lang) )
132+ {
133+ found = TRUE;
134+ gchar *tmp = g_strdup(line + strlen(env_lang));
135+ tmp = g_strchug(tmp);
136+ translators = g_strconcat("\n\n", tmp, NULL);
137+ g_free(tmp);
138+ }
139+ line = g_strchomp(line);
140+ }
141+ while ( !g_str_has_suffix(line, ":") );
142+
143+ return line;
144+}
145+
146+static void
147+about_read_file(void)
148+{
149+ FILE *fp;
150+ gchar *line;
151+ gint i_auth = 0;
152+ gint i_doc = 0;
153+
154+ fp = fopen(PACKAGE_DATA_DIR"/"ABOUT_AUTHORS, "r");
155+
156+ g_return_if_fail (fp != NULL);
157+ line = about_read_line(fp);
158+ do
159+ {
160+ line = g_strchomp(line);
161+ if (g_str_has_suffix(line, "Developer:") ||
162+ g_str_has_suffix(line, "Developers:") ||
163+ g_str_has_suffix(line, "Contributors:") ||
164+ g_str_has_suffix(line, "Note:"))
165+ {
166+ line = about_read_developers(fp, line, &i_auth, authors);
167+ }
168+ else if (g_str_has_suffix(line, "Website:") ||
169+ g_str_has_suffix(line, "Documenters:") )
170+ {
171+ line = read_documenters(fp, line, &i_doc, documenters);
172+ }
173+ else if (g_str_has_suffix(line, "Translators:") )
174+ {
175+ line = read_translators(fp, line);
176+ }
177+ else
178+ line = about_read_line(fp);
179+ }
180+ while (line);
181+ fclose(fp);
182+}
183+
184+static void
185+about_free_credit(void)
186+{
187+ gint i = 0;
188+
189+ gchar** ptr = (gchar**) authors;
190+ for(i=0; ptr[i]; i++)
191+ g_free (ptr[i]);
192+ ptr = (gchar**) documenters;
193+ for(i=0; ptr[i]; i++)
194+ g_free (ptr[i]);
195+
196+ g_free(translators);
197+}
198+
199+GtkWidget *
200+about_box_new (GtkWindow *parent)
201+{
202+ GtkWidget *dialog;
203+ GdkPixbuf *pix;
204+ gchar* license = NULL;
205+ GError* error = NULL;
206+
207+ /* Parse AUTHORS file */
208+ about_read_file();
209+
210+
211+ if (!g_file_get_contents (LICENSE_FILE,
212+ &license,
213+ NULL,
214+ &error))
215+ {
216+ g_warning ("Couldn't read license file %s: %s",
217+ LICENSE_FILE,
218+ error->message);
219+ g_error_free (error);
220+ }
221+
222+ pix = gdk_pixbuf_new_from_file (PACKAGE_PIXMAPS_DIR"/"ANJUTA_PIXMAP_LOGO,
223+ NULL);
224+
225+ dialog = gtk_about_dialog_new();
226+ gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
227+ gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
228+
229+ gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(dialog), "Anjuta");
230+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
231+ gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog),
232+ _("Copyright (c) Naba Kumar"));
233+ gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog),
234+ _("Integrated Development Environment"));
235+ gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog),
236+ license);
237+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://www.anjuta.org");
238+ gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), pix);
239+
240+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog), authors);
241+ gtk_about_dialog_set_documenters(GTK_ABOUT_DIALOG(dialog), documenters);
242+ gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(dialog), translators);
243+ /* We should fill this!
244+ gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(dialog), ???);*/
245+ /* Free authors, documenters, translators */
246+ about_free_credit();
247+ g_object_unref (pix);
248+ g_free (license);
249+ return dialog;
250+}
251+
252+static void
253+on_about_plugin_activate (GtkMenuItem *item, AnjutaShell *shell)
254+{
255+ gchar *name = NULL;
256+ gchar *authors = NULL;
257+ gchar *license = NULL;
258+ gchar **authors_v = NULL;
259+ gchar *icon = NULL;
260+ gchar *d = NULL;
261+ GdkPixbuf *pix = NULL;
262+ GtkWidget *dialog;
263+ AnjutaPluginDescription *desc;
264+
265+ desc = g_object_get_data (G_OBJECT (item), "plugin-desc");
266+
267+ anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
268+ "Name", &name);
269+ anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
270+ "Description", &d);
271+ anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
272+ "Icon", &icon);
273+ anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
274+ "Authors", &authors);
275+ anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
276+ "License", &license);
277+ if (icon)
278+ {
279+ gchar *path = g_build_filename (PACKAGE_PIXMAPS_DIR, icon, NULL);
280+ pix = gdk_pixbuf_new_from_file (path, NULL);
281+ g_free (path);
282+ }
283+ if (authors)
284+ {
285+ authors_v = g_strsplit(authors, ",", -1);
286+ }
287+ dialog = gtk_about_dialog_new();
288+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(shell));
289+ gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
290+
291+ gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(dialog), name);
292+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
293+ if (license)
294+ gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog),
295+ license);
296+ gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog),d);
297+ gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), pix);
298+
299+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog),
300+ (const gchar **)authors_v);
301+
302+ gtk_widget_show (dialog);
303+
304+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
305+
306+ g_object_unref (pix);
307+ g_strfreev (authors_v);
308+ g_free (name);
309+ g_free (d);
310+ g_free (authors);
311+ g_free (icon);
312+ g_free (license);
313+}
314+
315+void
316+about_create_plugins_submenu (AnjutaShell *shell, GtkWidget *menuitem)
317+{
318+ GtkWidget *submenu;
319+ GList *plugin_descs, *node;
320+
321+ g_return_if_fail (ANJUTA_IS_SHELL (shell));
322+ g_return_if_fail (GTK_IS_MENU_ITEM (menuitem));
323+
324+ submenu = gtk_menu_new ();
325+ gtk_widget_show (submenu);
326+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
327+
328+ plugin_descs =
329+ anjuta_plugin_manager_query (anjuta_shell_get_plugin_manager (shell, NULL),
330+ NULL, NULL, NULL, NULL);
331+ node = plugin_descs;
332+ while (node)
333+ {
334+ gchar *label;
335+ GtkWidget *item;
336+ AnjutaPluginDescription *desc = node->data;
337+ if (anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
338+ "Name", &label))
339+ {
340+ gchar *authors = NULL;
341+ gchar *license = NULL;
342+ if (anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
343+ "Authors", &authors) ||
344+ anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
345+ "License", &license))
346+ {
347+ item = gtk_menu_item_new_with_label (label);
348+ gtk_widget_show (item);
349+
350+ g_object_set_data (G_OBJECT (item), "plugin-desc", desc);
351+ g_signal_connect (G_OBJECT (item), "activate",
352+ G_CALLBACK (on_about_plugin_activate),
353+ shell);
354+ gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
355+ g_free (authors);
356+ g_free (license);
357+ }
358+ g_free (label);
359+ }
360+ node = g_list_next (node);
361+ }
362+}
363
364=== added directory '.pc/99_ltmain_as-needed.patch'
365=== added file '.pc/99_ltmain_as-needed.patch/.timestamp'
366=== added file '.pc/99_ltmain_as-needed.patch/ltmain.sh'
367--- .pc/99_ltmain_as-needed.patch/ltmain.sh 1970-01-01 00:00:00 +0000
368+++ .pc/99_ltmain_as-needed.patch/ltmain.sh 2011-09-19 06:15:35 +0000
369@@ -0,0 +1,9636 @@
370+
371+# libtool (GNU libtool) 2.4
372+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
373+
374+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
375+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
376+# This is free software; see the source for copying conditions. There is NO
377+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
378+
379+# GNU Libtool is free software; you can redistribute it and/or modify
380+# it under the terms of the GNU General Public License as published by
381+# the Free Software Foundation; either version 2 of the License, or
382+# (at your option) any later version.
383+#
384+# As a special exception to the GNU General Public License,
385+# if you distribute this file as part of a program or library that
386+# is built using GNU Libtool, you may include this file under the
387+# same distribution terms that you use for the rest of that program.
388+#
389+# GNU Libtool is distributed in the hope that it will be useful, but
390+# WITHOUT ANY WARRANTY; without even the implied warranty of
391+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
392+# General Public License for more details.
393+#
394+# You should have received a copy of the GNU General Public License
395+# along with GNU Libtool; see the file COPYING. If not, a copy
396+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
397+# or obtained by writing to the Free Software Foundation, Inc.,
398+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
399+
400+# Usage: $progname [OPTION]... [MODE-ARG]...
401+#
402+# Provide generalized library-building support services.
403+#
404+# --config show all configuration variables
405+# --debug enable verbose shell tracing
406+# -n, --dry-run display commands without modifying any files
407+# --features display basic configuration information and exit
408+# --mode=MODE use operation mode MODE
409+# --preserve-dup-deps don't remove duplicate dependency libraries
410+# --quiet, --silent don't print informational messages
411+# --no-quiet, --no-silent
412+# print informational messages (default)
413+# --tag=TAG use configuration variables from tag TAG
414+# -v, --verbose print more informational messages than default
415+# --no-verbose don't print the extra informational messages
416+# --version print version information
417+# -h, --help, --help-all print short, long, or detailed help message
418+#
419+# MODE must be one of the following:
420+#
421+# clean remove files from the build directory
422+# compile compile a source file into a libtool object
423+# execute automatically set library path, then run a program
424+# finish complete the installation of libtool libraries
425+# install install libraries or executables
426+# link create a library or an executable
427+# uninstall remove libraries from an installed directory
428+#
429+# MODE-ARGS vary depending on the MODE. When passed as first option,
430+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
431+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
432+#
433+# When reporting a bug, please describe a test case to reproduce it and
434+# include the following information:
435+#
436+# host-triplet: $host
437+# shell: $SHELL
438+# compiler: $LTCC
439+# compiler flags: $LTCFLAGS
440+# linker: $LD (gnu? $with_gnu_ld)
441+# $progname: (GNU libtool) 2.4
442+# automake: $automake_version
443+# autoconf: $autoconf_version
444+#
445+# Report bugs to <bug-libtool@gnu.org>.
446+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
447+# General help using GNU software: <http://www.gnu.org/gethelp/>.
448+
449+PROGRAM=libtool
450+PACKAGE=libtool
451+VERSION=2.4
452+TIMESTAMP=""
453+package_revision=1.3293
454+
455+# Be Bourne compatible
456+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
457+ emulate sh
458+ NULLCMD=:
459+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
460+ # is contrary to our usage. Disable this feature.
461+ alias -g '${1+"$@"}'='"$@"'
462+ setopt NO_GLOB_SUBST
463+else
464+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
465+fi
466+BIN_SH=xpg4; export BIN_SH # for Tru64
467+DUALCASE=1; export DUALCASE # for MKS sh
468+
469+# A function that is used when there is no print builtin or printf.
470+func_fallback_echo ()
471+{
472+ eval 'cat <<_LTECHO_EOF
473+$1
474+_LTECHO_EOF'
475+}
476+
477+# NLS nuisances: We save the old values to restore during execute mode.
478+lt_user_locale=
479+lt_safe_locale=
480+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
481+do
482+ eval "if test \"\${$lt_var+set}\" = set; then
483+ save_$lt_var=\$$lt_var
484+ $lt_var=C
485+ export $lt_var
486+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
487+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
488+ fi"
489+done
490+LC_ALL=C
491+LANGUAGE=C
492+export LANGUAGE LC_ALL
493+
494+$lt_unset CDPATH
495+
496+
497+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
498+# is ksh but when the shell is invoked as "sh" and the current value of
499+# the _XPG environment variable is not equal to 1 (one), the special
500+# positional parameter $0, within a function call, is the name of the
501+# function.
502+progpath="$0"
503+
504+
505+
506+: ${CP="cp -f"}
507+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
508+: ${EGREP="/bin/grep -E"}
509+: ${FGREP="/bin/grep -F"}
510+: ${GREP="/bin/grep"}
511+: ${LN_S="ln -s"}
512+: ${MAKE="make"}
513+: ${MKDIR="mkdir"}
514+: ${MV="mv -f"}
515+: ${RM="rm -f"}
516+: ${SED="/bin/sed"}
517+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
518+: ${Xsed="$SED -e 1s/^X//"}
519+
520+# Global variables:
521+EXIT_SUCCESS=0
522+EXIT_FAILURE=1
523+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
524+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
525+
526+exit_status=$EXIT_SUCCESS
527+
528+# Make sure IFS has a sensible default
529+lt_nl='
530+'
531+IFS=" $lt_nl"
532+
533+dirname="s,/[^/]*$,,"
534+basename="s,^.*/,,"
535+
536+# func_dirname file append nondir_replacement
537+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
538+# otherwise set result to NONDIR_REPLACEMENT.
539+func_dirname ()
540+{
541+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
542+ if test "X$func_dirname_result" = "X${1}"; then
543+ func_dirname_result="${3}"
544+ else
545+ func_dirname_result="$func_dirname_result${2}"
546+ fi
547+} # func_dirname may be replaced by extended shell implementation
548+
549+
550+# func_basename file
551+func_basename ()
552+{
553+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
554+} # func_basename may be replaced by extended shell implementation
555+
556+
557+# func_dirname_and_basename file append nondir_replacement
558+# perform func_basename and func_dirname in a single function
559+# call:
560+# dirname: Compute the dirname of FILE. If nonempty,
561+# add APPEND to the result, otherwise set result
562+# to NONDIR_REPLACEMENT.
563+# value returned in "$func_dirname_result"
564+# basename: Compute filename of FILE.
565+# value retuned in "$func_basename_result"
566+# Implementation must be kept synchronized with func_dirname
567+# and func_basename. For efficiency, we do not delegate to
568+# those functions but instead duplicate the functionality here.
569+func_dirname_and_basename ()
570+{
571+ # Extract subdirectory from the argument.
572+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
573+ if test "X$func_dirname_result" = "X${1}"; then
574+ func_dirname_result="${3}"
575+ else
576+ func_dirname_result="$func_dirname_result${2}"
577+ fi
578+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
579+} # func_dirname_and_basename may be replaced by extended shell implementation
580+
581+
582+# func_stripname prefix suffix name
583+# strip PREFIX and SUFFIX off of NAME.
584+# PREFIX and SUFFIX must not contain globbing or regex special
585+# characters, hashes, percent signs, but SUFFIX may contain a leading
586+# dot (in which case that matches only a dot).
587+# func_strip_suffix prefix name
588+func_stripname ()
589+{
590+ case ${2} in
591+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
592+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
593+ esac
594+} # func_stripname may be replaced by extended shell implementation
595+
596+
597+# These SED scripts presuppose an absolute path with a trailing slash.
598+pathcar='s,^/\([^/]*\).*$,\1,'
599+pathcdr='s,^/[^/]*,,'
600+removedotparts=':dotsl
601+ s@/\./@/@g
602+ t dotsl
603+ s,/\.$,/,'
604+collapseslashes='s@/\{1,\}@/@g'
605+finalslash='s,/*$,/,'
606+
607+# func_normal_abspath PATH
608+# Remove doubled-up and trailing slashes, "." path components,
609+# and cancel out any ".." path components in PATH after making
610+# it an absolute path.
611+# value returned in "$func_normal_abspath_result"
612+func_normal_abspath ()
613+{
614+ # Start from root dir and reassemble the path.
615+ func_normal_abspath_result=
616+ func_normal_abspath_tpath=$1
617+ func_normal_abspath_altnamespace=
618+ case $func_normal_abspath_tpath in
619+ "")
620+ # Empty path, that just means $cwd.
621+ func_stripname '' '/' "`pwd`"
622+ func_normal_abspath_result=$func_stripname_result
623+ return
624+ ;;
625+ # The next three entries are used to spot a run of precisely
626+ # two leading slashes without using negated character classes;
627+ # we take advantage of case's first-match behaviour.
628+ ///*)
629+ # Unusual form of absolute path, do nothing.
630+ ;;
631+ //*)
632+ # Not necessarily an ordinary path; POSIX reserves leading '//'
633+ # and for example Cygwin uses it to access remote file shares
634+ # over CIFS/SMB, so we conserve a leading double slash if found.
635+ func_normal_abspath_altnamespace=/
636+ ;;
637+ /*)
638+ # Absolute path, do nothing.
639+ ;;
640+ *)
641+ # Relative path, prepend $cwd.
642+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
643+ ;;
644+ esac
645+ # Cancel out all the simple stuff to save iterations. We also want
646+ # the path to end with a slash for ease of parsing, so make sure
647+ # there is one (and only one) here.
648+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
649+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
650+ while :; do
651+ # Processed it all yet?
652+ if test "$func_normal_abspath_tpath" = / ; then
653+ # If we ascended to the root using ".." the result may be empty now.
654+ if test -z "$func_normal_abspath_result" ; then
655+ func_normal_abspath_result=/
656+ fi
657+ break
658+ fi
659+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
660+ -e "$pathcar"`
661+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
662+ -e "$pathcdr"`
663+ # Figure out what to do with it
664+ case $func_normal_abspath_tcomponent in
665+ "")
666+ # Trailing empty path component, ignore it.
667+ ;;
668+ ..)
669+ # Parent dir; strip last assembled component from result.
670+ func_dirname "$func_normal_abspath_result"
671+ func_normal_abspath_result=$func_dirname_result
672+ ;;
673+ *)
674+ # Actual path component, append it.
675+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
676+ ;;
677+ esac
678+ done
679+ # Restore leading double-slash if one was found on entry.
680+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
681+}
682+
683+# func_relative_path SRCDIR DSTDIR
684+# generates a relative path from SRCDIR to DSTDIR, with a trailing
685+# slash if non-empty, suitable for immediately appending a filename
686+# without needing to append a separator.
687+# value returned in "$func_relative_path_result"
688+func_relative_path ()
689+{
690+ func_relative_path_result=
691+ func_normal_abspath "$1"
692+ func_relative_path_tlibdir=$func_normal_abspath_result
693+ func_normal_abspath "$2"
694+ func_relative_path_tbindir=$func_normal_abspath_result
695+
696+ # Ascend the tree starting from libdir
697+ while :; do
698+ # check if we have found a prefix of bindir
699+ case $func_relative_path_tbindir in
700+ $func_relative_path_tlibdir)
701+ # found an exact match
702+ func_relative_path_tcancelled=
703+ break
704+ ;;
705+ $func_relative_path_tlibdir*)
706+ # found a matching prefix
707+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
708+ func_relative_path_tcancelled=$func_stripname_result
709+ if test -z "$func_relative_path_result"; then
710+ func_relative_path_result=.
711+ fi
712+ break
713+ ;;
714+ *)
715+ func_dirname $func_relative_path_tlibdir
716+ func_relative_path_tlibdir=${func_dirname_result}
717+ if test "x$func_relative_path_tlibdir" = x ; then
718+ # Have to descend all the way to the root!
719+ func_relative_path_result=../$func_relative_path_result
720+ func_relative_path_tcancelled=$func_relative_path_tbindir
721+ break
722+ fi
723+ func_relative_path_result=../$func_relative_path_result
724+ ;;
725+ esac
726+ done
727+
728+ # Now calculate path; take care to avoid doubling-up slashes.
729+ func_stripname '' '/' "$func_relative_path_result"
730+ func_relative_path_result=$func_stripname_result
731+ func_stripname '/' '/' "$func_relative_path_tcancelled"
732+ if test "x$func_stripname_result" != x ; then
733+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
734+ fi
735+
736+ # Normalisation. If bindir is libdir, return empty string,
737+ # else relative path ending with a slash; either way, target
738+ # file name can be directly appended.
739+ if test ! -z "$func_relative_path_result"; then
740+ func_stripname './' '' "$func_relative_path_result/"
741+ func_relative_path_result=$func_stripname_result
742+ fi
743+}
744+
745+# The name of this program:
746+func_dirname_and_basename "$progpath"
747+progname=$func_basename_result
748+
749+# Make sure we have an absolute path for reexecution:
750+case $progpath in
751+ [\\/]*|[A-Za-z]:\\*) ;;
752+ *[\\/]*)
753+ progdir=$func_dirname_result
754+ progdir=`cd "$progdir" && pwd`
755+ progpath="$progdir/$progname"
756+ ;;
757+ *)
758+ save_IFS="$IFS"
759+ IFS=:
760+ for progdir in $PATH; do
761+ IFS="$save_IFS"
762+ test -x "$progdir/$progname" && break
763+ done
764+ IFS="$save_IFS"
765+ test -n "$progdir" || progdir=`pwd`
766+ progpath="$progdir/$progname"
767+ ;;
768+esac
769+
770+# Sed substitution that helps us do robust quoting. It backslashifies
771+# metacharacters that are still active within double-quoted strings.
772+Xsed="${SED}"' -e 1s/^X//'
773+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
774+
775+# Same as above, but do not quote variable references.
776+double_quote_subst='s/\(["`\\]\)/\\\1/g'
777+
778+# Sed substitution that turns a string into a regex matching for the
779+# string literally.
780+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
781+
782+# Sed substitution that converts a w32 file name or path
783+# which contains forward slashes, into one that contains
784+# (escaped) backslashes. A very naive implementation.
785+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
786+
787+# Re-`\' parameter expansions in output of double_quote_subst that were
788+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
789+# in input to double_quote_subst, that '$' was protected from expansion.
790+# Since each input `\' is now two `\'s, look for any number of runs of
791+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
792+bs='\\'
793+bs2='\\\\'
794+bs4='\\\\\\\\'
795+dollar='\$'
796+sed_double_backslash="\
797+ s/$bs4/&\\
798+/g
799+ s/^$bs2$dollar/$bs&/
800+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
801+ s/\n//g"
802+
803+# Standard options:
804+opt_dry_run=false
805+opt_help=false
806+opt_quiet=false
807+opt_verbose=false
808+opt_warning=:
809+
810+# func_echo arg...
811+# Echo program name prefixed message, along with the current mode
812+# name if it has been set yet.
813+func_echo ()
814+{
815+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
816+}
817+
818+# func_verbose arg...
819+# Echo program name prefixed message in verbose mode only.
820+func_verbose ()
821+{
822+ $opt_verbose && func_echo ${1+"$@"}
823+
824+ # A bug in bash halts the script if the last line of a function
825+ # fails when set -e is in force, so we need another command to
826+ # work around that:
827+ :
828+}
829+
830+# func_echo_all arg...
831+# Invoke $ECHO with all args, space-separated.
832+func_echo_all ()
833+{
834+ $ECHO "$*"
835+}
836+
837+# func_error arg...
838+# Echo program name prefixed message to standard error.
839+func_error ()
840+{
841+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
842+}
843+
844+# func_warning arg...
845+# Echo program name prefixed warning message to standard error.
846+func_warning ()
847+{
848+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
849+
850+ # bash bug again:
851+ :
852+}
853+
854+# func_fatal_error arg...
855+# Echo program name prefixed message to standard error, and exit.
856+func_fatal_error ()
857+{
858+ func_error ${1+"$@"}
859+ exit $EXIT_FAILURE
860+}
861+
862+# func_fatal_help arg...
863+# Echo program name prefixed message to standard error, followed by
864+# a help hint, and exit.
865+func_fatal_help ()
866+{
867+ func_error ${1+"$@"}
868+ func_fatal_error "$help"
869+}
870+help="Try \`$progname --help' for more information." ## default
871+
872+
873+# func_grep expression filename
874+# Check whether EXPRESSION matches any line of FILENAME, without output.
875+func_grep ()
876+{
877+ $GREP "$1" "$2" >/dev/null 2>&1
878+}
879+
880+
881+# func_mkdir_p directory-path
882+# Make sure the entire path to DIRECTORY-PATH is available.
883+func_mkdir_p ()
884+{
885+ my_directory_path="$1"
886+ my_dir_list=
887+
888+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
889+
890+ # Protect directory names starting with `-'
891+ case $my_directory_path in
892+ -*) my_directory_path="./$my_directory_path" ;;
893+ esac
894+
895+ # While some portion of DIR does not yet exist...
896+ while test ! -d "$my_directory_path"; do
897+ # ...make a list in topmost first order. Use a colon delimited
898+ # list incase some portion of path contains whitespace.
899+ my_dir_list="$my_directory_path:$my_dir_list"
900+
901+ # If the last portion added has no slash in it, the list is done
902+ case $my_directory_path in */*) ;; *) break ;; esac
903+
904+ # ...otherwise throw away the child directory and loop
905+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
906+ done
907+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
908+
909+ save_mkdir_p_IFS="$IFS"; IFS=':'
910+ for my_dir in $my_dir_list; do
911+ IFS="$save_mkdir_p_IFS"
912+ # mkdir can fail with a `File exist' error if two processes
913+ # try to create one of the directories concurrently. Don't
914+ # stop in that case!
915+ $MKDIR "$my_dir" 2>/dev/null || :
916+ done
917+ IFS="$save_mkdir_p_IFS"
918+
919+ # Bail out if we (or some other process) failed to create a directory.
920+ test -d "$my_directory_path" || \
921+ func_fatal_error "Failed to create \`$1'"
922+ fi
923+}
924+
925+
926+# func_mktempdir [string]
927+# Make a temporary directory that won't clash with other running
928+# libtool processes, and avoids race conditions if possible. If
929+# given, STRING is the basename for that directory.
930+func_mktempdir ()
931+{
932+ my_template="${TMPDIR-/tmp}/${1-$progname}"
933+
934+ if test "$opt_dry_run" = ":"; then
935+ # Return a directory name, but don't create it in dry-run mode
936+ my_tmpdir="${my_template}-$$"
937+ else
938+
939+ # If mktemp works, use that first and foremost
940+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
941+
942+ if test ! -d "$my_tmpdir"; then
943+ # Failing that, at least try and use $RANDOM to avoid a race
944+ my_tmpdir="${my_template}-${RANDOM-0}$$"
945+
946+ save_mktempdir_umask=`umask`
947+ umask 0077
948+ $MKDIR "$my_tmpdir"
949+ umask $save_mktempdir_umask
950+ fi
951+
952+ # If we're not in dry-run mode, bomb out on failure
953+ test -d "$my_tmpdir" || \
954+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
955+ fi
956+
957+ $ECHO "$my_tmpdir"
958+}
959+
960+
961+# func_quote_for_eval arg
962+# Aesthetically quote ARG to be evaled later.
963+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
964+# is double-quoted, suitable for a subsequent eval, whereas
965+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
966+# which are still active within double quotes backslashified.
967+func_quote_for_eval ()
968+{
969+ case $1 in
970+ *[\\\`\"\$]*)
971+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
972+ *)
973+ func_quote_for_eval_unquoted_result="$1" ;;
974+ esac
975+
976+ case $func_quote_for_eval_unquoted_result in
977+ # Double-quote args containing shell metacharacters to delay
978+ # word splitting, command substitution and and variable
979+ # expansion for a subsequent eval.
980+ # Many Bourne shells cannot handle close brackets correctly
981+ # in scan sets, so we specify it separately.
982+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
983+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
984+ ;;
985+ *)
986+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
987+ esac
988+}
989+
990+
991+# func_quote_for_expand arg
992+# Aesthetically quote ARG to be evaled later; same as above,
993+# but do not quote variable references.
994+func_quote_for_expand ()
995+{
996+ case $1 in
997+ *[\\\`\"]*)
998+ my_arg=`$ECHO "$1" | $SED \
999+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1000+ *)
1001+ my_arg="$1" ;;
1002+ esac
1003+
1004+ case $my_arg in
1005+ # Double-quote args containing shell metacharacters to delay
1006+ # word splitting and command substitution for a subsequent eval.
1007+ # Many Bourne shells cannot handle close brackets correctly
1008+ # in scan sets, so we specify it separately.
1009+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1010+ my_arg="\"$my_arg\""
1011+ ;;
1012+ esac
1013+
1014+ func_quote_for_expand_result="$my_arg"
1015+}
1016+
1017+
1018+# func_show_eval cmd [fail_exp]
1019+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1020+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1021+# is given, then evaluate it.
1022+func_show_eval ()
1023+{
1024+ my_cmd="$1"
1025+ my_fail_exp="${2-:}"
1026+
1027+ ${opt_silent-false} || {
1028+ func_quote_for_expand "$my_cmd"
1029+ eval "func_echo $func_quote_for_expand_result"
1030+ }
1031+
1032+ if ${opt_dry_run-false}; then :; else
1033+ eval "$my_cmd"
1034+ my_status=$?
1035+ if test "$my_status" -eq 0; then :; else
1036+ eval "(exit $my_status); $my_fail_exp"
1037+ fi
1038+ fi
1039+}
1040+
1041+
1042+# func_show_eval_locale cmd [fail_exp]
1043+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1044+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1045+# is given, then evaluate it. Use the saved locale for evaluation.
1046+func_show_eval_locale ()
1047+{
1048+ my_cmd="$1"
1049+ my_fail_exp="${2-:}"
1050+
1051+ ${opt_silent-false} || {
1052+ func_quote_for_expand "$my_cmd"
1053+ eval "func_echo $func_quote_for_expand_result"
1054+ }
1055+
1056+ if ${opt_dry_run-false}; then :; else
1057+ eval "$lt_user_locale
1058+ $my_cmd"
1059+ my_status=$?
1060+ eval "$lt_safe_locale"
1061+ if test "$my_status" -eq 0; then :; else
1062+ eval "(exit $my_status); $my_fail_exp"
1063+ fi
1064+ fi
1065+}
1066+
1067+# func_tr_sh
1068+# Turn $1 into a string suitable for a shell variable name.
1069+# Result is stored in $func_tr_sh_result. All characters
1070+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1071+# if $1 begins with a digit, a '_' is prepended as well.
1072+func_tr_sh ()
1073+{
1074+ case $1 in
1075+ [0-9]* | *[!a-zA-Z0-9_]*)
1076+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1077+ ;;
1078+ * )
1079+ func_tr_sh_result=$1
1080+ ;;
1081+ esac
1082+}
1083+
1084+
1085+# func_version
1086+# Echo version message to standard output and exit.
1087+func_version ()
1088+{
1089+ $opt_debug
1090+
1091+ $SED -n '/(C)/!b go
1092+ :more
1093+ /\./!{
1094+ N
1095+ s/\n# / /
1096+ b more
1097+ }
1098+ :go
1099+ /^# '$PROGRAM' (GNU /,/# warranty; / {
1100+ s/^# //
1101+ s/^# *$//
1102+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1103+ p
1104+ }' < "$progpath"
1105+ exit $?
1106+}
1107+
1108+# func_usage
1109+# Echo short help message to standard output and exit.
1110+func_usage ()
1111+{
1112+ $opt_debug
1113+
1114+ $SED -n '/^# Usage:/,/^# *.*--help/ {
1115+ s/^# //
1116+ s/^# *$//
1117+ s/\$progname/'$progname'/
1118+ p
1119+ }' < "$progpath"
1120+ echo
1121+ $ECHO "run \`$progname --help | more' for full usage"
1122+ exit $?
1123+}
1124+
1125+# func_help [NOEXIT]
1126+# Echo long help message to standard output and exit,
1127+# unless 'noexit' is passed as argument.
1128+func_help ()
1129+{
1130+ $opt_debug
1131+
1132+ $SED -n '/^# Usage:/,/# Report bugs to/ {
1133+ :print
1134+ s/^# //
1135+ s/^# *$//
1136+ s*\$progname*'$progname'*
1137+ s*\$host*'"$host"'*
1138+ s*\$SHELL*'"$SHELL"'*
1139+ s*\$LTCC*'"$LTCC"'*
1140+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
1141+ s*\$LD*'"$LD"'*
1142+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
1143+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1144+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1145+ p
1146+ d
1147+ }
1148+ /^# .* home page:/b print
1149+ /^# General help using/b print
1150+ ' < "$progpath"
1151+ ret=$?
1152+ if test -z "$1"; then
1153+ exit $ret
1154+ fi
1155+}
1156+
1157+# func_missing_arg argname
1158+# Echo program name prefixed message to standard error and set global
1159+# exit_cmd.
1160+func_missing_arg ()
1161+{
1162+ $opt_debug
1163+
1164+ func_error "missing argument for $1."
1165+ exit_cmd=exit
1166+}
1167+
1168+
1169+# func_split_short_opt shortopt
1170+# Set func_split_short_opt_name and func_split_short_opt_arg shell
1171+# variables after splitting SHORTOPT after the 2nd character.
1172+func_split_short_opt ()
1173+{
1174+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
1175+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
1176+
1177+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
1178+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
1179+} # func_split_short_opt may be replaced by extended shell implementation
1180+
1181+
1182+# func_split_long_opt longopt
1183+# Set func_split_long_opt_name and func_split_long_opt_arg shell
1184+# variables after splitting LONGOPT at the `=' sign.
1185+func_split_long_opt ()
1186+{
1187+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
1188+ my_sed_long_arg='1s/^--[^=]*=//'
1189+
1190+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
1191+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
1192+} # func_split_long_opt may be replaced by extended shell implementation
1193+
1194+exit_cmd=:
1195+
1196+
1197+
1198+
1199+
1200+magic="%%%MAGIC variable%%%"
1201+magic_exe="%%%MAGIC EXE variable%%%"
1202+
1203+# Global variables.
1204+nonopt=
1205+preserve_args=
1206+lo2o="s/\\.lo\$/.${objext}/"
1207+o2lo="s/\\.${objext}\$/.lo/"
1208+extracted_archives=
1209+extracted_serial=0
1210+
1211+# If this variable is set in any of the actions, the command in it
1212+# will be execed at the end. This prevents here-documents from being
1213+# left over by shells.
1214+exec_cmd=
1215+
1216+# func_append var value
1217+# Append VALUE to the end of shell variable VAR.
1218+func_append ()
1219+{
1220+ eval "${1}=\$${1}\${2}"
1221+} # func_append may be replaced by extended shell implementation
1222+
1223+# func_append_quoted var value
1224+# Quote VALUE and append to the end of shell variable VAR, separated
1225+# by a space.
1226+func_append_quoted ()
1227+{
1228+ func_quote_for_eval "${2}"
1229+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
1230+} # func_append_quoted may be replaced by extended shell implementation
1231+
1232+
1233+# func_arith arithmetic-term...
1234+func_arith ()
1235+{
1236+ func_arith_result=`expr "${@}"`
1237+} # func_arith may be replaced by extended shell implementation
1238+
1239+
1240+# func_len string
1241+# STRING may not start with a hyphen.
1242+func_len ()
1243+{
1244+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
1245+} # func_len may be replaced by extended shell implementation
1246+
1247+
1248+# func_lo2o object
1249+func_lo2o ()
1250+{
1251+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
1252+} # func_lo2o may be replaced by extended shell implementation
1253+
1254+
1255+# func_xform libobj-or-source
1256+func_xform ()
1257+{
1258+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
1259+} # func_xform may be replaced by extended shell implementation
1260+
1261+
1262+# func_fatal_configuration arg...
1263+# Echo program name prefixed message to standard error, followed by
1264+# a configuration failure hint, and exit.
1265+func_fatal_configuration ()
1266+{
1267+ func_error ${1+"$@"}
1268+ func_error "See the $PACKAGE documentation for more information."
1269+ func_fatal_error "Fatal configuration error."
1270+}
1271+
1272+
1273+# func_config
1274+# Display the configuration for all the tags in this script.
1275+func_config ()
1276+{
1277+ re_begincf='^# ### BEGIN LIBTOOL'
1278+ re_endcf='^# ### END LIBTOOL'
1279+
1280+ # Default configuration.
1281+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1282+
1283+ # Now print the configurations for the tags.
1284+ for tagname in $taglist; do
1285+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1286+ done
1287+
1288+ exit $?
1289+}
1290+
1291+# func_features
1292+# Display the features supported by this script.
1293+func_features ()
1294+{
1295+ echo "host: $host"
1296+ if test "$build_libtool_libs" = yes; then
1297+ echo "enable shared libraries"
1298+ else
1299+ echo "disable shared libraries"
1300+ fi
1301+ if test "$build_old_libs" = yes; then
1302+ echo "enable static libraries"
1303+ else
1304+ echo "disable static libraries"
1305+ fi
1306+
1307+ exit $?
1308+}
1309+
1310+# func_enable_tag tagname
1311+# Verify that TAGNAME is valid, and either flag an error and exit, or
1312+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1313+# variable here.
1314+func_enable_tag ()
1315+{
1316+ # Global variable:
1317+ tagname="$1"
1318+
1319+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1320+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1321+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
1322+
1323+ # Validate tagname.
1324+ case $tagname in
1325+ *[!-_A-Za-z0-9,/]*)
1326+ func_fatal_error "invalid tag name: $tagname"
1327+ ;;
1328+ esac
1329+
1330+ # Don't test for the "default" C tag, as we know it's
1331+ # there but not specially marked.
1332+ case $tagname in
1333+ CC) ;;
1334+ *)
1335+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1336+ taglist="$taglist $tagname"
1337+
1338+ # Evaluate the configuration. Be careful to quote the path
1339+ # and the sed script, to avoid splitting on whitespace, but
1340+ # also don't use non-portable quotes within backquotes within
1341+ # quotes we have to do it in 2 steps:
1342+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1343+ eval "$extractedcf"
1344+ else
1345+ func_error "ignoring unknown tag $tagname"
1346+ fi
1347+ ;;
1348+ esac
1349+}
1350+
1351+# func_check_version_match
1352+# Ensure that we are using m4 macros, and libtool script from the same
1353+# release of libtool.
1354+func_check_version_match ()
1355+{
1356+ if test "$package_revision" != "$macro_revision"; then
1357+ if test "$VERSION" != "$macro_version"; then
1358+ if test -z "$macro_version"; then
1359+ cat >&2 <<_LT_EOF
1360+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1361+$progname: definition of this LT_INIT comes from an older release.
1362+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1363+$progname: and run autoconf again.
1364+_LT_EOF
1365+ else
1366+ cat >&2 <<_LT_EOF
1367+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1368+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1369+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1370+$progname: and run autoconf again.
1371+_LT_EOF
1372+ fi
1373+ else
1374+ cat >&2 <<_LT_EOF
1375+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1376+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1377+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1378+$progname: of $PACKAGE $VERSION and run autoconf again.
1379+_LT_EOF
1380+ fi
1381+
1382+ exit $EXIT_MISMATCH
1383+ fi
1384+}
1385+
1386+
1387+# Shorthand for --mode=foo, only valid as the first argument
1388+case $1 in
1389+clean|clea|cle|cl)
1390+ shift; set dummy --mode clean ${1+"$@"}; shift
1391+ ;;
1392+compile|compil|compi|comp|com|co|c)
1393+ shift; set dummy --mode compile ${1+"$@"}; shift
1394+ ;;
1395+execute|execut|execu|exec|exe|ex|e)
1396+ shift; set dummy --mode execute ${1+"$@"}; shift
1397+ ;;
1398+finish|finis|fini|fin|fi|f)
1399+ shift; set dummy --mode finish ${1+"$@"}; shift
1400+ ;;
1401+install|instal|insta|inst|ins|in|i)
1402+ shift; set dummy --mode install ${1+"$@"}; shift
1403+ ;;
1404+link|lin|li|l)
1405+ shift; set dummy --mode link ${1+"$@"}; shift
1406+ ;;
1407+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1408+ shift; set dummy --mode uninstall ${1+"$@"}; shift
1409+ ;;
1410+esac
1411+
1412+
1413+
1414+# Option defaults:
1415+opt_debug=:
1416+opt_dry_run=false
1417+opt_config=false
1418+opt_preserve_dup_deps=false
1419+opt_features=false
1420+opt_finish=false
1421+opt_help=false
1422+opt_help_all=false
1423+opt_silent=:
1424+opt_verbose=:
1425+opt_silent=false
1426+opt_verbose=false
1427+
1428+
1429+# Parse options once, thoroughly. This comes as soon as possible in the
1430+# script to make things like `--version' happen as quickly as we can.
1431+{
1432+ # this just eases exit handling
1433+ while test $# -gt 0; do
1434+ opt="$1"
1435+ shift
1436+ case $opt in
1437+ --debug|-x) opt_debug='set -x'
1438+ func_echo "enabling shell trace mode"
1439+ $opt_debug
1440+ ;;
1441+ --dry-run|--dryrun|-n)
1442+ opt_dry_run=:
1443+ ;;
1444+ --config)
1445+ opt_config=:
1446+func_config
1447+ ;;
1448+ --dlopen|-dlopen)
1449+ optarg="$1"
1450+ opt_dlopen="${opt_dlopen+$opt_dlopen
1451+}$optarg"
1452+ shift
1453+ ;;
1454+ --preserve-dup-deps)
1455+ opt_preserve_dup_deps=:
1456+ ;;
1457+ --features)
1458+ opt_features=:
1459+func_features
1460+ ;;
1461+ --finish)
1462+ opt_finish=:
1463+set dummy --mode finish ${1+"$@"}; shift
1464+ ;;
1465+ --help)
1466+ opt_help=:
1467+ ;;
1468+ --help-all)
1469+ opt_help_all=:
1470+opt_help=': help-all'
1471+ ;;
1472+ --mode)
1473+ test $# = 0 && func_missing_arg $opt && break
1474+ optarg="$1"
1475+ opt_mode="$optarg"
1476+case $optarg in
1477+ # Valid mode arguments:
1478+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
1479+
1480+ # Catch anything else as an error
1481+ *) func_error "invalid argument for $opt"
1482+ exit_cmd=exit
1483+ break
1484+ ;;
1485+esac
1486+ shift
1487+ ;;
1488+ --no-silent|--no-quiet)
1489+ opt_silent=false
1490+func_append preserve_args " $opt"
1491+ ;;
1492+ --no-verbose)
1493+ opt_verbose=false
1494+func_append preserve_args " $opt"
1495+ ;;
1496+ --silent|--quiet)
1497+ opt_silent=:
1498+func_append preserve_args " $opt"
1499+ opt_verbose=false
1500+ ;;
1501+ --verbose|-v)
1502+ opt_verbose=:
1503+func_append preserve_args " $opt"
1504+opt_silent=false
1505+ ;;
1506+ --tag)
1507+ test $# = 0 && func_missing_arg $opt && break
1508+ optarg="$1"
1509+ opt_tag="$optarg"
1510+func_append preserve_args " $opt $optarg"
1511+func_enable_tag "$optarg"
1512+ shift
1513+ ;;
1514+
1515+ -\?|-h) func_usage ;;
1516+ --help) func_help ;;
1517+ --version) func_version ;;
1518+
1519+ # Separate optargs to long options:
1520+ --*=*)
1521+ func_split_long_opt "$opt"
1522+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1523+ shift
1524+ ;;
1525+
1526+ # Separate non-argument short options:
1527+ -\?*|-h*|-n*|-v*)
1528+ func_split_short_opt "$opt"
1529+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1530+ shift
1531+ ;;
1532+
1533+ --) break ;;
1534+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
1535+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1536+ esac
1537+ done
1538+
1539+ # Validate options:
1540+
1541+ # save first non-option argument
1542+ if test "$#" -gt 0; then
1543+ nonopt="$opt"
1544+ shift
1545+ fi
1546+
1547+ # preserve --debug
1548+ test "$opt_debug" = : || func_append preserve_args " --debug"
1549+
1550+ case $host in
1551+ *cygwin* | *mingw* | *pw32* | *cegcc*)
1552+ # don't eliminate duplications in $postdeps and $predeps
1553+ opt_duplicate_compiler_generated_deps=:
1554+ ;;
1555+ *)
1556+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1557+ ;;
1558+ esac
1559+
1560+ $opt_help || {
1561+ # Sanity checks first:
1562+ func_check_version_match
1563+
1564+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1565+ func_fatal_configuration "not configured to build any kind of library"
1566+ fi
1567+
1568+ # Darwin sucks
1569+ eval std_shrext=\"$shrext_cmds\"
1570+
1571+ # Only execute mode is allowed to have -dlopen flags.
1572+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1573+ func_error "unrecognized option \`-dlopen'"
1574+ $ECHO "$help" 1>&2
1575+ exit $EXIT_FAILURE
1576+ fi
1577+
1578+ # Change the help message to a mode-specific one.
1579+ generic_help="$help"
1580+ help="Try \`$progname --help --mode=$opt_mode' for more information."
1581+ }
1582+
1583+
1584+ # Bail if the options were screwed
1585+ $exit_cmd $EXIT_FAILURE
1586+}
1587+
1588+
1589+
1590+
1591+## ----------- ##
1592+## Main. ##
1593+## ----------- ##
1594+
1595+# func_lalib_p file
1596+# True iff FILE is a libtool `.la' library or `.lo' object file.
1597+# This function is only a basic sanity check; it will hardly flush out
1598+# determined imposters.
1599+func_lalib_p ()
1600+{
1601+ test -f "$1" &&
1602+ $SED -e 4q "$1" 2>/dev/null \
1603+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1604+}
1605+
1606+# func_lalib_unsafe_p file
1607+# True iff FILE is a libtool `.la' library or `.lo' object file.
1608+# This function implements the same check as func_lalib_p without
1609+# resorting to external programs. To this end, it redirects stdin and
1610+# closes it afterwards, without saving the original file descriptor.
1611+# As a safety measure, use it only where a negative result would be
1612+# fatal anyway. Works if `file' does not exist.
1613+func_lalib_unsafe_p ()
1614+{
1615+ lalib_p=no
1616+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1617+ for lalib_p_l in 1 2 3 4
1618+ do
1619+ read lalib_p_line
1620+ case "$lalib_p_line" in
1621+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1622+ esac
1623+ done
1624+ exec 0<&5 5<&-
1625+ fi
1626+ test "$lalib_p" = yes
1627+}
1628+
1629+# func_ltwrapper_script_p file
1630+# True iff FILE is a libtool wrapper script
1631+# This function is only a basic sanity check; it will hardly flush out
1632+# determined imposters.
1633+func_ltwrapper_script_p ()
1634+{
1635+ func_lalib_p "$1"
1636+}
1637+
1638+# func_ltwrapper_executable_p file
1639+# True iff FILE is a libtool wrapper executable
1640+# This function is only a basic sanity check; it will hardly flush out
1641+# determined imposters.
1642+func_ltwrapper_executable_p ()
1643+{
1644+ func_ltwrapper_exec_suffix=
1645+ case $1 in
1646+ *.exe) ;;
1647+ *) func_ltwrapper_exec_suffix=.exe ;;
1648+ esac
1649+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1650+}
1651+
1652+# func_ltwrapper_scriptname file
1653+# Assumes file is an ltwrapper_executable
1654+# uses $file to determine the appropriate filename for a
1655+# temporary ltwrapper_script.
1656+func_ltwrapper_scriptname ()
1657+{
1658+ func_dirname_and_basename "$1" "" "."
1659+ func_stripname '' '.exe' "$func_basename_result"
1660+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1661+}
1662+
1663+# func_ltwrapper_p file
1664+# True iff FILE is a libtool wrapper script or wrapper executable
1665+# This function is only a basic sanity check; it will hardly flush out
1666+# determined imposters.
1667+func_ltwrapper_p ()
1668+{
1669+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1670+}
1671+
1672+
1673+# func_execute_cmds commands fail_cmd
1674+# Execute tilde-delimited COMMANDS.
1675+# If FAIL_CMD is given, eval that upon failure.
1676+# FAIL_CMD may read-access the current command in variable CMD!
1677+func_execute_cmds ()
1678+{
1679+ $opt_debug
1680+ save_ifs=$IFS; IFS='~'
1681+ for cmd in $1; do
1682+ IFS=$save_ifs
1683+ eval cmd=\"$cmd\"
1684+ func_show_eval "$cmd" "${2-:}"
1685+ done
1686+ IFS=$save_ifs
1687+}
1688+
1689+
1690+# func_source file
1691+# Source FILE, adding directory component if necessary.
1692+# Note that it is not necessary on cygwin/mingw to append a dot to
1693+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1694+# behavior happens only for exec(3), not for open(2)! Also, sourcing
1695+# `FILE.' does not work on cygwin managed mounts.
1696+func_source ()
1697+{
1698+ $opt_debug
1699+ case $1 in
1700+ */* | *\\*) . "$1" ;;
1701+ *) . "./$1" ;;
1702+ esac
1703+}
1704+
1705+
1706+# func_resolve_sysroot PATH
1707+# Replace a leading = in PATH with a sysroot. Store the result into
1708+# func_resolve_sysroot_result
1709+func_resolve_sysroot ()
1710+{
1711+ func_resolve_sysroot_result=$1
1712+ case $func_resolve_sysroot_result in
1713+ =*)
1714+ func_stripname '=' '' "$func_resolve_sysroot_result"
1715+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1716+ ;;
1717+ esac
1718+}
1719+
1720+# func_replace_sysroot PATH
1721+# If PATH begins with the sysroot, replace it with = and
1722+# store the result into func_replace_sysroot_result.
1723+func_replace_sysroot ()
1724+{
1725+ case "$lt_sysroot:$1" in
1726+ ?*:"$lt_sysroot"*)
1727+ func_stripname "$lt_sysroot" '' "$1"
1728+ func_replace_sysroot_result="=$func_stripname_result"
1729+ ;;
1730+ *)
1731+ # Including no sysroot.
1732+ func_replace_sysroot_result=$1
1733+ ;;
1734+ esac
1735+}
1736+
1737+# func_infer_tag arg
1738+# Infer tagged configuration to use if any are available and
1739+# if one wasn't chosen via the "--tag" command line option.
1740+# Only attempt this if the compiler in the base compile
1741+# command doesn't match the default compiler.
1742+# arg is usually of the form 'gcc ...'
1743+func_infer_tag ()
1744+{
1745+ $opt_debug
1746+ if test -n "$available_tags" && test -z "$tagname"; then
1747+ CC_quoted=
1748+ for arg in $CC; do
1749+ func_append_quoted CC_quoted "$arg"
1750+ done
1751+ CC_expanded=`func_echo_all $CC`
1752+ CC_quoted_expanded=`func_echo_all $CC_quoted`
1753+ case $@ in
1754+ # Blanks in the command may have been stripped by the calling shell,
1755+ # but not from the CC environment variable when configure was run.
1756+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1757+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1758+ # Blanks at the start of $base_compile will cause this to fail
1759+ # if we don't check for them as well.
1760+ *)
1761+ for z in $available_tags; do
1762+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1763+ # Evaluate the configuration.
1764+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1765+ CC_quoted=
1766+ for arg in $CC; do
1767+ # Double-quote args containing other shell metacharacters.
1768+ func_append_quoted CC_quoted "$arg"
1769+ done
1770+ CC_expanded=`func_echo_all $CC`
1771+ CC_quoted_expanded=`func_echo_all $CC_quoted`
1772+ case "$@ " in
1773+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1774+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1775+ # The compiler in the base compile command matches
1776+ # the one in the tagged configuration.
1777+ # Assume this is the tagged configuration we want.
1778+ tagname=$z
1779+ break
1780+ ;;
1781+ esac
1782+ fi
1783+ done
1784+ # If $tagname still isn't set, then no tagged configuration
1785+ # was found and let the user know that the "--tag" command
1786+ # line option must be used.
1787+ if test -z "$tagname"; then
1788+ func_echo "unable to infer tagged configuration"
1789+ func_fatal_error "specify a tag with \`--tag'"
1790+# else
1791+# func_verbose "using $tagname tagged configuration"
1792+ fi
1793+ ;;
1794+ esac
1795+ fi
1796+}
1797+
1798+
1799+
1800+# func_write_libtool_object output_name pic_name nonpic_name
1801+# Create a libtool object file (analogous to a ".la" file),
1802+# but don't create it if we're doing a dry run.
1803+func_write_libtool_object ()
1804+{
1805+ write_libobj=${1}
1806+ if test "$build_libtool_libs" = yes; then
1807+ write_lobj=\'${2}\'
1808+ else
1809+ write_lobj=none
1810+ fi
1811+
1812+ if test "$build_old_libs" = yes; then
1813+ write_oldobj=\'${3}\'
1814+ else
1815+ write_oldobj=none
1816+ fi
1817+
1818+ $opt_dry_run || {
1819+ cat >${write_libobj}T <<EOF
1820+# $write_libobj - a libtool object file
1821+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1822+#
1823+# Please DO NOT delete this file!
1824+# It is necessary for linking the library.
1825+
1826+# Name of the PIC object.
1827+pic_object=$write_lobj
1828+
1829+# Name of the non-PIC object
1830+non_pic_object=$write_oldobj
1831+
1832+EOF
1833+ $MV "${write_libobj}T" "${write_libobj}"
1834+ }
1835+}
1836+
1837+
1838+##################################################
1839+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1840+##################################################
1841+
1842+# func_convert_core_file_wine_to_w32 ARG
1843+# Helper function used by file name conversion functions when $build is *nix,
1844+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1845+# correctly configured wine environment available, with the winepath program
1846+# in $build's $PATH.
1847+#
1848+# ARG is the $build file name to be converted to w32 format.
1849+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1850+# be empty on error (or when ARG is empty)
1851+func_convert_core_file_wine_to_w32 ()
1852+{
1853+ $opt_debug
1854+ func_convert_core_file_wine_to_w32_result="$1"
1855+ if test -n "$1"; then
1856+ # Unfortunately, winepath does not exit with a non-zero error code, so we
1857+ # are forced to check the contents of stdout. On the other hand, if the
1858+ # command is not found, the shell will set an exit code of 127 and print
1859+ # *an error message* to stdout. So we must check for both error code of
1860+ # zero AND non-empty stdout, which explains the odd construction:
1861+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1862+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1863+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1864+ $SED -e "$lt_sed_naive_backslashify"`
1865+ else
1866+ func_convert_core_file_wine_to_w32_result=
1867+ fi
1868+ fi
1869+}
1870+# end: func_convert_core_file_wine_to_w32
1871+
1872+
1873+# func_convert_core_path_wine_to_w32 ARG
1874+# Helper function used by path conversion functions when $build is *nix, and
1875+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1876+# configured wine environment available, with the winepath program in $build's
1877+# $PATH. Assumes ARG has no leading or trailing path separator characters.
1878+#
1879+# ARG is path to be converted from $build format to win32.
1880+# Result is available in $func_convert_core_path_wine_to_w32_result.
1881+# Unconvertible file (directory) names in ARG are skipped; if no directory names
1882+# are convertible, then the result may be empty.
1883+func_convert_core_path_wine_to_w32 ()
1884+{
1885+ $opt_debug
1886+ # unfortunately, winepath doesn't convert paths, only file names
1887+ func_convert_core_path_wine_to_w32_result=""
1888+ if test -n "$1"; then
1889+ oldIFS=$IFS
1890+ IFS=:
1891+ for func_convert_core_path_wine_to_w32_f in $1; do
1892+ IFS=$oldIFS
1893+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1894+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1895+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
1896+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1897+ else
1898+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1899+ fi
1900+ fi
1901+ done
1902+ IFS=$oldIFS
1903+ fi
1904+}
1905+# end: func_convert_core_path_wine_to_w32
1906+
1907+
1908+# func_cygpath ARGS...
1909+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1910+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1911+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1912+# (2), returns the Cygwin file name or path in func_cygpath_result (input
1913+# file name or path is assumed to be in w32 format, as previously converted
1914+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1915+# or path in func_cygpath_result (input file name or path is assumed to be in
1916+# Cygwin format). Returns an empty string on error.
1917+#
1918+# ARGS are passed to cygpath, with the last one being the file name or path to
1919+# be converted.
1920+#
1921+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1922+# environment variable; do not put it in $PATH.
1923+func_cygpath ()
1924+{
1925+ $opt_debug
1926+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1927+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1928+ if test "$?" -ne 0; then
1929+ # on failure, ensure result is empty
1930+ func_cygpath_result=
1931+ fi
1932+ else
1933+ func_cygpath_result=
1934+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1935+ fi
1936+}
1937+#end: func_cygpath
1938+
1939+
1940+# func_convert_core_msys_to_w32 ARG
1941+# Convert file name or path ARG from MSYS format to w32 format. Return
1942+# result in func_convert_core_msys_to_w32_result.
1943+func_convert_core_msys_to_w32 ()
1944+{
1945+ $opt_debug
1946+ # awkward: cmd appends spaces to result
1947+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1948+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1949+}
1950+#end: func_convert_core_msys_to_w32
1951+
1952+
1953+# func_convert_file_check ARG1 ARG2
1954+# Verify that ARG1 (a file name in $build format) was converted to $host
1955+# format in ARG2. Otherwise, emit an error message, but continue (resetting
1956+# func_to_host_file_result to ARG1).
1957+func_convert_file_check ()
1958+{
1959+ $opt_debug
1960+ if test -z "$2" && test -n "$1" ; then
1961+ func_error "Could not determine host file name corresponding to"
1962+ func_error " \`$1'"
1963+ func_error "Continuing, but uninstalled executables may not work."
1964+ # Fallback:
1965+ func_to_host_file_result="$1"
1966+ fi
1967+}
1968+# end func_convert_file_check
1969+
1970+
1971+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1972+# Verify that FROM_PATH (a path in $build format) was converted to $host
1973+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1974+# func_to_host_file_result to a simplistic fallback value (see below).
1975+func_convert_path_check ()
1976+{
1977+ $opt_debug
1978+ if test -z "$4" && test -n "$3"; then
1979+ func_error "Could not determine the host path corresponding to"
1980+ func_error " \`$3'"
1981+ func_error "Continuing, but uninstalled executables may not work."
1982+ # Fallback. This is a deliberately simplistic "conversion" and
1983+ # should not be "improved". See libtool.info.
1984+ if test "x$1" != "x$2"; then
1985+ lt_replace_pathsep_chars="s|$1|$2|g"
1986+ func_to_host_path_result=`echo "$3" |
1987+ $SED -e "$lt_replace_pathsep_chars"`
1988+ else
1989+ func_to_host_path_result="$3"
1990+ fi
1991+ fi
1992+}
1993+# end func_convert_path_check
1994+
1995+
1996+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1997+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1998+# and appending REPL if ORIG matches BACKPAT.
1999+func_convert_path_front_back_pathsep ()
2000+{
2001+ $opt_debug
2002+ case $4 in
2003+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2004+ ;;
2005+ esac
2006+ case $4 in
2007+ $2 ) func_append func_to_host_path_result "$3"
2008+ ;;
2009+ esac
2010+}
2011+# end func_convert_path_front_back_pathsep
2012+
2013+
2014+##################################################
2015+# $build to $host FILE NAME CONVERSION FUNCTIONS #
2016+##################################################
2017+# invoked via `$to_host_file_cmd ARG'
2018+#
2019+# In each case, ARG is the path to be converted from $build to $host format.
2020+# Result will be available in $func_to_host_file_result.
2021+
2022+
2023+# func_to_host_file ARG
2024+# Converts the file name ARG from $build format to $host format. Return result
2025+# in func_to_host_file_result.
2026+func_to_host_file ()
2027+{
2028+ $opt_debug
2029+ $to_host_file_cmd "$1"
2030+}
2031+# end func_to_host_file
2032+
2033+
2034+# func_to_tool_file ARG LAZY
2035+# converts the file name ARG from $build format to toolchain format. Return
2036+# result in func_to_tool_file_result. If the conversion in use is listed
2037+# in (the comma separated) LAZY, no conversion takes place.
2038+func_to_tool_file ()
2039+{
2040+ $opt_debug
2041+ case ,$2, in
2042+ *,"$to_tool_file_cmd",*)
2043+ func_to_tool_file_result=$1
2044+ ;;
2045+ *)
2046+ $to_tool_file_cmd "$1"
2047+ func_to_tool_file_result=$func_to_host_file_result
2048+ ;;
2049+ esac
2050+}
2051+# end func_to_tool_file
2052+
2053+
2054+# func_convert_file_noop ARG
2055+# Copy ARG to func_to_host_file_result.
2056+func_convert_file_noop ()
2057+{
2058+ func_to_host_file_result="$1"
2059+}
2060+# end func_convert_file_noop
2061+
2062+
2063+# func_convert_file_msys_to_w32 ARG
2064+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2065+# conversion to w32 is not available inside the cwrapper. Returns result in
2066+# func_to_host_file_result.
2067+func_convert_file_msys_to_w32 ()
2068+{
2069+ $opt_debug
2070+ func_to_host_file_result="$1"
2071+ if test -n "$1"; then
2072+ func_convert_core_msys_to_w32 "$1"
2073+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2074+ fi
2075+ func_convert_file_check "$1" "$func_to_host_file_result"
2076+}
2077+# end func_convert_file_msys_to_w32
2078+
2079+
2080+# func_convert_file_cygwin_to_w32 ARG
2081+# Convert file name ARG from Cygwin to w32 format. Returns result in
2082+# func_to_host_file_result.
2083+func_convert_file_cygwin_to_w32 ()
2084+{
2085+ $opt_debug
2086+ func_to_host_file_result="$1"
2087+ if test -n "$1"; then
2088+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2089+ # LT_CYGPATH in this case.
2090+ func_to_host_file_result=`cygpath -m "$1"`
2091+ fi
2092+ func_convert_file_check "$1" "$func_to_host_file_result"
2093+}
2094+# end func_convert_file_cygwin_to_w32
2095+
2096+
2097+# func_convert_file_nix_to_w32 ARG
2098+# Convert file name ARG from *nix to w32 format. Requires a wine environment
2099+# and a working winepath. Returns result in func_to_host_file_result.
2100+func_convert_file_nix_to_w32 ()
2101+{
2102+ $opt_debug
2103+ func_to_host_file_result="$1"
2104+ if test -n "$1"; then
2105+ func_convert_core_file_wine_to_w32 "$1"
2106+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2107+ fi
2108+ func_convert_file_check "$1" "$func_to_host_file_result"
2109+}
2110+# end func_convert_file_nix_to_w32
2111+
2112+
2113+# func_convert_file_msys_to_cygwin ARG
2114+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2115+# Returns result in func_to_host_file_result.
2116+func_convert_file_msys_to_cygwin ()
2117+{
2118+ $opt_debug
2119+ func_to_host_file_result="$1"
2120+ if test -n "$1"; then
2121+ func_convert_core_msys_to_w32 "$1"
2122+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
2123+ func_to_host_file_result="$func_cygpath_result"
2124+ fi
2125+ func_convert_file_check "$1" "$func_to_host_file_result"
2126+}
2127+# end func_convert_file_msys_to_cygwin
2128+
2129+
2130+# func_convert_file_nix_to_cygwin ARG
2131+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2132+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2133+# in func_to_host_file_result.
2134+func_convert_file_nix_to_cygwin ()
2135+{
2136+ $opt_debug
2137+ func_to_host_file_result="$1"
2138+ if test -n "$1"; then
2139+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2140+ func_convert_core_file_wine_to_w32 "$1"
2141+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2142+ func_to_host_file_result="$func_cygpath_result"
2143+ fi
2144+ func_convert_file_check "$1" "$func_to_host_file_result"
2145+}
2146+# end func_convert_file_nix_to_cygwin
2147+
2148+
2149+#############################################
2150+# $build to $host PATH CONVERSION FUNCTIONS #
2151+#############################################
2152+# invoked via `$to_host_path_cmd ARG'
2153+#
2154+# In each case, ARG is the path to be converted from $build to $host format.
2155+# The result will be available in $func_to_host_path_result.
2156+#
2157+# Path separators are also converted from $build format to $host format. If
2158+# ARG begins or ends with a path separator character, it is preserved (but
2159+# converted to $host format) on output.
2160+#
2161+# All path conversion functions are named using the following convention:
2162+# file name conversion function : func_convert_file_X_to_Y ()
2163+# path conversion function : func_convert_path_X_to_Y ()
2164+# where, for any given $build/$host combination the 'X_to_Y' value is the
2165+# same. If conversion functions are added for new $build/$host combinations,
2166+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
2167+# will break.
2168+
2169+
2170+# func_init_to_host_path_cmd
2171+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
2172+# appropriate value, based on the value of $to_host_file_cmd.
2173+to_host_path_cmd=
2174+func_init_to_host_path_cmd ()
2175+{
2176+ $opt_debug
2177+ if test -z "$to_host_path_cmd"; then
2178+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2179+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
2180+ fi
2181+}
2182+
2183+
2184+# func_to_host_path ARG
2185+# Converts the path ARG from $build format to $host format. Return result
2186+# in func_to_host_path_result.
2187+func_to_host_path ()
2188+{
2189+ $opt_debug
2190+ func_init_to_host_path_cmd
2191+ $to_host_path_cmd "$1"
2192+}
2193+# end func_to_host_path
2194+
2195+
2196+# func_convert_path_noop ARG
2197+# Copy ARG to func_to_host_path_result.
2198+func_convert_path_noop ()
2199+{
2200+ func_to_host_path_result="$1"
2201+}
2202+# end func_convert_path_noop
2203+
2204+
2205+# func_convert_path_msys_to_w32 ARG
2206+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2207+# conversion to w32 is not available inside the cwrapper. Returns result in
2208+# func_to_host_path_result.
2209+func_convert_path_msys_to_w32 ()
2210+{
2211+ $opt_debug
2212+ func_to_host_path_result="$1"
2213+ if test -n "$1"; then
2214+ # Remove leading and trailing path separator characters from ARG. MSYS
2215+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2216+ # and winepath ignores them completely.
2217+ func_stripname : : "$1"
2218+ func_to_host_path_tmp1=$func_stripname_result
2219+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2220+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2221+ func_convert_path_check : ";" \
2222+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
2223+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2224+ fi
2225+}
2226+# end func_convert_path_msys_to_w32
2227+
2228+
2229+# func_convert_path_cygwin_to_w32 ARG
2230+# Convert path ARG from Cygwin to w32 format. Returns result in
2231+# func_to_host_file_result.
2232+func_convert_path_cygwin_to_w32 ()
2233+{
2234+ $opt_debug
2235+ func_to_host_path_result="$1"
2236+ if test -n "$1"; then
2237+ # See func_convert_path_msys_to_w32:
2238+ func_stripname : : "$1"
2239+ func_to_host_path_tmp1=$func_stripname_result
2240+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2241+ func_convert_path_check : ";" \
2242+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
2243+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2244+ fi
2245+}
2246+# end func_convert_path_cygwin_to_w32
2247+
2248+
2249+# func_convert_path_nix_to_w32 ARG
2250+# Convert path ARG from *nix to w32 format. Requires a wine environment and
2251+# a working winepath. Returns result in func_to_host_file_result.
2252+func_convert_path_nix_to_w32 ()
2253+{
2254+ $opt_debug
2255+ func_to_host_path_result="$1"
2256+ if test -n "$1"; then
2257+ # See func_convert_path_msys_to_w32:
2258+ func_stripname : : "$1"
2259+ func_to_host_path_tmp1=$func_stripname_result
2260+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2261+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2262+ func_convert_path_check : ";" \
2263+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
2264+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2265+ fi
2266+}
2267+# end func_convert_path_nix_to_w32
2268+
2269+
2270+# func_convert_path_msys_to_cygwin ARG
2271+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2272+# Returns result in func_to_host_file_result.
2273+func_convert_path_msys_to_cygwin ()
2274+{
2275+ $opt_debug
2276+ func_to_host_path_result="$1"
2277+ if test -n "$1"; then
2278+ # See func_convert_path_msys_to_w32:
2279+ func_stripname : : "$1"
2280+ func_to_host_path_tmp1=$func_stripname_result
2281+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2282+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2283+ func_to_host_path_result="$func_cygpath_result"
2284+ func_convert_path_check : : \
2285+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
2286+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2287+ fi
2288+}
2289+# end func_convert_path_msys_to_cygwin
2290+
2291+
2292+# func_convert_path_nix_to_cygwin ARG
2293+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2294+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2295+# func_to_host_file_result.
2296+func_convert_path_nix_to_cygwin ()
2297+{
2298+ $opt_debug
2299+ func_to_host_path_result="$1"
2300+ if test -n "$1"; then
2301+ # Remove leading and trailing path separator characters from
2302+ # ARG. msys behavior is inconsistent here, cygpath turns them
2303+ # into '.;' and ';.', and winepath ignores them completely.
2304+ func_stripname : : "$1"
2305+ func_to_host_path_tmp1=$func_stripname_result
2306+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2307+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2308+ func_to_host_path_result="$func_cygpath_result"
2309+ func_convert_path_check : : \
2310+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
2311+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2312+ fi
2313+}
2314+# end func_convert_path_nix_to_cygwin
2315+
2316+
2317+# func_mode_compile arg...
2318+func_mode_compile ()
2319+{
2320+ $opt_debug
2321+ # Get the compilation command and the source file.
2322+ base_compile=
2323+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
2324+ suppress_opt=yes
2325+ suppress_output=
2326+ arg_mode=normal
2327+ libobj=
2328+ later=
2329+ pie_flag=
2330+
2331+ for arg
2332+ do
2333+ case $arg_mode in
2334+ arg )
2335+ # do not "continue". Instead, add this to base_compile
2336+ lastarg="$arg"
2337+ arg_mode=normal
2338+ ;;
2339+
2340+ target )
2341+ libobj="$arg"
2342+ arg_mode=normal
2343+ continue
2344+ ;;
2345+
2346+ normal )
2347+ # Accept any command-line options.
2348+ case $arg in
2349+ -o)
2350+ test -n "$libobj" && \
2351+ func_fatal_error "you cannot specify \`-o' more than once"
2352+ arg_mode=target
2353+ continue
2354+ ;;
2355+
2356+ -pie | -fpie | -fPIE)
2357+ func_append pie_flag " $arg"
2358+ continue
2359+ ;;
2360+
2361+ -shared | -static | -prefer-pic | -prefer-non-pic)
2362+ func_append later " $arg"
2363+ continue
2364+ ;;
2365+
2366+ -no-suppress)
2367+ suppress_opt=no
2368+ continue
2369+ ;;
2370+
2371+ -Xcompiler)
2372+ arg_mode=arg # the next one goes into the "base_compile" arg list
2373+ continue # The current "srcfile" will either be retained or
2374+ ;; # replaced later. I would guess that would be a bug.
2375+
2376+ -Wc,*)
2377+ func_stripname '-Wc,' '' "$arg"
2378+ args=$func_stripname_result
2379+ lastarg=
2380+ save_ifs="$IFS"; IFS=','
2381+ for arg in $args; do
2382+ IFS="$save_ifs"
2383+ func_append_quoted lastarg "$arg"
2384+ done
2385+ IFS="$save_ifs"
2386+ func_stripname ' ' '' "$lastarg"
2387+ lastarg=$func_stripname_result
2388+
2389+ # Add the arguments to base_compile.
2390+ func_append base_compile " $lastarg"
2391+ continue
2392+ ;;
2393+
2394+ *)
2395+ # Accept the current argument as the source file.
2396+ # The previous "srcfile" becomes the current argument.
2397+ #
2398+ lastarg="$srcfile"
2399+ srcfile="$arg"
2400+ ;;
2401+ esac # case $arg
2402+ ;;
2403+ esac # case $arg_mode
2404+
2405+ # Aesthetically quote the previous argument.
2406+ func_append_quoted base_compile "$lastarg"
2407+ done # for arg
2408+
2409+ case $arg_mode in
2410+ arg)
2411+ func_fatal_error "you must specify an argument for -Xcompile"
2412+ ;;
2413+ target)
2414+ func_fatal_error "you must specify a target with \`-o'"
2415+ ;;
2416+ *)
2417+ # Get the name of the library object.
2418+ test -z "$libobj" && {
2419+ func_basename "$srcfile"
2420+ libobj="$func_basename_result"
2421+ }
2422+ ;;
2423+ esac
2424+
2425+ # Recognize several different file suffixes.
2426+ # If the user specifies -o file.o, it is replaced with file.lo
2427+ case $libobj in
2428+ *.[cCFSifmso] | \
2429+ *.ada | *.adb | *.ads | *.asm | \
2430+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2431+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
2432+ func_xform "$libobj"
2433+ libobj=$func_xform_result
2434+ ;;
2435+ esac
2436+
2437+ case $libobj in
2438+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2439+ *)
2440+ func_fatal_error "cannot determine name of library object from \`$libobj'"
2441+ ;;
2442+ esac
2443+
2444+ func_infer_tag $base_compile
2445+
2446+ for arg in $later; do
2447+ case $arg in
2448+ -shared)
2449+ test "$build_libtool_libs" != yes && \
2450+ func_fatal_configuration "can not build a shared library"
2451+ build_old_libs=no
2452+ continue
2453+ ;;
2454+
2455+ -static)
2456+ build_libtool_libs=no
2457+ build_old_libs=yes
2458+ continue
2459+ ;;
2460+
2461+ -prefer-pic)
2462+ pic_mode=yes
2463+ continue
2464+ ;;
2465+
2466+ -prefer-non-pic)
2467+ pic_mode=no
2468+ continue
2469+ ;;
2470+ esac
2471+ done
2472+
2473+ func_quote_for_eval "$libobj"
2474+ test "X$libobj" != "X$func_quote_for_eval_result" \
2475+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2476+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
2477+ func_dirname_and_basename "$obj" "/" ""
2478+ objname="$func_basename_result"
2479+ xdir="$func_dirname_result"
2480+ lobj=${xdir}$objdir/$objname
2481+
2482+ test -z "$base_compile" && \
2483+ func_fatal_help "you must specify a compilation command"
2484+
2485+ # Delete any leftover library objects.
2486+ if test "$build_old_libs" = yes; then
2487+ removelist="$obj $lobj $libobj ${libobj}T"
2488+ else
2489+ removelist="$lobj $libobj ${libobj}T"
2490+ fi
2491+
2492+ # On Cygwin there's no "real" PIC flag so we must build both object types
2493+ case $host_os in
2494+ cygwin* | mingw* | pw32* | os2* | cegcc*)
2495+ pic_mode=default
2496+ ;;
2497+ esac
2498+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2499+ # non-PIC code in shared libraries is not supported
2500+ pic_mode=default
2501+ fi
2502+
2503+ # Calculate the filename of the output object if compiler does
2504+ # not support -o with -c
2505+ if test "$compiler_c_o" = no; then
2506+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2507+ lockfile="$output_obj.lock"
2508+ else
2509+ output_obj=
2510+ need_locks=no
2511+ lockfile=
2512+ fi
2513+
2514+ # Lock this critical section if it is needed
2515+ # We use this script file to make the link, it avoids creating a new file
2516+ if test "$need_locks" = yes; then
2517+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2518+ func_echo "Waiting for $lockfile to be removed"
2519+ sleep 2
2520+ done
2521+ elif test "$need_locks" = warn; then
2522+ if test -f "$lockfile"; then
2523+ $ECHO "\
2524+*** ERROR, $lockfile exists and contains:
2525+`cat $lockfile 2>/dev/null`
2526+
2527+This indicates that another process is trying to use the same
2528+temporary object file, and libtool could not work around it because
2529+your compiler does not support \`-c' and \`-o' together. If you
2530+repeat this compilation, it may succeed, by chance, but you had better
2531+avoid parallel builds (make -j) in this platform, or get a better
2532+compiler."
2533+
2534+ $opt_dry_run || $RM $removelist
2535+ exit $EXIT_FAILURE
2536+ fi
2537+ func_append removelist " $output_obj"
2538+ $ECHO "$srcfile" > "$lockfile"
2539+ fi
2540+
2541+ $opt_dry_run || $RM $removelist
2542+ func_append removelist " $lockfile"
2543+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2544+
2545+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2546+ srcfile=$func_to_tool_file_result
2547+ func_quote_for_eval "$srcfile"
2548+ qsrcfile=$func_quote_for_eval_result
2549+
2550+ # Only build a PIC object if we are building libtool libraries.
2551+ if test "$build_libtool_libs" = yes; then
2552+ # Without this assignment, base_compile gets emptied.
2553+ fbsd_hideous_sh_bug=$base_compile
2554+
2555+ if test "$pic_mode" != no; then
2556+ command="$base_compile $qsrcfile $pic_flag"
2557+ else
2558+ # Don't build PIC code
2559+ command="$base_compile $qsrcfile"
2560+ fi
2561+
2562+ func_mkdir_p "$xdir$objdir"
2563+
2564+ if test -z "$output_obj"; then
2565+ # Place PIC objects in $objdir
2566+ func_append command " -o $lobj"
2567+ fi
2568+
2569+ func_show_eval_locale "$command" \
2570+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2571+
2572+ if test "$need_locks" = warn &&
2573+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2574+ $ECHO "\
2575+*** ERROR, $lockfile contains:
2576+`cat $lockfile 2>/dev/null`
2577+
2578+but it should contain:
2579+$srcfile
2580+
2581+This indicates that another process is trying to use the same
2582+temporary object file, and libtool could not work around it because
2583+your compiler does not support \`-c' and \`-o' together. If you
2584+repeat this compilation, it may succeed, by chance, but you had better
2585+avoid parallel builds (make -j) in this platform, or get a better
2586+compiler."
2587+
2588+ $opt_dry_run || $RM $removelist
2589+ exit $EXIT_FAILURE
2590+ fi
2591+
2592+ # Just move the object if needed, then go on to compile the next one
2593+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2594+ func_show_eval '$MV "$output_obj" "$lobj"' \
2595+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2596+ fi
2597+
2598+ # Allow error messages only from the first compilation.
2599+ if test "$suppress_opt" = yes; then
2600+ suppress_output=' >/dev/null 2>&1'
2601+ fi
2602+ fi
2603+
2604+ # Only build a position-dependent object if we build old libraries.
2605+ if test "$build_old_libs" = yes; then
2606+ if test "$pic_mode" != yes; then
2607+ # Don't build PIC code
2608+ command="$base_compile $qsrcfile$pie_flag"
2609+ else
2610+ command="$base_compile $qsrcfile $pic_flag"
2611+ fi
2612+ if test "$compiler_c_o" = yes; then
2613+ func_append command " -o $obj"
2614+ fi
2615+
2616+ # Suppress compiler output if we already did a PIC compilation.
2617+ func_append command "$suppress_output"
2618+ func_show_eval_locale "$command" \
2619+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2620+
2621+ if test "$need_locks" = warn &&
2622+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2623+ $ECHO "\
2624+*** ERROR, $lockfile contains:
2625+`cat $lockfile 2>/dev/null`
2626+
2627+but it should contain:
2628+$srcfile
2629+
2630+This indicates that another process is trying to use the same
2631+temporary object file, and libtool could not work around it because
2632+your compiler does not support \`-c' and \`-o' together. If you
2633+repeat this compilation, it may succeed, by chance, but you had better
2634+avoid parallel builds (make -j) in this platform, or get a better
2635+compiler."
2636+
2637+ $opt_dry_run || $RM $removelist
2638+ exit $EXIT_FAILURE
2639+ fi
2640+
2641+ # Just move the object if needed
2642+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2643+ func_show_eval '$MV "$output_obj" "$obj"' \
2644+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2645+ fi
2646+ fi
2647+
2648+ $opt_dry_run || {
2649+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2650+
2651+ # Unlock the critical section if it was locked
2652+ if test "$need_locks" != no; then
2653+ removelist=$lockfile
2654+ $RM "$lockfile"
2655+ fi
2656+ }
2657+
2658+ exit $EXIT_SUCCESS
2659+}
2660+
2661+$opt_help || {
2662+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2663+}
2664+
2665+func_mode_help ()
2666+{
2667+ # We need to display help for each of the modes.
2668+ case $opt_mode in
2669+ "")
2670+ # Generic help is extracted from the usage comments
2671+ # at the start of this file.
2672+ func_help
2673+ ;;
2674+
2675+ clean)
2676+ $ECHO \
2677+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2678+
2679+Remove files from the build directory.
2680+
2681+RM is the name of the program to use to delete files associated with each FILE
2682+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2683+to RM.
2684+
2685+If FILE is a libtool library, object or program, all the files associated
2686+with it are deleted. Otherwise, only FILE itself is deleted using RM."
2687+ ;;
2688+
2689+ compile)
2690+ $ECHO \
2691+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2692+
2693+Compile a source file into a libtool library object.
2694+
2695+This mode accepts the following additional options:
2696+
2697+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2698+ -no-suppress do not suppress compiler output for multiple passes
2699+ -prefer-pic try to build PIC objects only
2700+ -prefer-non-pic try to build non-PIC objects only
2701+ -shared do not build a \`.o' file suitable for static linking
2702+ -static only build a \`.o' file suitable for static linking
2703+ -Wc,FLAG pass FLAG directly to the compiler
2704+
2705+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2706+from the given SOURCEFILE.
2707+
2708+The output file name is determined by removing the directory component from
2709+SOURCEFILE, then substituting the C source code suffix \`.c' with the
2710+library object suffix, \`.lo'."
2711+ ;;
2712+
2713+ execute)
2714+ $ECHO \
2715+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2716+
2717+Automatically set library path, then run a program.
2718+
2719+This mode accepts the following additional options:
2720+
2721+ -dlopen FILE add the directory containing FILE to the library path
2722+
2723+This mode sets the library path environment variable according to \`-dlopen'
2724+flags.
2725+
2726+If any of the ARGS are libtool executable wrappers, then they are translated
2727+into their corresponding uninstalled binary, and any of their required library
2728+directories are added to the library path.
2729+
2730+Then, COMMAND is executed, with ARGS as arguments."
2731+ ;;
2732+
2733+ finish)
2734+ $ECHO \
2735+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2736+
2737+Complete the installation of libtool libraries.
2738+
2739+Each LIBDIR is a directory that contains libtool libraries.
2740+
2741+The commands that this mode executes may require superuser privileges. Use
2742+the \`--dry-run' option if you just want to see what would be executed."
2743+ ;;
2744+
2745+ install)
2746+ $ECHO \
2747+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2748+
2749+Install executables or libraries.
2750+
2751+INSTALL-COMMAND is the installation command. The first component should be
2752+either the \`install' or \`cp' program.
2753+
2754+The following components of INSTALL-COMMAND are treated specially:
2755+
2756+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2757+
2758+The rest of the components are interpreted as arguments to that command (only
2759+BSD-compatible install options are recognized)."
2760+ ;;
2761+
2762+ link)
2763+ $ECHO \
2764+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2765+
2766+Link object files or libraries together to form another library, or to
2767+create an executable program.
2768+
2769+LINK-COMMAND is a command using the C compiler that you would use to create
2770+a program from several object files.
2771+
2772+The following components of LINK-COMMAND are treated specially:
2773+
2774+ -all-static do not do any dynamic linking at all
2775+ -avoid-version do not add a version suffix if possible
2776+ -bindir BINDIR specify path to binaries directory (for systems where
2777+ libraries must be found in the PATH setting at runtime)
2778+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2779+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2780+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2781+ -export-symbols SYMFILE
2782+ try to export only the symbols listed in SYMFILE
2783+ -export-symbols-regex REGEX
2784+ try to export only the symbols matching REGEX
2785+ -LLIBDIR search LIBDIR for required installed libraries
2786+ -lNAME OUTPUT-FILE requires the installed library libNAME
2787+ -module build a library that can dlopened
2788+ -no-fast-install disable the fast-install mode
2789+ -no-install link a not-installable executable
2790+ -no-undefined declare that a library does not refer to external symbols
2791+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2792+ -objectlist FILE Use a list of object files found in FILE to specify objects
2793+ -precious-files-regex REGEX
2794+ don't remove output files matching REGEX
2795+ -release RELEASE specify package release information
2796+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
2797+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2798+ -shared only do dynamic linking of libtool libraries
2799+ -shrext SUFFIX override the standard shared library file extension
2800+ -static do not do any dynamic linking of uninstalled libtool libraries
2801+ -static-libtool-libs
2802+ do not do any dynamic linking of libtool libraries
2803+ -version-info CURRENT[:REVISION[:AGE]]
2804+ specify library version info [each variable defaults to 0]
2805+ -weak LIBNAME declare that the target provides the LIBNAME interface
2806+ -Wc,FLAG
2807+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2808+ -Wl,FLAG
2809+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
2810+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2811+
2812+All other options (arguments beginning with \`-') are ignored.
2813+
2814+Every other argument is treated as a filename. Files ending in \`.la' are
2815+treated as uninstalled libtool libraries, other files are standard or library
2816+object files.
2817+
2818+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2819+only library objects (\`.lo' files) may be specified, and \`-rpath' is
2820+required, except when creating a convenience library.
2821+
2822+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2823+using \`ar' and \`ranlib', or on Windows using \`lib'.
2824+
2825+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2826+is created, otherwise an executable program is created."
2827+ ;;
2828+
2829+ uninstall)
2830+ $ECHO \
2831+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2832+
2833+Remove libraries from an installation directory.
2834+
2835+RM is the name of the program to use to delete files associated with each FILE
2836+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2837+to RM.
2838+
2839+If FILE is a libtool library, all the files associated with it are deleted.
2840+Otherwise, only FILE itself is deleted using RM."
2841+ ;;
2842+
2843+ *)
2844+ func_fatal_help "invalid operation mode \`$opt_mode'"
2845+ ;;
2846+ esac
2847+
2848+ echo
2849+ $ECHO "Try \`$progname --help' for more information about other modes."
2850+}
2851+
2852+# Now that we've collected a possible --mode arg, show help if necessary
2853+if $opt_help; then
2854+ if test "$opt_help" = :; then
2855+ func_mode_help
2856+ else
2857+ {
2858+ func_help noexit
2859+ for opt_mode in compile link execute install finish uninstall clean; do
2860+ func_mode_help
2861+ done
2862+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2863+ {
2864+ func_help noexit
2865+ for opt_mode in compile link execute install finish uninstall clean; do
2866+ echo
2867+ func_mode_help
2868+ done
2869+ } |
2870+ sed '1d
2871+ /^When reporting/,/^Report/{
2872+ H
2873+ d
2874+ }
2875+ $x
2876+ /information about other modes/d
2877+ /more detailed .*MODE/d
2878+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2879+ fi
2880+ exit $?
2881+fi
2882+
2883+
2884+# func_mode_execute arg...
2885+func_mode_execute ()
2886+{
2887+ $opt_debug
2888+ # The first argument is the command name.
2889+ cmd="$nonopt"
2890+ test -z "$cmd" && \
2891+ func_fatal_help "you must specify a COMMAND"
2892+
2893+ # Handle -dlopen flags immediately.
2894+ for file in $opt_dlopen; do
2895+ test -f "$file" \
2896+ || func_fatal_help "\`$file' is not a file"
2897+
2898+ dir=
2899+ case $file in
2900+ *.la)
2901+ func_resolve_sysroot "$file"
2902+ file=$func_resolve_sysroot_result
2903+
2904+ # Check to see that this really is a libtool archive.
2905+ func_lalib_unsafe_p "$file" \
2906+ || func_fatal_help "\`$lib' is not a valid libtool archive"
2907+
2908+ # Read the libtool library.
2909+ dlname=
2910+ library_names=
2911+ func_source "$file"
2912+
2913+ # Skip this library if it cannot be dlopened.
2914+ if test -z "$dlname"; then
2915+ # Warn if it was a shared library.
2916+ test -n "$library_names" && \
2917+ func_warning "\`$file' was not linked with \`-export-dynamic'"
2918+ continue
2919+ fi
2920+
2921+ func_dirname "$file" "" "."
2922+ dir="$func_dirname_result"
2923+
2924+ if test -f "$dir/$objdir/$dlname"; then
2925+ func_append dir "/$objdir"
2926+ else
2927+ if test ! -f "$dir/$dlname"; then
2928+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2929+ fi
2930+ fi
2931+ ;;
2932+
2933+ *.lo)
2934+ # Just add the directory containing the .lo file.
2935+ func_dirname "$file" "" "."
2936+ dir="$func_dirname_result"
2937+ ;;
2938+
2939+ *)
2940+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2941+ continue
2942+ ;;
2943+ esac
2944+
2945+ # Get the absolute pathname.
2946+ absdir=`cd "$dir" && pwd`
2947+ test -n "$absdir" && dir="$absdir"
2948+
2949+ # Now add the directory to shlibpath_var.
2950+ if eval "test -z \"\$$shlibpath_var\""; then
2951+ eval "$shlibpath_var=\"\$dir\""
2952+ else
2953+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2954+ fi
2955+ done
2956+
2957+ # This variable tells wrapper scripts just to set shlibpath_var
2958+ # rather than running their programs.
2959+ libtool_execute_magic="$magic"
2960+
2961+ # Check if any of the arguments is a wrapper script.
2962+ args=
2963+ for file
2964+ do
2965+ case $file in
2966+ -* | *.la | *.lo ) ;;
2967+ *)
2968+ # Do a test to see if this is really a libtool program.
2969+ if func_ltwrapper_script_p "$file"; then
2970+ func_source "$file"
2971+ # Transform arg to wrapped name.
2972+ file="$progdir/$program"
2973+ elif func_ltwrapper_executable_p "$file"; then
2974+ func_ltwrapper_scriptname "$file"
2975+ func_source "$func_ltwrapper_scriptname_result"
2976+ # Transform arg to wrapped name.
2977+ file="$progdir/$program"
2978+ fi
2979+ ;;
2980+ esac
2981+ # Quote arguments (to preserve shell metacharacters).
2982+ func_append_quoted args "$file"
2983+ done
2984+
2985+ if test "X$opt_dry_run" = Xfalse; then
2986+ if test -n "$shlibpath_var"; then
2987+ # Export the shlibpath_var.
2988+ eval "export $shlibpath_var"
2989+ fi
2990+
2991+ # Restore saved environment variables
2992+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2993+ do
2994+ eval "if test \"\${save_$lt_var+set}\" = set; then
2995+ $lt_var=\$save_$lt_var; export $lt_var
2996+ else
2997+ $lt_unset $lt_var
2998+ fi"
2999+ done
3000+
3001+ # Now prepare to actually exec the command.
3002+ exec_cmd="\$cmd$args"
3003+ else
3004+ # Display what would be done.
3005+ if test -n "$shlibpath_var"; then
3006+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3007+ echo "export $shlibpath_var"
3008+ fi
3009+ $ECHO "$cmd$args"
3010+ exit $EXIT_SUCCESS
3011+ fi
3012+}
3013+
3014+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3015+
3016+
3017+# func_mode_finish arg...
3018+func_mode_finish ()
3019+{
3020+ $opt_debug
3021+ libs=
3022+ libdirs=
3023+ admincmds=
3024+
3025+ for opt in "$nonopt" ${1+"$@"}
3026+ do
3027+ if test -d "$opt"; then
3028+ func_append libdirs " $opt"
3029+
3030+ elif test -f "$opt"; then
3031+ if func_lalib_unsafe_p "$opt"; then
3032+ func_append libs " $opt"
3033+ else
3034+ func_warning "\`$opt' is not a valid libtool archive"
3035+ fi
3036+
3037+ else
3038+ func_fatal_error "invalid argument \`$opt'"
3039+ fi
3040+ done
3041+
3042+ if test -n "$libs"; then
3043+ if test -n "$lt_sysroot"; then
3044+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3045+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3046+ else
3047+ sysroot_cmd=
3048+ fi
3049+
3050+ # Remove sysroot references
3051+ if $opt_dry_run; then
3052+ for lib in $libs; do
3053+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3054+ done
3055+ else
3056+ tmpdir=`func_mktempdir`
3057+ for lib in $libs; do
3058+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3059+ > $tmpdir/tmp-la
3060+ mv -f $tmpdir/tmp-la $lib
3061+ done
3062+ ${RM}r "$tmpdir"
3063+ fi
3064+ fi
3065+
3066+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3067+ for libdir in $libdirs; do
3068+ if test -n "$finish_cmds"; then
3069+ # Do each command in the finish commands.
3070+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3071+'"$cmd"'"'
3072+ fi
3073+ if test -n "$finish_eval"; then
3074+ # Do the single finish_eval.
3075+ eval cmds=\"$finish_eval\"
3076+ $opt_dry_run || eval "$cmds" || func_append admincmds "
3077+ $cmds"
3078+ fi
3079+ done
3080+ fi
3081+
3082+ # Exit here if they wanted silent mode.
3083+ $opt_silent && exit $EXIT_SUCCESS
3084+
3085+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3086+ echo "----------------------------------------------------------------------"
3087+ echo "Libraries have been installed in:"
3088+ for libdir in $libdirs; do
3089+ $ECHO " $libdir"
3090+ done
3091+ echo
3092+ echo "If you ever happen to want to link against installed libraries"
3093+ echo "in a given directory, LIBDIR, you must either use libtool, and"
3094+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3095+ echo "flag during linking and do at least one of the following:"
3096+ if test -n "$shlibpath_var"; then
3097+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3098+ echo " during execution"
3099+ fi
3100+ if test -n "$runpath_var"; then
3101+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
3102+ echo " during linking"
3103+ fi
3104+ if test -n "$hardcode_libdir_flag_spec"; then
3105+ libdir=LIBDIR
3106+ eval flag=\"$hardcode_libdir_flag_spec\"
3107+
3108+ $ECHO " - use the \`$flag' linker flag"
3109+ fi
3110+ if test -n "$admincmds"; then
3111+ $ECHO " - have your system administrator run these commands:$admincmds"
3112+ fi
3113+ if test -f /etc/ld.so.conf; then
3114+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3115+ fi
3116+ echo
3117+
3118+ echo "See any operating system documentation about shared libraries for"
3119+ case $host in
3120+ solaris2.[6789]|solaris2.1[0-9])
3121+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3122+ echo "pages."
3123+ ;;
3124+ *)
3125+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
3126+ ;;
3127+ esac
3128+ echo "----------------------------------------------------------------------"
3129+ fi
3130+ exit $EXIT_SUCCESS
3131+}
3132+
3133+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3134+
3135+
3136+# func_mode_install arg...
3137+func_mode_install ()
3138+{
3139+ $opt_debug
3140+ # There may be an optional sh(1) argument at the beginning of
3141+ # install_prog (especially on Windows NT).
3142+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3143+ # Allow the use of GNU shtool's install command.
3144+ case $nonopt in *shtool*) :;; *) false;; esac; then
3145+ # Aesthetically quote it.
3146+ func_quote_for_eval "$nonopt"
3147+ install_prog="$func_quote_for_eval_result "
3148+ arg=$1
3149+ shift
3150+ else
3151+ install_prog=
3152+ arg=$nonopt
3153+ fi
3154+
3155+ # The real first argument should be the name of the installation program.
3156+ # Aesthetically quote it.
3157+ func_quote_for_eval "$arg"
3158+ func_append install_prog "$func_quote_for_eval_result"
3159+ install_shared_prog=$install_prog
3160+ case " $install_prog " in
3161+ *[\\\ /]cp\ *) install_cp=: ;;
3162+ *) install_cp=false ;;
3163+ esac
3164+
3165+ # We need to accept at least all the BSD install flags.
3166+ dest=
3167+ files=
3168+ opts=
3169+ prev=
3170+ install_type=
3171+ isdir=no
3172+ stripme=
3173+ no_mode=:
3174+ for arg
3175+ do
3176+ arg2=
3177+ if test -n "$dest"; then
3178+ func_append files " $dest"
3179+ dest=$arg
3180+ continue
3181+ fi
3182+
3183+ case $arg in
3184+ -d) isdir=yes ;;
3185+ -f)
3186+ if $install_cp; then :; else
3187+ prev=$arg
3188+ fi
3189+ ;;
3190+ -g | -m | -o)
3191+ prev=$arg
3192+ ;;
3193+ -s)
3194+ stripme=" -s"
3195+ continue
3196+ ;;
3197+ -*)
3198+ ;;
3199+ *)
3200+ # If the previous option needed an argument, then skip it.
3201+ if test -n "$prev"; then
3202+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
3203+ arg2=$install_override_mode
3204+ no_mode=false
3205+ fi
3206+ prev=
3207+ else
3208+ dest=$arg
3209+ continue
3210+ fi
3211+ ;;
3212+ esac
3213+
3214+ # Aesthetically quote the argument.
3215+ func_quote_for_eval "$arg"
3216+ func_append install_prog " $func_quote_for_eval_result"
3217+ if test -n "$arg2"; then
3218+ func_quote_for_eval "$arg2"
3219+ fi
3220+ func_append install_shared_prog " $func_quote_for_eval_result"
3221+ done
3222+
3223+ test -z "$install_prog" && \
3224+ func_fatal_help "you must specify an install program"
3225+
3226+ test -n "$prev" && \
3227+ func_fatal_help "the \`$prev' option requires an argument"
3228+
3229+ if test -n "$install_override_mode" && $no_mode; then
3230+ if $install_cp; then :; else
3231+ func_quote_for_eval "$install_override_mode"
3232+ func_append install_shared_prog " -m $func_quote_for_eval_result"
3233+ fi
3234+ fi
3235+
3236+ if test -z "$files"; then
3237+ if test -z "$dest"; then
3238+ func_fatal_help "no file or destination specified"
3239+ else
3240+ func_fatal_help "you must specify a destination"
3241+ fi
3242+ fi
3243+
3244+ # Strip any trailing slash from the destination.
3245+ func_stripname '' '/' "$dest"
3246+ dest=$func_stripname_result
3247+
3248+ # Check to see that the destination is a directory.
3249+ test -d "$dest" && isdir=yes
3250+ if test "$isdir" = yes; then
3251+ destdir="$dest"
3252+ destname=
3253+ else
3254+ func_dirname_and_basename "$dest" "" "."
3255+ destdir="$func_dirname_result"
3256+ destname="$func_basename_result"
3257+
3258+ # Not a directory, so check to see that there is only one file specified.
3259+ set dummy $files; shift
3260+ test "$#" -gt 1 && \
3261+ func_fatal_help "\`$dest' is not a directory"
3262+ fi
3263+ case $destdir in
3264+ [\\/]* | [A-Za-z]:[\\/]*) ;;
3265+ *)
3266+ for file in $files; do
3267+ case $file in
3268+ *.lo) ;;
3269+ *)
3270+ func_fatal_help "\`$destdir' must be an absolute directory name"
3271+ ;;
3272+ esac
3273+ done
3274+ ;;
3275+ esac
3276+
3277+ # This variable tells wrapper scripts just to set variables rather
3278+ # than running their programs.
3279+ libtool_install_magic="$magic"
3280+
3281+ staticlibs=
3282+ future_libdirs=
3283+ current_libdirs=
3284+ for file in $files; do
3285+
3286+ # Do each installation.
3287+ case $file in
3288+ *.$libext)
3289+ # Do the static libraries later.
3290+ func_append staticlibs " $file"
3291+ ;;
3292+
3293+ *.la)
3294+ func_resolve_sysroot "$file"
3295+ file=$func_resolve_sysroot_result
3296+
3297+ # Check to see that this really is a libtool archive.
3298+ func_lalib_unsafe_p "$file" \
3299+ || func_fatal_help "\`$file' is not a valid libtool archive"
3300+
3301+ library_names=
3302+ old_library=
3303+ relink_command=
3304+ func_source "$file"
3305+
3306+ # Add the libdir to current_libdirs if it is the destination.
3307+ if test "X$destdir" = "X$libdir"; then
3308+ case "$current_libdirs " in
3309+ *" $libdir "*) ;;
3310+ *) func_append current_libdirs " $libdir" ;;
3311+ esac
3312+ else
3313+ # Note the libdir as a future libdir.
3314+ case "$future_libdirs " in
3315+ *" $libdir "*) ;;
3316+ *) func_append future_libdirs " $libdir" ;;
3317+ esac
3318+ fi
3319+
3320+ func_dirname "$file" "/" ""
3321+ dir="$func_dirname_result"
3322+ func_append dir "$objdir"
3323+
3324+ if test -n "$relink_command"; then
3325+ # Determine the prefix the user has applied to our future dir.
3326+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3327+
3328+ # Don't allow the user to place us outside of our expected
3329+ # location b/c this prevents finding dependent libraries that
3330+ # are installed to the same prefix.
3331+ # At present, this check doesn't affect windows .dll's that
3332+ # are installed into $libdir/../bin (currently, that works fine)
3333+ # but it's something to keep an eye on.
3334+ test "$inst_prefix_dir" = "$destdir" && \
3335+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3336+
3337+ if test -n "$inst_prefix_dir"; then
3338+ # Stick the inst_prefix_dir data into the link command.
3339+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3340+ else
3341+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3342+ fi
3343+
3344+ func_warning "relinking \`$file'"
3345+ func_show_eval "$relink_command" \
3346+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3347+ fi
3348+
3349+ # See the names of the shared library.
3350+ set dummy $library_names; shift
3351+ if test -n "$1"; then
3352+ realname="$1"
3353+ shift
3354+
3355+ srcname="$realname"
3356+ test -n "$relink_command" && srcname="$realname"T
3357+
3358+ # Install the shared library and build the symlinks.
3359+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3360+ 'exit $?'
3361+ tstripme="$stripme"
3362+ case $host_os in
3363+ cygwin* | mingw* | pw32* | cegcc*)
3364+ case $realname in
3365+ *.dll.a)
3366+ tstripme=""
3367+ ;;
3368+ esac
3369+ ;;
3370+ esac
3371+ if test -n "$tstripme" && test -n "$striplib"; then
3372+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
3373+ fi
3374+
3375+ if test "$#" -gt 0; then
3376+ # Delete the old symlinks, and create new ones.
3377+ # Try `ln -sf' first, because the `ln' binary might depend on
3378+ # the symlink we replace! Solaris /bin/ln does not understand -f,
3379+ # so we also need to try rm && ln -s.
3380+ for linkname
3381+ do
3382+ test "$linkname" != "$realname" \
3383+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3384+ done
3385+ fi
3386+
3387+ # Do each command in the postinstall commands.
3388+ lib="$destdir/$realname"
3389+ func_execute_cmds "$postinstall_cmds" 'exit $?'
3390+ fi
3391+
3392+ # Install the pseudo-library for information purposes.
3393+ func_basename "$file"
3394+ name="$func_basename_result"
3395+ instname="$dir/$name"i
3396+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3397+
3398+ # Maybe install the static library, too.
3399+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3400+ ;;
3401+
3402+ *.lo)
3403+ # Install (i.e. copy) a libtool object.
3404+
3405+ # Figure out destination file name, if it wasn't already specified.
3406+ if test -n "$destname"; then
3407+ destfile="$destdir/$destname"
3408+ else
3409+ func_basename "$file"
3410+ destfile="$func_basename_result"
3411+ destfile="$destdir/$destfile"
3412+ fi
3413+
3414+ # Deduce the name of the destination old-style object file.
3415+ case $destfile in
3416+ *.lo)
3417+ func_lo2o "$destfile"
3418+ staticdest=$func_lo2o_result
3419+ ;;
3420+ *.$objext)
3421+ staticdest="$destfile"
3422+ destfile=
3423+ ;;
3424+ *)
3425+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
3426+ ;;
3427+ esac
3428+
3429+ # Install the libtool object if requested.
3430+ test -n "$destfile" && \
3431+ func_show_eval "$install_prog $file $destfile" 'exit $?'
3432+
3433+ # Install the old object if enabled.
3434+ if test "$build_old_libs" = yes; then
3435+ # Deduce the name of the old-style object file.
3436+ func_lo2o "$file"
3437+ staticobj=$func_lo2o_result
3438+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3439+ fi
3440+ exit $EXIT_SUCCESS
3441+ ;;
3442+
3443+ *)
3444+ # Figure out destination file name, if it wasn't already specified.
3445+ if test -n "$destname"; then
3446+ destfile="$destdir/$destname"
3447+ else
3448+ func_basename "$file"
3449+ destfile="$func_basename_result"
3450+ destfile="$destdir/$destfile"
3451+ fi
3452+
3453+ # If the file is missing, and there is a .exe on the end, strip it
3454+ # because it is most likely a libtool script we actually want to
3455+ # install
3456+ stripped_ext=""
3457+ case $file in
3458+ *.exe)
3459+ if test ! -f "$file"; then
3460+ func_stripname '' '.exe' "$file"
3461+ file=$func_stripname_result
3462+ stripped_ext=".exe"
3463+ fi
3464+ ;;
3465+ esac
3466+
3467+ # Do a test to see if this is really a libtool program.
3468+ case $host in
3469+ *cygwin* | *mingw*)
3470+ if func_ltwrapper_executable_p "$file"; then
3471+ func_ltwrapper_scriptname "$file"
3472+ wrapper=$func_ltwrapper_scriptname_result
3473+ else
3474+ func_stripname '' '.exe' "$file"
3475+ wrapper=$func_stripname_result
3476+ fi
3477+ ;;
3478+ *)
3479+ wrapper=$file
3480+ ;;
3481+ esac
3482+ if func_ltwrapper_script_p "$wrapper"; then
3483+ notinst_deplibs=
3484+ relink_command=
3485+
3486+ func_source "$wrapper"
3487+
3488+ # Check the variables that should have been set.
3489+ test -z "$generated_by_libtool_version" && \
3490+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3491+
3492+ finalize=yes
3493+ for lib in $notinst_deplibs; do
3494+ # Check to see that each library is installed.
3495+ libdir=
3496+ if test -f "$lib"; then
3497+ func_source "$lib"
3498+ fi
3499+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3500+ if test -n "$libdir" && test ! -f "$libfile"; then
3501+ func_warning "\`$lib' has not been installed in \`$libdir'"
3502+ finalize=no
3503+ fi
3504+ done
3505+
3506+ relink_command=
3507+ func_source "$wrapper"
3508+
3509+ outputname=
3510+ if test "$fast_install" = no && test -n "$relink_command"; then
3511+ $opt_dry_run || {
3512+ if test "$finalize" = yes; then
3513+ tmpdir=`func_mktempdir`
3514+ func_basename "$file$stripped_ext"
3515+ file="$func_basename_result"
3516+ outputname="$tmpdir/$file"
3517+ # Replace the output file specification.
3518+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3519+
3520+ $opt_silent || {
3521+ func_quote_for_expand "$relink_command"
3522+ eval "func_echo $func_quote_for_expand_result"
3523+ }
3524+ if eval "$relink_command"; then :
3525+ else
3526+ func_error "error: relink \`$file' with the above command before installing it"
3527+ $opt_dry_run || ${RM}r "$tmpdir"
3528+ continue
3529+ fi
3530+ file="$outputname"
3531+ else
3532+ func_warning "cannot relink \`$file'"
3533+ fi
3534+ }
3535+ else
3536+ # Install the binary that we compiled earlier.
3537+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3538+ fi
3539+ fi
3540+
3541+ # remove .exe since cygwin /usr/bin/install will append another
3542+ # one anyway
3543+ case $install_prog,$host in
3544+ */usr/bin/install*,*cygwin*)
3545+ case $file:$destfile in
3546+ *.exe:*.exe)
3547+ # this is ok
3548+ ;;
3549+ *.exe:*)
3550+ destfile=$destfile.exe
3551+ ;;
3552+ *:*.exe)
3553+ func_stripname '' '.exe' "$destfile"
3554+ destfile=$func_stripname_result
3555+ ;;
3556+ esac
3557+ ;;
3558+ esac
3559+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3560+ $opt_dry_run || if test -n "$outputname"; then
3561+ ${RM}r "$tmpdir"
3562+ fi
3563+ ;;
3564+ esac
3565+ done
3566+
3567+ for file in $staticlibs; do
3568+ func_basename "$file"
3569+ name="$func_basename_result"
3570+
3571+ # Set up the ranlib parameters.
3572+ oldlib="$destdir/$name"
3573+
3574+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3575+
3576+ if test -n "$stripme" && test -n "$old_striplib"; then
3577+ func_show_eval "$old_striplib $oldlib" 'exit $?'
3578+ fi
3579+
3580+ # Do each command in the postinstall commands.
3581+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3582+ done
3583+
3584+ test -n "$future_libdirs" && \
3585+ func_warning "remember to run \`$progname --finish$future_libdirs'"
3586+
3587+ if test -n "$current_libdirs"; then
3588+ # Maybe just do a dry run.
3589+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
3590+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3591+ else
3592+ exit $EXIT_SUCCESS
3593+ fi
3594+}
3595+
3596+test "$opt_mode" = install && func_mode_install ${1+"$@"}
3597+
3598+
3599+# func_generate_dlsyms outputname originator pic_p
3600+# Extract symbols from dlprefiles and create ${outputname}S.o with
3601+# a dlpreopen symbol table.
3602+func_generate_dlsyms ()
3603+{
3604+ $opt_debug
3605+ my_outputname="$1"
3606+ my_originator="$2"
3607+ my_pic_p="${3-no}"
3608+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3609+ my_dlsyms=
3610+
3611+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3612+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
3613+ my_dlsyms="${my_outputname}S.c"
3614+ else
3615+ func_error "not configured to extract global symbols from dlpreopened files"
3616+ fi
3617+ fi
3618+
3619+ if test -n "$my_dlsyms"; then
3620+ case $my_dlsyms in
3621+ "") ;;
3622+ *.c)
3623+ # Discover the nlist of each of the dlfiles.
3624+ nlist="$output_objdir/${my_outputname}.nm"
3625+
3626+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3627+
3628+ # Parse the name list into a source file.
3629+ func_verbose "creating $output_objdir/$my_dlsyms"
3630+
3631+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3632+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3633+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3634+
3635+#ifdef __cplusplus
3636+extern \"C\" {
3637+#endif
3638+
3639+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3640+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3641+#endif
3642+
3643+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3644+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3645+/* DATA imports from DLLs on WIN32 con't be const, because runtime
3646+ relocations are performed -- see ld's documentation on pseudo-relocs. */
3647+# define LT_DLSYM_CONST
3648+#elif defined(__osf__)
3649+/* This system does not cope well with relocations in const data. */
3650+# define LT_DLSYM_CONST
3651+#else
3652+# define LT_DLSYM_CONST const
3653+#endif
3654+
3655+/* External symbol declarations for the compiler. */\
3656+"
3657+
3658+ if test "$dlself" = yes; then
3659+ func_verbose "generating symbol list for \`$output'"
3660+
3661+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3662+
3663+ # Add our own program objects to the symbol list.
3664+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3665+ for progfile in $progfiles; do
3666+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3667+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3668+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3669+ done
3670+
3671+ if test -n "$exclude_expsyms"; then
3672+ $opt_dry_run || {
3673+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3674+ eval '$MV "$nlist"T "$nlist"'
3675+ }
3676+ fi
3677+
3678+ if test -n "$export_symbols_regex"; then
3679+ $opt_dry_run || {
3680+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3681+ eval '$MV "$nlist"T "$nlist"'
3682+ }
3683+ fi
3684+
3685+ # Prepare the list of exported symbols
3686+ if test -z "$export_symbols"; then
3687+ export_symbols="$output_objdir/$outputname.exp"
3688+ $opt_dry_run || {
3689+ $RM $export_symbols
3690+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3691+ case $host in
3692+ *cygwin* | *mingw* | *cegcc* )
3693+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3694+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3695+ ;;
3696+ esac
3697+ }
3698+ else
3699+ $opt_dry_run || {
3700+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3701+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3702+ eval '$MV "$nlist"T "$nlist"'
3703+ case $host in
3704+ *cygwin* | *mingw* | *cegcc* )
3705+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3706+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3707+ ;;
3708+ esac
3709+ }
3710+ fi
3711+ fi
3712+
3713+ for dlprefile in $dlprefiles; do
3714+ func_verbose "extracting global C symbols from \`$dlprefile'"
3715+ func_basename "$dlprefile"
3716+ name="$func_basename_result"
3717+ case $host in
3718+ *cygwin* | *mingw* | *cegcc* )
3719+ # if an import library, we need to obtain dlname
3720+ if func_win32_import_lib_p "$dlprefile"; then
3721+ func_tr_sh "$dlprefile"
3722+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
3723+ dlprefile_dlbasename=""
3724+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3725+ # Use subshell, to avoid clobbering current variable values
3726+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3727+ if test -n "$dlprefile_dlname" ; then
3728+ func_basename "$dlprefile_dlname"
3729+ dlprefile_dlbasename="$func_basename_result"
3730+ else
3731+ # no lafile. user explicitly requested -dlpreopen <import library>.
3732+ $sharedlib_from_linklib_cmd "$dlprefile"
3733+ dlprefile_dlbasename=$sharedlib_from_linklib_result
3734+ fi
3735+ fi
3736+ $opt_dry_run || {
3737+ if test -n "$dlprefile_dlbasename" ; then
3738+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3739+ else
3740+ func_warning "Could not compute DLL name from $name"
3741+ eval '$ECHO ": $name " >> "$nlist"'
3742+ fi
3743+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3744+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3745+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3746+ }
3747+ else # not an import lib
3748+ $opt_dry_run || {
3749+ eval '$ECHO ": $name " >> "$nlist"'
3750+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3751+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3752+ }
3753+ fi
3754+ ;;
3755+ *)
3756+ $opt_dry_run || {
3757+ eval '$ECHO ": $name " >> "$nlist"'
3758+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3759+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3760+ }
3761+ ;;
3762+ esac
3763+ done
3764+
3765+ $opt_dry_run || {
3766+ # Make sure we have at least an empty file.
3767+ test -f "$nlist" || : > "$nlist"
3768+
3769+ if test -n "$exclude_expsyms"; then
3770+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3771+ $MV "$nlist"T "$nlist"
3772+ fi
3773+
3774+ # Try sorting and uniquifying the output.
3775+ if $GREP -v "^: " < "$nlist" |
3776+ if sort -k 3 </dev/null >/dev/null 2>&1; then
3777+ sort -k 3
3778+ else
3779+ sort +2
3780+ fi |
3781+ uniq > "$nlist"S; then
3782+ :
3783+ else
3784+ $GREP -v "^: " < "$nlist" > "$nlist"S
3785+ fi
3786+
3787+ if test -f "$nlist"S; then
3788+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3789+ else
3790+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3791+ fi
3792+
3793+ echo >> "$output_objdir/$my_dlsyms" "\
3794+
3795+/* The mapping between symbol names and symbols. */
3796+typedef struct {
3797+ const char *name;
3798+ void *address;
3799+} lt_dlsymlist;
3800+extern LT_DLSYM_CONST lt_dlsymlist
3801+lt_${my_prefix}_LTX_preloaded_symbols[];
3802+LT_DLSYM_CONST lt_dlsymlist
3803+lt_${my_prefix}_LTX_preloaded_symbols[] =
3804+{\
3805+ { \"$my_originator\", (void *) 0 },"
3806+
3807+ case $need_lib_prefix in
3808+ no)
3809+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3810+ ;;
3811+ *)
3812+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3813+ ;;
3814+ esac
3815+ echo >> "$output_objdir/$my_dlsyms" "\
3816+ {0, (void *) 0}
3817+};
3818+
3819+/* This works around a problem in FreeBSD linker */
3820+#ifdef FREEBSD_WORKAROUND
3821+static const void *lt_preloaded_setup() {
3822+ return lt_${my_prefix}_LTX_preloaded_symbols;
3823+}
3824+#endif
3825+
3826+#ifdef __cplusplus
3827+}
3828+#endif\
3829+"
3830+ } # !$opt_dry_run
3831+
3832+ pic_flag_for_symtable=
3833+ case "$compile_command " in
3834+ *" -static "*) ;;
3835+ *)
3836+ case $host in
3837+ # compiling the symbol table file with pic_flag works around
3838+ # a FreeBSD bug that causes programs to crash when -lm is
3839+ # linked before any other PIC object. But we must not use
3840+ # pic_flag when linking with -static. The problem exists in
3841+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3842+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3843+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3844+ *-*-hpux*)
3845+ pic_flag_for_symtable=" $pic_flag" ;;
3846+ *)
3847+ if test "X$my_pic_p" != Xno; then
3848+ pic_flag_for_symtable=" $pic_flag"
3849+ fi
3850+ ;;
3851+ esac
3852+ ;;
3853+ esac
3854+ symtab_cflags=
3855+ for arg in $LTCFLAGS; do
3856+ case $arg in
3857+ -pie | -fpie | -fPIE) ;;
3858+ *) func_append symtab_cflags " $arg" ;;
3859+ esac
3860+ done
3861+
3862+ # Now compile the dynamic symbol file.
3863+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3864+
3865+ # Clean up the generated files.
3866+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3867+
3868+ # Transform the symbol file into the correct name.
3869+ symfileobj="$output_objdir/${my_outputname}S.$objext"
3870+ case $host in
3871+ *cygwin* | *mingw* | *cegcc* )
3872+ if test -f "$output_objdir/$my_outputname.def"; then
3873+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3874+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3875+ else
3876+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3877+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3878+ fi
3879+ ;;
3880+ *)
3881+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3882+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3883+ ;;
3884+ esac
3885+ ;;
3886+ *)
3887+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
3888+ ;;
3889+ esac
3890+ else
3891+ # We keep going just in case the user didn't refer to
3892+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3893+ # really was required.
3894+
3895+ # Nullify the symbol file.
3896+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3897+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3898+ fi
3899+}
3900+
3901+# func_win32_libid arg
3902+# return the library type of file 'arg'
3903+#
3904+# Need a lot of goo to handle *both* DLLs and import libs
3905+# Has to be a shell function in order to 'eat' the argument
3906+# that is supplied when $file_magic_command is called.
3907+# Despite the name, also deal with 64 bit binaries.
3908+func_win32_libid ()
3909+{
3910+ $opt_debug
3911+ win32_libid_type="unknown"
3912+ win32_fileres=`file -L $1 2>/dev/null`
3913+ case $win32_fileres in
3914+ *ar\ archive\ import\ library*) # definitely import
3915+ win32_libid_type="x86 archive import"
3916+ ;;
3917+ *ar\ archive*) # could be an import, or static
3918+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3919+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3920+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3921+ func_to_tool_file "$1" func_convert_file_msys_to_w32
3922+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3923+ $SED -n -e '
3924+ 1,100{
3925+ / I /{
3926+ s,.*,import,
3927+ p
3928+ q
3929+ }
3930+ }'`
3931+ case $win32_nmres in
3932+ import*) win32_libid_type="x86 archive import";;
3933+ *) win32_libid_type="x86 archive static";;
3934+ esac
3935+ fi
3936+ ;;
3937+ *DLL*)
3938+ win32_libid_type="x86 DLL"
3939+ ;;
3940+ *executable*) # but shell scripts are "executable" too...
3941+ case $win32_fileres in
3942+ *MS\ Windows\ PE\ Intel*)
3943+ win32_libid_type="x86 DLL"
3944+ ;;
3945+ esac
3946+ ;;
3947+ esac
3948+ $ECHO "$win32_libid_type"
3949+}
3950+
3951+# func_cygming_dll_for_implib ARG
3952+#
3953+# Platform-specific function to extract the
3954+# name of the DLL associated with the specified
3955+# import library ARG.
3956+# Invoked by eval'ing the libtool variable
3957+# $sharedlib_from_linklib_cmd
3958+# Result is available in the variable
3959+# $sharedlib_from_linklib_result
3960+func_cygming_dll_for_implib ()
3961+{
3962+ $opt_debug
3963+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3964+}
3965+
3966+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3967+#
3968+# The is the core of a fallback implementation of a
3969+# platform-specific function to extract the name of the
3970+# DLL associated with the specified import library LIBNAME.
3971+#
3972+# SECTION_NAME is either .idata$6 or .idata$7, depending
3973+# on the platform and compiler that created the implib.
3974+#
3975+# Echos the name of the DLL associated with the
3976+# specified import library.
3977+func_cygming_dll_for_implib_fallback_core ()
3978+{
3979+ $opt_debug
3980+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3981+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3982+ $SED '/^Contents of section '"$match_literal"':/{
3983+ # Place marker at beginning of archive member dllname section
3984+ s/.*/====MARK====/
3985+ p
3986+ d
3987+ }
3988+ # These lines can sometimes be longer than 43 characters, but
3989+ # are always uninteresting
3990+ /:[ ]*file format pe[i]\{,1\}-/d
3991+ /^In archive [^:]*:/d
3992+ # Ensure marker is printed
3993+ /^====MARK====/p
3994+ # Remove all lines with less than 43 characters
3995+ /^.\{43\}/!d
3996+ # From remaining lines, remove first 43 characters
3997+ s/^.\{43\}//' |
3998+ $SED -n '
3999+ # Join marker and all lines until next marker into a single line
4000+ /^====MARK====/ b para
4001+ H
4002+ $ b para
4003+ b
4004+ :para
4005+ x
4006+ s/\n//g
4007+ # Remove the marker
4008+ s/^====MARK====//
4009+ # Remove trailing dots and whitespace
4010+ s/[\. \t]*$//
4011+ # Print
4012+ /./p' |
4013+ # we now have a list, one entry per line, of the stringified
4014+ # contents of the appropriate section of all members of the
4015+ # archive which possess that section. Heuristic: eliminate
4016+ # all those which have a first or second character that is
4017+ # a '.' (that is, objdump's representation of an unprintable
4018+ # character.) This should work for all archives with less than
4019+ # 0x302f exports -- but will fail for DLLs whose name actually
4020+ # begins with a literal '.' or a single character followed by
4021+ # a '.'.
4022+ #
4023+ # Of those that remain, print the first one.
4024+ $SED -e '/^\./d;/^.\./d;q'
4025+}
4026+
4027+# func_cygming_gnu_implib_p ARG
4028+# This predicate returns with zero status (TRUE) if
4029+# ARG is a GNU/binutils-style import library. Returns
4030+# with nonzero status (FALSE) otherwise.
4031+func_cygming_gnu_implib_p ()
4032+{
4033+ $opt_debug
4034+ func_to_tool_file "$1" func_convert_file_msys_to_w32
4035+ 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)$'`
4036+ test -n "$func_cygming_gnu_implib_tmp"
4037+}
4038+
4039+# func_cygming_ms_implib_p ARG
4040+# This predicate returns with zero status (TRUE) if
4041+# ARG is an MS-style import library. Returns
4042+# with nonzero status (FALSE) otherwise.
4043+func_cygming_ms_implib_p ()
4044+{
4045+ $opt_debug
4046+ func_to_tool_file "$1" func_convert_file_msys_to_w32
4047+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4048+ test -n "$func_cygming_ms_implib_tmp"
4049+}
4050+
4051+# func_cygming_dll_for_implib_fallback ARG
4052+# Platform-specific function to extract the
4053+# name of the DLL associated with the specified
4054+# import library ARG.
4055+#
4056+# This fallback implementation is for use when $DLLTOOL
4057+# does not support the --identify-strict option.
4058+# Invoked by eval'ing the libtool variable
4059+# $sharedlib_from_linklib_cmd
4060+# Result is available in the variable
4061+# $sharedlib_from_linklib_result
4062+func_cygming_dll_for_implib_fallback ()
4063+{
4064+ $opt_debug
4065+ if func_cygming_gnu_implib_p "$1" ; then
4066+ # binutils import library
4067+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4068+ elif func_cygming_ms_implib_p "$1" ; then
4069+ # ms-generated import library
4070+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4071+ else
4072+ # unknown
4073+ sharedlib_from_linklib_result=""
4074+ fi
4075+}
4076+
4077+
4078+# func_extract_an_archive dir oldlib
4079+func_extract_an_archive ()
4080+{
4081+ $opt_debug
4082+ f_ex_an_ar_dir="$1"; shift
4083+ f_ex_an_ar_oldlib="$1"
4084+ if test "$lock_old_archive_extraction" = yes; then
4085+ lockfile=$f_ex_an_ar_oldlib.lock
4086+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
4087+ func_echo "Waiting for $lockfile to be removed"
4088+ sleep 2
4089+ done
4090+ fi
4091+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4092+ 'stat=$?; rm -f "$lockfile"; exit $stat'
4093+ if test "$lock_old_archive_extraction" = yes; then
4094+ $opt_dry_run || rm -f "$lockfile"
4095+ fi
4096+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
4097+ :
4098+ else
4099+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
4100+ fi
4101+}
4102+
4103+
4104+# func_extract_archives gentop oldlib ...
4105+func_extract_archives ()
4106+{
4107+ $opt_debug
4108+ my_gentop="$1"; shift
4109+ my_oldlibs=${1+"$@"}
4110+ my_oldobjs=""
4111+ my_xlib=""
4112+ my_xabs=""
4113+ my_xdir=""
4114+
4115+ for my_xlib in $my_oldlibs; do
4116+ # Extract the objects.
4117+ case $my_xlib in
4118+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
4119+ *) my_xabs=`pwd`"/$my_xlib" ;;
4120+ esac
4121+ func_basename "$my_xlib"
4122+ my_xlib="$func_basename_result"
4123+ my_xlib_u=$my_xlib
4124+ while :; do
4125+ case " $extracted_archives " in
4126+ *" $my_xlib_u "*)
4127+ func_arith $extracted_serial + 1
4128+ extracted_serial=$func_arith_result
4129+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
4130+ *) break ;;
4131+ esac
4132+ done
4133+ extracted_archives="$extracted_archives $my_xlib_u"
4134+ my_xdir="$my_gentop/$my_xlib_u"
4135+
4136+ func_mkdir_p "$my_xdir"
4137+
4138+ case $host in
4139+ *-darwin*)
4140+ func_verbose "Extracting $my_xabs"
4141+ # Do not bother doing anything if just a dry run
4142+ $opt_dry_run || {
4143+ darwin_orig_dir=`pwd`
4144+ cd $my_xdir || exit $?
4145+ darwin_archive=$my_xabs
4146+ darwin_curdir=`pwd`
4147+ darwin_base_archive=`basename "$darwin_archive"`
4148+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4149+ if test -n "$darwin_arches"; then
4150+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4151+ darwin_arch=
4152+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
4153+ for darwin_arch in $darwin_arches ; do
4154+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4155+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4156+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4157+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
4158+ cd "$darwin_curdir"
4159+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
4160+ done # $darwin_arches
4161+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
4162+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
4163+ darwin_file=
4164+ darwin_files=
4165+ for darwin_file in $darwin_filelist; do
4166+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
4167+ $LIPO -create -output "$darwin_file" $darwin_files
4168+ done # $darwin_filelist
4169+ $RM -rf unfat-$$
4170+ cd "$darwin_orig_dir"
4171+ else
4172+ cd $darwin_orig_dir
4173+ func_extract_an_archive "$my_xdir" "$my_xabs"
4174+ fi # $darwin_arches
4175+ } # !$opt_dry_run
4176+ ;;
4177+ *)
4178+ func_extract_an_archive "$my_xdir" "$my_xabs"
4179+ ;;
4180+ esac
4181+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4182+ done
4183+
4184+ func_extract_archives_result="$my_oldobjs"
4185+}
4186+
4187+
4188+# func_emit_wrapper [arg=no]
4189+#
4190+# Emit a libtool wrapper script on stdout.
4191+# Don't directly open a file because we may want to
4192+# incorporate the script contents within a cygwin/mingw
4193+# wrapper executable. Must ONLY be called from within
4194+# func_mode_link because it depends on a number of variables
4195+# set therein.
4196+#
4197+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
4198+# variable will take. If 'yes', then the emitted script
4199+# will assume that the directory in which it is stored is
4200+# the $objdir directory. This is a cygwin/mingw-specific
4201+# behavior.
4202+func_emit_wrapper ()
4203+{
4204+ func_emit_wrapper_arg1=${1-no}
4205+
4206+ $ECHO "\
4207+#! $SHELL
4208+
4209+# $output - temporary wrapper script for $objdir/$outputname
4210+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4211+#
4212+# The $output program cannot be directly executed until all the libtool
4213+# libraries that it depends on are installed.
4214+#
4215+# This wrapper script should never be moved out of the build directory.
4216+# If it is, it will not operate correctly.
4217+
4218+# Sed substitution that helps us do robust quoting. It backslashifies
4219+# metacharacters that are still active within double-quoted strings.
4220+sed_quote_subst='$sed_quote_subst'
4221+
4222+# Be Bourne compatible
4223+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
4224+ emulate sh
4225+ NULLCMD=:
4226+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
4227+ # is contrary to our usage. Disable this feature.
4228+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
4229+ setopt NO_GLOB_SUBST
4230+else
4231+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
4232+fi
4233+BIN_SH=xpg4; export BIN_SH # for Tru64
4234+DUALCASE=1; export DUALCASE # for MKS sh
4235+
4236+# The HP-UX ksh and POSIX shell print the target directory to stdout
4237+# if CDPATH is set.
4238+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4239+
4240+relink_command=\"$relink_command\"
4241+
4242+# This environment variable determines our operation mode.
4243+if test \"\$libtool_install_magic\" = \"$magic\"; then
4244+ # install mode needs the following variables:
4245+ generated_by_libtool_version='$macro_version'
4246+ notinst_deplibs='$notinst_deplibs'
4247+else
4248+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
4249+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
4250+ file=\"\$0\""
4251+
4252+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
4253+ $ECHO "\
4254+
4255+# A function that is used when there is no print builtin or printf.
4256+func_fallback_echo ()
4257+{
4258+ eval 'cat <<_LTECHO_EOF
4259+\$1
4260+_LTECHO_EOF'
4261+}
4262+ ECHO=\"$qECHO\"
4263+ fi
4264+
4265+# Very basic option parsing. These options are (a) specific to
4266+# the libtool wrapper, (b) are identical between the wrapper
4267+# /script/ and the wrapper /executable/ which is used only on
4268+# windows platforms, and (c) all begin with the string "--lt-"
4269+# (application programs are unlikely to have options which match
4270+# this pattern).
4271+#
4272+# There are only two supported options: --lt-debug and
4273+# --lt-dump-script. There is, deliberately, no --lt-help.
4274+#
4275+# The first argument to this parsing function should be the
4276+# script's $0 value, followed by "$@".
4277+lt_option_debug=
4278+func_parse_lt_options ()
4279+{
4280+ lt_script_arg0=\$0
4281+ shift
4282+ for lt_opt
4283+ do
4284+ case \"\$lt_opt\" in
4285+ --lt-debug) lt_option_debug=1 ;;
4286+ --lt-dump-script)
4287+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
4288+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
4289+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
4290+ cat \"\$lt_dump_D/\$lt_dump_F\"
4291+ exit 0
4292+ ;;
4293+ --lt-*)
4294+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
4295+ exit 1
4296+ ;;
4297+ esac
4298+ done
4299+
4300+ # Print the debug banner immediately:
4301+ if test -n \"\$lt_option_debug\"; then
4302+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
4303+ fi
4304+}
4305+
4306+# Used when --lt-debug. Prints its arguments to stdout
4307+# (redirection is the responsibility of the caller)
4308+func_lt_dump_args ()
4309+{
4310+ lt_dump_args_N=1;
4311+ for lt_arg
4312+ do
4313+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
4314+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4315+ done
4316+}
4317+
4318+# Core function for launching the target application
4319+func_exec_program_core ()
4320+{
4321+"
4322+ case $host in
4323+ # Backslashes separate directories on plain windows
4324+ *-*-mingw | *-*-os2* | *-cegcc*)
4325+ $ECHO "\
4326+ if test -n \"\$lt_option_debug\"; then
4327+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
4328+ func_lt_dump_args \${1+\"\$@\"} 1>&2
4329+ fi
4330+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4331+"
4332+ ;;
4333+
4334+ *)
4335+ $ECHO "\
4336+ if test -n \"\$lt_option_debug\"; then
4337+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
4338+ func_lt_dump_args \${1+\"\$@\"} 1>&2
4339+ fi
4340+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
4341+"
4342+ ;;
4343+ esac
4344+ $ECHO "\
4345+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
4346+ exit 1
4347+}
4348+
4349+# A function to encapsulate launching the target application
4350+# Strips options in the --lt-* namespace from \$@ and
4351+# launches target application with the remaining arguments.
4352+func_exec_program ()
4353+{
4354+ for lt_wr_arg
4355+ do
4356+ case \$lt_wr_arg in
4357+ --lt-*) ;;
4358+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4359+ esac
4360+ shift
4361+ done
4362+ func_exec_program_core \${1+\"\$@\"}
4363+}
4364+
4365+ # Parse options
4366+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4367+
4368+ # Find the directory that this script lives in.
4369+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4370+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4371+
4372+ # Follow symbolic links until we get to the real thisdir.
4373+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4374+ while test -n \"\$file\"; do
4375+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4376+
4377+ # If there was a directory component, then change thisdir.
4378+ if test \"x\$destdir\" != \"x\$file\"; then
4379+ case \"\$destdir\" in
4380+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4381+ *) thisdir=\"\$thisdir/\$destdir\" ;;
4382+ esac
4383+ fi
4384+
4385+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4386+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4387+ done
4388+
4389+ # Usually 'no', except on cygwin/mingw when embedded into
4390+ # the cwrapper.
4391+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4392+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4393+ # special case for '.'
4394+ if test \"\$thisdir\" = \".\"; then
4395+ thisdir=\`pwd\`
4396+ fi
4397+ # remove .libs from thisdir
4398+ case \"\$thisdir\" in
4399+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4400+ $objdir ) thisdir=. ;;
4401+ esac
4402+ fi
4403+
4404+ # Try to get the absolute directory name.
4405+ absdir=\`cd \"\$thisdir\" && pwd\`
4406+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
4407+"
4408+
4409+ if test "$fast_install" = yes; then
4410+ $ECHO "\
4411+ program=lt-'$outputname'$exeext
4412+ progdir=\"\$thisdir/$objdir\"
4413+
4414+ if test ! -f \"\$progdir/\$program\" ||
4415+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4416+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4417+
4418+ file=\"\$\$-\$program\"
4419+
4420+ if test ! -d \"\$progdir\"; then
4421+ $MKDIR \"\$progdir\"
4422+ else
4423+ $RM \"\$progdir/\$file\"
4424+ fi"
4425+
4426+ $ECHO "\
4427+
4428+ # relink executable if necessary
4429+ if test -n \"\$relink_command\"; then
4430+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4431+ else
4432+ $ECHO \"\$relink_command_output\" >&2
4433+ $RM \"\$progdir/\$file\"
4434+ exit 1
4435+ fi
4436+ fi
4437+
4438+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4439+ { $RM \"\$progdir/\$program\";
4440+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4441+ $RM \"\$progdir/\$file\"
4442+ fi"
4443+ else
4444+ $ECHO "\
4445+ program='$outputname'
4446+ progdir=\"\$thisdir/$objdir\"
4447+"
4448+ fi
4449+
4450+ $ECHO "\
4451+
4452+ if test -f \"\$progdir/\$program\"; then"
4453+
4454+ # fixup the dll searchpath if we need to.
4455+ #
4456+ # Fix the DLL searchpath if we need to. Do this before prepending
4457+ # to shlibpath, because on Windows, both are PATH and uninstalled
4458+ # libraries must come first.
4459+ if test -n "$dllsearchpath"; then
4460+ $ECHO "\
4461+ # Add the dll search path components to the executable PATH
4462+ PATH=$dllsearchpath:\$PATH
4463+"
4464+ fi
4465+
4466+ # Export our shlibpath_var if we have one.
4467+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4468+ $ECHO "\
4469+ # Add our own library path to $shlibpath_var
4470+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4471+
4472+ # Some systems cannot cope with colon-terminated $shlibpath_var
4473+ # The second colon is a workaround for a bug in BeOS R4 sed
4474+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4475+
4476+ export $shlibpath_var
4477+"
4478+ fi
4479+
4480+ $ECHO "\
4481+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
4482+ # Run the actual program with our arguments.
4483+ func_exec_program \${1+\"\$@\"}
4484+ fi
4485+ else
4486+ # The program doesn't exist.
4487+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4488+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4489+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4490+ exit 1
4491+ fi
4492+fi\
4493+"
4494+}
4495+
4496+
4497+# func_emit_cwrapperexe_src
4498+# emit the source code for a wrapper executable on stdout
4499+# Must ONLY be called from within func_mode_link because
4500+# it depends on a number of variable set therein.
4501+func_emit_cwrapperexe_src ()
4502+{
4503+ cat <<EOF
4504+
4505+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4506+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4507+
4508+ The $output program cannot be directly executed until all the libtool
4509+ libraries that it depends on are installed.
4510+
4511+ This wrapper executable should never be moved out of the build directory.
4512+ If it is, it will not operate correctly.
4513+*/
4514+EOF
4515+ cat <<"EOF"
4516+#ifdef _MSC_VER
4517+# define _CRT_SECURE_NO_DEPRECATE 1
4518+#endif
4519+#include <stdio.h>
4520+#include <stdlib.h>
4521+#ifdef _MSC_VER
4522+# include <direct.h>
4523+# include <process.h>
4524+# include <io.h>
4525+#else
4526+# include <unistd.h>
4527+# include <stdint.h>
4528+# ifdef __CYGWIN__
4529+# include <io.h>
4530+# endif
4531+#endif
4532+#include <malloc.h>
4533+#include <stdarg.h>
4534+#include <assert.h>
4535+#include <string.h>
4536+#include <ctype.h>
4537+#include <errno.h>
4538+#include <fcntl.h>
4539+#include <sys/stat.h>
4540+
4541+/* declarations of non-ANSI functions */
4542+#if defined(__MINGW32__)
4543+# ifdef __STRICT_ANSI__
4544+int _putenv (const char *);
4545+# endif
4546+#elif defined(__CYGWIN__)
4547+# ifdef __STRICT_ANSI__
4548+char *realpath (const char *, char *);
4549+int putenv (char *);
4550+int setenv (const char *, const char *, int);
4551+# endif
4552+/* #elif defined (other platforms) ... */
4553+#endif
4554+
4555+/* portability defines, excluding path handling macros */
4556+#if defined(_MSC_VER)
4557+# define setmode _setmode
4558+# define stat _stat
4559+# define chmod _chmod
4560+# define getcwd _getcwd
4561+# define putenv _putenv
4562+# define S_IXUSR _S_IEXEC
4563+# ifndef _INTPTR_T_DEFINED
4564+# define _INTPTR_T_DEFINED
4565+# define intptr_t int
4566+# endif
4567+#elif defined(__MINGW32__)
4568+# define setmode _setmode
4569+# define stat _stat
4570+# define chmod _chmod
4571+# define getcwd _getcwd
4572+# define putenv _putenv
4573+#elif defined(__CYGWIN__)
4574+# define HAVE_SETENV
4575+# define FOPEN_WB "wb"
4576+/* #elif defined (other platforms) ... */
4577+#endif
4578+
4579+#if defined(PATH_MAX)
4580+# define LT_PATHMAX PATH_MAX
4581+#elif defined(MAXPATHLEN)
4582+# define LT_PATHMAX MAXPATHLEN
4583+#else
4584+# define LT_PATHMAX 1024
4585+#endif
4586+
4587+#ifndef S_IXOTH
4588+# define S_IXOTH 0
4589+#endif
4590+#ifndef S_IXGRP
4591+# define S_IXGRP 0
4592+#endif
4593+
4594+/* path handling portability macros */
4595+#ifndef DIR_SEPARATOR
4596+# define DIR_SEPARATOR '/'
4597+# define PATH_SEPARATOR ':'
4598+#endif
4599+
4600+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4601+ defined (__OS2__)
4602+# define HAVE_DOS_BASED_FILE_SYSTEM
4603+# define FOPEN_WB "wb"
4604+# ifndef DIR_SEPARATOR_2
4605+# define DIR_SEPARATOR_2 '\\'
4606+# endif
4607+# ifndef PATH_SEPARATOR_2
4608+# define PATH_SEPARATOR_2 ';'
4609+# endif
4610+#endif
4611+
4612+#ifndef DIR_SEPARATOR_2
4613+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4614+#else /* DIR_SEPARATOR_2 */
4615+# define IS_DIR_SEPARATOR(ch) \
4616+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4617+#endif /* DIR_SEPARATOR_2 */
4618+
4619+#ifndef PATH_SEPARATOR_2
4620+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4621+#else /* PATH_SEPARATOR_2 */
4622+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4623+#endif /* PATH_SEPARATOR_2 */
4624+
4625+#ifndef FOPEN_WB
4626+# define FOPEN_WB "w"
4627+#endif
4628+#ifndef _O_BINARY
4629+# define _O_BINARY 0
4630+#endif
4631+
4632+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4633+#define XFREE(stale) do { \
4634+ if (stale) { free ((void *) stale); stale = 0; } \
4635+} while (0)
4636+
4637+#if defined(LT_DEBUGWRAPPER)
4638+static int lt_debug = 1;
4639+#else
4640+static int lt_debug = 0;
4641+#endif
4642+
4643+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4644+
4645+void *xmalloc (size_t num);
4646+char *xstrdup (const char *string);
4647+const char *base_name (const char *name);
4648+char *find_executable (const char *wrapper);
4649+char *chase_symlinks (const char *pathspec);
4650+int make_executable (const char *path);
4651+int check_executable (const char *path);
4652+char *strendzap (char *str, const char *pat);
4653+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4654+void lt_fatal (const char *file, int line, const char *message, ...);
4655+static const char *nonnull (const char *s);
4656+static const char *nonempty (const char *s);
4657+void lt_setenv (const char *name, const char *value);
4658+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4659+void lt_update_exe_path (const char *name, const char *value);
4660+void lt_update_lib_path (const char *name, const char *value);
4661+char **prepare_spawn (char **argv);
4662+void lt_dump_script (FILE *f);
4663+EOF
4664+
4665+ cat <<EOF
4666+volatile const char * MAGIC_EXE = "$magic_exe";
4667+const char * LIB_PATH_VARNAME = "$shlibpath_var";
4668+EOF
4669+
4670+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4671+ func_to_host_path "$temp_rpath"
4672+ cat <<EOF
4673+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4674+EOF
4675+ else
4676+ cat <<"EOF"
4677+const char * LIB_PATH_VALUE = "";
4678+EOF
4679+ fi
4680+
4681+ if test -n "$dllsearchpath"; then
4682+ func_to_host_path "$dllsearchpath:"
4683+ cat <<EOF
4684+const char * EXE_PATH_VARNAME = "PATH";
4685+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4686+EOF
4687+ else
4688+ cat <<"EOF"
4689+const char * EXE_PATH_VARNAME = "";
4690+const char * EXE_PATH_VALUE = "";
4691+EOF
4692+ fi
4693+
4694+ if test "$fast_install" = yes; then
4695+ cat <<EOF
4696+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4697+EOF
4698+ else
4699+ cat <<EOF
4700+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4701+EOF
4702+ fi
4703+
4704+
4705+ cat <<"EOF"
4706+
4707+#define LTWRAPPER_OPTION_PREFIX "--lt-"
4708+
4709+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4710+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4711+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4712+
4713+int
4714+main (int argc, char *argv[])
4715+{
4716+ char **newargz;
4717+ int newargc;
4718+ char *tmp_pathspec;
4719+ char *actual_cwrapper_path;
4720+ char *actual_cwrapper_name;
4721+ char *target_name;
4722+ char *lt_argv_zero;
4723+ intptr_t rval = 127;
4724+
4725+ int i;
4726+
4727+ program_name = (char *) xstrdup (base_name (argv[0]));
4728+ newargz = XMALLOC (char *, argc + 1);
4729+
4730+ /* very simple arg parsing; don't want to rely on getopt
4731+ * also, copy all non cwrapper options to newargz, except
4732+ * argz[0], which is handled differently
4733+ */
4734+ newargc=0;
4735+ for (i = 1; i < argc; i++)
4736+ {
4737+ if (strcmp (argv[i], dumpscript_opt) == 0)
4738+ {
4739+EOF
4740+ case "$host" in
4741+ *mingw* | *cygwin* )
4742+ # make stdout use "unix" line endings
4743+ echo " setmode(1,_O_BINARY);"
4744+ ;;
4745+ esac
4746+
4747+ cat <<"EOF"
4748+ lt_dump_script (stdout);
4749+ return 0;
4750+ }
4751+ if (strcmp (argv[i], debug_opt) == 0)
4752+ {
4753+ lt_debug = 1;
4754+ continue;
4755+ }
4756+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4757+ {
4758+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4759+ namespace, but it is not one of the ones we know about and
4760+ have already dealt with, above (inluding dump-script), then
4761+ report an error. Otherwise, targets might begin to believe
4762+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4763+ namespace. The first time any user complains about this, we'll
4764+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4765+ or a configure.ac-settable value.
4766+ */
4767+ lt_fatal (__FILE__, __LINE__,
4768+ "unrecognized %s option: '%s'",
4769+ ltwrapper_option_prefix, argv[i]);
4770+ }
4771+ /* otherwise ... */
4772+ newargz[++newargc] = xstrdup (argv[i]);
4773+ }
4774+ newargz[++newargc] = NULL;
4775+
4776+EOF
4777+ cat <<EOF
4778+ /* The GNU banner must be the first non-error debug message */
4779+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4780+EOF
4781+ cat <<"EOF"
4782+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4783+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4784+
4785+ tmp_pathspec = find_executable (argv[0]);
4786+ if (tmp_pathspec == NULL)
4787+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4788+ lt_debugprintf (__FILE__, __LINE__,
4789+ "(main) found exe (before symlink chase) at: %s\n",
4790+ tmp_pathspec);
4791+
4792+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4793+ lt_debugprintf (__FILE__, __LINE__,
4794+ "(main) found exe (after symlink chase) at: %s\n",
4795+ actual_cwrapper_path);
4796+ XFREE (tmp_pathspec);
4797+
4798+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4799+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
4800+
4801+ /* wrapper name transforms */
4802+ strendzap (actual_cwrapper_name, ".exe");
4803+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4804+ XFREE (actual_cwrapper_name);
4805+ actual_cwrapper_name = tmp_pathspec;
4806+ tmp_pathspec = 0;
4807+
4808+ /* target_name transforms -- use actual target program name; might have lt- prefix */
4809+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4810+ strendzap (target_name, ".exe");
4811+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4812+ XFREE (target_name);
4813+ target_name = tmp_pathspec;
4814+ tmp_pathspec = 0;
4815+
4816+ lt_debugprintf (__FILE__, __LINE__,
4817+ "(main) libtool target name: %s\n",
4818+ target_name);
4819+EOF
4820+
4821+ cat <<EOF
4822+ newargz[0] =
4823+ XMALLOC (char, (strlen (actual_cwrapper_path) +
4824+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4825+ strcpy (newargz[0], actual_cwrapper_path);
4826+ strcat (newargz[0], "$objdir");
4827+ strcat (newargz[0], "/");
4828+EOF
4829+
4830+ cat <<"EOF"
4831+ /* stop here, and copy so we don't have to do this twice */
4832+ tmp_pathspec = xstrdup (newargz[0]);
4833+
4834+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4835+ strcat (newargz[0], actual_cwrapper_name);
4836+
4837+ /* DO want the lt- prefix here if it exists, so use target_name */
4838+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4839+ XFREE (tmp_pathspec);
4840+ tmp_pathspec = NULL;
4841+EOF
4842+
4843+ case $host_os in
4844+ mingw*)
4845+ cat <<"EOF"
4846+ {
4847+ char* p;
4848+ while ((p = strchr (newargz[0], '\\')) != NULL)
4849+ {
4850+ *p = '/';
4851+ }
4852+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4853+ {
4854+ *p = '/';
4855+ }
4856+ }
4857+EOF
4858+ ;;
4859+ esac
4860+
4861+ cat <<"EOF"
4862+ XFREE (target_name);
4863+ XFREE (actual_cwrapper_path);
4864+ XFREE (actual_cwrapper_name);
4865+
4866+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4867+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4868+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4869+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4870+ because on Windows, both *_VARNAMEs are PATH but uninstalled
4871+ libraries must come first. */
4872+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4873+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4874+
4875+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4876+ nonnull (lt_argv_zero));
4877+ for (i = 0; i < newargc; i++)
4878+ {
4879+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4880+ i, nonnull (newargz[i]));
4881+ }
4882+
4883+EOF
4884+
4885+ case $host_os in
4886+ mingw*)
4887+ cat <<"EOF"
4888+ /* execv doesn't actually work on mingw as expected on unix */
4889+ newargz = prepare_spawn (newargz);
4890+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4891+ if (rval == -1)
4892+ {
4893+ /* failed to start process */
4894+ lt_debugprintf (__FILE__, __LINE__,
4895+ "(main) failed to launch target \"%s\": %s\n",
4896+ lt_argv_zero, nonnull (strerror (errno)));
4897+ return 127;
4898+ }
4899+ return rval;
4900+EOF
4901+ ;;
4902+ *)
4903+ cat <<"EOF"
4904+ execv (lt_argv_zero, newargz);
4905+ return rval; /* =127, but avoids unused variable warning */
4906+EOF
4907+ ;;
4908+ esac
4909+
4910+ cat <<"EOF"
4911+}
4912+
4913+void *
4914+xmalloc (size_t num)
4915+{
4916+ void *p = (void *) malloc (num);
4917+ if (!p)
4918+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
4919+
4920+ return p;
4921+}
4922+
4923+char *
4924+xstrdup (const char *string)
4925+{
4926+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4927+ string) : NULL;
4928+}
4929+
4930+const char *
4931+base_name (const char *name)
4932+{
4933+ const char *base;
4934+
4935+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4936+ /* Skip over the disk name in MSDOS pathnames. */
4937+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4938+ name += 2;
4939+#endif
4940+
4941+ for (base = name; *name; name++)
4942+ if (IS_DIR_SEPARATOR (*name))
4943+ base = name + 1;
4944+ return base;
4945+}
4946+
4947+int
4948+check_executable (const char *path)
4949+{
4950+ struct stat st;
4951+
4952+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4953+ nonempty (path));
4954+ if ((!path) || (!*path))
4955+ return 0;
4956+
4957+ if ((stat (path, &st) >= 0)
4958+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4959+ return 1;
4960+ else
4961+ return 0;
4962+}
4963+
4964+int
4965+make_executable (const char *path)
4966+{
4967+ int rval = 0;
4968+ struct stat st;
4969+
4970+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4971+ nonempty (path));
4972+ if ((!path) || (!*path))
4973+ return 0;
4974+
4975+ if (stat (path, &st) >= 0)
4976+ {
4977+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4978+ }
4979+ return rval;
4980+}
4981+
4982+/* Searches for the full path of the wrapper. Returns
4983+ newly allocated full path name if found, NULL otherwise
4984+ Does not chase symlinks, even on platforms that support them.
4985+*/
4986+char *
4987+find_executable (const char *wrapper)
4988+{
4989+ int has_slash = 0;
4990+ const char *p;
4991+ const char *p_next;
4992+ /* static buffer for getcwd */
4993+ char tmp[LT_PATHMAX + 1];
4994+ int tmp_len;
4995+ char *concat_name;
4996+
4997+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4998+ nonempty (wrapper));
4999+
5000+ if ((wrapper == NULL) || (*wrapper == '\0'))
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: