Merge lp:~l3on/ubuntu/precise/anjuta-extras/new-version-3.3.4 into lp:ubuntu/precise/anjuta-extras

Proposed by Leo Iannacone on 2012-01-23
Status: Merged
Merged at revision: 10
Proposed branch: lp:~l3on/ubuntu/precise/anjuta-extras/new-version-3.3.4
Merge into: lp:ubuntu/precise/anjuta-extras
Diff against target: 37070 lines (+10885/-15628)
55 files modified
.pc/10_scratchbox_path.patch/plugins/scratchbox/anjuta-scratchbox.ui (+0/-214)
.pc/10_scratchbox_path.patch/plugins/scratchbox/plugin.c (+0/-569)
.pc/99_ltmain_as-needed.patch/ltmain.sh (+0/-8413)
.pc/applied-patches (+0/-2)
Makefile.am (+1/-1)
Makefile.in (+10/-2)
NEWS (+30/-0)
aclocal.m4 (+1344/-804)
config.guess (+120/-105)
config.sub (+101/-55)
configure (+2699/-1802)
configure.ac (+11/-2)
debian/changelog (+12/-0)
debian/control.in (+4/-3)
debian/patches/10_scratchbox_path.patch (+0/-22)
debian/patches/99_ltmain_as-needed.patch (+8/-4)
debian/patches/series (+0/-1)
gnome-doc-utils.make (+655/-0)
help/C/scintilla-plugin.page (+43/-0)
help/Makefile.am (+13/-0)
help/Makefile.in (+981/-0)
ltmain.sh (+2619/-1404)
plugins/Makefile.in (+9/-1)
plugins/sample1/Makefile.in (+9/-1)
plugins/sample1/anjuta-sample.plugin (+2/-0)
plugins/scintilla/Makefile.am (+13/-5)
plugins/scintilla/Makefile.in (+61/-38)
plugins/scintilla/aneditor.cxx (+132/-135)
plugins/scintilla/anjuta-editor-scintilla.gschema-part.xml (+0/-15)
plugins/scintilla/anjuta-editor-scintilla.ui (+52/-62)
plugins/scintilla/anjuta-editor.plugin (+4/-2)
plugins/scintilla/anjuta-scintilla.xml (+29/-0)
plugins/scintilla/org.gnome.anjuta.plugins.scintilla.gschema.xml.in (+151/-0)
plugins/scintilla/plugin.c (+152/-1)
plugins/scintilla/properties.h (+48/-7)
plugins/scintilla/properties/Makefile.in (+9/-1)
plugins/scintilla/scintilla/Makefile.am (+3/-1)
plugins/scintilla/scintilla/Makefile.in (+13/-3)
plugins/scintilla/scintilla/include/Makefile.in (+9/-1)
plugins/scintilla/style-editor.c (+235/-138)
plugins/scintilla/text_editor.c (+41/-2)
plugins/scintilla/text_editor.h (+16/-54)
plugins/scratchbox/Makefile.am (+9/-4)
plugins/scratchbox/Makefile.in (+19/-22)
plugins/scratchbox/anjuta-scratchbox.ui (+10/-30)
plugins/scratchbox/org.gnome.anjuta.plugins.scratchbox.gschema.xml.in (+17/-0)
plugins/scratchbox/plugin.c (+8/-8)
po/LINGUAS (+1/-0)
po/POTFILES.in (+2/-0)
po/cs.po (+88/-555)
po/eo.po (+165/-0)
po/ja.po (+463/-573)
po/sl.po (+455/-548)
scripts/Makefile.in (+9/-1)
scripts/build-schemas.mk (+0/-17)
To merge this branch: bzr merge lp:~l3on/ubuntu/precise/anjuta-extras/new-version-3.3.4
Reviewer Review Type Date Requested Status
Martin Pitt 2012-01-23 Approve on 2012-01-23
Review via email: mp+89672@code.launchpad.net

Description of the Change

Ubuntu has Anjuta version 3.3.4, but it's incompatible with the
current anjuta-extras version (3.2).

We need a release upgrade to make them work again.

anjuta-extras 3.3.4 downloaded from:
http://ftp.acc.umu.se/pub/GNOME/sources/anjuta-extras/3.3/

To post a comment you must log in.
Martin Pitt (pitti) wrote :

Thanks!

review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches

to all changes: