Merge lp:~noskcaj/ubuntu/trusty/libgweather/3.10.1 into lp:ubuntu/trusty/libgweather
- Trusty (14.04)
- 3.10.1
- Merge into trusty
Proposed by
Jackson Doak
Status: | Merged |
---|---|
Merge reported by: | Martin Pitt |
Merged at revision: | not available |
Proposed branch: | lp:~noskcaj/ubuntu/trusty/libgweather/3.10.1 |
Merge into: | lp:ubuntu/trusty/libgweather |
Diff against target: |
515364 lines (+200514/-172931) 165 files modified
.pc/0001-Don-t-crash-when-unsetting-the-location.patch/libgweather/location-entry.c (+0/-588) .pc/01_gettext_not_xml.patch/configure.ac (+0/-193) .pc/01_gettext_not_xml.patch/data/Makefile.am (+0/-78) .pc/01_gettext_not_xml.patch/libgweather/gweather-location.c (+0/-1085) .pc/01_gettext_not_xml.patch/libgweather/gweather-timezone.c (+0/-407) .pc/02_no_external_gettext.patch/configure.ac (+0/-182) .pc/99_ltmain_as-needed.patch/build-aux/ltmain.sh (+0/-9655) .pc/applied-patches (+0/-4) Makefile.am (+24/-15) Makefile.in (+30/-17) NEWS (+93/-28) aclocal.m4 (+102/-0) build-aux/ltmain.sh (+0/-14) config.h.in (+3/-0) configure (+991/-656) configure.ac (+65/-19) data/Locations.xml.in (+28/-31) data/Makefile.am (+21/-23) data/Makefile.in (+233/-87) data/check-timezones.sh (+1/-1) data/glade/Makefile.am (+15/-0) data/glade/Makefile.in (+574/-0) data/glade/libgweather.xml.in (+19/-0) debian/changelog (+39/-1) debian/control (+7/-4) debian/control.in (+5/-3) debian/libgweather-3-3.install (+0/-1) debian/libgweather-3-3.symbols (+0/-115) debian/libgweather-3-6.install (+1/-0) debian/libgweather-3-6.symbols (+108/-0) debian/libgweather-3-dev.install (+1/-0) debian/patches/0001-Don-t-crash-when-unsetting-the-location.patch (+0/-31) debian/patches/01_gettext_not_xml.patch (+0/-551) debian/patches/02_no_external_gettext.patch (+12/-10) debian/patches/series (+0/-2) debian/rules (+1/-1) doc/Makefile.in (+5/-2) doc/html/GWeatherLocation.html (+73/-43) doc/html/GWeatherLocationEntry.html (+21/-26) doc/html/GWeatherTimezone.html (+14/-11) doc/html/GWeatherTimezoneMenu.html (+23/-26) doc/html/annotation-glossary.html (+29/-26) doc/html/api-index-deprecated.html (+7/-7) doc/html/api-index-full.html (+46/-58) doc/html/ch01.html (+7/-7) doc/html/index.html (+1/-1) doc/html/index.sgml (+9/-14) doc/html/libgweather-GWeatherInfo.html (+109/-108) doc/html/libgweather.devhelp2 (+7/-12) doc/html/object-tree.html (+9/-8) doc/html/style.css (+16/-71) doc/libgweather-sections.txt (+7/-8) icons/Makefile.in (+5/-2) libgweather/Makefile.am (+22/-5) libgweather/Makefile.in (+69/-41) libgweather/gweather-enum-types.c (+17/-16) libgweather/gweather-enum-types.h (+2/-2) libgweather/gweather-enums.h (+6/-6) libgweather/gweather-location.c (+110/-111) libgweather/gweather-location.h (+5/-7) libgweather/gweather-timezone.c (+10/-16) libgweather/gweather-weather.h (+10/-6) libgweather/location-entry.c (+133/-45) libgweather/location-entry.h (+12/-10) libgweather/parser.c (+43/-113) libgweather/parser.h (+6/-7) libgweather/test_locations.c (+2/-5) libgweather/timezone-menu.c (+20/-16) libgweather/timezone-menu.h (+7/-4) libgweather/weather-bom.c (+0/-76) libgweather/weather-iwin.c (+23/-110) libgweather/weather-met.c (+0/-182) libgweather/weather-owm.c (+450/-0) libgweather/weather-priv.h (+13/-11) libgweather/weather-yahoo.c (+0/-11) libgweather/weather-yrno.c (+37/-26) libgweather/weather.c (+444/-173) po-locations/LINGUAS (+10/-1) po-locations/Makefile.am (+0/-11) po-locations/Makefile.in (+0/-512) po-locations/Makefile.in.in (+17/-12) po-locations/POTFILES.skip (+21/-0) po-locations/README.translators (+0/-42) po-locations/as.po (+29/-20) po-locations/ca.po (+25/-1702) po-locations/ca@valencia.po (+4098/-5673) po-locations/cs.po (+21/-13) po-locations/da.po (+14701/-19063) po-locations/es.po (+34/-17) po-locations/eu.po (+15440/-19346) po-locations/extract.xsl (+0/-56) po-locations/fi.po (+38/-27) po-locations/fr.po (+27/-13) po-locations/gl.po (+3495/-3479) po-locations/gu.po (+4/-8) po-locations/he.po (+19356/-14897) po-locations/hi.po (+28/-9) po-locations/hu.po (+30/-14) po-locations/id.po (+24/-16) po-locations/it.po (+3556/-3546) po-locations/kk.po (+19213/-0) po-locations/ko.po (+3794/-7979) po-locations/lt.po (+25/-14) po-locations/ml.po (+40/-18) po-locations/mr.po (+1/-1) po-locations/nb.po (+3552/-3542) po-locations/pa.po (+30/-21) po-locations/pl.po (+22/-14) po-locations/pt.po (+4106/-4013) po-locations/pt_BR.po (+28/-17) po-locations/regen.sh (+0/-41) po-locations/ru.po (+19356/-14877) po-locations/sk.po (+2065/-2588) po-locations/sl.po (+27/-19) po-locations/sr.po (+27/-16) po-locations/sr@latin.po (+27/-16) po-locations/ta.po (+19352/-14945) po-locations/zh_HK.po (+18443/-14082) po-locations/zh_TW.po (+18443/-14082) po/LINGUAS (+1/-0) po/POTFILES.in (+4/-0) po/af.po (+503/-523) po/as.po (+236/-230) po/be.po (+187/-214) po/ca.po (+188/-419) po/ca@valencia.po (+188/-419) po/cs.po (+188/-216) po/da.po (+225/-217) po/de.po (+258/-252) po/el.po (+207/-211) po/es.po (+233/-220) po/et.po (+1/-1) po/fr.po (+226/-213) po/gl.po (+139/-130) po/gu.po (+202/-247) po/he.po (+630/-218) po/hi.po (+173/-258) po/hu.po (+230/-229) po/id.po (+178/-206) po/it.po (+101/-128) po/kk.po (+710/-0) po/kn.po (+1/-1) po/ko.po (+194/-216) po/lt.po (+196/-215) po/lv.po (+289/-213) po/ml.po (+299/-374) po/mr.po (+2/-2) po/nb.po (+191/-217) po/pa.po (+241/-224) po/pl.po (+102/-129) po/pt.po (+219/-209) po/pt_BR.po (+150/-140) po/ru.po (+188/-215) po/sk.po (+189/-219) po/sl.po (+143/-133) po/sr.po (+213/-218) po/sr@latin.po (+213/-218) po/ta.po (+13730/-232) po/te.po (+56/-17) po/ug.po (+4708/-4699) po/zh_CN.po (+206/-218) po/zh_HK.po (+130/-132) po/zh_TW.po (+130/-132) schemas/Makefile.in (+5/-2) schemas/org.gnome.GWeather.gschema.xml (+4/-12) |
To merge this branch: | bzr merge lp:~noskcaj/ubuntu/trusty/libgweather/3.10.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pitt | Approve | ||
Review via email: mp+200210@code.launchpad.net |
Commit message
Description of the change
Merge from debian. Will require a minor transition, which has been fully handled by gnome upstream.
To post a comment you must log in.
Revision history for this message
Jackson Doak (noskcaj) wrote : | # |
I'll do the transition on monday when i have internet again
On Wed, Jan 15, 2014 at 11:36 PM, Martin Pitt <email address hidden>wrote:
> The proposal to merge lp:~noskcaj/ubuntu/trusty/libgweather/3.10.1 into
> lp:ubuntu/libgweather has been updated.
>
> Status: Needs review => Merged
>
> For more details, see:
>
> https:/
> --
>
> https:/
> You are the owner of lp:~noskcaj/ubuntu/trusty/libgweather/3.10.1.
>
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed directory '.pc/0001-Don-t-crash-when-unsetting-the-location.patch' |
2 | === removed directory '.pc/0001-Don-t-crash-when-unsetting-the-location.patch/libgweather' |
3 | === removed file '.pc/0001-Don-t-crash-when-unsetting-the-location.patch/libgweather/location-entry.c' |
4 | --- .pc/0001-Don-t-crash-when-unsetting-the-location.patch/libgweather/location-entry.c 2013-09-22 20:31:29 +0000 |
5 | +++ .pc/0001-Don-t-crash-when-unsetting-the-location.patch/libgweather/location-entry.c 1970-01-01 00:00:00 +0000 |
6 | @@ -1,588 +0,0 @@ |
7 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
8 | -/* location-entry.c - Location-selecting text entry |
9 | - * |
10 | - * Copyright 2008, Red Hat, Inc. |
11 | - * |
12 | - * This library is free software; you can redistribute it and/or |
13 | - * modify it under the terms of the GNU Lesser General Public License |
14 | - * as published by the Free Software Foundation; either version 2.1 of |
15 | - * the License, or (at your option) any later version. |
16 | - * |
17 | - * This library is distributed in the hope that it will be useful, but |
18 | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | - * Lesser General Public License for more details. |
21 | - * |
22 | - * You should have received a copy of the GNU Lesser General Public |
23 | - * License along with this library; if not, see |
24 | - * <http://www.gnu.org/licenses/>. |
25 | - */ |
26 | - |
27 | -#ifdef HAVE_CONFIG_H |
28 | -#include <config.h> |
29 | -#endif |
30 | - |
31 | -#include <string.h> |
32 | - |
33 | -#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE |
34 | -#include "location-entry.h" |
35 | -#include "weather-priv.h" |
36 | - |
37 | -/** |
38 | - * SECTION:gweatherlocationentry |
39 | - * @Title: GWeatherLocationEntry |
40 | - * |
41 | - * A subclass of #GtkEntry that provides autocompletion on |
42 | - * #GWeatherLocation<!-- -->s |
43 | - */ |
44 | - |
45 | -G_DEFINE_TYPE (GWeatherLocationEntry, gweather_location_entry, GTK_TYPE_ENTRY) |
46 | - |
47 | -enum { |
48 | - PROP_0, |
49 | - |
50 | - PROP_TOP, |
51 | - PROP_LOCATION, |
52 | - |
53 | - LAST_PROP |
54 | -}; |
55 | - |
56 | -static void gweather_location_entry_build_model (GWeatherLocationEntry *entry, |
57 | - GWeatherLocation *top); |
58 | -static void set_property (GObject *object, guint prop_id, |
59 | - const GValue *value, GParamSpec *pspec); |
60 | -static void get_property (GObject *object, guint prop_id, |
61 | - GValue *value, GParamSpec *pspec); |
62 | - |
63 | -enum |
64 | -{ |
65 | - GWEATHER_LOCATION_ENTRY_COL_DISPLAY_NAME = 0, |
66 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, |
67 | - GWEATHER_LOCATION_ENTRY_COL_COMPARE_NAME, |
68 | - GWEATHER_LOCATION_ENTRY_COL_SORT_NAME, |
69 | - GWEATHER_LOCATION_ENTRY_NUM_COLUMNS |
70 | -}; |
71 | - |
72 | -static gboolean matcher (GtkEntryCompletion *completion, const char *key, |
73 | - GtkTreeIter *iter, gpointer user_data); |
74 | -static gboolean match_selected (GtkEntryCompletion *completion, |
75 | - GtkTreeModel *model, |
76 | - GtkTreeIter *iter, |
77 | - gpointer entry); |
78 | -static void entry_changed (GWeatherLocationEntry *entry); |
79 | - |
80 | -static void |
81 | -gweather_location_entry_init (GWeatherLocationEntry *entry) |
82 | -{ |
83 | - GtkEntryCompletion *completion; |
84 | - |
85 | - completion = gtk_entry_completion_new (); |
86 | - |
87 | - gtk_entry_completion_set_popup_set_width (completion, FALSE); |
88 | - gtk_entry_completion_set_text_column (completion, GWEATHER_LOCATION_ENTRY_COL_DISPLAY_NAME); |
89 | - gtk_entry_completion_set_match_func (completion, matcher, NULL, NULL); |
90 | - |
91 | - g_signal_connect (completion, "match_selected", |
92 | - G_CALLBACK (match_selected), entry); |
93 | - |
94 | - gtk_entry_set_completion (GTK_ENTRY (entry), completion); |
95 | - g_object_unref (completion); |
96 | - |
97 | - entry->custom_text = FALSE; |
98 | - g_signal_connect (entry, "changed", |
99 | - G_CALLBACK (entry_changed), NULL); |
100 | -} |
101 | - |
102 | -static void |
103 | -finalize (GObject *object) |
104 | -{ |
105 | - GWeatherLocationEntry *entry = GWEATHER_LOCATION_ENTRY (object); |
106 | - |
107 | - if (entry->location) |
108 | - gweather_location_unref (entry->location); |
109 | - if (entry->top) |
110 | - gweather_location_unref (entry->top); |
111 | - |
112 | - G_OBJECT_CLASS (gweather_location_entry_parent_class)->finalize (object); |
113 | -} |
114 | - |
115 | -static void |
116 | -gweather_location_entry_class_init (GWeatherLocationEntryClass *location_entry_class) |
117 | -{ |
118 | - GObjectClass *object_class = G_OBJECT_CLASS (location_entry_class); |
119 | - |
120 | - object_class->finalize = finalize; |
121 | - object_class->set_property = set_property; |
122 | - object_class->get_property = get_property; |
123 | - |
124 | - /* properties */ |
125 | - g_object_class_install_property ( |
126 | - object_class, PROP_TOP, |
127 | - g_param_spec_boxed ("top", |
128 | - "Top Location", |
129 | - "The GWeatherLocation whose children will be used to fill in the entry", |
130 | - GWEATHER_TYPE_LOCATION, |
131 | - G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
132 | - g_object_class_install_property ( |
133 | - object_class, PROP_LOCATION, |
134 | - g_param_spec_boxed ("location", |
135 | - "Location", |
136 | - "The selected GWeatherLocation", |
137 | - GWEATHER_TYPE_LOCATION, |
138 | - G_PARAM_READWRITE)); |
139 | -} |
140 | - |
141 | -static void |
142 | -set_property (GObject *object, guint prop_id, |
143 | - const GValue *value, GParamSpec *pspec) |
144 | -{ |
145 | - switch (prop_id) { |
146 | - case PROP_TOP: |
147 | - gweather_location_entry_build_model (GWEATHER_LOCATION_ENTRY (object), |
148 | - g_value_get_boxed (value)); |
149 | - break; |
150 | - case PROP_LOCATION: |
151 | - gweather_location_entry_set_location (GWEATHER_LOCATION_ENTRY (object), |
152 | - g_value_get_boxed (value)); |
153 | - break; |
154 | - default: |
155 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
156 | - break; |
157 | - } |
158 | -} |
159 | - |
160 | -static void |
161 | -get_property (GObject *object, guint prop_id, |
162 | - GValue *value, GParamSpec *pspec) |
163 | -{ |
164 | - GWeatherLocationEntry *entry = GWEATHER_LOCATION_ENTRY (object); |
165 | - |
166 | - switch (prop_id) { |
167 | - case PROP_LOCATION: |
168 | - g_value_set_boxed (value, entry->location); |
169 | - break; |
170 | - default: |
171 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
172 | - break; |
173 | - } |
174 | -} |
175 | - |
176 | -static void |
177 | -entry_changed (GWeatherLocationEntry *entry) |
178 | -{ |
179 | - entry->custom_text = TRUE; |
180 | -} |
181 | - |
182 | -static void |
183 | -set_location_internal (GWeatherLocationEntry *entry, |
184 | - GtkTreeModel *model, |
185 | - GtkTreeIter *iter, |
186 | - GWeatherLocation *loc) |
187 | -{ |
188 | - char *name; |
189 | - |
190 | - if (entry->location) |
191 | - gweather_location_unref (entry->location); |
192 | - |
193 | - g_assert (iter == NULL || loc == NULL); |
194 | - |
195 | - if (iter) { |
196 | - gtk_tree_model_get (model, iter, |
197 | - GWEATHER_LOCATION_ENTRY_COL_DISPLAY_NAME, &name, |
198 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, &loc, |
199 | - -1); |
200 | - entry->location = gweather_location_ref (loc); |
201 | - gtk_entry_set_text (GTK_ENTRY (entry), name); |
202 | - entry->custom_text = FALSE; |
203 | - g_free (name); |
204 | - } else if (loc) { |
205 | - entry->location = gweather_location_ref (loc); |
206 | - gtk_entry_set_text (GTK_ENTRY (entry), loc->name); |
207 | - entry->custom_text = TRUE; |
208 | - } else { |
209 | - entry->location = NULL; |
210 | - gtk_entry_set_text (GTK_ENTRY (entry), ""); |
211 | - entry->custom_text = TRUE; |
212 | - } |
213 | - |
214 | - gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); |
215 | - g_object_notify (G_OBJECT (entry), "location"); |
216 | -} |
217 | - |
218 | -/** |
219 | - * gweather_location_entry_set_location: |
220 | - * @entry: a #GWeatherLocationEntry |
221 | - * @loc: (allow-none): a #GWeatherLocation in @entry, or %NULL to |
222 | - * clear @entry |
223 | - * |
224 | - * Sets @entry's location to @loc, and updates the text of the |
225 | - * entry accordingly. |
226 | - * Note that if the database contains a location that compares |
227 | - * equal to @loc, that will be chosen in place of @loc. |
228 | - **/ |
229 | -void |
230 | -gweather_location_entry_set_location (GWeatherLocationEntry *entry, |
231 | - GWeatherLocation *loc) |
232 | -{ |
233 | - GtkEntryCompletion *completion; |
234 | - GtkTreeModel *model; |
235 | - GtkTreeIter iter; |
236 | - GWeatherLocation *cmploc; |
237 | - |
238 | - g_return_if_fail (GWEATHER_IS_LOCATION_ENTRY (entry)); |
239 | - |
240 | - completion = gtk_entry_get_completion (GTK_ENTRY (entry)); |
241 | - model = gtk_entry_completion_get_model (completion); |
242 | - |
243 | - gtk_tree_model_get_iter_first (model, &iter); |
244 | - do { |
245 | - gtk_tree_model_get (model, &iter, |
246 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, &cmploc, |
247 | - -1); |
248 | - if (gweather_location_equal (loc, cmploc)) { |
249 | - set_location_internal (entry, model, &iter, NULL); |
250 | - return; |
251 | - } |
252 | - } while (gtk_tree_model_iter_next (model, &iter)); |
253 | - |
254 | - set_location_internal (entry, model, NULL, loc); |
255 | -} |
256 | - |
257 | -/** |
258 | - * gweather_location_entry_get_location: |
259 | - * @entry: a #GWeatherLocationEntry |
260 | - * |
261 | - * Gets the location that was set by a previous call to |
262 | - * gweather_location_entry_set_location() or was selected by the user. |
263 | - * |
264 | - * Return value: (transfer full) (allow-none): the selected location |
265 | - * (which you must unref when you are done with it), or %NULL if no |
266 | - * location is selected. |
267 | - **/ |
268 | -GWeatherLocation * |
269 | -gweather_location_entry_get_location (GWeatherLocationEntry *entry) |
270 | -{ |
271 | - g_return_val_if_fail (GWEATHER_IS_LOCATION_ENTRY (entry), NULL); |
272 | - |
273 | - if (entry->location) |
274 | - return gweather_location_ref (entry->location); |
275 | - else |
276 | - return NULL; |
277 | -} |
278 | - |
279 | -/** |
280 | - * gweather_location_entry_has_custom_text: |
281 | - * @entry: a #GWeatherLocationEntry |
282 | - * |
283 | - * Checks whether or not @entry's text has been modified by the user. |
284 | - * Note that this does not mean that no location is associated with @entry. |
285 | - * gweather_location_entry_get_location() should be used for this. |
286 | - * |
287 | - * Return value: %TRUE if @entry's text was modified by the user, or %FALSE if |
288 | - * it's set to the default text of a location. |
289 | - **/ |
290 | -gboolean |
291 | -gweather_location_entry_has_custom_text (GWeatherLocationEntry *entry) |
292 | -{ |
293 | - g_return_val_if_fail (GWEATHER_IS_LOCATION_ENTRY (entry), FALSE); |
294 | - |
295 | - return entry->custom_text; |
296 | -} |
297 | - |
298 | -/** |
299 | - * gweather_location_entry_set_city: |
300 | - * @entry: a #GWeatherLocationEntry |
301 | - * @city_name: (allow-none): the city name, or %NULL |
302 | - * @code: the METAR station code |
303 | - * |
304 | - * Sets @entry's location to a city with the given @code, and given |
305 | - * @city_name, if non-%NULL. If there is no matching city, sets |
306 | - * @entry's location to %NULL. |
307 | - * |
308 | - * Return value: %TRUE if @entry's location could be set to a matching city, |
309 | - * %FALSE otherwise. |
310 | - **/ |
311 | -gboolean |
312 | -gweather_location_entry_set_city (GWeatherLocationEntry *entry, |
313 | - const char *city_name, |
314 | - const char *code) |
315 | -{ |
316 | - GtkEntryCompletion *completion; |
317 | - GtkTreeModel *model; |
318 | - GtkTreeIter iter; |
319 | - GWeatherLocation *cmploc; |
320 | - const char *cmpcode; |
321 | - char *cmpname; |
322 | - |
323 | - g_return_val_if_fail (GWEATHER_IS_LOCATION_ENTRY (entry), FALSE); |
324 | - g_return_val_if_fail (code != NULL, FALSE); |
325 | - |
326 | - completion = gtk_entry_get_completion (GTK_ENTRY (entry)); |
327 | - model = gtk_entry_completion_get_model (completion); |
328 | - |
329 | - gtk_tree_model_get_iter_first (model, &iter); |
330 | - do { |
331 | - gtk_tree_model_get (model, &iter, |
332 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, &cmploc, |
333 | - -1); |
334 | - |
335 | - cmpcode = gweather_location_get_code (cmploc); |
336 | - if (!cmpcode || strcmp (cmpcode, code) != 0) |
337 | - continue; |
338 | - |
339 | - if (city_name) { |
340 | - cmpname = gweather_location_get_city_name (cmploc); |
341 | - if (!cmpname || strcmp (cmpname, city_name) != 0) { |
342 | - g_free (cmpname); |
343 | - continue; |
344 | - } |
345 | - g_free (cmpname); |
346 | - } |
347 | - |
348 | - set_location_internal (entry, model, &iter, NULL); |
349 | - return TRUE; |
350 | - } while (gtk_tree_model_iter_next (model, &iter)); |
351 | - |
352 | - set_location_internal (entry, model, NULL, NULL); |
353 | - |
354 | - return FALSE; |
355 | -} |
356 | - |
357 | -static void |
358 | -fill_location_entry_model (GtkTreeStore *store, GWeatherLocation *loc, |
359 | - const char *parent_display_name, |
360 | - const char *parent_compare_name) |
361 | -{ |
362 | - GWeatherLocation **children; |
363 | - char *display_name, *compare_name; |
364 | - GtkTreeIter iter; |
365 | - int i; |
366 | - |
367 | - children = gweather_location_get_children (loc); |
368 | - |
369 | - switch (gweather_location_get_level (loc)) { |
370 | - case GWEATHER_LOCATION_WORLD: |
371 | - case GWEATHER_LOCATION_REGION: |
372 | - case GWEATHER_LOCATION_ADM2: |
373 | - /* Ignore these levels of hierarchy; just recurse, passing on |
374 | - * the names from the parent node. |
375 | - */ |
376 | - for (i = 0; children[i]; i++) { |
377 | - fill_location_entry_model (store, children[i], |
378 | - parent_display_name, |
379 | - parent_compare_name); |
380 | - } |
381 | - break; |
382 | - |
383 | - case GWEATHER_LOCATION_COUNTRY: |
384 | - /* Recurse, initializing the names to the country name */ |
385 | - for (i = 0; children[i]; i++) { |
386 | - fill_location_entry_model (store, children[i], |
387 | - gweather_location_get_name (loc), |
388 | - gweather_location_get_sort_name (loc)); |
389 | - } |
390 | - break; |
391 | - |
392 | - case GWEATHER_LOCATION_ADM1: |
393 | - /* Recurse, adding the ADM1 name to the country name */ |
394 | - display_name = g_strdup_printf ("%s, %s", gweather_location_get_name (loc), parent_display_name); |
395 | - compare_name = g_strdup_printf ("%s, %s", gweather_location_get_sort_name (loc), parent_compare_name); |
396 | - |
397 | - for (i = 0; children[i]; i++) { |
398 | - fill_location_entry_model (store, children[i], |
399 | - display_name, compare_name); |
400 | - } |
401 | - |
402 | - g_free (display_name); |
403 | - g_free (compare_name); |
404 | - break; |
405 | - |
406 | - case GWEATHER_LOCATION_CITY: |
407 | - if (children[0] && children[1]) { |
408 | - /* If there are multiple (<location>) children, add a line |
409 | - * for each of them. |
410 | - */ |
411 | - for (i = 0; children[i]; i++) { |
412 | - display_name = g_strdup_printf ("%s (%s), %s", |
413 | - gweather_location_get_name (loc), |
414 | - gweather_location_get_name (children[i]), |
415 | - parent_display_name); |
416 | - compare_name = g_strdup_printf ("%s (%s), %s", |
417 | - gweather_location_get_sort_name (loc), |
418 | - gweather_location_get_sort_name (children[i]), |
419 | - parent_compare_name); |
420 | - |
421 | - gtk_tree_store_append (store, &iter, NULL); |
422 | - gtk_tree_store_set (store, &iter, |
423 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, children[i], |
424 | - GWEATHER_LOCATION_ENTRY_COL_DISPLAY_NAME, display_name, |
425 | - GWEATHER_LOCATION_ENTRY_COL_COMPARE_NAME, compare_name, |
426 | - -1); |
427 | - |
428 | - g_free (display_name); |
429 | - g_free (compare_name); |
430 | - } |
431 | - |
432 | - break; |
433 | - } |
434 | - |
435 | - /* fall through */ |
436 | - |
437 | - case GWEATHER_LOCATION_WEATHER_STATION: |
438 | - /* <location> with no parent <city>, or <city> with a single |
439 | - * child <location>. |
440 | - */ |
441 | - display_name = g_strdup_printf ("%s, %s", |
442 | - gweather_location_get_name (loc), |
443 | - parent_display_name); |
444 | - compare_name = g_strdup_printf ("%s, %s", |
445 | - gweather_location_get_sort_name (loc), |
446 | - parent_compare_name); |
447 | - |
448 | - gtk_tree_store_append (store, &iter, NULL); |
449 | - gtk_tree_store_set (store, &iter, |
450 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, loc, |
451 | - GWEATHER_LOCATION_ENTRY_COL_DISPLAY_NAME, display_name, |
452 | - GWEATHER_LOCATION_ENTRY_COL_COMPARE_NAME, compare_name, |
453 | - -1); |
454 | - |
455 | - g_free (display_name); |
456 | - g_free (compare_name); |
457 | - break; |
458 | - |
459 | - case GWEATHER_LOCATION_DETACHED: |
460 | - g_assert_not_reached (); |
461 | - } |
462 | - |
463 | - gweather_location_free_children (loc, children); |
464 | -} |
465 | - |
466 | -static void |
467 | -gweather_location_entry_build_model (GWeatherLocationEntry *entry, |
468 | - GWeatherLocation *top) |
469 | -{ |
470 | - GtkTreeStore *store = NULL; |
471 | - |
472 | - entry->top = gweather_location_ref (top); |
473 | - |
474 | - store = gtk_tree_store_new (4, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_STRING); |
475 | - fill_location_entry_model (store, top, NULL, NULL); |
476 | - gtk_entry_completion_set_model (gtk_entry_get_completion (GTK_ENTRY (entry)), |
477 | - GTK_TREE_MODEL (store)); |
478 | - g_object_unref (store); |
479 | -} |
480 | - |
481 | -static char * |
482 | -find_word (const char *full_name, const char *word, int word_len, |
483 | - gboolean whole_word, gboolean is_first_word) |
484 | -{ |
485 | - char *p = (char *)full_name - 1; |
486 | - |
487 | - while ((p = strchr (p + 1, *word))) { |
488 | - if (strncmp (p, word, word_len) != 0) |
489 | - continue; |
490 | - |
491 | - if (p > (char *)full_name) { |
492 | - char *prev = g_utf8_prev_char (p); |
493 | - |
494 | - /* Make sure p points to the start of a word */ |
495 | - if (g_unichar_isalpha (g_utf8_get_char (prev))) |
496 | - continue; |
497 | - |
498 | - /* If we're matching the first word of the key, it has to |
499 | - * match the first word of the location, city, state, or |
500 | - * country. Eg, it either matches the start of the string |
501 | - * (which we already know it doesn't at this point) or |
502 | - * it is preceded by the string ", " (which isn't actually |
503 | - * a perfect test. FIXME) |
504 | - */ |
505 | - if (is_first_word) { |
506 | - if (prev == (char *)full_name || strncmp (prev - 1, ", ", 2) != 0) |
507 | - continue; |
508 | - } |
509 | - } |
510 | - |
511 | - if (whole_word && g_unichar_isalpha (g_utf8_get_char (p + word_len))) |
512 | - continue; |
513 | - |
514 | - return p; |
515 | - } |
516 | - return NULL; |
517 | -} |
518 | - |
519 | -static gboolean |
520 | -matcher (GtkEntryCompletion *completion, const char *key, |
521 | - GtkTreeIter *iter, gpointer user_data) |
522 | -{ |
523 | - char *name, *name_mem; |
524 | - GWeatherLocation *loc; |
525 | - gboolean is_first_word = TRUE, match; |
526 | - int len; |
527 | - |
528 | - gtk_tree_model_get (gtk_entry_completion_get_model (completion), iter, |
529 | - GWEATHER_LOCATION_ENTRY_COL_COMPARE_NAME, &name_mem, |
530 | - GWEATHER_LOCATION_ENTRY_COL_LOCATION, &loc, |
531 | - -1); |
532 | - name = name_mem; |
533 | - |
534 | - if (!loc) { |
535 | - g_free (name_mem); |
536 | - return FALSE; |
537 | - } |
538 | - |
539 | - /* All but the last word in KEY must match a full word from NAME, |
540 | - * in order (but possibly skipping some words from NAME). |
541 | - */ |
542 | - len = strcspn (key, " "); |
543 | - while (key[len]) { |
544 | - name = find_word (name, key, len, TRUE, is_first_word); |
545 | - if (!name) { |
546 | - g_free (name_mem); |
547 | - return FALSE; |
548 | - } |
549 | - |
550 | - key += len; |
551 | - while (*key && !g_unichar_isalpha (g_utf8_get_char (key))) |
552 | - key = g_utf8_next_char (key); |
553 | - while (*name && !g_unichar_isalpha (g_utf8_get_char (name))) |
554 | - name = g_utf8_next_char (name); |
555 | - |
556 | - len = strcspn (key, " "); |
557 | - is_first_word = FALSE; |
558 | - } |
559 | - |
560 | - /* The last word in KEY must match a prefix of a following word in NAME */ |
561 | - match = find_word (name, key, strlen (key), FALSE, is_first_word) != NULL; |
562 | - g_free (name_mem); |
563 | - return match; |
564 | -} |
565 | - |
566 | -static gboolean |
567 | -match_selected (GtkEntryCompletion *completion, |
568 | - GtkTreeModel *model, |
569 | - GtkTreeIter *iter, |
570 | - gpointer entry) |
571 | -{ |
572 | - set_location_internal (entry, model, iter, NULL); |
573 | - return TRUE; |
574 | -} |
575 | - |
576 | -/** |
577 | - * gweather_location_entry_new: |
578 | - * @top: the top-level location for the entry. |
579 | - * |
580 | - * Creates a new #GWeatherLocationEntry. |
581 | - * |
582 | - * @top will normally be a location returned from |
583 | - * gweather_location_new_world(), but you can create an entry that |
584 | - * only accepts a smaller set of locations if you want. |
585 | - * |
586 | - * Return value: the new #GWeatherLocationEntry |
587 | - **/ |
588 | -GtkWidget * |
589 | -gweather_location_entry_new (GWeatherLocation *top) |
590 | -{ |
591 | - return g_object_new (GWEATHER_TYPE_LOCATION_ENTRY, |
592 | - "top", top, |
593 | - NULL); |
594 | -} |
595 | |
596 | === removed directory '.pc/01_gettext_not_xml.patch' |
597 | === removed file '.pc/01_gettext_not_xml.patch/configure.ac' |
598 | --- .pc/01_gettext_not_xml.patch/configure.ac 2013-12-17 09:39:59 +0000 |
599 | +++ .pc/01_gettext_not_xml.patch/configure.ac 1970-01-01 00:00:00 +0000 |
600 | @@ -1,193 +0,0 @@ |
601 | -AC_INIT([libgweather], |
602 | - [3.8.3], |
603 | - [http://bugzilla.gnome.org/enter_bug.cgi?product=libgweather], |
604 | - [libgweather], |
605 | - [http://live.gnome.org/LibGWeather]) |
606 | -AC_PREREQ([2.64]) |
607 | - |
608 | -AC_CONFIG_HEADERS([config.h]) |
609 | -AC_CONFIG_MACRO_DIR([m4]) |
610 | -AC_CONFIG_AUX_DIR([build-aux]) |
611 | - |
612 | -AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar]) |
613 | -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
614 | - |
615 | -# Before making a release, the LT_VERSION string should be modified. |
616 | -# The string is of the form C:R:A. |
617 | -# - If interfaces have been changed or added, but binary compatibility has |
618 | -# been preserved, change to C+1:0:A+1 |
619 | -# - If binary compatibility has been broken (eg removed or changed interfaces) |
620 | -# change to C+1:0:0 |
621 | -# - If the interface is the same as the previous version, change to C:R+1:A |
622 | - |
623 | -LT_VERSION=3:3:0 |
624 | -AC_SUBST(LT_VERSION) |
625 | - |
626 | -GTK_REQUIRED=2.90.0 |
627 | -GLIB_REQUIRED=2.35.1 |
628 | -LIBSOUP_REQUIRED=2.34.0 |
629 | -LIBXML_REQUIRED=2.6.0 |
630 | - |
631 | -LT_PREREQ([2.2.6]) |
632 | -LT_INIT([disable-static]) |
633 | -LT_LIB_M |
634 | - |
635 | -PKG_PROG_PKG_CONFIG([0.19]) |
636 | - |
637 | -AC_PROG_CC |
638 | -AM_PROG_CC_C_O |
639 | - |
640 | -GLIB_GSETTINGS |
641 | - |
642 | -AC_ARG_ENABLE(all-translations-in-one-xml, |
643 | - [AS_HELP_STRING([--enable-all-translations-in-one-xml], |
644 | - [Put all translations in a big Locations.xml file (slow to parse)])], |
645 | - [enable_big_xml=yes], |
646 | - [enable_big_xml=no]) |
647 | -AM_CONDITIONAL(USE_ONE_BIG_XML, test "x$enable_big_xml" = "xyes") |
648 | - |
649 | -AC_ARG_ENABLE(locations-compression, |
650 | - [AS_HELP_STRING([--enable-locations-compression], |
651 | - [Compress Locations.xml files])], |
652 | - [enable_locations_compression=yes], |
653 | - [enable_locations_compression=no]) |
654 | -if test "x$enable_locations_compression" = "xyes"; then |
655 | - COMPRESS_EXT=.gz |
656 | -else |
657 | - COMPRESS_EXT= |
658 | -fi |
659 | -AC_SUBST(COMPRESS_EXT) |
660 | - |
661 | -GNOME_COMPILE_WARNINGS([maximum]) |
662 | - |
663 | -dnl -- Check for GTK+ 3.0 (required) ------------------------------------------ |
664 | -PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED) |
665 | - |
666 | -dnl -- Check for libxml (required) ------------------------------------------ |
667 | -PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED) |
668 | - |
669 | -dnl -- check for libsoup (required) ----------------------------------------- |
670 | -PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_REQUIRED]) |
671 | - |
672 | -dnl -- check for glib and gio (required) ----------------------------------------- |
673 | -PKG_CHECK_MODULES(GIO, |
674 | - [glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED]) |
675 | - |
676 | -dnl -- check for glib; redundant at this point, but sets $GLIB_MKENUMS |
677 | -AM_PATH_GLIB_2_0($GLIB_REQUIRED) |
678 | - |
679 | -dnl gettext |
680 | -IT_PROG_INTLTOOL([0.50.0]) |
681 | - |
682 | -AM_GNU_GETTEXT_VERSION([0.18]) |
683 | -AM_GNU_GETTEXT([external]) |
684 | - |
685 | -GETTEXT_PACKAGE=libgweather-3.0 |
686 | -AC_SUBST(GETTEXT_PACKAGE) |
687 | -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package]) |
688 | - |
689 | -dnl *************************************************************************** |
690 | -dnl *** REGEX *** |
691 | -dnl *************************************************************************** |
692 | -AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec, |
693 | - [REGEX_LIBS=-lregex], |
694 | - [AC_MSG_ERROR([No regex library found])])]) |
695 | -AC_SUBST(REGEX_LIBS) |
696 | - |
697 | - |
698 | -dnl *************************************************************************** |
699 | -dnl *** Check for presence of tm.tm_gmtoff on the system *** |
700 | -dnl *************************************************************************** |
701 | -AC_CHECK_MEMBER([struct tm.tm_gmtoff],[struct_tm_tm_gmtoff=true],[struct_tm_tm_gmtoff=false],[#include <time.h>]) |
702 | -case $struct_tm_tm_gmtoff in |
703 | - true) |
704 | - AC_DEFINE_UNQUOTED(HAVE_TM_TM_GMOFF, 1, Have the tm.tm_gmtoff member.) |
705 | - ;; |
706 | - *) |
707 | - AC_CHECK_DECL(timezone,AC_DEFINE(HAVE_TIMEZONE,1,Have timezone),, |
708 | -[ |
709 | -#include <time.h> |
710 | -]) |
711 | - ;; |
712 | -esac |
713 | - |
714 | -dnl *************************************************************************** |
715 | -dnl *** _NL_MEASUREMENT_MEASUREMENT is an enum and not a define *** |
716 | -dnl *************************************************************************** |
717 | -AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT]) |
718 | -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[ |
719 | -char c; |
720 | -c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT)); |
721 | -]])],[gtk_ok=yes],[gtk_ok=no]) |
722 | -AC_MSG_RESULT($gtk_ok) |
723 | -if test "$gtk_ok" = "yes"; then |
724 | - AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1], |
725 | - [Define if _NL_MEASUREMENT_MEASUREMENT is available]) |
726 | -fi |
727 | - |
728 | -dnl *************************************************************************** |
729 | -dnl *** Find tzdata *** |
730 | -dnl *************************************************************************** |
731 | -AC_ARG_WITH(zoneinfo-dir, |
732 | - [ --with-zoneinfo-dir tzdata zoneinfo directory], |
733 | - ZONEINFO_DIR="$withval") |
734 | -if test -z "$ZONEINFO_DIR"; then |
735 | - if test -d /usr/share/zoneinfo; then |
736 | - ZONEINFO_DIR="/usr/share/zoneinfo" |
737 | - elif test -d /usr/share/lib/zoneinfo/tab; then |
738 | - ZONEINFO_DIR="/usr/share/lib/zoneinfo/tab" |
739 | - else |
740 | - AC_MSG_ERROR(Can't find zoneinfo directory. Use --with-zoneinfo-dir) |
741 | - fi |
742 | -fi |
743 | -AC_DEFINE_UNQUOTED(ZONEINFO_DIR, "$ZONEINFO_DIR", [zoneinfo directory]) |
744 | - |
745 | -AC_SUBST(VERSION) |
746 | -AC_SUBST(PACKAGE) |
747 | -AC_SUBST(DATADIR) |
748 | -AC_SUBST(LIBDIR) |
749 | -AC_SUBST(GLADEDIR) |
750 | - |
751 | -################################################## |
752 | -# Checks for gtk-doc and docbook-tools |
753 | -################################################## |
754 | -GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) |
755 | - |
756 | -GOBJECT_INTROSPECTION_CHECK([0.9.5]) |
757 | - |
758 | -dnl *************************************************************************** |
759 | -dnl *** Output Makefiles et al *** |
760 | -dnl *************************************************************************** |
761 | -AC_CONFIG_FILES([ |
762 | -Makefile |
763 | -doc/Makefile |
764 | -po/Makefile.in |
765 | -po-locations/Makefile |
766 | -libgweather/Makefile |
767 | -libgweather/gweather-3.0.pc |
768 | -libgweather/gweather-3.0-uninstalled.pc |
769 | -data/Makefile |
770 | -icons/Makefile |
771 | -schemas/Makefile |
772 | -]) |
773 | -AC_OUTPUT |
774 | - |
775 | -if test "x$enable_big_xml" = "xyes"; then |
776 | - LOCATIONS_XML_TRANSLATIONS="one big file" |
777 | -else |
778 | - LOCATIONS_XML_TRANSLATIONS="one file per translation" |
779 | -fi |
780 | - |
781 | -dnl *************************************************************************** |
782 | -dnl *** Display Summary *** |
783 | -dnl *************************************************************************** |
784 | -echo " |
785 | -libgweather-$VERSION configure summary: |
786 | - |
787 | - Prefix: ${prefix} |
788 | - Source code location: ${srcdir} |
789 | - Compiler: ${CC} |
790 | - Introspection support: ${found_introspection} |
791 | - Locations.xml translations: ${LOCATIONS_XML_TRANSLATIONS} |
792 | - Locations.xml compression: ${enable_locations_compression} |
793 | -" >&2 |
794 | |
795 | === removed directory '.pc/01_gettext_not_xml.patch/data' |
796 | === removed file '.pc/01_gettext_not_xml.patch/data/Makefile.am' |
797 | --- .pc/01_gettext_not_xml.patch/data/Makefile.am 2013-05-27 11:58:15 +0000 |
798 | +++ .pc/01_gettext_not_xml.patch/data/Makefile.am 1970-01-01 00:00:00 +0000 |
799 | @@ -1,78 +0,0 @@ |
800 | -libgweatherdtddir = $(pkgdatadir) |
801 | -libgweatherdtd_DATA = locations.dtd |
802 | - |
803 | -libgweatherlocationsdir = $(pkgdatadir) |
804 | -libgweatherlocations_in_files = Locations.xml.in |
805 | - |
806 | -if USE_ONE_BIG_XML |
807 | - |
808 | -LOCATIONS_STAMP = |
809 | - |
810 | -libgweatherlocations_DATA = $(libgweatherlocations_in_files:.xml.in=.xml$(COMPRESS_EXT)) |
811 | - |
812 | -%.xml$(COMPRESS_EXT): %.xml.in $(wildcard $(top_srcdir)/po-locations/*.po) |
813 | - $(AM_V_GEN)LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-locations/.intltool-merge-cache $(top_srcdir)/po-locations $< `echo $@ | sed "s/.xml$(COMPRESS_EXT)/.xml/"` && \ |
814 | - if test "x$(COMPRESS_EXT)" = "x.gz"; then \ |
815 | - gzip --force `echo $@ | sed "s/.xml$(COMPRESS_EXT)/.xml/"`; \ |
816 | - fi |
817 | - |
818 | -else # USE_ONE_BIG_XML |
819 | - |
820 | -LOCATIONS_STAMP = stamp-Locations.xml |
821 | - |
822 | -PO_LOCATIONS = $(shell if test -n "$(LINGUAS)"; then for lang in $(LINGUAS); do if test -f "$(top_srcdir)/po-locations/$$lang.po"; then echo "$(top_srcdir)/po-locations/$$lang.po "; fi; done; else for pofile in $(top_srcdir)/po-locations/*.po; do echo $$pofile; done; fi) |
823 | - |
824 | -# Helper variable |
825 | -libgweatherlocations_data = $(libgweatherlocations_in_files:.xml.in=.xml) |
826 | - |
827 | -libgweatherlocations_DATA = $(shell echo $(PO_LOCATIONS) | sed "s|$(top_srcdir)/po-locations/|Locations.|g;s|\.po|.xml$(COMPRESS_EXT)|g") $(libgweatherlocations_data)$(COMPRESS_EXT) |
828 | - |
829 | -# We need this step so that we merge all the make Locations.xy.xml destinations |
830 | -# into one unique destination. This makes -j2 work. (Else, we end up with |
831 | -# multiple and conflicting calls to intltool-merge) |
832 | -$(libgweatherlocations_DATA): $(LOCATIONS_STAMP) |
833 | - |
834 | -$(LOCATIONS_STAMP): $(libgweatherlocations_in_files) $(PO_LOCATIONS) Makefile |
835 | - $(AM_V_at)LC_ALL=C $(INTLTOOL_MERGE) --multiple-output --xml-style --utf8 --cache=$(top_builddir)/po-locations/.intltool-merge-cache $(top_srcdir)/po-locations $< $(libgweatherlocations_data) && \ |
836 | - for pofile in $(PO_LOCATIONS); do \ |
837 | - locale=`echo $$pofile | sed "s;$(top_srcdir)/po-locations/\(.*\)\.po;\1;"`; \ |
838 | - xmllint --noblanks -o Locations.$$locale.xml $$locale/$(libgweatherlocations_data); \ |
839 | - rm -f $$locale/$(libgweatherlocations_data); \ |
840 | - test -d $$locale && rmdir $$locale; \ |
841 | - if test "x$(COMPRESS_EXT)" = "x.gz"; then \ |
842 | - gzip --force Locations.$$locale.xml; \ |
843 | - fi; \ |
844 | - done && \ |
845 | - xmllint --noblanks -o Locations.xml C/$(libgweatherlocations_data) && \ |
846 | - rm -f C/$(libgweatherlocations_data) && \ |
847 | - test -d C && rmdir C && \ |
848 | - if test "x$(COMPRESS_EXT)" = "x.gz"; then \ |
849 | - gzip --force Locations.xml; \ |
850 | - fi && \ |
851 | - touch $@ |
852 | - |
853 | -endif # USE_ONE_BIG_XML |
854 | - |
855 | -### Locations.xml.in rebuild |
856 | -rebuild-locations: locationdb.sqlite update-locations.py |
857 | - $(AM_V_GEN)($(srcdir)/update-locations.py > Locations.xml.in.new && mv Locations.xml.in.new Locations.xml.in) || rm -f Locations.xml.in.new |
858 | - |
859 | -locationdb.sqlite: build-locationdb.pl major-cities.txt sources/nsd_cccc.txt sources/POP_PLACES.txt sources/US_CONCISE.txt sources/geonames_dd_dms_date_*.txt city-fixups.pl station-fixups.pl |
860 | - $(AM_V_GEN)$(srcdir)/build-locationdb.pl |
861 | - |
862 | -check: |
863 | - xmllint --valid --noout $(top_srcdir)/data/Locations.xml.in |
864 | - $(srcdir)/check-timezones.sh $(srcdir)/Locations.xml.in |
865 | - |
866 | -EXTRA_DIST = \ |
867 | - $(libgweatherlocations_in_files) \ |
868 | - $(libgweatherdtd_DATA) \ |
869 | - check-timezones.sh \ |
870 | - README \ |
871 | - README.timezones |
872 | - |
873 | -CLEANFILES = \ |
874 | - $(libgweatherlocations_DATA) \ |
875 | - $(LOCATIONS_STAMP) |
876 | - |
877 | --include $(top_srcdir)/git.mk |
878 | |
879 | === removed directory '.pc/01_gettext_not_xml.patch/libgweather' |
880 | === removed file '.pc/01_gettext_not_xml.patch/libgweather/gweather-location.c' |
881 | --- .pc/01_gettext_not_xml.patch/libgweather/gweather-location.c 2013-05-27 11:58:15 +0000 |
882 | +++ .pc/01_gettext_not_xml.patch/libgweather/gweather-location.c 1970-01-01 00:00:00 +0000 |
883 | @@ -1,1085 +0,0 @@ |
884 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
885 | -/* gweather-location.c - Location-handling code |
886 | - * |
887 | - * Copyright 2008, Red Hat, Inc. |
888 | - * |
889 | - * This library is free software; you can redistribute it and/or |
890 | - * modify it under the terms of the GNU Lesser General Public License |
891 | - * as published by the Free Software Foundation; either version 2.1 of |
892 | - * the License, or (at your option) any later version. |
893 | - * |
894 | - * This library is distributed in the hope that it will be useful, but |
895 | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
896 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
897 | - * Lesser General Public License for more details. |
898 | - * |
899 | - * You should have received a copy of the GNU Lesser General Public |
900 | - * License along with this library; if not, see |
901 | - * <http://www.gnu.org/licenses/>. |
902 | - */ |
903 | - |
904 | -#ifdef HAVE_CONFIG_H |
905 | -#include <config.h> |
906 | -#endif |
907 | - |
908 | -#include <string.h> |
909 | -#include <math.h> |
910 | -#include <locale.h> |
911 | -#include <gtk/gtk.h> |
912 | -#include <libxml/xmlreader.h> |
913 | - |
914 | -#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE |
915 | -#include "gweather-location.h" |
916 | -#include "gweather-timezone.h" |
917 | -#include "parser.h" |
918 | -#include "weather-priv.h" |
919 | - |
920 | -/* This is the precision of coordinates in the database */ |
921 | -#define EPSILON 0.000001 |
922 | - |
923 | -/** |
924 | - * SECTION:gweather-location |
925 | - * @Title: GWeatherLocation |
926 | - * |
927 | - * A #GWeatherLocation represents a "location" of some type known to |
928 | - * libgweather; anything from a single weather station to the entire |
929 | - * world. See #GWeatherLocationLevel for information about how the |
930 | - * hierarchy of locations works. |
931 | - */ |
932 | - |
933 | -/** |
934 | - * GWeatherLocationLevel: |
935 | - * @GWEATHER_LOCATION_WORLD: A location representing the entire world. |
936 | - * @GWEATHER_LOCATION_REGION: A location representing a continent or |
937 | - * other top-level region. |
938 | - * @GWEATHER_LOCATION_COUNTRY: A location representing a "country" (or |
939 | - * other geographic unit that has an ISO-3166 country code) |
940 | - * @GWEATHER_LOCATION_ADM1: A location representing a "first-level |
941 | - * administrative division"; ie, a state, province, or similar |
942 | - * division. |
943 | - * @GWEATHER_LOCATION_ADM2: A location representing a subdivision of a |
944 | - * %GWEATHER_LOCATION_ADM1 location, or a direct subdivision of |
945 | - * a country that is not represented in a #GWeatherLocationEntry. |
946 | - * @GWEATHER_LOCATION_CITY: A location representing a city |
947 | - * @GWEATHER_LOCATION_WEATHER_STATION: A location representing a |
948 | - * weather station. |
949 | - * @GWEATHER_LOCATION_DETACHED: A location that is detached from the |
950 | - * database, for example because it was loaded from external storage |
951 | - * and could not be fully recovered. The parent of this location is |
952 | - * the nearest weather station. |
953 | - * |
954 | - * The size/scope of a particular #GWeatherLocation. |
955 | - * |
956 | - * Locations form a hierarchy, with a %GWEATHER_LOCATION_WORLD |
957 | - * location at the top, divided into regions or countries, and so on. |
958 | - * Countries may or may not be divided into "adm1"s, and "adm1"s may |
959 | - * or may not be divided into "adm2"s. A city will have at least one, |
960 | - * and possibly several, weather stations inside it. Weather stations |
961 | - * will never appear outside of cities. |
962 | - * |
963 | - * Building a database with gweather_location_new_world() will never |
964 | - * create detached instances, but deserializing might. |
965 | - **/ |
966 | - |
967 | -static int |
968 | -sort_locations_by_name (gconstpointer a, gconstpointer b) |
969 | -{ |
970 | - GWeatherLocation *loc_a = *(GWeatherLocation **)a; |
971 | - GWeatherLocation *loc_b = *(GWeatherLocation **)b; |
972 | - |
973 | - return g_utf8_collate (loc_a->sort_name, loc_b->sort_name); |
974 | -} |
975 | - |
976 | -static int |
977 | -sort_locations_by_distance (gconstpointer a, gconstpointer b, gpointer user_data) |
978 | -{ |
979 | - GWeatherLocation *loc_a = *(GWeatherLocation **)a; |
980 | - GWeatherLocation *loc_b = *(GWeatherLocation **)b; |
981 | - GWeatherLocation *city = (GWeatherLocation *)user_data; |
982 | - double dist_a, dist_b; |
983 | - |
984 | - dist_a = gweather_location_get_distance (loc_a, city); |
985 | - dist_b = gweather_location_get_distance (loc_b, city); |
986 | - if (dist_a < dist_b) |
987 | - return -1; |
988 | - else if (dist_a > dist_b) |
989 | - return 1; |
990 | - else |
991 | - return 0; |
992 | -} |
993 | - |
994 | -static gboolean |
995 | -parse_coordinates (const char *coordinates, |
996 | - double *latitude, double *longitude) |
997 | -{ |
998 | - char *p; |
999 | - |
1000 | - *latitude = g_ascii_strtod (coordinates, &p) * M_PI / 180.0; |
1001 | - if (p == (char *)coordinates) |
1002 | - return FALSE; |
1003 | - if (*p++ != ' ') |
1004 | - return FALSE; |
1005 | - *longitude = g_ascii_strtod (p, &p) * M_PI / 180.0; |
1006 | - return !*p; |
1007 | -} |
1008 | - |
1009 | -static GWeatherLocation * |
1010 | -location_new_from_xml (GWeatherParser *parser, GWeatherLocationLevel level, |
1011 | - GWeatherLocation *parent) |
1012 | -{ |
1013 | - GWeatherLocation *loc, *child; |
1014 | - GPtrArray *children = NULL; |
1015 | - const char *tagname; |
1016 | - char *value, *normalized; |
1017 | - int tagtype, i; |
1018 | - |
1019 | - loc = g_slice_new0 (GWeatherLocation); |
1020 | - loc->latitude = loc->longitude = DBL_MAX; |
1021 | - loc->parent = parent; |
1022 | - loc->level = level; |
1023 | - loc->ref_count = 1; |
1024 | - if (level == GWEATHER_LOCATION_WORLD) |
1025 | - loc->metar_code_cache = g_hash_table_ref (parser->metar_code_cache); |
1026 | - children = g_ptr_array_new (); |
1027 | - |
1028 | - if (xmlTextReaderRead (parser->xml) != 1) |
1029 | - goto error_out; |
1030 | - while ((tagtype = xmlTextReaderNodeType (parser->xml)) != |
1031 | - XML_READER_TYPE_END_ELEMENT) { |
1032 | - if (tagtype != XML_READER_TYPE_ELEMENT) { |
1033 | - if (xmlTextReaderRead (parser->xml) != 1) |
1034 | - goto error_out; |
1035 | - continue; |
1036 | - } |
1037 | - |
1038 | - tagname = (const char *) xmlTextReaderConstName (parser->xml); |
1039 | - if (!strcmp (tagname, "name") && !loc->name) { |
1040 | - value = gweather_parser_get_localized_value (parser); |
1041 | - if (!value) |
1042 | - goto error_out; |
1043 | - loc->name = g_strdup (value); |
1044 | - xmlFree (value); |
1045 | - normalized = g_utf8_normalize (loc->name, -1, G_NORMALIZE_ALL); |
1046 | - loc->sort_name = g_utf8_casefold (normalized, -1); |
1047 | - g_free (normalized); |
1048 | - |
1049 | - } else if (!strcmp (tagname, "iso-code") && !loc->country_code) { |
1050 | - value = gweather_parser_get_value (parser); |
1051 | - if (!value) |
1052 | - goto error_out; |
1053 | - loc->country_code = g_strdup (value); |
1054 | - xmlFree (value); |
1055 | - } else if (!strcmp (tagname, "tz-hint") && !loc->tz_hint) { |
1056 | - value = gweather_parser_get_value (parser); |
1057 | - if (!value) |
1058 | - goto error_out; |
1059 | - loc->tz_hint = g_strdup (value); |
1060 | - xmlFree (value); |
1061 | - } else if (!strcmp (tagname, "code") && !loc->station_code) { |
1062 | - value = gweather_parser_get_value (parser); |
1063 | - if (!value) |
1064 | - goto error_out; |
1065 | - loc->station_code = g_strdup (value); |
1066 | - xmlFree (value); |
1067 | - } else if (!strcmp (tagname, "coordinates") && !loc->latlon_valid) { |
1068 | - value = gweather_parser_get_value (parser); |
1069 | - if (!value) |
1070 | - goto error_out; |
1071 | - if (parse_coordinates (value, &loc->latitude, &loc->longitude)) |
1072 | - loc->latlon_valid = TRUE; |
1073 | - xmlFree (value); |
1074 | - } else if (!strcmp (tagname, "zone") && !loc->forecast_zone) { |
1075 | - value = gweather_parser_get_value (parser); |
1076 | - if (!value) |
1077 | - goto error_out; |
1078 | - loc->forecast_zone = g_strdup (value); |
1079 | - xmlFree (value); |
1080 | - } else if (!strcmp (tagname, "yahoo-woeid") && !loc->yahoo_id) { |
1081 | - value = gweather_parser_get_value (parser); |
1082 | - if (!value) |
1083 | - goto error_out; |
1084 | - loc->yahoo_id = g_strdup (value); |
1085 | - xmlFree (value); |
1086 | - } else if (!strcmp (tagname, "radar") && !loc->radar) { |
1087 | - value = gweather_parser_get_value (parser); |
1088 | - if (!value) |
1089 | - goto error_out; |
1090 | - loc->radar = g_strdup (value); |
1091 | - xmlFree (value); |
1092 | - |
1093 | - } else if (!strcmp (tagname, "region")) { |
1094 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_REGION, loc); |
1095 | - if (!child) |
1096 | - goto error_out; |
1097 | - if (parser->use_regions) |
1098 | - g_ptr_array_add (children, child); |
1099 | - else { |
1100 | - if (child->children) { |
1101 | - for (i = 0; child->children[i]; i++) { |
1102 | - /* Correct back pointers */ |
1103 | - child->children[i]->parent = loc; |
1104 | - g_ptr_array_add (children, child->children[i]); |
1105 | - } |
1106 | - } |
1107 | - child->children = NULL; |
1108 | - gweather_location_unref (child); |
1109 | - } |
1110 | - } else if (!strcmp (tagname, "country")) { |
1111 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_COUNTRY, loc); |
1112 | - if (!child) |
1113 | - goto error_out; |
1114 | - g_ptr_array_add (children, child); |
1115 | - } else if (!strcmp (tagname, "state")) { |
1116 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_ADM1, loc); |
1117 | - if (!child) |
1118 | - goto error_out; |
1119 | - g_ptr_array_add (children, child); |
1120 | - } else if (!strcmp (tagname, "province")) { |
1121 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_ADM2, loc); |
1122 | - if (!child) |
1123 | - goto error_out; |
1124 | - g_ptr_array_add (children, child); |
1125 | - } else if (!strcmp (tagname, "city")) { |
1126 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_CITY, loc); |
1127 | - if (!child) |
1128 | - goto error_out; |
1129 | - g_ptr_array_add (children, child); |
1130 | - } else if (!strcmp (tagname, "location")) { |
1131 | - child = location_new_from_xml (parser, GWEATHER_LOCATION_WEATHER_STATION, loc); |
1132 | - if (!child) |
1133 | - goto error_out; |
1134 | - g_ptr_array_add (children, child); |
1135 | - |
1136 | - } else if (!strcmp (tagname, "timezones")) { |
1137 | - loc->zones = gweather_timezones_parse_xml (parser); |
1138 | - if (!loc->zones) |
1139 | - goto error_out; |
1140 | - |
1141 | - } else { |
1142 | - if (xmlTextReaderNext (parser->xml) != 1) |
1143 | - goto error_out; |
1144 | - } |
1145 | - } |
1146 | - if (xmlTextReaderRead (parser->xml) != 1 && parent) |
1147 | - goto error_out; |
1148 | - |
1149 | - if (level == GWEATHER_LOCATION_WEATHER_STATION) { |
1150 | - /* Cache weather stations by METAR code */ |
1151 | - GList *a, *b; |
1152 | - |
1153 | - a = g_hash_table_lookup (parser->metar_code_cache, loc->station_code); |
1154 | - b = g_list_append (a, gweather_location_ref (loc)); |
1155 | - if (b != a) |
1156 | - g_hash_table_replace (parser->metar_code_cache, loc->station_code, b); |
1157 | - } |
1158 | - |
1159 | - if (children->len) { |
1160 | - if (level == GWEATHER_LOCATION_CITY) |
1161 | - g_ptr_array_sort_with_data (children, sort_locations_by_distance, loc); |
1162 | - else |
1163 | - g_ptr_array_sort (children, sort_locations_by_name); |
1164 | - |
1165 | - g_ptr_array_add (children, NULL); |
1166 | - loc->children = (GWeatherLocation **)g_ptr_array_free (children, FALSE); |
1167 | - } else |
1168 | - g_ptr_array_free (children, TRUE); |
1169 | - |
1170 | - return loc; |
1171 | - |
1172 | -error_out: |
1173 | - gweather_location_unref (loc); |
1174 | - for (i = 0; i < children->len; i++) |
1175 | - gweather_location_unref (children->pdata[i]); |
1176 | - g_ptr_array_free (children, TRUE); |
1177 | - |
1178 | - return NULL; |
1179 | -} |
1180 | - |
1181 | -/** |
1182 | - * gweather_location_new_world: |
1183 | - * @use_regions: whether or not to divide the world into regions |
1184 | - * |
1185 | - * Creates a new #GWeatherLocation of type %GWEATHER_LOCATION_WORLD, |
1186 | - * representing a hierarchy containing all of the locations from |
1187 | - * Locations.xml. |
1188 | - * |
1189 | - * If @use_regions is %TRUE, the immediate children of the returned |
1190 | - * location will be %GWEATHER_LOCATION_REGION nodes, representing the |
1191 | - * top-level "regions" of Locations.xml (the continents and a few |
1192 | - * other divisions), and the country-level nodes will be the children |
1193 | - * of the regions. If @use_regions is %FALSE, the regions will be |
1194 | - * skipped, and the children of the returned location will be the |
1195 | - * %GWEATHER_LOCATION_COUNTRY nodes. |
1196 | - * |
1197 | - * Return value: (allow-none): a %GWEATHER_LOCATION_WORLD location, or |
1198 | - * %NULL if Locations.xml could not be found or could not be parsed. |
1199 | - **/ |
1200 | -GWeatherLocation * |
1201 | -gweather_location_new_world (gboolean use_regions) |
1202 | -{ |
1203 | - GWeatherParser *parser; |
1204 | - GWeatherLocation *world; |
1205 | - |
1206 | - parser = gweather_parser_new (use_regions); |
1207 | - if (!parser) |
1208 | - return NULL; |
1209 | - |
1210 | - world = location_new_from_xml (parser, GWEATHER_LOCATION_WORLD, NULL); |
1211 | - |
1212 | - gweather_parser_free (parser); |
1213 | - return world; |
1214 | -} |
1215 | - |
1216 | -/** |
1217 | - * gweather_location_ref: |
1218 | - * @loc: a #GWeatherLocation |
1219 | - * |
1220 | - * Adds 1 to @loc's reference count. |
1221 | - * |
1222 | - * Return value: @loc |
1223 | - **/ |
1224 | -GWeatherLocation * |
1225 | -gweather_location_ref (GWeatherLocation *loc) |
1226 | -{ |
1227 | - g_return_val_if_fail (loc != NULL, NULL); |
1228 | - |
1229 | - loc->ref_count++; |
1230 | - return loc; |
1231 | -} |
1232 | - |
1233 | -/** |
1234 | - * gweather_location_unref: |
1235 | - * @loc: a #GWeatherLocation |
1236 | - * |
1237 | - * Subtracts 1 from @loc's reference count, and frees it if the |
1238 | - * reference count reaches 0. |
1239 | - **/ |
1240 | -void |
1241 | -gweather_location_unref (GWeatherLocation *loc) |
1242 | -{ |
1243 | - int i; |
1244 | - |
1245 | - g_return_if_fail (loc != NULL); |
1246 | - |
1247 | - if (--loc->ref_count) |
1248 | - return; |
1249 | - |
1250 | - g_free (loc->name); |
1251 | - g_free (loc->sort_name); |
1252 | - g_free (loc->country_code); |
1253 | - g_free (loc->tz_hint); |
1254 | - g_free (loc->station_code); |
1255 | - g_free (loc->forecast_zone); |
1256 | - g_free (loc->radar); |
1257 | - |
1258 | - if (loc->children) { |
1259 | - for (i = 0; loc->children[i]; i++) { |
1260 | - loc->children[i]->parent = NULL; |
1261 | - gweather_location_unref (loc->children[i]); |
1262 | - } |
1263 | - g_free (loc->children); |
1264 | - } |
1265 | - |
1266 | - if (loc->zones) { |
1267 | - for (i = 0; loc->zones[i]; i++) |
1268 | - gweather_timezone_unref (loc->zones[i]); |
1269 | - g_free (loc->zones); |
1270 | - } |
1271 | - |
1272 | - if (loc->metar_code_cache) |
1273 | - g_hash_table_unref (loc->metar_code_cache); |
1274 | - |
1275 | - g_slice_free (GWeatherLocation, loc); |
1276 | -} |
1277 | - |
1278 | -GType |
1279 | -gweather_location_get_type (void) |
1280 | -{ |
1281 | - static volatile gsize type_volatile = 0; |
1282 | - |
1283 | - if (g_once_init_enter (&type_volatile)) { |
1284 | - GType type = g_boxed_type_register_static ( |
1285 | - g_intern_static_string ("GWeatherLocation"), |
1286 | - (GBoxedCopyFunc) gweather_location_ref, |
1287 | - (GBoxedFreeFunc) gweather_location_unref); |
1288 | - g_once_init_leave (&type_volatile, type); |
1289 | - } |
1290 | - return type_volatile; |
1291 | -} |
1292 | - |
1293 | -/** |
1294 | - * gweather_location_get_name: |
1295 | - * @loc: a #GWeatherLocation |
1296 | - * |
1297 | - * Gets @loc's name, localized into the current language. |
1298 | - * |
1299 | - * Note that %GWEATHER_LOCATION_WEATHER_STATION nodes are not |
1300 | - * localized, and so the name returned for those nodes will always be |
1301 | - * in English, and should therefore not be displayed to the user. |
1302 | - * (FIXME: should we just not return a name?) |
1303 | - * |
1304 | - * Return value: @loc's name |
1305 | - **/ |
1306 | -const char * |
1307 | -gweather_location_get_name (GWeatherLocation *loc) |
1308 | -{ |
1309 | - g_return_val_if_fail (loc != NULL, NULL); |
1310 | - return loc->name; |
1311 | -} |
1312 | - |
1313 | -/** |
1314 | - * gweather_location_get_sort_name: |
1315 | - * @loc: a #GWeatherLocation |
1316 | - * |
1317 | - * Gets @loc's "sort name", which is the name after having |
1318 | - * g_utf8_normalize() (with %G_NORMALIZE_ALL) and g_utf8_casefold() |
1319 | - * called on it. You can use this to sort locations, or to comparing |
1320 | - * user input against a location name. |
1321 | - * |
1322 | - * Return value: @loc's sort name |
1323 | - **/ |
1324 | -const char * |
1325 | -gweather_location_get_sort_name (GWeatherLocation *loc) |
1326 | -{ |
1327 | - g_return_val_if_fail (loc != NULL, NULL); |
1328 | - return loc->sort_name; |
1329 | -} |
1330 | - |
1331 | -/** |
1332 | - * gweather_location_get_level: |
1333 | - * @loc: a #GWeatherLocation |
1334 | - * |
1335 | - * Gets @loc's level, from %GWEATHER_LOCATION_WORLD, to |
1336 | - * %GWEATHER_LOCATION_WEATHER_STATION. |
1337 | - * |
1338 | - * Return value: @loc's level |
1339 | - **/ |
1340 | -GWeatherLocationLevel |
1341 | -gweather_location_get_level (GWeatherLocation *loc) |
1342 | -{ |
1343 | - g_return_val_if_fail (loc != NULL, GWEATHER_LOCATION_WORLD); |
1344 | - return loc->level; |
1345 | -} |
1346 | - |
1347 | -/** |
1348 | - * gweather_location_get_parent: |
1349 | - * @loc: a #GWeatherLocation |
1350 | - * |
1351 | - * Gets @loc's parent location. |
1352 | - * |
1353 | - * Return value: (transfer none) (allow-none): @loc's parent, or %NULL |
1354 | - * if @loc is a %GWEATHER_LOCATION_WORLD node. |
1355 | - **/ |
1356 | -GWeatherLocation * |
1357 | -gweather_location_get_parent (GWeatherLocation *loc) |
1358 | -{ |
1359 | - g_return_val_if_fail (loc != NULL, NULL); |
1360 | - return loc->parent; |
1361 | -} |
1362 | - |
1363 | -/** |
1364 | - * gweather_location_get_children: |
1365 | - * @loc: a #GWeatherLocation |
1366 | - * |
1367 | - * Gets an array of @loc's children; this is owned by @loc and will |
1368 | - * not remain valid if @loc is freed. |
1369 | - * |
1370 | - * Return value: (transfer none) (array zero-terminated=1): @loc's |
1371 | - * children. (May be empty, but will not be %NULL.) |
1372 | - **/ |
1373 | -GWeatherLocation ** |
1374 | -gweather_location_get_children (GWeatherLocation *loc) |
1375 | -{ |
1376 | - static GWeatherLocation *no_children = NULL; |
1377 | - |
1378 | - g_return_val_if_fail (loc != NULL, NULL); |
1379 | - |
1380 | - if (loc->children) |
1381 | - return loc->children; |
1382 | - else |
1383 | - return &no_children; |
1384 | -} |
1385 | - |
1386 | - |
1387 | -/** |
1388 | - * gweather_location_free_children: |
1389 | - * @loc: a #GWeatherLocation |
1390 | - * @children: an array of @loc's children |
1391 | - * |
1392 | - * This is a no-op. Do not use it. |
1393 | - * |
1394 | - * Deprecated: This is a no-op. |
1395 | - **/ |
1396 | -void |
1397 | -gweather_location_free_children (GWeatherLocation *loc, |
1398 | - GWeatherLocation **children) |
1399 | -{ |
1400 | - ; |
1401 | -} |
1402 | - |
1403 | -/** |
1404 | - * gweather_location_has_coords: |
1405 | - * @loc: a #GWeatherLocation |
1406 | - * |
1407 | - * Checks if @loc has valid latitude and longitude. |
1408 | - * |
1409 | - * Return value: %TRUE if @loc has valid latitude and longitude. |
1410 | - **/ |
1411 | -gboolean |
1412 | -gweather_location_has_coords (GWeatherLocation *loc) |
1413 | -{ |
1414 | - g_return_val_if_fail (loc != NULL, FALSE); |
1415 | - return loc->latlon_valid; |
1416 | -} |
1417 | - |
1418 | -/** |
1419 | - * gweather_location_get_coords: |
1420 | - * @loc: a #GWeatherLocation |
1421 | - * @latitude: (out): on return will contain @loc's latitude |
1422 | - * @longitude: (out): on return will contain @loc's longitude |
1423 | - * |
1424 | - * Gets @loc's coordinates; you must check |
1425 | - * gweather_location_has_coords() before calling this. |
1426 | - **/ |
1427 | -void |
1428 | -gweather_location_get_coords (GWeatherLocation *loc, |
1429 | - double *latitude, double *longitude) |
1430 | -{ |
1431 | - //g_return_if_fail (loc->latlon_valid); |
1432 | - g_return_if_fail (loc != NULL); |
1433 | - g_return_if_fail (latitude != NULL); |
1434 | - g_return_if_fail (longitude != NULL); |
1435 | - |
1436 | - *latitude = loc->latitude / M_PI * 180.0; |
1437 | - *longitude = loc->longitude / M_PI * 180.0; |
1438 | -} |
1439 | - |
1440 | -/** |
1441 | - * gweather_location_get_distance: |
1442 | - * @loc: a #GWeatherLocation |
1443 | - * @loc2: a second #GWeatherLocation |
1444 | - * |
1445 | - * Determines the distance in kilometers between @loc and @loc2. |
1446 | - * |
1447 | - * Return value: the distance between @loc and @loc2. |
1448 | - **/ |
1449 | -double |
1450 | -gweather_location_get_distance (GWeatherLocation *loc, GWeatherLocation *loc2) |
1451 | -{ |
1452 | - /* average radius of the earth in km */ |
1453 | - static const double radius = 6372.795; |
1454 | - |
1455 | - g_return_val_if_fail (loc != NULL, 0); |
1456 | - g_return_val_if_fail (loc2 != NULL, 0); |
1457 | - |
1458 | - //g_return_val_if_fail (loc->latlon_valid, 0.0); |
1459 | - //g_return_val_if_fail (loc2->latlon_valid, 0.0); |
1460 | - |
1461 | - return acos (cos (loc->latitude) * cos (loc2->latitude) * cos (loc->longitude - loc2->longitude) + |
1462 | - sin (loc->latitude) * sin (loc2->latitude)) * radius; |
1463 | -} |
1464 | - |
1465 | -/** |
1466 | - * gweather_location_get_country: |
1467 | - * @loc: a #GWeatherLocation |
1468 | - * |
1469 | - * Gets the ISO 3166 country code of @loc (or %NULL if @loc is a |
1470 | - * region- or world-level location) |
1471 | - * |
1472 | - * Return value: (allow-none): @loc's country code (or %NULL if @loc |
1473 | - * is a region- or world-level location) |
1474 | - **/ |
1475 | -const char * |
1476 | -gweather_location_get_country (GWeatherLocation *loc) |
1477 | -{ |
1478 | - g_return_val_if_fail (loc != NULL, NULL); |
1479 | - |
1480 | - while (loc->parent && !loc->country_code) |
1481 | - loc = loc->parent; |
1482 | - return loc->country_code; |
1483 | -} |
1484 | - |
1485 | -/** |
1486 | - * gweather_location_get_timezone: |
1487 | - * @loc: a #GWeatherLocation |
1488 | - * |
1489 | - * Gets the timezone associated with @loc, if known. |
1490 | - * |
1491 | - * The timezone is owned either by @loc or by one of its parents. |
1492 | - * FIXME. |
1493 | - * |
1494 | - * Return value: (transfer none) (allow-none): @loc's timezone, or |
1495 | - * %NULL |
1496 | - **/ |
1497 | -GWeatherTimezone * |
1498 | -gweather_location_get_timezone (GWeatherLocation *loc) |
1499 | -{ |
1500 | - const char *tz_hint; |
1501 | - int i; |
1502 | - |
1503 | - g_return_val_if_fail (loc != NULL, NULL); |
1504 | - |
1505 | - while (loc && !loc->tz_hint) |
1506 | - loc = loc->parent; |
1507 | - if (!loc) |
1508 | - return NULL; |
1509 | - tz_hint = loc->tz_hint; |
1510 | - |
1511 | - while (loc) { |
1512 | - while (loc && !loc->zones) |
1513 | - loc = loc->parent; |
1514 | - if (!loc) |
1515 | - return NULL; |
1516 | - for (i = 0; loc->zones[i]; i++) { |
1517 | - if (!strcmp (tz_hint, gweather_timezone_get_tzid (loc->zones[i]))) |
1518 | - return loc->zones[i]; |
1519 | - } |
1520 | - loc = loc->parent; |
1521 | - } |
1522 | - |
1523 | - return NULL; |
1524 | -} |
1525 | - |
1526 | -static void |
1527 | -add_timezones (GWeatherLocation *loc, GPtrArray *zones) |
1528 | -{ |
1529 | - int i; |
1530 | - |
1531 | - if (loc->zones) { |
1532 | - for (i = 0; loc->zones[i]; i++) |
1533 | - g_ptr_array_add (zones, gweather_timezone_ref (loc->zones[i])); |
1534 | - } |
1535 | - if (loc->level < GWEATHER_LOCATION_COUNTRY && loc->children) { |
1536 | - for (i = 0; loc->children[i]; i++) |
1537 | - add_timezones (loc->children[i], zones); |
1538 | - } |
1539 | -} |
1540 | - |
1541 | -/** |
1542 | - * gweather_location_get_timezones: |
1543 | - * @loc: a #GWeatherLocation |
1544 | - * |
1545 | - * Gets an array of all timezones associated with any location under |
1546 | - * @loc. You can use gweather_location_free_timezones() to free this |
1547 | - * array. |
1548 | - * |
1549 | - * Return value: (transfer full) (array zero-terminated=1): an array |
1550 | - * of timezones. May be empty but will not be %NULL. |
1551 | - **/ |
1552 | -GWeatherTimezone ** |
1553 | -gweather_location_get_timezones (GWeatherLocation *loc) |
1554 | -{ |
1555 | - GPtrArray *zones; |
1556 | - |
1557 | - g_return_val_if_fail (loc != NULL, NULL); |
1558 | - |
1559 | - zones = g_ptr_array_new (); |
1560 | - add_timezones (loc, zones); |
1561 | - g_ptr_array_add (zones, NULL); |
1562 | - return (GWeatherTimezone **)g_ptr_array_free (zones, FALSE); |
1563 | -} |
1564 | - |
1565 | -/** |
1566 | - * gweather_location_free_timezones: |
1567 | - * @loc: a #GWeatherLocation |
1568 | - * @zones: an array returned from gweather_location_get_timezones() |
1569 | - * |
1570 | - * Frees the array of timezones returned by |
1571 | - * gweather_location_get_timezones(). |
1572 | - **/ |
1573 | -void |
1574 | -gweather_location_free_timezones (GWeatherLocation *loc, |
1575 | - GWeatherTimezone **zones) |
1576 | -{ |
1577 | - int i; |
1578 | - |
1579 | - g_return_if_fail (loc != NULL); |
1580 | - g_return_if_fail (zones != NULL); |
1581 | - |
1582 | - for (i = 0; zones[i]; i++) |
1583 | - gweather_timezone_unref (zones[i]); |
1584 | - g_free (zones); |
1585 | -} |
1586 | - |
1587 | -/** |
1588 | - * gweather_location_get_code: |
1589 | - * @loc: a #GWeatherLocation |
1590 | - * |
1591 | - * Gets the METAR station code associated with a |
1592 | - * %GWEATHER_LOCATION_WEATHER_STATION location. |
1593 | - * |
1594 | - * Return value: (allow-none): @loc's METAR station code, or %NULL |
1595 | - **/ |
1596 | -const char * |
1597 | -gweather_location_get_code (GWeatherLocation *loc) |
1598 | -{ |
1599 | - g_return_val_if_fail (loc != NULL, NULL); |
1600 | - return loc->station_code; |
1601 | -} |
1602 | - |
1603 | -/** |
1604 | - * gweather_location_get_city_name: |
1605 | - * @loc: a #GWeatherLocation |
1606 | - * |
1607 | - * For a %GWEATHER_LOCATION_CITY or %GWEATHER_LOCATION_DETACHED location, |
1608 | - * this is equivalent to gweather_location_get_name(). |
1609 | - * For a %GWEATHER_LOCATION_WEATHER_STATION location, it is equivalent to |
1610 | - * calling gweather_location_get_name() on the location's parent. For |
1611 | - * other locations it will return %NULL. |
1612 | - * |
1613 | - * Return value: (allow-none) @loc's city name, or %NULL |
1614 | - **/ |
1615 | -char * |
1616 | -gweather_location_get_city_name (GWeatherLocation *loc) |
1617 | -{ |
1618 | - g_return_val_if_fail (loc != NULL, NULL); |
1619 | - |
1620 | - if (loc->level == GWEATHER_LOCATION_CITY || |
1621 | - loc->level == GWEATHER_LOCATION_DETACHED) |
1622 | - return g_strdup (loc->name); |
1623 | - else if (loc->level == GWEATHER_LOCATION_WEATHER_STATION && |
1624 | - loc->parent && |
1625 | - loc->parent->level == GWEATHER_LOCATION_CITY) |
1626 | - return g_strdup (loc->parent->name); |
1627 | - else |
1628 | - return NULL; |
1629 | -} |
1630 | - |
1631 | -void |
1632 | -_gweather_location_update_weather_location (GWeatherLocation *gloc, |
1633 | - WeatherLocation *loc) |
1634 | -{ |
1635 | - const char *code = NULL, *zone = NULL, *yahoo_id = NULL, *radar = NULL, *tz_hint = NULL, *country = NULL; |
1636 | - gboolean latlon_valid = FALSE; |
1637 | - gdouble lat = DBL_MAX, lon = DBL_MAX; |
1638 | - GWeatherLocation *l; |
1639 | - |
1640 | - if (gloc->level == GWEATHER_LOCATION_CITY && gloc->children) |
1641 | - l = gloc->children[0]; |
1642 | - else |
1643 | - l = gloc; |
1644 | - |
1645 | - while (l && (!code || !zone || !radar || !tz_hint || !latlon_valid || !country)) { |
1646 | - if (!code && l->station_code) |
1647 | - code = l->station_code; |
1648 | - if (!zone && l->forecast_zone) |
1649 | - zone = l->forecast_zone; |
1650 | - if (!yahoo_id && l->yahoo_id) |
1651 | - yahoo_id = l->yahoo_id; |
1652 | - if (!radar && l->radar) |
1653 | - radar = l->radar; |
1654 | - if (!tz_hint && l->tz_hint) |
1655 | - tz_hint = l->tz_hint; |
1656 | - if (!country && l->country_code) |
1657 | - country = l->country_code; |
1658 | - if (!latlon_valid && l->latlon_valid) { |
1659 | - lat = l->latitude; |
1660 | - lon = l->longitude; |
1661 | - latlon_valid = TRUE; |
1662 | - } |
1663 | - l = l->parent; |
1664 | - } |
1665 | - |
1666 | - loc->name = g_strdup (gweather_location_get_name (gloc)), |
1667 | - loc->code = g_strdup (code); |
1668 | - loc->zone = g_strdup (zone); |
1669 | - loc->yahoo_id = g_strdup (yahoo_id); |
1670 | - loc->radar = g_strdup (radar); |
1671 | - loc->country_code = g_strdup (country); |
1672 | - loc->tz_hint = g_strdup (tz_hint); |
1673 | - |
1674 | - loc->latlon_valid = latlon_valid; |
1675 | - loc->latitude = lat; |
1676 | - loc->longitude = lon; |
1677 | -} |
1678 | - |
1679 | -/** |
1680 | - * gweather_location_find_by_station_code: |
1681 | - * @world: a #GWeatherLocation at the world level |
1682 | - * @station_code: a 4 letter METAR code |
1683 | - * |
1684 | - * Retrieves the weather station identifier by @station_code. |
1685 | - * Note that multiple instances of the same weather station can exist |
1686 | - * in the database, and this function will return any of them, so this |
1687 | - * not usually what you want. |
1688 | - * |
1689 | - * See gweather_location_deserialize() to recover a stored #GWeatherLocation. |
1690 | - * |
1691 | - * Returns: a weather station level #GWeatherLocation for @station_code, |
1692 | - * or %NULL if none exists in the database. |
1693 | - */ |
1694 | -GWeatherLocation * |
1695 | -gweather_location_find_by_station_code (GWeatherLocation *world, |
1696 | - const gchar *station_code) |
1697 | -{ |
1698 | - GList *l; |
1699 | - |
1700 | - l = g_hash_table_lookup (world->metar_code_cache, station_code); |
1701 | - return l ? l->data : NULL; |
1702 | -} |
1703 | - |
1704 | -GWeatherLocation * |
1705 | -gweather_location_ref_world (GWeatherLocation *loc) |
1706 | -{ |
1707 | - while (loc && |
1708 | - loc->level != GWEATHER_LOCATION_WORLD) |
1709 | - loc = loc->parent; |
1710 | - |
1711 | - if (loc) |
1712 | - gweather_location_ref (loc); |
1713 | - return loc; |
1714 | -} |
1715 | - |
1716 | -/** |
1717 | - * gweather_location_equal: |
1718 | - * @one: a #GWeatherLocation |
1719 | - * @two: another #GWeatherLocation |
1720 | - * |
1721 | - * Compares two #GWeatherLocation and sees if they represent the same |
1722 | - * place. |
1723 | - * It is only legal to call this for cities, weather stations or |
1724 | - * detached locations. |
1725 | - * Note that this function only checks for geographical characteristics, |
1726 | - * such as coordinates and METAR code. It is still possible that the two |
1727 | - * locations belong to different worlds (in which case care must be |
1728 | - * taken when passing them GWeatherLocationEntry and GWeatherInfo), or |
1729 | - * if one is them is detached it could have a custom name. |
1730 | - * |
1731 | - * Returns: %TRUE if the two locations represent the same place as |
1732 | - * far as libgweather can tell, and %FALSE otherwise. |
1733 | - */ |
1734 | -gboolean |
1735 | -gweather_location_equal (GWeatherLocation *one, |
1736 | - GWeatherLocation *two) |
1737 | -{ |
1738 | - int level; |
1739 | - |
1740 | - if (one == two) |
1741 | - return TRUE; |
1742 | - |
1743 | - if (one->level != two->level && |
1744 | - one->level != GWEATHER_LOCATION_DETACHED && |
1745 | - two->level != GWEATHER_LOCATION_DETACHED) |
1746 | - return FALSE; |
1747 | - |
1748 | - level = one->level; |
1749 | - if (level == GWEATHER_LOCATION_DETACHED) |
1750 | - level = two->level; |
1751 | - |
1752 | - if (level == GWEATHER_LOCATION_COUNTRY) |
1753 | - return g_strcmp0 (one->country_code, two->country_code); |
1754 | - |
1755 | - if (level == GWEATHER_LOCATION_ADM1 || |
1756 | - level == GWEATHER_LOCATION_ADM2) { |
1757 | - if (g_strcmp0 (one->sort_name, two->sort_name) != 0) |
1758 | - return FALSE; |
1759 | - |
1760 | - return one->parent && two->parent && |
1761 | - gweather_location_equal (one->parent, two->parent); |
1762 | - } |
1763 | - |
1764 | - if (g_strcmp0 (one->station_code, two->station_code) != 0) |
1765 | - return FALSE; |
1766 | - |
1767 | - if (one->level != GWEATHER_LOCATION_DETACHED && |
1768 | - two->level != GWEATHER_LOCATION_DETACHED && |
1769 | - !gweather_location_equal (one->parent, two->parent)) |
1770 | - return FALSE; |
1771 | - |
1772 | - return ABS(one->latitude - two->latitude) < EPSILON && |
1773 | - ABS(one->longitude - two->longitude) < EPSILON; |
1774 | -} |
1775 | - |
1776 | -/* ------------------- serialization ------------------------------- */ |
1777 | - |
1778 | -#define FORMAT 1 |
1779 | - |
1780 | -static GVariant * |
1781 | -gweather_location_format_one_serialize (GWeatherLocation *location) |
1782 | -{ |
1783 | - const char *name; |
1784 | - gboolean is_city; |
1785 | - |
1786 | - name = location->name; |
1787 | - |
1788 | - /* Normalize location to be a weather station or detached */ |
1789 | - if (location->level == GWEATHER_LOCATION_CITY) { |
1790 | - location = location->children[0]; |
1791 | - is_city = TRUE; |
1792 | - } else { |
1793 | - is_city = FALSE; |
1794 | - } |
1795 | - |
1796 | - return g_variant_new ("(ssbm(dd)m(dd))", |
1797 | - name, location->station_code, is_city, |
1798 | - location->latlon_valid, |
1799 | - location->latitude, |
1800 | - location->longitude, |
1801 | - location->parent && location->parent->latlon_valid, |
1802 | - location->parent ? location->parent->latitude : 0.0d, |
1803 | - location->parent ? location->parent->longitude : 0.0d); |
1804 | -} |
1805 | - |
1806 | -GWeatherLocation * |
1807 | -_gweather_location_new_detached (GWeatherLocation *nearest_station, |
1808 | - const char *name, |
1809 | - gboolean latlon_valid, |
1810 | - gdouble latitude, |
1811 | - gdouble longitude) |
1812 | -{ |
1813 | - GWeatherLocation *self; |
1814 | - char *normalized; |
1815 | - |
1816 | - self = g_slice_new0 (GWeatherLocation); |
1817 | - self->level = GWEATHER_LOCATION_DETACHED; |
1818 | - self->name = g_strdup (name); |
1819 | - |
1820 | - normalized = g_utf8_normalize (name, -1, G_NORMALIZE_ALL); |
1821 | - self->sort_name = g_utf8_casefold (normalized, -1); |
1822 | - g_free (normalized); |
1823 | - |
1824 | - self->parent = nearest_station; |
1825 | - self->children = NULL; |
1826 | - |
1827 | - if (nearest_station) |
1828 | - self->station_code = g_strdup (nearest_station->station_code); |
1829 | - |
1830 | - g_assert (nearest_station || latlon_valid); |
1831 | - |
1832 | - if (latlon_valid) { |
1833 | - self->latlon_valid = TRUE; |
1834 | - self->latitude = latitude; |
1835 | - self->longitude = longitude; |
1836 | - } else { |
1837 | - self->latlon_valid = nearest_station->latlon_valid; |
1838 | - self->latitude = nearest_station->latitude; |
1839 | - self->longitude = nearest_station->longitude; |
1840 | - } |
1841 | - |
1842 | - return self; |
1843 | -} |
1844 | - |
1845 | -static GWeatherLocation * |
1846 | -gweather_location_format_one_deserialize (GWeatherLocation *world, |
1847 | - GVariant *variant) |
1848 | -{ |
1849 | - const char *name; |
1850 | - const char *station_code; |
1851 | - gboolean is_city, latlon_valid, parent_latlon_valid; |
1852 | - gdouble latitude, longitude, parent_latitude, parent_longitude; |
1853 | - GList *candidates, *l; |
1854 | - GWeatherLocation *found; |
1855 | - |
1856 | - /* This one instead is a critical, because format is specified in |
1857 | - the containing variant */ |
1858 | - g_return_val_if_fail (g_variant_is_of_type (variant, |
1859 | - G_VARIANT_TYPE ("(ssbm(dd)m(dd))")), NULL); |
1860 | - |
1861 | - g_variant_get (variant, "(&s&sbm(dd)m(dd))", &name, &station_code, &is_city, |
1862 | - &latlon_valid, &latitude, &longitude, |
1863 | - &parent_latlon_valid, &parent_latitude, &parent_longitude); |
1864 | - |
1865 | - /* First find the list of candidate locations */ |
1866 | - candidates = g_hash_table_lookup (world->metar_code_cache, station_code); |
1867 | - |
1868 | - /* If we don't have coordinates, fallback immediately to making up |
1869 | - * a location |
1870 | - */ |
1871 | - if (!latlon_valid) |
1872 | - return candidates ? _gweather_location_new_detached (candidates->data, name, FALSE, 0, 0) : NULL; |
1873 | - |
1874 | - found = NULL; |
1875 | - |
1876 | - /* First try weather stations directly. */ |
1877 | - for (l = candidates; l; l = l->next) { |
1878 | - GWeatherLocation *ws, *city; |
1879 | - |
1880 | - ws = l->data; |
1881 | - |
1882 | - if (!ws->latlon_valid || |
1883 | - ABS(ws->latitude - latitude) >= EPSILON || |
1884 | - ABS(ws->longitude - longitude) >= EPSILON) |
1885 | - /* Not what we're looking for... */ |
1886 | - continue; |
1887 | - |
1888 | - /* If we can't check for the latitude and longitude |
1889 | - of the parent, we just assume we found what we needed |
1890 | - */ |
1891 | - if ((!parent_latlon_valid || !ws->parent || !ws->parent->latlon_valid) || |
1892 | - (ABS(parent_latitude - ws->parent->latitude) < EPSILON && |
1893 | - ABS(parent_longitude - ws->parent->longitude) < EPSILON)) { |
1894 | - |
1895 | - /* Found! Now check which one we want (ws or city) and the name... */ |
1896 | - if (is_city) |
1897 | - city = ws->parent; |
1898 | - else |
1899 | - city = ws; |
1900 | - |
1901 | - if (city == NULL) { |
1902 | - /* Oops! There is no city for this weather station! */ |
1903 | - continue; |
1904 | - } |
1905 | - |
1906 | - if (g_strcmp0 (name, city->name) == 0) |
1907 | - found = gweather_location_ref (city); |
1908 | - else |
1909 | - found = _gweather_location_new_detached (city, name, FALSE, 0, 0); |
1910 | - |
1911 | - break; |
1912 | - } |
1913 | - } |
1914 | - |
1915 | - if (found) |
1916 | - return found; |
1917 | - |
1918 | - /* No weather station matches the serialized data, let's pick |
1919 | - one at random from the station code list */ |
1920 | - if (candidates) |
1921 | - return _gweather_location_new_detached (candidates->data, |
1922 | - name, TRUE, latitude, longitude); |
1923 | - else |
1924 | - return NULL; |
1925 | -} |
1926 | - |
1927 | -/** |
1928 | - * gweather_location_serialize: |
1929 | - * @location: a #GWeatherLocation |
1930 | - * |
1931 | - * Returns: (transfer none): |
1932 | - */ |
1933 | -GVariant * |
1934 | -gweather_location_serialize (GWeatherLocation *location) |
1935 | -{ |
1936 | - g_return_val_if_fail (location != NULL, NULL); |
1937 | - g_return_val_if_fail (location->level >= GWEATHER_LOCATION_CITY, NULL); |
1938 | - |
1939 | - return g_variant_new ("(uv)", FORMAT, |
1940 | - gweather_location_format_one_serialize (location)); |
1941 | -} |
1942 | - |
1943 | -GWeatherLocation * |
1944 | -gweather_location_deserialize (GWeatherLocation *world, |
1945 | - GVariant *serialized) |
1946 | -{ |
1947 | - GVariant *v; |
1948 | - GWeatherLocation *loc; |
1949 | - int format; |
1950 | - |
1951 | - g_return_val_if_fail (world != NULL, NULL); |
1952 | - g_return_val_if_fail (serialized != NULL, NULL); |
1953 | - |
1954 | - /* This is not a critical error, because the serialization format |
1955 | - is not public, so apps can't check this before calling */ |
1956 | - if (!g_variant_is_of_type (serialized, G_VARIANT_TYPE ("(uv)"))) |
1957 | - return NULL; |
1958 | - |
1959 | - g_variant_get (serialized, "(uv)", &format, &v); |
1960 | - |
1961 | - if (format == FORMAT) |
1962 | - loc = gweather_location_format_one_deserialize (world, v); |
1963 | - else |
1964 | - loc = NULL; |
1965 | - |
1966 | - g_variant_unref (v); |
1967 | - return loc; |
1968 | -} |
1969 | |
1970 | === removed file '.pc/01_gettext_not_xml.patch/libgweather/gweather-timezone.c' |
1971 | --- .pc/01_gettext_not_xml.patch/libgweather/gweather-timezone.c 2013-05-27 11:58:15 +0000 |
1972 | +++ .pc/01_gettext_not_xml.patch/libgweather/gweather-timezone.c 1970-01-01 00:00:00 +0000 |
1973 | @@ -1,407 +0,0 @@ |
1974 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
1975 | -/* gweather-timezone.c - Timezone handling |
1976 | - * |
1977 | - * Copyright 2008, Red Hat, Inc. |
1978 | - * |
1979 | - * This library is free software; you can redistribute it and/or |
1980 | - * modify it under the terms of the GNU Lesser General Public License |
1981 | - * as published by the Free Software Foundation; either version 2.1 of |
1982 | - * the License, or (at your option) any later version. |
1983 | - * |
1984 | - * This library is distributed in the hope that it will be useful, but |
1985 | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
1986 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1987 | - * Lesser General Public License for more details. |
1988 | - * |
1989 | - * You should have received a copy of the GNU Lesser General Public |
1990 | - * License along with this library; if not, see |
1991 | - * <http://www.gnu.org/licenses/>. |
1992 | - */ |
1993 | - |
1994 | -#ifdef HAVE_CONFIG_H |
1995 | -#include <config.h> |
1996 | -#endif |
1997 | - |
1998 | -#include <string.h> |
1999 | - |
2000 | -#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE |
2001 | -#include "gweather-timezone.h" |
2002 | -#include "parser.h" |
2003 | -#include "weather-priv.h" |
2004 | - |
2005 | -/** |
2006 | - * SECTION:gweathertimezone |
2007 | - * @Title: GWeatherTimezone |
2008 | - * |
2009 | - * A timezone. |
2010 | - * |
2011 | - * There are no public methods for creating timezones; they can only |
2012 | - * be created by calling gweather_location_new_world() to parse |
2013 | - * Locations.xml, and then calling various #GWeatherLocation methods |
2014 | - * to extract relevant timezones from the location hierarchy. |
2015 | - */ |
2016 | - |
2017 | -struct _GWeatherTimezone { |
2018 | - char *id, *name; |
2019 | - int offset, dst_offset; |
2020 | - gboolean has_dst; |
2021 | - |
2022 | - int ref_count; |
2023 | -}; |
2024 | - |
2025 | -#define TZ_MAGIC "TZif" |
2026 | -#define TZ_HEADER_SIZE 44 |
2027 | -#define TZ_TIMECNT_OFFSET 32 |
2028 | -#define TZ_TRANSITIONS_OFFSET 44 |
2029 | - |
2030 | -#define TZ_TTINFO_SIZE 6 |
2031 | -#define TZ_TTINFO_GMTOFF_OFFSET 0 |
2032 | -#define TZ_TTINFO_ISDST_OFFSET 4 |
2033 | - |
2034 | -static gboolean |
2035 | -parse_tzdata (const char *tzname, time_t start, time_t end, |
2036 | - int *offset, gboolean *has_dst, int *dst_offset) |
2037 | -{ |
2038 | - char *filename, *contents; |
2039 | - gsize length; |
2040 | - int timecnt, transitions_size, ttinfo_map_size; |
2041 | - int initial_transition = -1, second_transition = -1; |
2042 | - gint32 *transitions; |
2043 | - char *ttinfo_map, *ttinfos; |
2044 | - gint32 initial_offset, second_offset; |
2045 | - char initial_isdst, second_isdst; |
2046 | - int i; |
2047 | - |
2048 | - filename = g_build_filename (ZONEINFO_DIR, tzname, NULL); |
2049 | - if (!g_file_get_contents (filename, &contents, &length, NULL)) { |
2050 | - g_free (filename); |
2051 | - return FALSE; |
2052 | - } |
2053 | - g_free (filename); |
2054 | - |
2055 | - if (length < TZ_HEADER_SIZE || |
2056 | - strncmp (contents, TZ_MAGIC, strlen (TZ_MAGIC)) != 0) { |
2057 | - g_free (contents); |
2058 | - return FALSE; |
2059 | - } |
2060 | - |
2061 | - timecnt = GUINT32_FROM_BE (*(guint32 *)(contents + TZ_TIMECNT_OFFSET)); |
2062 | - transitions = (void *)(contents + TZ_TRANSITIONS_OFFSET); |
2063 | - transitions_size = timecnt * sizeof (*transitions); |
2064 | - ttinfo_map = (void *)(contents + TZ_TRANSITIONS_OFFSET + transitions_size); |
2065 | - ttinfo_map_size = timecnt; |
2066 | - ttinfos = (void *)(ttinfo_map + ttinfo_map_size); |
2067 | - |
2068 | - /* @transitions is an array of @timecnt time_t values. We need to |
2069 | - * find the transition into the current offset, which is the last |
2070 | - * transition before @start. If the following transition is before |
2071 | - * @end, then note that one too, since it presumably means we're |
2072 | - * doing DST. |
2073 | - */ |
2074 | - for (i = 1; i < timecnt && initial_transition == -1; i++) { |
2075 | - if (GINT32_FROM_BE (transitions[i]) > start) { |
2076 | - initial_transition = ttinfo_map[i - 1]; |
2077 | - if (GINT32_FROM_BE (transitions[i]) < end) |
2078 | - second_transition = ttinfo_map[i]; |
2079 | - } |
2080 | - } |
2081 | - if (initial_transition == -1) { |
2082 | - if (timecnt) |
2083 | - initial_transition = ttinfo_map[timecnt - 1]; |
2084 | - else |
2085 | - initial_transition = 0; |
2086 | - } |
2087 | - |
2088 | - /* Copy the data out of the corresponding ttinfo structs */ |
2089 | - initial_offset = *(gint32 *)(ttinfos + |
2090 | - initial_transition * TZ_TTINFO_SIZE + |
2091 | - TZ_TTINFO_GMTOFF_OFFSET); |
2092 | - initial_offset = GINT32_FROM_BE (initial_offset); |
2093 | - initial_isdst = *(ttinfos + |
2094 | - initial_transition * TZ_TTINFO_SIZE + |
2095 | - TZ_TTINFO_ISDST_OFFSET); |
2096 | - |
2097 | - if (second_transition != -1) { |
2098 | - second_offset = *(gint32 *)(ttinfos + |
2099 | - second_transition * TZ_TTINFO_SIZE + |
2100 | - TZ_TTINFO_GMTOFF_OFFSET); |
2101 | - second_offset = GINT32_FROM_BE (second_offset); |
2102 | - second_isdst = *(ttinfos + |
2103 | - second_transition * TZ_TTINFO_SIZE + |
2104 | - TZ_TTINFO_ISDST_OFFSET); |
2105 | - |
2106 | - *has_dst = (initial_isdst != second_isdst); |
2107 | - } else |
2108 | - *has_dst = FALSE; |
2109 | - |
2110 | - if (!*has_dst) |
2111 | - *offset = initial_offset / 60; |
2112 | - else { |
2113 | - if (initial_isdst) { |
2114 | - *offset = second_offset / 60; |
2115 | - *dst_offset = initial_offset / 60; |
2116 | - } else { |
2117 | - *offset = initial_offset / 60; |
2118 | - *dst_offset = second_offset / 60; |
2119 | - } |
2120 | - } |
2121 | - |
2122 | - g_free (contents); |
2123 | - return TRUE; |
2124 | -} |
2125 | - |
2126 | -static GWeatherTimezone * |
2127 | -parse_timezone (GWeatherParser *parser) |
2128 | -{ |
2129 | - GWeatherTimezone *zone = NULL; |
2130 | - char *id = NULL, *name = NULL; |
2131 | - int offset = 0, dst_offset = 0; |
2132 | - gboolean has_dst = FALSE; |
2133 | - |
2134 | - id = (char *) xmlTextReaderGetAttribute (parser->xml, (xmlChar *) "id"); |
2135 | - if (!id) { |
2136 | - xmlTextReaderNext (parser->xml); |
2137 | - return NULL; |
2138 | - } |
2139 | - |
2140 | - if (!xmlTextReaderIsEmptyElement (parser->xml)) { |
2141 | - if (xmlTextReaderRead (parser->xml) != 1) { |
2142 | - xmlFree (id); |
2143 | - return NULL; |
2144 | - } |
2145 | - |
2146 | - while (xmlTextReaderNodeType (parser->xml) != XML_READER_TYPE_END_ELEMENT) { |
2147 | - if (xmlTextReaderNodeType (parser->xml) != XML_READER_TYPE_ELEMENT) { |
2148 | - if (xmlTextReaderRead (parser->xml) != 1) |
2149 | - break; |
2150 | - continue; |
2151 | - } |
2152 | - |
2153 | - if (!strcmp ((const char *) xmlTextReaderConstName (parser->xml), "name")) |
2154 | - name = gweather_parser_get_localized_value (parser); |
2155 | - else { |
2156 | - if (xmlTextReaderNext (parser->xml) != 1) |
2157 | - break; |
2158 | - } |
2159 | - } |
2160 | - } |
2161 | - |
2162 | - if (parse_tzdata (id, parser->year_start, parser->year_end, |
2163 | - &offset, &has_dst, &dst_offset)) { |
2164 | - zone = g_slice_new0 (GWeatherTimezone); |
2165 | - zone->ref_count = 1; |
2166 | - zone->id = g_strdup (id); |
2167 | - zone->name = g_strdup (name); |
2168 | - zone->offset = offset; |
2169 | - zone->has_dst = has_dst; |
2170 | - zone->dst_offset = dst_offset; |
2171 | - } |
2172 | - |
2173 | - xmlFree (id); |
2174 | - if (name) |
2175 | - xmlFree (name); |
2176 | - |
2177 | - return zone; |
2178 | -} |
2179 | - |
2180 | -GWeatherTimezone ** |
2181 | -gweather_timezones_parse_xml (GWeatherParser *parser) |
2182 | -{ |
2183 | - GPtrArray *zones; |
2184 | - GWeatherTimezone *zone; |
2185 | - const char *tagname; |
2186 | - int tagtype, i; |
2187 | - |
2188 | - zones = g_ptr_array_new (); |
2189 | - |
2190 | - if (xmlTextReaderRead (parser->xml) != 1) |
2191 | - goto error_out; |
2192 | - while ((tagtype = xmlTextReaderNodeType (parser->xml)) != |
2193 | - XML_READER_TYPE_END_ELEMENT) { |
2194 | - if (tagtype != XML_READER_TYPE_ELEMENT) { |
2195 | - if (xmlTextReaderRead (parser->xml) != 1) |
2196 | - goto error_out; |
2197 | - continue; |
2198 | - } |
2199 | - |
2200 | - tagname = (const char *) xmlTextReaderConstName (parser->xml); |
2201 | - |
2202 | - if (!strcmp (tagname, "timezone")) { |
2203 | - zone = parse_timezone (parser); |
2204 | - if (zone) |
2205 | - g_ptr_array_add (zones, zone); |
2206 | - } |
2207 | - |
2208 | - if (xmlTextReaderNext (parser->xml) != 1) |
2209 | - goto error_out; |
2210 | - } |
2211 | - if (xmlTextReaderRead (parser->xml) != 1) |
2212 | - goto error_out; |
2213 | - |
2214 | - g_ptr_array_add (zones, NULL); |
2215 | - return (GWeatherTimezone **)g_ptr_array_free (zones, FALSE); |
2216 | - |
2217 | -error_out: |
2218 | - for (i = 0; i < zones->len; i++) |
2219 | - gweather_timezone_unref (zones->pdata[i]); |
2220 | - g_ptr_array_free (zones, TRUE); |
2221 | - return NULL; |
2222 | -} |
2223 | - |
2224 | -/** |
2225 | - * gweather_timezone_ref: |
2226 | - * @zone: a #GWeatherTimezone |
2227 | - * |
2228 | - * Adds 1 to @zone's reference count. |
2229 | - * |
2230 | - * Return value: @zone |
2231 | - **/ |
2232 | -GWeatherTimezone * |
2233 | -gweather_timezone_ref (GWeatherTimezone *zone) |
2234 | -{ |
2235 | - g_return_val_if_fail (zone != NULL, NULL); |
2236 | - |
2237 | - zone->ref_count++; |
2238 | - return zone; |
2239 | -} |
2240 | - |
2241 | -/** |
2242 | - * gweather_timezone_unref: |
2243 | - * @zone: a #GWeatherTimezone |
2244 | - * |
2245 | - * Subtracts 1 from @zone's reference count and frees it if it reaches 0. |
2246 | - **/ |
2247 | -void |
2248 | -gweather_timezone_unref (GWeatherTimezone *zone) |
2249 | -{ |
2250 | - g_return_if_fail (zone != NULL); |
2251 | - |
2252 | - if (!--zone->ref_count) { |
2253 | - g_free (zone->id); |
2254 | - g_free (zone->name); |
2255 | - g_slice_free (GWeatherTimezone, zone); |
2256 | - } |
2257 | -} |
2258 | - |
2259 | -GType |
2260 | -gweather_timezone_get_type (void) |
2261 | -{ |
2262 | - static volatile gsize type_volatile = 0; |
2263 | - |
2264 | - if (g_once_init_enter (&type_volatile)) { |
2265 | - GType type = g_boxed_type_register_static ( |
2266 | - g_intern_static_string ("GWeatherTimezone"), |
2267 | - (GBoxedCopyFunc) gweather_timezone_ref, |
2268 | - (GBoxedFreeFunc) gweather_timezone_unref); |
2269 | - g_once_init_leave (&type_volatile, type); |
2270 | - } |
2271 | - return type_volatile; |
2272 | -} |
2273 | - |
2274 | -/** |
2275 | - * gweather_timezone_get_utc: |
2276 | - * |
2277 | - * Gets the UTC timezone. |
2278 | - * |
2279 | - * Return value: a #GWeatherTimezone for UTC, or %NULL on error. |
2280 | - **/ |
2281 | -GWeatherTimezone * |
2282 | -gweather_timezone_get_utc (void) |
2283 | -{ |
2284 | - GWeatherTimezone *zone = NULL; |
2285 | - |
2286 | - zone = g_slice_new0 (GWeatherTimezone); |
2287 | - zone->ref_count = 1; |
2288 | - zone->id = g_strdup ("GMT"); |
2289 | - zone->name = g_strdup (_("Greenwich Mean Time")); |
2290 | - zone->offset = 0; |
2291 | - zone->has_dst = FALSE; |
2292 | - zone->dst_offset = 0; |
2293 | - |
2294 | - return zone; |
2295 | -} |
2296 | - |
2297 | -/** |
2298 | - * gweather_timezone_get_name: |
2299 | - * @zone: a #GWeatherTimezone |
2300 | - * |
2301 | - * Gets @zone's name; a translated, user-presentable string. |
2302 | - * |
2303 | - * Note that the returned name might not be unique among timezones, |
2304 | - * and may not make sense to the user unless it is presented along |
2305 | - * with the timezone's country's name (or in some context where the |
2306 | - * country is obvious). |
2307 | - * |
2308 | - * Return value: @zone's name |
2309 | - **/ |
2310 | -const char * |
2311 | -gweather_timezone_get_name (GWeatherTimezone *zone) |
2312 | -{ |
2313 | - g_return_val_if_fail (zone != NULL, NULL); |
2314 | - return zone->name; |
2315 | -} |
2316 | - |
2317 | -/** |
2318 | - * gweather_timezone_get_tzid: |
2319 | - * @zone: a #GWeatherTimezone |
2320 | - * |
2321 | - * Gets @zone's tzdata identifier, eg "America/New_York". |
2322 | - * |
2323 | - * Return value: @zone's tzid |
2324 | - **/ |
2325 | -const char * |
2326 | -gweather_timezone_get_tzid (GWeatherTimezone *zone) |
2327 | -{ |
2328 | - g_return_val_if_fail (zone != NULL, NULL); |
2329 | - return zone->id; |
2330 | -} |
2331 | - |
2332 | -/** |
2333 | - * gweather_timezone_get_offset: |
2334 | - * @zone: a #GWeatherTimezone |
2335 | - * |
2336 | - * Gets @zone's standard offset from UTC, in minutes. Eg, a value of |
2337 | - * 120 would indicate "GMT+2". |
2338 | - * |
2339 | - * Return value: @zone's standard offset, in minutes |
2340 | - **/ |
2341 | -int |
2342 | -gweather_timezone_get_offset (GWeatherTimezone *zone) |
2343 | -{ |
2344 | - g_return_val_if_fail (zone != NULL, 0); |
2345 | - return zone->offset; |
2346 | -} |
2347 | - |
2348 | -/** |
2349 | - * gweather_timezone_has_dst: |
2350 | - * @zone: a #GWeatherTimezone |
2351 | - * |
2352 | - * Checks if @zone observes daylight/summer time for part of the year. |
2353 | - * |
2354 | - * Return value: %TRUE if @zone observes daylight/summer time. |
2355 | - **/ |
2356 | -gboolean |
2357 | -gweather_timezone_has_dst (GWeatherTimezone *zone) |
2358 | -{ |
2359 | - g_return_val_if_fail (zone != NULL, FALSE); |
2360 | - return zone->has_dst; |
2361 | -} |
2362 | - |
2363 | -/** |
2364 | - * gweather_timezone_get_dst_offset: |
2365 | - * @zone: a #GWeatherTimezone |
2366 | - * |
2367 | - * Gets @zone's daylight/summer time offset from UTC, in minutes. Eg, |
2368 | - * a value of 120 would indicate "GMT+2". This is only meaningful if |
2369 | - * gweather_timezone_has_dst() returns %TRUE. |
2370 | - * |
2371 | - * Return value: @zone's daylight/summer time offset, in minutes |
2372 | - **/ |
2373 | -int |
2374 | -gweather_timezone_get_dst_offset (GWeatherTimezone *zone) |
2375 | -{ |
2376 | - g_return_val_if_fail (zone != NULL, 0); |
2377 | - g_return_val_if_fail (zone->has_dst, 0); |
2378 | - return zone->dst_offset; |
2379 | -} |
2380 | - |
2381 | |
2382 | === removed directory '.pc/01_gettext_not_xml.patch/po-locations' |
2383 | === removed file '.pc/01_gettext_not_xml.patch/po-locations/LINGUAS' |
2384 | === removed file '.pc/01_gettext_not_xml.patch/po-locations/Makefile.in.in' |
2385 | === removed file '.pc/01_gettext_not_xml.patch/po-locations/POTFILES.in' |
2386 | === removed directory '.pc/02_no_external_gettext.patch' |
2387 | === removed file '.pc/02_no_external_gettext.patch/configure.ac' |
2388 | --- .pc/02_no_external_gettext.patch/configure.ac 2013-12-17 09:39:59 +0000 |
2389 | +++ .pc/02_no_external_gettext.patch/configure.ac 1970-01-01 00:00:00 +0000 |
2390 | @@ -1,182 +0,0 @@ |
2391 | -AC_INIT([libgweather], |
2392 | - [3.8.3], |
2393 | - [http://bugzilla.gnome.org/enter_bug.cgi?product=libgweather], |
2394 | - [libgweather], |
2395 | - [http://live.gnome.org/LibGWeather]) |
2396 | -AC_PREREQ([2.64]) |
2397 | - |
2398 | -AC_CONFIG_HEADERS([config.h]) |
2399 | -AC_CONFIG_MACRO_DIR([m4]) |
2400 | -AC_CONFIG_AUX_DIR([build-aux]) |
2401 | - |
2402 | -AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar]) |
2403 | -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
2404 | - |
2405 | -# Before making a release, the LT_VERSION string should be modified. |
2406 | -# The string is of the form C:R:A. |
2407 | -# - If interfaces have been changed or added, but binary compatibility has |
2408 | -# been preserved, change to C+1:0:A+1 |
2409 | -# - If binary compatibility has been broken (eg removed or changed interfaces) |
2410 | -# change to C+1:0:0 |
2411 | -# - If the interface is the same as the previous version, change to C:R+1:A |
2412 | - |
2413 | -LT_VERSION=3:3:0 |
2414 | -AC_SUBST(LT_VERSION) |
2415 | - |
2416 | -GTK_REQUIRED=2.90.0 |
2417 | -GLIB_REQUIRED=2.35.1 |
2418 | -LIBSOUP_REQUIRED=2.34.0 |
2419 | -LIBXML_REQUIRED=2.6.0 |
2420 | - |
2421 | -LT_PREREQ([2.2.6]) |
2422 | -LT_INIT([disable-static]) |
2423 | -LT_LIB_M |
2424 | - |
2425 | -dnl IT_PROG_INTLTOOL does this for us in the case of the po/ subdir, but we're on our own for po-locations |
2426 | -AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po-locations/Makefile.in > po-locations/Makefile]) |
2427 | -IT_PO_SUBDIR([po-locations]) |
2428 | - |
2429 | -PKG_PROG_PKG_CONFIG([0.19]) |
2430 | - |
2431 | -AC_PROG_CC |
2432 | -AM_PROG_CC_C_O |
2433 | - |
2434 | -GLIB_GSETTINGS |
2435 | - |
2436 | -AC_ARG_ENABLE(locations-compression, |
2437 | - [AS_HELP_STRING([--enable-locations-compression], |
2438 | - [Compress Locations.xml files])], |
2439 | - [enable_locations_compression=yes], |
2440 | - [enable_locations_compression=no]) |
2441 | -if test "x$enable_locations_compression" = "xyes"; then |
2442 | - COMPRESS_EXT=.gz |
2443 | -else |
2444 | - COMPRESS_EXT= |
2445 | -fi |
2446 | -AC_SUBST(COMPRESS_EXT) |
2447 | - |
2448 | -GNOME_COMPILE_WARNINGS([maximum]) |
2449 | - |
2450 | -dnl -- Check for GTK+ 3.0 (required) ------------------------------------------ |
2451 | -PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED) |
2452 | - |
2453 | -dnl -- Check for libxml (required) ------------------------------------------ |
2454 | -PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED) |
2455 | - |
2456 | -dnl -- check for libsoup (required) ----------------------------------------- |
2457 | -PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_REQUIRED]) |
2458 | - |
2459 | -dnl -- check for glib and gio (required) ----------------------------------------- |
2460 | -PKG_CHECK_MODULES(GIO, |
2461 | - [glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED]) |
2462 | - |
2463 | -dnl -- check for glib; redundant at this point, but sets $GLIB_MKENUMS |
2464 | -AM_PATH_GLIB_2_0($GLIB_REQUIRED) |
2465 | - |
2466 | -dnl gettext |
2467 | -IT_PROG_INTLTOOL([0.50.0]) |
2468 | - |
2469 | -AM_GNU_GETTEXT_VERSION([0.18]) |
2470 | -AM_GNU_GETTEXT([external]) |
2471 | - |
2472 | -GETTEXT_PACKAGE=libgweather-3.0 |
2473 | -AC_SUBST(GETTEXT_PACKAGE) |
2474 | -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package]) |
2475 | - |
2476 | -dnl *************************************************************************** |
2477 | -dnl *** REGEX *** |
2478 | -dnl *************************************************************************** |
2479 | -AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec, |
2480 | - [REGEX_LIBS=-lregex], |
2481 | - [AC_MSG_ERROR([No regex library found])])]) |
2482 | -AC_SUBST(REGEX_LIBS) |
2483 | - |
2484 | - |
2485 | -dnl *************************************************************************** |
2486 | -dnl *** Check for presence of tm.tm_gmtoff on the system *** |
2487 | -dnl *************************************************************************** |
2488 | -AC_CHECK_MEMBER([struct tm.tm_gmtoff],[struct_tm_tm_gmtoff=true],[struct_tm_tm_gmtoff=false],[#include <time.h>]) |
2489 | -case $struct_tm_tm_gmtoff in |
2490 | - true) |
2491 | - AC_DEFINE_UNQUOTED(HAVE_TM_TM_GMOFF, 1, Have the tm.tm_gmtoff member.) |
2492 | - ;; |
2493 | - *) |
2494 | - AC_CHECK_DECL(timezone,AC_DEFINE(HAVE_TIMEZONE,1,Have timezone),, |
2495 | -[ |
2496 | -#include <time.h> |
2497 | -]) |
2498 | - ;; |
2499 | -esac |
2500 | - |
2501 | -dnl *************************************************************************** |
2502 | -dnl *** _NL_MEASUREMENT_MEASUREMENT is an enum and not a define *** |
2503 | -dnl *************************************************************************** |
2504 | -AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT]) |
2505 | -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[ |
2506 | -char c; |
2507 | -c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT)); |
2508 | -]])],[gtk_ok=yes],[gtk_ok=no]) |
2509 | -AC_MSG_RESULT($gtk_ok) |
2510 | -if test "$gtk_ok" = "yes"; then |
2511 | - AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1], |
2512 | - [Define if _NL_MEASUREMENT_MEASUREMENT is available]) |
2513 | -fi |
2514 | - |
2515 | -dnl *************************************************************************** |
2516 | -dnl *** Find tzdata *** |
2517 | -dnl *************************************************************************** |
2518 | -AC_ARG_WITH(zoneinfo-dir, |
2519 | - [ --with-zoneinfo-dir tzdata zoneinfo directory], |
2520 | - ZONEINFO_DIR="$withval") |
2521 | -if test -z "$ZONEINFO_DIR"; then |
2522 | - if test -d /usr/share/zoneinfo; then |
2523 | - ZONEINFO_DIR="/usr/share/zoneinfo" |
2524 | - elif test -d /usr/share/lib/zoneinfo/tab; then |
2525 | - ZONEINFO_DIR="/usr/share/lib/zoneinfo/tab" |
2526 | - else |
2527 | - AC_MSG_ERROR(Can't find zoneinfo directory. Use --with-zoneinfo-dir) |
2528 | - fi |
2529 | -fi |
2530 | -AC_DEFINE_UNQUOTED(ZONEINFO_DIR, "$ZONEINFO_DIR", [zoneinfo directory]) |
2531 | - |
2532 | -AC_SUBST(VERSION) |
2533 | -AC_SUBST(PACKAGE) |
2534 | -AC_SUBST(DATADIR) |
2535 | -AC_SUBST(LIBDIR) |
2536 | -AC_SUBST(GLADEDIR) |
2537 | - |
2538 | -################################################## |
2539 | -# Checks for gtk-doc and docbook-tools |
2540 | -################################################## |
2541 | -GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) |
2542 | - |
2543 | -GOBJECT_INTROSPECTION_CHECK([0.9.5]) |
2544 | - |
2545 | -dnl *************************************************************************** |
2546 | -dnl *** Output Makefiles et al *** |
2547 | -dnl *************************************************************************** |
2548 | -AC_CONFIG_FILES([ |
2549 | -Makefile |
2550 | -doc/Makefile |
2551 | -po/Makefile.in |
2552 | -po-locations/Makefile.in |
2553 | -libgweather/Makefile |
2554 | -libgweather/gweather-3.0.pc |
2555 | -libgweather/gweather-3.0-uninstalled.pc |
2556 | -data/Makefile |
2557 | -icons/Makefile |
2558 | -schemas/Makefile |
2559 | -]) |
2560 | -AC_OUTPUT |
2561 | - |
2562 | -dnl *************************************************************************** |
2563 | -dnl *** Display Summary *** |
2564 | -dnl *************************************************************************** |
2565 | -echo " |
2566 | -libgweather-$VERSION configure summary: |
2567 | - |
2568 | - Prefix: ${prefix} |
2569 | - Source code location: ${srcdir} |
2570 | - Compiler: ${CC} |
2571 | - Introspection support: ${found_introspection} |
2572 | -" >&2 |
2573 | |
2574 | === removed directory '.pc/99_ltmain_as-needed.patch' |
2575 | === removed directory '.pc/99_ltmain_as-needed.patch/build-aux' |
2576 | === removed file '.pc/99_ltmain_as-needed.patch/build-aux/ltmain.sh' |
2577 | --- .pc/99_ltmain_as-needed.patch/build-aux/ltmain.sh 2012-10-05 21:46:06 +0000 |
2578 | +++ .pc/99_ltmain_as-needed.patch/build-aux/ltmain.sh 1970-01-01 00:00:00 +0000 |
2579 | @@ -1,9655 +0,0 @@ |
2580 | - |
2581 | -# libtool (GNU libtool) 2.4.2 |
2582 | -# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
2583 | - |
2584 | -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, |
2585 | -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
2586 | -# This is free software; see the source for copying conditions. There is NO |
2587 | -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
2588 | - |
2589 | -# GNU Libtool is free software; you can redistribute it and/or modify |
2590 | -# it under the terms of the GNU General Public License as published by |
2591 | -# the Free Software Foundation; either version 2 of the License, or |
2592 | -# (at your option) any later version. |
2593 | -# |
2594 | -# As a special exception to the GNU General Public License, |
2595 | -# if you distribute this file as part of a program or library that |
2596 | -# is built using GNU Libtool, you may include this file under the |
2597 | -# same distribution terms that you use for the rest of that program. |
2598 | -# |
2599 | -# GNU Libtool is distributed in the hope that it will be useful, but |
2600 | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
2601 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2602 | -# General Public License for more details. |
2603 | -# |
2604 | -# You should have received a copy of the GNU General Public License |
2605 | -# along with GNU Libtool; see the file COPYING. If not, a copy |
2606 | -# can be downloaded from http://www.gnu.org/licenses/gpl.html, |
2607 | -# or obtained by writing to the Free Software Foundation, Inc., |
2608 | -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
2609 | - |
2610 | -# Usage: $progname [OPTION]... [MODE-ARG]... |
2611 | -# |
2612 | -# Provide generalized library-building support services. |
2613 | -# |
2614 | -# --config show all configuration variables |
2615 | -# --debug enable verbose shell tracing |
2616 | -# -n, --dry-run display commands without modifying any files |
2617 | -# --features display basic configuration information and exit |
2618 | -# --mode=MODE use operation mode MODE |
2619 | -# --preserve-dup-deps don't remove duplicate dependency libraries |
2620 | -# --quiet, --silent don't print informational messages |
2621 | -# --no-quiet, --no-silent |
2622 | -# print informational messages (default) |
2623 | -# --no-warn don't display warning messages |
2624 | -# --tag=TAG use configuration variables from tag TAG |
2625 | -# -v, --verbose print more informational messages than default |
2626 | -# --no-verbose don't print the extra informational messages |
2627 | -# --version print version information |
2628 | -# -h, --help, --help-all print short, long, or detailed help message |
2629 | -# |
2630 | -# MODE must be one of the following: |
2631 | -# |
2632 | -# clean remove files from the build directory |
2633 | -# compile compile a source file into a libtool object |
2634 | -# execute automatically set library path, then run a program |
2635 | -# finish complete the installation of libtool libraries |
2636 | -# install install libraries or executables |
2637 | -# link create a library or an executable |
2638 | -# uninstall remove libraries from an installed directory |
2639 | -# |
2640 | -# MODE-ARGS vary depending on the MODE. When passed as first option, |
2641 | -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. |
2642 | -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. |
2643 | -# |
2644 | -# When reporting a bug, please describe a test case to reproduce it and |
2645 | -# include the following information: |
2646 | -# |
2647 | -# host-triplet: $host |
2648 | -# shell: $SHELL |
2649 | -# compiler: $LTCC |
2650 | -# compiler flags: $LTCFLAGS |
2651 | -# linker: $LD (gnu? $with_gnu_ld) |
2652 | -# $progname: (GNU libtool) 2.4.2 |
2653 | -# automake: $automake_version |
2654 | -# autoconf: $autoconf_version |
2655 | -# |
2656 | -# Report bugs to <bug-libtool@gnu.org>. |
2657 | -# GNU libtool home page: <http://www.gnu.org/software/libtool/>. |
2658 | -# General help using GNU software: <http://www.gnu.org/gethelp/>. |
2659 | - |
2660 | -PROGRAM=libtool |
2661 | -PACKAGE=libtool |
2662 | -VERSION=2.4.2 |
2663 | -TIMESTAMP="" |
2664 | -package_revision=1.3337 |
2665 | - |
2666 | -# Be Bourne compatible |
2667 | -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then |
2668 | - emulate sh |
2669 | - NULLCMD=: |
2670 | - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which |
2671 | - # is contrary to our usage. Disable this feature. |
2672 | - alias -g '${1+"$@"}'='"$@"' |
2673 | - setopt NO_GLOB_SUBST |
2674 | -else |
2675 | - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac |
2676 | -fi |
2677 | -BIN_SH=xpg4; export BIN_SH # for Tru64 |
2678 | -DUALCASE=1; export DUALCASE # for MKS sh |
2679 | - |
2680 | -# A function that is used when there is no print builtin or printf. |
2681 | -func_fallback_echo () |
2682 | -{ |
2683 | - eval 'cat <<_LTECHO_EOF |
2684 | -$1 |
2685 | -_LTECHO_EOF' |
2686 | -} |
2687 | - |
2688 | -# NLS nuisances: We save the old values to restore during execute mode. |
2689 | -lt_user_locale= |
2690 | -lt_safe_locale= |
2691 | -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES |
2692 | -do |
2693 | - eval "if test \"\${$lt_var+set}\" = set; then |
2694 | - save_$lt_var=\$$lt_var |
2695 | - $lt_var=C |
2696 | - export $lt_var |
2697 | - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" |
2698 | - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" |
2699 | - fi" |
2700 | -done |
2701 | -LC_ALL=C |
2702 | -LANGUAGE=C |
2703 | -export LANGUAGE LC_ALL |
2704 | - |
2705 | -$lt_unset CDPATH |
2706 | - |
2707 | - |
2708 | -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh |
2709 | -# is ksh but when the shell is invoked as "sh" and the current value of |
2710 | -# the _XPG environment variable is not equal to 1 (one), the special |
2711 | -# positional parameter $0, within a function call, is the name of the |
2712 | -# function. |
2713 | -progpath="$0" |
2714 | - |
2715 | - |
2716 | - |
2717 | -: ${CP="cp -f"} |
2718 | -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} |
2719 | -: ${MAKE="make"} |
2720 | -: ${MKDIR="mkdir"} |
2721 | -: ${MV="mv -f"} |
2722 | -: ${RM="rm -f"} |
2723 | -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} |
2724 | -: ${Xsed="$SED -e 1s/^X//"} |
2725 | - |
2726 | -# Global variables: |
2727 | -EXIT_SUCCESS=0 |
2728 | -EXIT_FAILURE=1 |
2729 | -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. |
2730 | -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. |
2731 | - |
2732 | -exit_status=$EXIT_SUCCESS |
2733 | - |
2734 | -# Make sure IFS has a sensible default |
2735 | -lt_nl=' |
2736 | -' |
2737 | -IFS=" $lt_nl" |
2738 | - |
2739 | -dirname="s,/[^/]*$,," |
2740 | -basename="s,^.*/,," |
2741 | - |
2742 | -# func_dirname file append nondir_replacement |
2743 | -# Compute the dirname of FILE. If nonempty, add APPEND to the result, |
2744 | -# otherwise set result to NONDIR_REPLACEMENT. |
2745 | -func_dirname () |
2746 | -{ |
2747 | - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` |
2748 | - if test "X$func_dirname_result" = "X${1}"; then |
2749 | - func_dirname_result="${3}" |
2750 | - else |
2751 | - func_dirname_result="$func_dirname_result${2}" |
2752 | - fi |
2753 | -} # func_dirname may be replaced by extended shell implementation |
2754 | - |
2755 | - |
2756 | -# func_basename file |
2757 | -func_basename () |
2758 | -{ |
2759 | - func_basename_result=`$ECHO "${1}" | $SED "$basename"` |
2760 | -} # func_basename may be replaced by extended shell implementation |
2761 | - |
2762 | - |
2763 | -# func_dirname_and_basename file append nondir_replacement |
2764 | -# perform func_basename and func_dirname in a single function |
2765 | -# call: |
2766 | -# dirname: Compute the dirname of FILE. If nonempty, |
2767 | -# add APPEND to the result, otherwise set result |
2768 | -# to NONDIR_REPLACEMENT. |
2769 | -# value returned in "$func_dirname_result" |
2770 | -# basename: Compute filename of FILE. |
2771 | -# value retuned in "$func_basename_result" |
2772 | -# Implementation must be kept synchronized with func_dirname |
2773 | -# and func_basename. For efficiency, we do not delegate to |
2774 | -# those functions but instead duplicate the functionality here. |
2775 | -func_dirname_and_basename () |
2776 | -{ |
2777 | - # Extract subdirectory from the argument. |
2778 | - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` |
2779 | - if test "X$func_dirname_result" = "X${1}"; then |
2780 | - func_dirname_result="${3}" |
2781 | - else |
2782 | - func_dirname_result="$func_dirname_result${2}" |
2783 | - fi |
2784 | - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` |
2785 | -} # func_dirname_and_basename may be replaced by extended shell implementation |
2786 | - |
2787 | - |
2788 | -# func_stripname prefix suffix name |
2789 | -# strip PREFIX and SUFFIX off of NAME. |
2790 | -# PREFIX and SUFFIX must not contain globbing or regex special |
2791 | -# characters, hashes, percent signs, but SUFFIX may contain a leading |
2792 | -# dot (in which case that matches only a dot). |
2793 | -# func_strip_suffix prefix name |
2794 | -func_stripname () |
2795 | -{ |
2796 | - case ${2} in |
2797 | - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; |
2798 | - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; |
2799 | - esac |
2800 | -} # func_stripname may be replaced by extended shell implementation |
2801 | - |
2802 | - |
2803 | -# These SED scripts presuppose an absolute path with a trailing slash. |
2804 | -pathcar='s,^/\([^/]*\).*$,\1,' |
2805 | -pathcdr='s,^/[^/]*,,' |
2806 | -removedotparts=':dotsl |
2807 | - s@/\./@/@g |
2808 | - t dotsl |
2809 | - s,/\.$,/,' |
2810 | -collapseslashes='s@/\{1,\}@/@g' |
2811 | -finalslash='s,/*$,/,' |
2812 | - |
2813 | -# func_normal_abspath PATH |
2814 | -# Remove doubled-up and trailing slashes, "." path components, |
2815 | -# and cancel out any ".." path components in PATH after making |
2816 | -# it an absolute path. |
2817 | -# value returned in "$func_normal_abspath_result" |
2818 | -func_normal_abspath () |
2819 | -{ |
2820 | - # Start from root dir and reassemble the path. |
2821 | - func_normal_abspath_result= |
2822 | - func_normal_abspath_tpath=$1 |
2823 | - func_normal_abspath_altnamespace= |
2824 | - case $func_normal_abspath_tpath in |
2825 | - "") |
2826 | - # Empty path, that just means $cwd. |
2827 | - func_stripname '' '/' "`pwd`" |
2828 | - func_normal_abspath_result=$func_stripname_result |
2829 | - return |
2830 | - ;; |
2831 | - # The next three entries are used to spot a run of precisely |
2832 | - # two leading slashes without using negated character classes; |
2833 | - # we take advantage of case's first-match behaviour. |
2834 | - ///*) |
2835 | - # Unusual form of absolute path, do nothing. |
2836 | - ;; |
2837 | - //*) |
2838 | - # Not necessarily an ordinary path; POSIX reserves leading '//' |
2839 | - # and for example Cygwin uses it to access remote file shares |
2840 | - # over CIFS/SMB, so we conserve a leading double slash if found. |
2841 | - func_normal_abspath_altnamespace=/ |
2842 | - ;; |
2843 | - /*) |
2844 | - # Absolute path, do nothing. |
2845 | - ;; |
2846 | - *) |
2847 | - # Relative path, prepend $cwd. |
2848 | - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath |
2849 | - ;; |
2850 | - esac |
2851 | - # Cancel out all the simple stuff to save iterations. We also want |
2852 | - # the path to end with a slash for ease of parsing, so make sure |
2853 | - # there is one (and only one) here. |
2854 | - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ |
2855 | - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` |
2856 | - while :; do |
2857 | - # Processed it all yet? |
2858 | - if test "$func_normal_abspath_tpath" = / ; then |
2859 | - # If we ascended to the root using ".." the result may be empty now. |
2860 | - if test -z "$func_normal_abspath_result" ; then |
2861 | - func_normal_abspath_result=/ |
2862 | - fi |
2863 | - break |
2864 | - fi |
2865 | - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ |
2866 | - -e "$pathcar"` |
2867 | - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ |
2868 | - -e "$pathcdr"` |
2869 | - # Figure out what to do with it |
2870 | - case $func_normal_abspath_tcomponent in |
2871 | - "") |
2872 | - # Trailing empty path component, ignore it. |
2873 | - ;; |
2874 | - ..) |
2875 | - # Parent dir; strip last assembled component from result. |
2876 | - func_dirname "$func_normal_abspath_result" |
2877 | - func_normal_abspath_result=$func_dirname_result |
2878 | - ;; |
2879 | - *) |
2880 | - # Actual path component, append it. |
2881 | - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent |
2882 | - ;; |
2883 | - esac |
2884 | - done |
2885 | - # Restore leading double-slash if one was found on entry. |
2886 | - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result |
2887 | -} |
2888 | - |
2889 | -# func_relative_path SRCDIR DSTDIR |
2890 | -# generates a relative path from SRCDIR to DSTDIR, with a trailing |
2891 | -# slash if non-empty, suitable for immediately appending a filename |
2892 | -# without needing to append a separator. |
2893 | -# value returned in "$func_relative_path_result" |
2894 | -func_relative_path () |
2895 | -{ |
2896 | - func_relative_path_result= |
2897 | - func_normal_abspath "$1" |
2898 | - func_relative_path_tlibdir=$func_normal_abspath_result |
2899 | - func_normal_abspath "$2" |
2900 | - func_relative_path_tbindir=$func_normal_abspath_result |
2901 | - |
2902 | - # Ascend the tree starting from libdir |
2903 | - while :; do |
2904 | - # check if we have found a prefix of bindir |
2905 | - case $func_relative_path_tbindir in |
2906 | - $func_relative_path_tlibdir) |
2907 | - # found an exact match |
2908 | - func_relative_path_tcancelled= |
2909 | - break |
2910 | - ;; |
2911 | - $func_relative_path_tlibdir*) |
2912 | - # found a matching prefix |
2913 | - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" |
2914 | - func_relative_path_tcancelled=$func_stripname_result |
2915 | - if test -z "$func_relative_path_result"; then |
2916 | - func_relative_path_result=. |
2917 | - fi |
2918 | - break |
2919 | - ;; |
2920 | - *) |
2921 | - func_dirname $func_relative_path_tlibdir |
2922 | - func_relative_path_tlibdir=${func_dirname_result} |
2923 | - if test "x$func_relative_path_tlibdir" = x ; then |
2924 | - # Have to descend all the way to the root! |
2925 | - func_relative_path_result=../$func_relative_path_result |
2926 | - func_relative_path_tcancelled=$func_relative_path_tbindir |
2927 | - break |
2928 | - fi |
2929 | - func_relative_path_result=../$func_relative_path_result |
2930 | - ;; |
2931 | - esac |
2932 | - done |
2933 | - |
2934 | - # Now calculate path; take care to avoid doubling-up slashes. |
2935 | - func_stripname '' '/' "$func_relative_path_result" |
2936 | - func_relative_path_result=$func_stripname_result |
2937 | - func_stripname '/' '/' "$func_relative_path_tcancelled" |
2938 | - if test "x$func_stripname_result" != x ; then |
2939 | - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} |
2940 | - fi |
2941 | - |
2942 | - # Normalisation. If bindir is libdir, return empty string, |
2943 | - # else relative path ending with a slash; either way, target |
2944 | - # file name can be directly appended. |
2945 | - if test ! -z "$func_relative_path_result"; then |
2946 | - func_stripname './' '' "$func_relative_path_result/" |
2947 | - func_relative_path_result=$func_stripname_result |
2948 | - fi |
2949 | -} |
2950 | - |
2951 | -# The name of this program: |
2952 | -func_dirname_and_basename "$progpath" |
2953 | -progname=$func_basename_result |
2954 | - |
2955 | -# Make sure we have an absolute path for reexecution: |
2956 | -case $progpath in |
2957 | - [\\/]*|[A-Za-z]:\\*) ;; |
2958 | - *[\\/]*) |
2959 | - progdir=$func_dirname_result |
2960 | - progdir=`cd "$progdir" && pwd` |
2961 | - progpath="$progdir/$progname" |
2962 | - ;; |
2963 | - *) |
2964 | - save_IFS="$IFS" |
2965 | - IFS=${PATH_SEPARATOR-:} |
2966 | - for progdir in $PATH; do |
2967 | - IFS="$save_IFS" |
2968 | - test -x "$progdir/$progname" && break |
2969 | - done |
2970 | - IFS="$save_IFS" |
2971 | - test -n "$progdir" || progdir=`pwd` |
2972 | - progpath="$progdir/$progname" |
2973 | - ;; |
2974 | -esac |
2975 | - |
2976 | -# Sed substitution that helps us do robust quoting. It backslashifies |
2977 | -# metacharacters that are still active within double-quoted strings. |
2978 | -Xsed="${SED}"' -e 1s/^X//' |
2979 | -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' |
2980 | - |
2981 | -# Same as above, but do not quote variable references. |
2982 | -double_quote_subst='s/\(["`\\]\)/\\\1/g' |
2983 | - |
2984 | -# Sed substitution that turns a string into a regex matching for the |
2985 | -# string literally. |
2986 | -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' |
2987 | - |
2988 | -# Sed substitution that converts a w32 file name or path |
2989 | -# which contains forward slashes, into one that contains |
2990 | -# (escaped) backslashes. A very naive implementation. |
2991 | -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' |
2992 | - |
2993 | -# Re-`\' parameter expansions in output of double_quote_subst that were |
2994 | -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' |
2995 | -# in input to double_quote_subst, that '$' was protected from expansion. |
2996 | -# Since each input `\' is now two `\'s, look for any number of runs of |
2997 | -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. |
2998 | -bs='\\' |
2999 | -bs2='\\\\' |
3000 | -bs4='\\\\\\\\' |
3001 | -dollar='\$' |
3002 | -sed_double_backslash="\ |
3003 | - s/$bs4/&\\ |
3004 | -/g |
3005 | - s/^$bs2$dollar/$bs&/ |
3006 | - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g |
3007 | - s/\n//g" |
3008 | - |
3009 | -# Standard options: |
3010 | -opt_dry_run=false |
3011 | -opt_help=false |
3012 | -opt_quiet=false |
3013 | -opt_verbose=false |
3014 | -opt_warning=: |
3015 | - |
3016 | -# func_echo arg... |
3017 | -# Echo program name prefixed message, along with the current mode |
3018 | -# name if it has been set yet. |
3019 | -func_echo () |
3020 | -{ |
3021 | - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" |
3022 | -} |
3023 | - |
3024 | -# func_verbose arg... |
3025 | -# Echo program name prefixed message in verbose mode only. |
3026 | -func_verbose () |
3027 | -{ |
3028 | - $opt_verbose && func_echo ${1+"$@"} |
3029 | - |
3030 | - # A bug in bash halts the script if the last line of a function |
3031 | - # fails when set -e is in force, so we need another command to |
3032 | - # work around that: |
3033 | - : |
3034 | -} |
3035 | - |
3036 | -# func_echo_all arg... |
3037 | -# Invoke $ECHO with all args, space-separated. |
3038 | -func_echo_all () |
3039 | -{ |
3040 | - $ECHO "$*" |
3041 | -} |
3042 | - |
3043 | -# func_error arg... |
3044 | -# Echo program name prefixed message to standard error. |
3045 | -func_error () |
3046 | -{ |
3047 | - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 |
3048 | -} |
3049 | - |
3050 | -# func_warning arg... |
3051 | -# Echo program name prefixed warning message to standard error. |
3052 | -func_warning () |
3053 | -{ |
3054 | - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 |
3055 | - |
3056 | - # bash bug again: |
3057 | - : |
3058 | -} |
3059 | - |
3060 | -# func_fatal_error arg... |
3061 | -# Echo program name prefixed message to standard error, and exit. |
3062 | -func_fatal_error () |
3063 | -{ |
3064 | - func_error ${1+"$@"} |
3065 | - exit $EXIT_FAILURE |
3066 | -} |
3067 | - |
3068 | -# func_fatal_help arg... |
3069 | -# Echo program name prefixed message to standard error, followed by |
3070 | -# a help hint, and exit. |
3071 | -func_fatal_help () |
3072 | -{ |
3073 | - func_error ${1+"$@"} |
3074 | - func_fatal_error "$help" |
3075 | -} |
3076 | -help="Try \`$progname --help' for more information." ## default |
3077 | - |
3078 | - |
3079 | -# func_grep expression filename |
3080 | -# Check whether EXPRESSION matches any line of FILENAME, without output. |
3081 | -func_grep () |
3082 | -{ |
3083 | - $GREP "$1" "$2" >/dev/null 2>&1 |
3084 | -} |
3085 | - |
3086 | - |
3087 | -# func_mkdir_p directory-path |
3088 | -# Make sure the entire path to DIRECTORY-PATH is available. |
3089 | -func_mkdir_p () |
3090 | -{ |
3091 | - my_directory_path="$1" |
3092 | - my_dir_list= |
3093 | - |
3094 | - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then |
3095 | - |
3096 | - # Protect directory names starting with `-' |
3097 | - case $my_directory_path in |
3098 | - -*) my_directory_path="./$my_directory_path" ;; |
3099 | - esac |
3100 | - |
3101 | - # While some portion of DIR does not yet exist... |
3102 | - while test ! -d "$my_directory_path"; do |
3103 | - # ...make a list in topmost first order. Use a colon delimited |
3104 | - # list incase some portion of path contains whitespace. |
3105 | - my_dir_list="$my_directory_path:$my_dir_list" |
3106 | - |
3107 | - # If the last portion added has no slash in it, the list is done |
3108 | - case $my_directory_path in */*) ;; *) break ;; esac |
3109 | - |
3110 | - # ...otherwise throw away the child directory and loop |
3111 | - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` |
3112 | - done |
3113 | - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` |
3114 | - |
3115 | - save_mkdir_p_IFS="$IFS"; IFS=':' |
3116 | - for my_dir in $my_dir_list; do |
3117 | - IFS="$save_mkdir_p_IFS" |
3118 | - # mkdir can fail with a `File exist' error if two processes |
3119 | - # try to create one of the directories concurrently. Don't |
3120 | - # stop in that case! |
3121 | - $MKDIR "$my_dir" 2>/dev/null || : |
3122 | - done |
3123 | - IFS="$save_mkdir_p_IFS" |
3124 | - |
3125 | - # Bail out if we (or some other process) failed to create a directory. |
3126 | - test -d "$my_directory_path" || \ |
3127 | - func_fatal_error "Failed to create \`$1'" |
3128 | - fi |
3129 | -} |
3130 | - |
3131 | - |
3132 | -# func_mktempdir [string] |
3133 | -# Make a temporary directory that won't clash with other running |
3134 | -# libtool processes, and avoids race conditions if possible. If |
3135 | -# given, STRING is the basename for that directory. |
3136 | -func_mktempdir () |
3137 | -{ |
3138 | - my_template="${TMPDIR-/tmp}/${1-$progname}" |
3139 | - |
3140 | - if test "$opt_dry_run" = ":"; then |
3141 | - # Return a directory name, but don't create it in dry-run mode |
3142 | - my_tmpdir="${my_template}-$$" |
3143 | - else |
3144 | - |
3145 | - # If mktemp works, use that first and foremost |
3146 | - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` |
3147 | - |
3148 | - if test ! -d "$my_tmpdir"; then |
3149 | - # Failing that, at least try and use $RANDOM to avoid a race |
3150 | - my_tmpdir="${my_template}-${RANDOM-0}$$" |
3151 | - |
3152 | - save_mktempdir_umask=`umask` |
3153 | - umask 0077 |
3154 | - $MKDIR "$my_tmpdir" |
3155 | - umask $save_mktempdir_umask |
3156 | - fi |
3157 | - |
3158 | - # If we're not in dry-run mode, bomb out on failure |
3159 | - test -d "$my_tmpdir" || \ |
3160 | - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" |
3161 | - fi |
3162 | - |
3163 | - $ECHO "$my_tmpdir" |
3164 | -} |
3165 | - |
3166 | - |
3167 | -# func_quote_for_eval arg |
3168 | -# Aesthetically quote ARG to be evaled later. |
3169 | -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT |
3170 | -# is double-quoted, suitable for a subsequent eval, whereas |
3171 | -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters |
3172 | -# which are still active within double quotes backslashified. |
3173 | -func_quote_for_eval () |
3174 | -{ |
3175 | - case $1 in |
3176 | - *[\\\`\"\$]*) |
3177 | - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; |
3178 | - *) |
3179 | - func_quote_for_eval_unquoted_result="$1" ;; |
3180 | - esac |
3181 | - |
3182 | - case $func_quote_for_eval_unquoted_result in |
3183 | - # Double-quote args containing shell metacharacters to delay |
3184 | - # word splitting, command substitution and and variable |
3185 | - # expansion for a subsequent eval. |
3186 | - # Many Bourne shells cannot handle close brackets correctly |
3187 | - # in scan sets, so we specify it separately. |
3188 | - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
3189 | - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" |
3190 | - ;; |
3191 | - *) |
3192 | - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" |
3193 | - esac |
3194 | -} |
3195 | - |
3196 | - |
3197 | -# func_quote_for_expand arg |
3198 | -# Aesthetically quote ARG to be evaled later; same as above, |
3199 | -# but do not quote variable references. |
3200 | -func_quote_for_expand () |
3201 | -{ |
3202 | - case $1 in |
3203 | - *[\\\`\"]*) |
3204 | - my_arg=`$ECHO "$1" | $SED \ |
3205 | - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; |
3206 | - *) |
3207 | - my_arg="$1" ;; |
3208 | - esac |
3209 | - |
3210 | - case $my_arg in |
3211 | - # Double-quote args containing shell metacharacters to delay |
3212 | - # word splitting and command substitution for a subsequent eval. |
3213 | - # Many Bourne shells cannot handle close brackets correctly |
3214 | - # in scan sets, so we specify it separately. |
3215 | - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
3216 | - my_arg="\"$my_arg\"" |
3217 | - ;; |
3218 | - esac |
3219 | - |
3220 | - func_quote_for_expand_result="$my_arg" |
3221 | -} |
3222 | - |
3223 | - |
3224 | -# func_show_eval cmd [fail_exp] |
3225 | -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is |
3226 | -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP |
3227 | -# is given, then evaluate it. |
3228 | -func_show_eval () |
3229 | -{ |
3230 | - my_cmd="$1" |
3231 | - my_fail_exp="${2-:}" |
3232 | - |
3233 | - ${opt_silent-false} || { |
3234 | - func_quote_for_expand "$my_cmd" |
3235 | - eval "func_echo $func_quote_for_expand_result" |
3236 | - } |
3237 | - |
3238 | - if ${opt_dry_run-false}; then :; else |
3239 | - eval "$my_cmd" |
3240 | - my_status=$? |
3241 | - if test "$my_status" -eq 0; then :; else |
3242 | - eval "(exit $my_status); $my_fail_exp" |
3243 | - fi |
3244 | - fi |
3245 | -} |
3246 | - |
3247 | - |
3248 | -# func_show_eval_locale cmd [fail_exp] |
3249 | -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is |
3250 | -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP |
3251 | -# is given, then evaluate it. Use the saved locale for evaluation. |
3252 | -func_show_eval_locale () |
3253 | -{ |
3254 | - my_cmd="$1" |
3255 | - my_fail_exp="${2-:}" |
3256 | - |
3257 | - ${opt_silent-false} || { |
3258 | - func_quote_for_expand "$my_cmd" |
3259 | - eval "func_echo $func_quote_for_expand_result" |
3260 | - } |
3261 | - |
3262 | - if ${opt_dry_run-false}; then :; else |
3263 | - eval "$lt_user_locale |
3264 | - $my_cmd" |
3265 | - my_status=$? |
3266 | - eval "$lt_safe_locale" |
3267 | - if test "$my_status" -eq 0; then :; else |
3268 | - eval "(exit $my_status); $my_fail_exp" |
3269 | - fi |
3270 | - fi |
3271 | -} |
3272 | - |
3273 | -# func_tr_sh |
3274 | -# Turn $1 into a string suitable for a shell variable name. |
3275 | -# Result is stored in $func_tr_sh_result. All characters |
3276 | -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, |
3277 | -# if $1 begins with a digit, a '_' is prepended as well. |
3278 | -func_tr_sh () |
3279 | -{ |
3280 | - case $1 in |
3281 | - [0-9]* | *[!a-zA-Z0-9_]*) |
3282 | - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` |
3283 | - ;; |
3284 | - * ) |
3285 | - func_tr_sh_result=$1 |
3286 | - ;; |
3287 | - esac |
3288 | -} |
3289 | - |
3290 | - |
3291 | -# func_version |
3292 | -# Echo version message to standard output and exit. |
3293 | -func_version () |
3294 | -{ |
3295 | - $opt_debug |
3296 | - |
3297 | - $SED -n '/(C)/!b go |
3298 | - :more |
3299 | - /\./!{ |
3300 | - N |
3301 | - s/\n# / / |
3302 | - b more |
3303 | - } |
3304 | - :go |
3305 | - /^# '$PROGRAM' (GNU /,/# warranty; / { |
3306 | - s/^# // |
3307 | - s/^# *$// |
3308 | - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ |
3309 | - p |
3310 | - }' < "$progpath" |
3311 | - exit $? |
3312 | -} |
3313 | - |
3314 | -# func_usage |
3315 | -# Echo short help message to standard output and exit. |
3316 | -func_usage () |
3317 | -{ |
3318 | - $opt_debug |
3319 | - |
3320 | - $SED -n '/^# Usage:/,/^# *.*--help/ { |
3321 | - s/^# // |
3322 | - s/^# *$// |
3323 | - s/\$progname/'$progname'/ |
3324 | - p |
3325 | - }' < "$progpath" |
3326 | - echo |
3327 | - $ECHO "run \`$progname --help | more' for full usage" |
3328 | - exit $? |
3329 | -} |
3330 | - |
3331 | -# func_help [NOEXIT] |
3332 | -# Echo long help message to standard output and exit, |
3333 | -# unless 'noexit' is passed as argument. |
3334 | -func_help () |
3335 | -{ |
3336 | - $opt_debug |
3337 | - |
3338 | - $SED -n '/^# Usage:/,/# Report bugs to/ { |
3339 | |
3340 | - s/^# // |
3341 | - s/^# *$// |
3342 | - s*\$progname*'$progname'* |
3343 | - s*\$host*'"$host"'* |
3344 | - s*\$SHELL*'"$SHELL"'* |
3345 | - s*\$LTCC*'"$LTCC"'* |
3346 | - s*\$LTCFLAGS*'"$LTCFLAGS"'* |
3347 | - s*\$LD*'"$LD"'* |
3348 | - s/\$with_gnu_ld/'"$with_gnu_ld"'/ |
3349 | - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ |
3350 | - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ |
3351 | - p |
3352 | - d |
3353 | - } |
3354 | - /^# .* home page:/b print |
3355 | - /^# General help using/b print |
3356 | - ' < "$progpath" |
3357 | - ret=$? |
3358 | - if test -z "$1"; then |
3359 | - exit $ret |
3360 | - fi |
3361 | -} |
3362 | - |
3363 | -# func_missing_arg argname |
3364 | -# Echo program name prefixed message to standard error and set global |
3365 | -# exit_cmd. |
3366 | -func_missing_arg () |
3367 | -{ |
3368 | - $opt_debug |
3369 | - |
3370 | - func_error "missing argument for $1." |
3371 | - exit_cmd=exit |
3372 | -} |
3373 | - |
3374 | - |
3375 | -# func_split_short_opt shortopt |
3376 | -# Set func_split_short_opt_name and func_split_short_opt_arg shell |
3377 | -# variables after splitting SHORTOPT after the 2nd character. |
3378 | -func_split_short_opt () |
3379 | -{ |
3380 | - my_sed_short_opt='1s/^\(..\).*$/\1/;q' |
3381 | - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' |
3382 | - |
3383 | - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` |
3384 | - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` |
3385 | -} # func_split_short_opt may be replaced by extended shell implementation |
3386 | - |
3387 | - |
3388 | -# func_split_long_opt longopt |
3389 | -# Set func_split_long_opt_name and func_split_long_opt_arg shell |
3390 | -# variables after splitting LONGOPT at the `=' sign. |
3391 | -func_split_long_opt () |
3392 | -{ |
3393 | - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' |
3394 | - my_sed_long_arg='1s/^--[^=]*=//' |
3395 | - |
3396 | - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` |
3397 | - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` |
3398 | -} # func_split_long_opt may be replaced by extended shell implementation |
3399 | - |
3400 | -exit_cmd=: |
3401 | - |
3402 | - |
3403 | - |
3404 | - |
3405 | - |
3406 | -magic="%%%MAGIC variable%%%" |
3407 | -magic_exe="%%%MAGIC EXE variable%%%" |
3408 | - |
3409 | -# Global variables. |
3410 | -nonopt= |
3411 | -preserve_args= |
3412 | -lo2o="s/\\.lo\$/.${objext}/" |
3413 | -o2lo="s/\\.${objext}\$/.lo/" |
3414 | -extracted_archives= |
3415 | -extracted_serial=0 |
3416 | - |
3417 | -# If this variable is set in any of the actions, the command in it |
3418 | -# will be execed at the end. This prevents here-documents from being |
3419 | -# left over by shells. |
3420 | -exec_cmd= |
3421 | - |
3422 | -# func_append var value |
3423 | -# Append VALUE to the end of shell variable VAR. |
3424 | -func_append () |
3425 | -{ |
3426 | - eval "${1}=\$${1}\${2}" |
3427 | -} # func_append may be replaced by extended shell implementation |
3428 | - |
3429 | -# func_append_quoted var value |
3430 | -# Quote VALUE and append to the end of shell variable VAR, separated |
3431 | -# by a space. |
3432 | -func_append_quoted () |
3433 | -{ |
3434 | - func_quote_for_eval "${2}" |
3435 | - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" |
3436 | -} # func_append_quoted may be replaced by extended shell implementation |
3437 | - |
3438 | - |
3439 | -# func_arith arithmetic-term... |
3440 | -func_arith () |
3441 | -{ |
3442 | - func_arith_result=`expr "${@}"` |
3443 | -} # func_arith may be replaced by extended shell implementation |
3444 | - |
3445 | - |
3446 | -# func_len string |
3447 | -# STRING may not start with a hyphen. |
3448 | -func_len () |
3449 | -{ |
3450 | - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` |
3451 | -} # func_len may be replaced by extended shell implementation |
3452 | - |
3453 | - |
3454 | -# func_lo2o object |
3455 | -func_lo2o () |
3456 | -{ |
3457 | - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` |
3458 | -} # func_lo2o may be replaced by extended shell implementation |
3459 | - |
3460 | - |
3461 | -# func_xform libobj-or-source |
3462 | -func_xform () |
3463 | -{ |
3464 | - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` |
3465 | -} # func_xform may be replaced by extended shell implementation |
3466 | - |
3467 | - |
3468 | -# func_fatal_configuration arg... |
3469 | -# Echo program name prefixed message to standard error, followed by |
3470 | -# a configuration failure hint, and exit. |
3471 | -func_fatal_configuration () |
3472 | -{ |
3473 | - func_error ${1+"$@"} |
3474 | - func_error "See the $PACKAGE documentation for more information." |
3475 | - func_fatal_error "Fatal configuration error." |
3476 | -} |
3477 | - |
3478 | - |
3479 | -# func_config |
3480 | -# Display the configuration for all the tags in this script. |
3481 | -func_config () |
3482 | -{ |
3483 | - re_begincf='^# ### BEGIN LIBTOOL' |
3484 | - re_endcf='^# ### END LIBTOOL' |
3485 | - |
3486 | - # Default configuration. |
3487 | - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" |
3488 | - |
3489 | - # Now print the configurations for the tags. |
3490 | - for tagname in $taglist; do |
3491 | - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" |
3492 | - done |
3493 | - |
3494 | - exit $? |
3495 | -} |
3496 | - |
3497 | -# func_features |
3498 | -# Display the features supported by this script. |
3499 | -func_features () |
3500 | -{ |
3501 | - echo "host: $host" |
3502 | - if test "$build_libtool_libs" = yes; then |
3503 | - echo "enable shared libraries" |
3504 | - else |
3505 | - echo "disable shared libraries" |
3506 | - fi |
3507 | - if test "$build_old_libs" = yes; then |
3508 | - echo "enable static libraries" |
3509 | - else |
3510 | - echo "disable static libraries" |
3511 | - fi |
3512 | - |
3513 | - exit $? |
3514 | -} |
3515 | - |
3516 | -# func_enable_tag tagname |
3517 | -# Verify that TAGNAME is valid, and either flag an error and exit, or |
3518 | -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist |
3519 | -# variable here. |
3520 | -func_enable_tag () |
3521 | -{ |
3522 | - # Global variable: |
3523 | - tagname="$1" |
3524 | - |
3525 | - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" |
3526 | - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" |
3527 | - sed_extractcf="/$re_begincf/,/$re_endcf/p" |
3528 | - |
3529 | - # Validate tagname. |
3530 | - case $tagname in |
3531 | - *[!-_A-Za-z0-9,/]*) |
3532 | - func_fatal_error "invalid tag name: $tagname" |
3533 | - ;; |
3534 | - esac |
3535 | - |
3536 | - # Don't test for the "default" C tag, as we know it's |
3537 | - # there but not specially marked. |
3538 | - case $tagname in |
3539 | - CC) ;; |
3540 | - *) |
3541 | - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then |
3542 | - taglist="$taglist $tagname" |
3543 | - |
3544 | - # Evaluate the configuration. Be careful to quote the path |
3545 | - # and the sed script, to avoid splitting on whitespace, but |
3546 | - # also don't use non-portable quotes within backquotes within |
3547 | - # quotes we have to do it in 2 steps: |
3548 | - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` |
3549 | - eval "$extractedcf" |
3550 | - else |
3551 | - func_error "ignoring unknown tag $tagname" |
3552 | - fi |
3553 | - ;; |
3554 | - esac |
3555 | -} |
3556 | - |
3557 | -# func_check_version_match |
3558 | -# Ensure that we are using m4 macros, and libtool script from the same |
3559 | -# release of libtool. |
3560 | -func_check_version_match () |
3561 | -{ |
3562 | - if test "$package_revision" != "$macro_revision"; then |
3563 | - if test "$VERSION" != "$macro_version"; then |
3564 | - if test -z "$macro_version"; then |
3565 | - cat >&2 <<_LT_EOF |
3566 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the |
3567 | -$progname: definition of this LT_INIT comes from an older release. |
3568 | -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION |
3569 | -$progname: and run autoconf again. |
3570 | -_LT_EOF |
3571 | - else |
3572 | - cat >&2 <<_LT_EOF |
3573 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the |
3574 | -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. |
3575 | -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION |
3576 | -$progname: and run autoconf again. |
3577 | -_LT_EOF |
3578 | - fi |
3579 | - else |
3580 | - cat >&2 <<_LT_EOF |
3581 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, |
3582 | -$progname: but the definition of this LT_INIT comes from revision $macro_revision. |
3583 | -$progname: You should recreate aclocal.m4 with macros from revision $package_revision |
3584 | -$progname: of $PACKAGE $VERSION and run autoconf again. |
3585 | -_LT_EOF |
3586 | - fi |
3587 | - |
3588 | - exit $EXIT_MISMATCH |
3589 | - fi |
3590 | -} |
3591 | - |
3592 | - |
3593 | -# Shorthand for --mode=foo, only valid as the first argument |
3594 | -case $1 in |
3595 | -clean|clea|cle|cl) |
3596 | - shift; set dummy --mode clean ${1+"$@"}; shift |
3597 | - ;; |
3598 | -compile|compil|compi|comp|com|co|c) |
3599 | - shift; set dummy --mode compile ${1+"$@"}; shift |
3600 | - ;; |
3601 | -execute|execut|execu|exec|exe|ex|e) |
3602 | - shift; set dummy --mode execute ${1+"$@"}; shift |
3603 | - ;; |
3604 | -finish|finis|fini|fin|fi|f) |
3605 | - shift; set dummy --mode finish ${1+"$@"}; shift |
3606 | - ;; |
3607 | -install|instal|insta|inst|ins|in|i) |
3608 | - shift; set dummy --mode install ${1+"$@"}; shift |
3609 | - ;; |
3610 | -link|lin|li|l) |
3611 | - shift; set dummy --mode link ${1+"$@"}; shift |
3612 | - ;; |
3613 | -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) |
3614 | - shift; set dummy --mode uninstall ${1+"$@"}; shift |
3615 | - ;; |
3616 | -esac |
3617 | - |
3618 | - |
3619 | - |
3620 | -# Option defaults: |
3621 | -opt_debug=: |
3622 | -opt_dry_run=false |
3623 | -opt_config=false |
3624 | -opt_preserve_dup_deps=false |
3625 | -opt_features=false |
3626 | -opt_finish=false |
3627 | -opt_help=false |
3628 | -opt_help_all=false |
3629 | -opt_silent=: |
3630 | -opt_warning=: |
3631 | -opt_verbose=: |
3632 | -opt_silent=false |
3633 | -opt_verbose=false |
3634 | - |
3635 | - |
3636 | -# Parse options once, thoroughly. This comes as soon as possible in the |
3637 | -# script to make things like `--version' happen as quickly as we can. |
3638 | -{ |
3639 | - # this just eases exit handling |
3640 | - while test $# -gt 0; do |
3641 | - opt="$1" |
3642 | - shift |
3643 | - case $opt in |
3644 | - --debug|-x) opt_debug='set -x' |
3645 | - func_echo "enabling shell trace mode" |
3646 | - $opt_debug |
3647 | - ;; |
3648 | - --dry-run|--dryrun|-n) |
3649 | - opt_dry_run=: |
3650 | - ;; |
3651 | - --config) |
3652 | - opt_config=: |
3653 | -func_config |
3654 | - ;; |
3655 | - --dlopen|-dlopen) |
3656 | - optarg="$1" |
3657 | - opt_dlopen="${opt_dlopen+$opt_dlopen |
3658 | -}$optarg" |
3659 | - shift |
3660 | - ;; |
3661 | - --preserve-dup-deps) |
3662 | - opt_preserve_dup_deps=: |
3663 | - ;; |
3664 | - --features) |
3665 | - opt_features=: |
3666 | -func_features |
3667 | - ;; |
3668 | - --finish) |
3669 | - opt_finish=: |
3670 | -set dummy --mode finish ${1+"$@"}; shift |
3671 | - ;; |
3672 | - --help) |
3673 | - opt_help=: |
3674 | - ;; |
3675 | - --help-all) |
3676 | - opt_help_all=: |
3677 | -opt_help=': help-all' |
3678 | - ;; |
3679 | - --mode) |
3680 | - test $# = 0 && func_missing_arg $opt && break |
3681 | - optarg="$1" |
3682 | - opt_mode="$optarg" |
3683 | -case $optarg in |
3684 | - # Valid mode arguments: |
3685 | - clean|compile|execute|finish|install|link|relink|uninstall) ;; |
3686 | - |
3687 | - # Catch anything else as an error |
3688 | - *) func_error "invalid argument for $opt" |
3689 | - exit_cmd=exit |
3690 | - break |
3691 | - ;; |
3692 | -esac |
3693 | - shift |
3694 | - ;; |
3695 | - --no-silent|--no-quiet) |
3696 | - opt_silent=false |
3697 | -func_append preserve_args " $opt" |
3698 | - ;; |
3699 | - --no-warning|--no-warn) |
3700 | - opt_warning=false |
3701 | -func_append preserve_args " $opt" |
3702 | - ;; |
3703 | - --no-verbose) |
3704 | - opt_verbose=false |
3705 | -func_append preserve_args " $opt" |
3706 | - ;; |
3707 | - --silent|--quiet) |
3708 | - opt_silent=: |
3709 | -func_append preserve_args " $opt" |
3710 | - opt_verbose=false |
3711 | - ;; |
3712 | - --verbose|-v) |
3713 | - opt_verbose=: |
3714 | -func_append preserve_args " $opt" |
3715 | -opt_silent=false |
3716 | - ;; |
3717 | - --tag) |
3718 | - test $# = 0 && func_missing_arg $opt && break |
3719 | - optarg="$1" |
3720 | - opt_tag="$optarg" |
3721 | -func_append preserve_args " $opt $optarg" |
3722 | -func_enable_tag "$optarg" |
3723 | - shift |
3724 | - ;; |
3725 | - |
3726 | - -\?|-h) func_usage ;; |
3727 | - --help) func_help ;; |
3728 | - --version) func_version ;; |
3729 | - |
3730 | - # Separate optargs to long options: |
3731 | - --*=*) |
3732 | - func_split_long_opt "$opt" |
3733 | - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} |
3734 | - shift |
3735 | - ;; |
3736 | - |
3737 | - # Separate non-argument short options: |
3738 | - -\?*|-h*|-n*|-v*) |
3739 | - func_split_short_opt "$opt" |
3740 | - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} |
3741 | - shift |
3742 | - ;; |
3743 | - |
3744 | - --) break ;; |
3745 | - -*) func_fatal_help "unrecognized option \`$opt'" ;; |
3746 | - *) set dummy "$opt" ${1+"$@"}; shift; break ;; |
3747 | - esac |
3748 | - done |
3749 | - |
3750 | - # Validate options: |
3751 | - |
3752 | - # save first non-option argument |
3753 | - if test "$#" -gt 0; then |
3754 | - nonopt="$opt" |
3755 | - shift |
3756 | - fi |
3757 | - |
3758 | - # preserve --debug |
3759 | - test "$opt_debug" = : || func_append preserve_args " --debug" |
3760 | - |
3761 | - case $host in |
3762 | - *cygwin* | *mingw* | *pw32* | *cegcc*) |
3763 | - # don't eliminate duplications in $postdeps and $predeps |
3764 | - opt_duplicate_compiler_generated_deps=: |
3765 | - ;; |
3766 | - *) |
3767 | - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps |
3768 | - ;; |
3769 | - esac |
3770 | - |
3771 | - $opt_help || { |
3772 | - # Sanity checks first: |
3773 | - func_check_version_match |
3774 | - |
3775 | - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
3776 | - func_fatal_configuration "not configured to build any kind of library" |
3777 | - fi |
3778 | - |
3779 | - # Darwin sucks |
3780 | - eval std_shrext=\"$shrext_cmds\" |
3781 | - |
3782 | - # Only execute mode is allowed to have -dlopen flags. |
3783 | - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then |
3784 | - func_error "unrecognized option \`-dlopen'" |
3785 | - $ECHO "$help" 1>&2 |
3786 | - exit $EXIT_FAILURE |
3787 | - fi |
3788 | - |
3789 | - # Change the help message to a mode-specific one. |
3790 | - generic_help="$help" |
3791 | - help="Try \`$progname --help --mode=$opt_mode' for more information." |
3792 | - } |
3793 | - |
3794 | - |
3795 | - # Bail if the options were screwed |
3796 | - $exit_cmd $EXIT_FAILURE |
3797 | -} |
3798 | - |
3799 | - |
3800 | - |
3801 | - |
3802 | -## ----------- ## |
3803 | -## Main. ## |
3804 | -## ----------- ## |
3805 | - |
3806 | -# func_lalib_p file |
3807 | -# True iff FILE is a libtool `.la' library or `.lo' object file. |
3808 | -# This function is only a basic sanity check; it will hardly flush out |
3809 | -# determined imposters. |
3810 | -func_lalib_p () |
3811 | -{ |
3812 | - test -f "$1" && |
3813 | - $SED -e 4q "$1" 2>/dev/null \ |
3814 | - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 |
3815 | -} |
3816 | - |
3817 | -# func_lalib_unsafe_p file |
3818 | -# True iff FILE is a libtool `.la' library or `.lo' object file. |
3819 | -# This function implements the same check as func_lalib_p without |
3820 | -# resorting to external programs. To this end, it redirects stdin and |
3821 | -# closes it afterwards, without saving the original file descriptor. |
3822 | -# As a safety measure, use it only where a negative result would be |
3823 | -# fatal anyway. Works if `file' does not exist. |
3824 | -func_lalib_unsafe_p () |
3825 | -{ |
3826 | - lalib_p=no |
3827 | - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then |
3828 | - for lalib_p_l in 1 2 3 4 |
3829 | - do |
3830 | - read lalib_p_line |
3831 | - case "$lalib_p_line" in |
3832 | - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; |
3833 | - esac |
3834 | - done |
3835 | - exec 0<&5 5<&- |
3836 | - fi |
3837 | - test "$lalib_p" = yes |
3838 | -} |
3839 | - |
3840 | -# func_ltwrapper_script_p file |
3841 | -# True iff FILE is a libtool wrapper script |
3842 | -# This function is only a basic sanity check; it will hardly flush out |
3843 | -# determined imposters. |
3844 | -func_ltwrapper_script_p () |
3845 | -{ |
3846 | - func_lalib_p "$1" |
3847 | -} |
3848 | - |
3849 | -# func_ltwrapper_executable_p file |
3850 | -# True iff FILE is a libtool wrapper executable |
3851 | -# This function is only a basic sanity check; it will hardly flush out |
3852 | -# determined imposters. |
3853 | -func_ltwrapper_executable_p () |
3854 | -{ |
3855 | - func_ltwrapper_exec_suffix= |
3856 | - case $1 in |
3857 | - *.exe) ;; |
3858 | - *) func_ltwrapper_exec_suffix=.exe ;; |
3859 | - esac |
3860 | - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 |
3861 | -} |
3862 | - |
3863 | -# func_ltwrapper_scriptname file |
3864 | -# Assumes file is an ltwrapper_executable |
3865 | -# uses $file to determine the appropriate filename for a |
3866 | -# temporary ltwrapper_script. |
3867 | -func_ltwrapper_scriptname () |
3868 | -{ |
3869 | - func_dirname_and_basename "$1" "" "." |
3870 | - func_stripname '' '.exe' "$func_basename_result" |
3871 | - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" |
3872 | -} |
3873 | - |
3874 | -# func_ltwrapper_p file |
3875 | -# True iff FILE is a libtool wrapper script or wrapper executable |
3876 | -# This function is only a basic sanity check; it will hardly flush out |
3877 | -# determined imposters. |
3878 | -func_ltwrapper_p () |
3879 | -{ |
3880 | - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" |
3881 | -} |
3882 | - |
3883 | - |
3884 | -# func_execute_cmds commands fail_cmd |
3885 | -# Execute tilde-delimited COMMANDS. |
3886 | -# If FAIL_CMD is given, eval that upon failure. |
3887 | -# FAIL_CMD may read-access the current command in variable CMD! |
3888 | -func_execute_cmds () |
3889 | -{ |
3890 | - $opt_debug |
3891 | - save_ifs=$IFS; IFS='~' |
3892 | - for cmd in $1; do |
3893 | - IFS=$save_ifs |
3894 | - eval cmd=\"$cmd\" |
3895 | - func_show_eval "$cmd" "${2-:}" |
3896 | - done |
3897 | - IFS=$save_ifs |
3898 | -} |
3899 | - |
3900 | - |
3901 | -# func_source file |
3902 | -# Source FILE, adding directory component if necessary. |
3903 | -# Note that it is not necessary on cygwin/mingw to append a dot to |
3904 | -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe |
3905 | -# behavior happens only for exec(3), not for open(2)! Also, sourcing |
3906 | -# `FILE.' does not work on cygwin managed mounts. |
3907 | -func_source () |
3908 | -{ |
3909 | - $opt_debug |
3910 | - case $1 in |
3911 | - */* | *\\*) . "$1" ;; |
3912 | - *) . "./$1" ;; |
3913 | - esac |
3914 | -} |
3915 | - |
3916 | - |
3917 | -# func_resolve_sysroot PATH |
3918 | -# Replace a leading = in PATH with a sysroot. Store the result into |
3919 | -# func_resolve_sysroot_result |
3920 | -func_resolve_sysroot () |
3921 | -{ |
3922 | - func_resolve_sysroot_result=$1 |
3923 | - case $func_resolve_sysroot_result in |
3924 | - =*) |
3925 | - func_stripname '=' '' "$func_resolve_sysroot_result" |
3926 | - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result |
3927 | - ;; |
3928 | - esac |
3929 | -} |
3930 | - |
3931 | -# func_replace_sysroot PATH |
3932 | -# If PATH begins with the sysroot, replace it with = and |
3933 | -# store the result into func_replace_sysroot_result. |
3934 | -func_replace_sysroot () |
3935 | -{ |
3936 | - case "$lt_sysroot:$1" in |
3937 | - ?*:"$lt_sysroot"*) |
3938 | - func_stripname "$lt_sysroot" '' "$1" |
3939 | - func_replace_sysroot_result="=$func_stripname_result" |
3940 | - ;; |
3941 | - *) |
3942 | - # Including no sysroot. |
3943 | - func_replace_sysroot_result=$1 |
3944 | - ;; |
3945 | - esac |
3946 | -} |
3947 | - |
3948 | -# func_infer_tag arg |
3949 | -# Infer tagged configuration to use if any are available and |
3950 | -# if one wasn't chosen via the "--tag" command line option. |
3951 | -# Only attempt this if the compiler in the base compile |
3952 | -# command doesn't match the default compiler. |
3953 | -# arg is usually of the form 'gcc ...' |
3954 | -func_infer_tag () |
3955 | -{ |
3956 | - $opt_debug |
3957 | - if test -n "$available_tags" && test -z "$tagname"; then |
3958 | - CC_quoted= |
3959 | - for arg in $CC; do |
3960 | - func_append_quoted CC_quoted "$arg" |
3961 | - done |
3962 | - CC_expanded=`func_echo_all $CC` |
3963 | - CC_quoted_expanded=`func_echo_all $CC_quoted` |
3964 | - case $@ in |
3965 | - # Blanks in the command may have been stripped by the calling shell, |
3966 | - # but not from the CC environment variable when configure was run. |
3967 | - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ |
3968 | - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; |
3969 | - # Blanks at the start of $base_compile will cause this to fail |
3970 | - # if we don't check for them as well. |
3971 | - *) |
3972 | - for z in $available_tags; do |
3973 | - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then |
3974 | - # Evaluate the configuration. |
3975 | - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
3976 | - CC_quoted= |
3977 | - for arg in $CC; do |
3978 | - # Double-quote args containing other shell metacharacters. |
3979 | - func_append_quoted CC_quoted "$arg" |
3980 | - done |
3981 | - CC_expanded=`func_echo_all $CC` |
3982 | - CC_quoted_expanded=`func_echo_all $CC_quoted` |
3983 | - case "$@ " in |
3984 | - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ |
3985 | - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) |
3986 | - # The compiler in the base compile command matches |
3987 | - # the one in the tagged configuration. |
3988 | - # Assume this is the tagged configuration we want. |
3989 | - tagname=$z |
3990 | - break |
3991 | - ;; |
3992 | - esac |
3993 | - fi |
3994 | - done |
3995 | - # If $tagname still isn't set, then no tagged configuration |
3996 | - # was found and let the user know that the "--tag" command |
3997 | - # line option must be used. |
3998 | - if test -z "$tagname"; then |
3999 | - func_echo "unable to infer tagged configuration" |
4000 | - func_fatal_error "specify a tag with \`--tag'" |
4001 | -# else |
4002 | -# func_verbose "using $tagname tagged configuration" |
4003 | - fi |
4004 | - ;; |
4005 | - esac |
4006 | - fi |
4007 | -} |
4008 | - |
4009 | - |
4010 | - |
4011 | -# func_write_libtool_object output_name pic_name nonpic_name |
4012 | -# Create a libtool object file (analogous to a ".la" file), |
4013 | -# but don't create it if we're doing a dry run. |
4014 | -func_write_libtool_object () |
4015 | -{ |
4016 | - write_libobj=${1} |
4017 | - if test "$build_libtool_libs" = yes; then |
4018 | - write_lobj=\'${2}\' |
4019 | - else |
4020 | - write_lobj=none |
4021 | - fi |
4022 | - |
4023 | - if test "$build_old_libs" = yes; then |
4024 | - write_oldobj=\'${3}\' |
4025 | - else |
4026 | - write_oldobj=none |
4027 | - fi |
4028 | - |
4029 | - $opt_dry_run || { |
4030 | - cat >${write_libobj}T <<EOF |
4031 | -# $write_libobj - a libtool object file |
4032 | -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION |
4033 | -# |
4034 | -# Please DO NOT delete this file! |
4035 | -# It is necessary for linking the library. |
4036 | - |
4037 | -# Name of the PIC object. |
4038 | -pic_object=$write_lobj |
4039 | - |
4040 | -# Name of the non-PIC object |
4041 | -non_pic_object=$write_oldobj |
4042 | - |
4043 | -EOF |
4044 | - $MV "${write_libobj}T" "${write_libobj}" |
4045 | - } |
4046 | -} |
4047 | - |
4048 | - |
4049 | -################################################## |
4050 | -# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # |
4051 | -################################################## |
4052 | - |
4053 | -# func_convert_core_file_wine_to_w32 ARG |
4054 | -# Helper function used by file name conversion functions when $build is *nix, |
4055 | -# and $host is mingw, cygwin, or some other w32 environment. Relies on a |
4056 | -# correctly configured wine environment available, with the winepath program |
4057 | -# in $build's $PATH. |
4058 | -# |
4059 | -# ARG is the $build file name to be converted to w32 format. |
4060 | -# Result is available in $func_convert_core_file_wine_to_w32_result, and will |
4061 | -# be empty on error (or when ARG is empty) |
4062 | -func_convert_core_file_wine_to_w32 () |
4063 | -{ |
4064 | - $opt_debug |
4065 | - func_convert_core_file_wine_to_w32_result="$1" |
4066 | - if test -n "$1"; then |
4067 | - # Unfortunately, winepath does not exit with a non-zero error code, so we |
4068 | - # are forced to check the contents of stdout. On the other hand, if the |
4069 | - # command is not found, the shell will set an exit code of 127 and print |
4070 | - # *an error message* to stdout. So we must check for both error code of |
4071 | - # zero AND non-empty stdout, which explains the odd construction: |
4072 | - func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` |
4073 | - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then |
4074 | - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | |
4075 | - $SED -e "$lt_sed_naive_backslashify"` |
4076 | - else |
4077 | - func_convert_core_file_wine_to_w32_result= |
4078 | - fi |
4079 | - fi |
4080 | -} |
4081 | -# end: func_convert_core_file_wine_to_w32 |
4082 | - |
4083 | - |
4084 | -# func_convert_core_path_wine_to_w32 ARG |
4085 | -# Helper function used by path conversion functions when $build is *nix, and |
4086 | -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly |
4087 | -# configured wine environment available, with the winepath program in $build's |
4088 | -# $PATH. Assumes ARG has no leading or trailing path separator characters. |
4089 | -# |
4090 | -# ARG is path to be converted from $build format to win32. |
4091 | -# Result is available in $func_convert_core_path_wine_to_w32_result. |
4092 | -# Unconvertible file (directory) names in ARG are skipped; if no directory names |
4093 | -# are convertible, then the result may be empty. |
4094 | -func_convert_core_path_wine_to_w32 () |
4095 | -{ |
4096 | - $opt_debug |
4097 | - # unfortunately, winepath doesn't convert paths, only file names |
4098 | - func_convert_core_path_wine_to_w32_result="" |
4099 | - if test -n "$1"; then |
4100 | - oldIFS=$IFS |
4101 | - IFS=: |
4102 | - for func_convert_core_path_wine_to_w32_f in $1; do |
4103 | - IFS=$oldIFS |
4104 | - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" |
4105 | - if test -n "$func_convert_core_file_wine_to_w32_result" ; then |
4106 | - if test -z "$func_convert_core_path_wine_to_w32_result"; then |
4107 | - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" |
4108 | - else |
4109 | - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" |
4110 | - fi |
4111 | - fi |
4112 | - done |
4113 | - IFS=$oldIFS |
4114 | - fi |
4115 | -} |
4116 | -# end: func_convert_core_path_wine_to_w32 |
4117 | - |
4118 | - |
4119 | -# func_cygpath ARGS... |
4120 | -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when |
4121 | -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) |
4122 | -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or |
4123 | -# (2), returns the Cygwin file name or path in func_cygpath_result (input |
4124 | -# file name or path is assumed to be in w32 format, as previously converted |
4125 | -# from $build's *nix or MSYS format). In case (3), returns the w32 file name |
4126 | -# or path in func_cygpath_result (input file name or path is assumed to be in |
4127 | -# Cygwin format). Returns an empty string on error. |
4128 | -# |
4129 | -# ARGS are passed to cygpath, with the last one being the file name or path to |
4130 | -# be converted. |
4131 | -# |
4132 | -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH |
4133 | -# environment variable; do not put it in $PATH. |
4134 | -func_cygpath () |
4135 | -{ |
4136 | - $opt_debug |
4137 | - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then |
4138 | - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` |
4139 | - if test "$?" -ne 0; then |
4140 | - # on failure, ensure result is empty |
4141 | - func_cygpath_result= |
4142 | - fi |
4143 | - else |
4144 | - func_cygpath_result= |
4145 | - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" |
4146 | - fi |
4147 | -} |
4148 | -#end: func_cygpath |
4149 | - |
4150 | - |
4151 | -# func_convert_core_msys_to_w32 ARG |
4152 | -# Convert file name or path ARG from MSYS format to w32 format. Return |
4153 | -# result in func_convert_core_msys_to_w32_result. |
4154 | -func_convert_core_msys_to_w32 () |
4155 | -{ |
4156 | - $opt_debug |
4157 | - # awkward: cmd appends spaces to result |
4158 | - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | |
4159 | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` |
4160 | -} |
4161 | -#end: func_convert_core_msys_to_w32 |
4162 | - |
4163 | - |
4164 | -# func_convert_file_check ARG1 ARG2 |
4165 | -# Verify that ARG1 (a file name in $build format) was converted to $host |
4166 | -# format in ARG2. Otherwise, emit an error message, but continue (resetting |
4167 | -# func_to_host_file_result to ARG1). |
4168 | -func_convert_file_check () |
4169 | -{ |
4170 | - $opt_debug |
4171 | - if test -z "$2" && test -n "$1" ; then |
4172 | - func_error "Could not determine host file name corresponding to" |
4173 | - func_error " \`$1'" |
4174 | - func_error "Continuing, but uninstalled executables may not work." |
4175 | - # Fallback: |
4176 | - func_to_host_file_result="$1" |
4177 | - fi |
4178 | -} |
4179 | -# end func_convert_file_check |
4180 | - |
4181 | - |
4182 | -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH |
4183 | -# Verify that FROM_PATH (a path in $build format) was converted to $host |
4184 | -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting |
4185 | -# func_to_host_file_result to a simplistic fallback value (see below). |
4186 | -func_convert_path_check () |
4187 | -{ |
4188 | - $opt_debug |
4189 | - if test -z "$4" && test -n "$3"; then |
4190 | - func_error "Could not determine the host path corresponding to" |
4191 | - func_error " \`$3'" |
4192 | - func_error "Continuing, but uninstalled executables may not work." |
4193 | - # Fallback. This is a deliberately simplistic "conversion" and |
4194 | - # should not be "improved". See libtool.info. |
4195 | - if test "x$1" != "x$2"; then |
4196 | - lt_replace_pathsep_chars="s|$1|$2|g" |
4197 | - func_to_host_path_result=`echo "$3" | |
4198 | - $SED -e "$lt_replace_pathsep_chars"` |
4199 | - else |
4200 | - func_to_host_path_result="$3" |
4201 | - fi |
4202 | - fi |
4203 | -} |
4204 | -# end func_convert_path_check |
4205 | - |
4206 | - |
4207 | -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG |
4208 | -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT |
4209 | -# and appending REPL if ORIG matches BACKPAT. |
4210 | -func_convert_path_front_back_pathsep () |
4211 | -{ |
4212 | - $opt_debug |
4213 | - case $4 in |
4214 | - $1 ) func_to_host_path_result="$3$func_to_host_path_result" |
4215 | - ;; |
4216 | - esac |
4217 | - case $4 in |
4218 | - $2 ) func_append func_to_host_path_result "$3" |
4219 | - ;; |
4220 | - esac |
4221 | -} |
4222 | -# end func_convert_path_front_back_pathsep |
4223 | - |
4224 | - |
4225 | -################################################## |
4226 | -# $build to $host FILE NAME CONVERSION FUNCTIONS # |
4227 | -################################################## |
4228 | -# invoked via `$to_host_file_cmd ARG' |
4229 | -# |
4230 | -# In each case, ARG is the path to be converted from $build to $host format. |
4231 | -# Result will be available in $func_to_host_file_result. |
4232 | - |
4233 | - |
4234 | -# func_to_host_file ARG |
4235 | -# Converts the file name ARG from $build format to $host format. Return result |
4236 | -# in func_to_host_file_result. |
4237 | -func_to_host_file () |
4238 | -{ |
4239 | - $opt_debug |
4240 | - $to_host_file_cmd "$1" |
4241 | -} |
4242 | -# end func_to_host_file |
4243 | - |
4244 | - |
4245 | -# func_to_tool_file ARG LAZY |
4246 | -# converts the file name ARG from $build format to toolchain format. Return |
4247 | -# result in func_to_tool_file_result. If the conversion in use is listed |
4248 | -# in (the comma separated) LAZY, no conversion takes place. |
4249 | -func_to_tool_file () |
4250 | -{ |
4251 | - $opt_debug |
4252 | - case ,$2, in |
4253 | - *,"$to_tool_file_cmd",*) |
4254 | - func_to_tool_file_result=$1 |
4255 | - ;; |
4256 | - *) |
4257 | - $to_tool_file_cmd "$1" |
4258 | - func_to_tool_file_result=$func_to_host_file_result |
4259 | - ;; |
4260 | - esac |
4261 | -} |
4262 | -# end func_to_tool_file |
4263 | - |
4264 | - |
4265 | -# func_convert_file_noop ARG |
4266 | -# Copy ARG to func_to_host_file_result. |
4267 | -func_convert_file_noop () |
4268 | -{ |
4269 | - func_to_host_file_result="$1" |
4270 | -} |
4271 | -# end func_convert_file_noop |
4272 | - |
4273 | - |
4274 | -# func_convert_file_msys_to_w32 ARG |
4275 | -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic |
4276 | -# conversion to w32 is not available inside the cwrapper. Returns result in |
4277 | -# func_to_host_file_result. |
4278 | -func_convert_file_msys_to_w32 () |
4279 | -{ |
4280 | - $opt_debug |
4281 | - func_to_host_file_result="$1" |
4282 | - if test -n "$1"; then |
4283 | - func_convert_core_msys_to_w32 "$1" |
4284 | - func_to_host_file_result="$func_convert_core_msys_to_w32_result" |
4285 | - fi |
4286 | - func_convert_file_check "$1" "$func_to_host_file_result" |
4287 | -} |
4288 | -# end func_convert_file_msys_to_w32 |
4289 | - |
4290 | - |
4291 | -# func_convert_file_cygwin_to_w32 ARG |
4292 | -# Convert file name ARG from Cygwin to w32 format. Returns result in |
4293 | -# func_to_host_file_result. |
4294 | -func_convert_file_cygwin_to_w32 () |
4295 | -{ |
4296 | - $opt_debug |
4297 | - func_to_host_file_result="$1" |
4298 | - if test -n "$1"; then |
4299 | - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use |
4300 | - # LT_CYGPATH in this case. |
4301 | - func_to_host_file_result=`cygpath -m "$1"` |
4302 | - fi |
4303 | - func_convert_file_check "$1" "$func_to_host_file_result" |
4304 | -} |
4305 | -# end func_convert_file_cygwin_to_w32 |
4306 | - |
4307 | - |
4308 | -# func_convert_file_nix_to_w32 ARG |
4309 | -# Convert file name ARG from *nix to w32 format. Requires a wine environment |
4310 | -# and a working winepath. Returns result in func_to_host_file_result. |
4311 | -func_convert_file_nix_to_w32 () |
4312 | -{ |
4313 | - $opt_debug |
4314 | - func_to_host_file_result="$1" |
4315 | - if test -n "$1"; then |
4316 | - func_convert_core_file_wine_to_w32 "$1" |
4317 | - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" |
4318 | - fi |
4319 | - func_convert_file_check "$1" "$func_to_host_file_result" |
4320 | -} |
4321 | -# end func_convert_file_nix_to_w32 |
4322 | - |
4323 | - |
4324 | -# func_convert_file_msys_to_cygwin ARG |
4325 | -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. |
4326 | -# Returns result in func_to_host_file_result. |
4327 | -func_convert_file_msys_to_cygwin () |
4328 | -{ |
4329 | - $opt_debug |
4330 | - func_to_host_file_result="$1" |
4331 | - if test -n "$1"; then |
4332 | - func_convert_core_msys_to_w32 "$1" |
4333 | - func_cygpath -u "$func_convert_core_msys_to_w32_result" |
4334 | - func_to_host_file_result="$func_cygpath_result" |
4335 | - fi |
4336 | - func_convert_file_check "$1" "$func_to_host_file_result" |
4337 | -} |
4338 | -# end func_convert_file_msys_to_cygwin |
4339 | - |
4340 | - |
4341 | -# func_convert_file_nix_to_cygwin ARG |
4342 | -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed |
4343 | -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result |
4344 | -# in func_to_host_file_result. |
4345 | -func_convert_file_nix_to_cygwin () |
4346 | -{ |
4347 | - $opt_debug |
4348 | - func_to_host_file_result="$1" |
4349 | - if test -n "$1"; then |
4350 | - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. |
4351 | - func_convert_core_file_wine_to_w32 "$1" |
4352 | - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" |
4353 | - func_to_host_file_result="$func_cygpath_result" |
4354 | - fi |
4355 | - func_convert_file_check "$1" "$func_to_host_file_result" |
4356 | -} |
4357 | -# end func_convert_file_nix_to_cygwin |
4358 | - |
4359 | - |
4360 | -############################################# |
4361 | -# $build to $host PATH CONVERSION FUNCTIONS # |
4362 | -############################################# |
4363 | -# invoked via `$to_host_path_cmd ARG' |
4364 | -# |
4365 | -# In each case, ARG is the path to be converted from $build to $host format. |
4366 | -# The result will be available in $func_to_host_path_result. |
4367 | -# |
4368 | -# Path separators are also converted from $build format to $host format. If |
4369 | -# ARG begins or ends with a path separator character, it is preserved (but |
4370 | -# converted to $host format) on output. |
4371 | -# |
4372 | -# All path conversion functions are named using the following convention: |
4373 | -# file name conversion function : func_convert_file_X_to_Y () |
4374 | -# path conversion function : func_convert_path_X_to_Y () |
4375 | -# where, for any given $build/$host combination the 'X_to_Y' value is the |
4376 | -# same. If conversion functions are added for new $build/$host combinations, |
4377 | -# the two new functions must follow this pattern, or func_init_to_host_path_cmd |
4378 | -# will break. |
4379 | - |
4380 | - |
4381 | -# func_init_to_host_path_cmd |
4382 | -# Ensures that function "pointer" variable $to_host_path_cmd is set to the |
4383 | -# appropriate value, based on the value of $to_host_file_cmd. |
4384 | -to_host_path_cmd= |
4385 | -func_init_to_host_path_cmd () |
4386 | -{ |
4387 | - $opt_debug |
4388 | - if test -z "$to_host_path_cmd"; then |
4389 | - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" |
4390 | - to_host_path_cmd="func_convert_path_${func_stripname_result}" |
4391 | - fi |
4392 | -} |
4393 | - |
4394 | - |
4395 | -# func_to_host_path ARG |
4396 | -# Converts the path ARG from $build format to $host format. Return result |
4397 | -# in func_to_host_path_result. |
4398 | -func_to_host_path () |
4399 | -{ |
4400 | - $opt_debug |
4401 | - func_init_to_host_path_cmd |
4402 | - $to_host_path_cmd "$1" |
4403 | -} |
4404 | -# end func_to_host_path |
4405 | - |
4406 | - |
4407 | -# func_convert_path_noop ARG |
4408 | -# Copy ARG to func_to_host_path_result. |
4409 | -func_convert_path_noop () |
4410 | -{ |
4411 | - func_to_host_path_result="$1" |
4412 | -} |
4413 | -# end func_convert_path_noop |
4414 | - |
4415 | - |
4416 | -# func_convert_path_msys_to_w32 ARG |
4417 | -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic |
4418 | -# conversion to w32 is not available inside the cwrapper. Returns result in |
4419 | -# func_to_host_path_result. |
4420 | -func_convert_path_msys_to_w32 () |
4421 | -{ |
4422 | - $opt_debug |
4423 | - func_to_host_path_result="$1" |
4424 | - if test -n "$1"; then |
4425 | - # Remove leading and trailing path separator characters from ARG. MSYS |
4426 | - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; |
4427 | - # and winepath ignores them completely. |
4428 | - func_stripname : : "$1" |
4429 | - func_to_host_path_tmp1=$func_stripname_result |
4430 | - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" |
4431 | - func_to_host_path_result="$func_convert_core_msys_to_w32_result" |
4432 | - func_convert_path_check : ";" \ |
4433 | - "$func_to_host_path_tmp1" "$func_to_host_path_result" |
4434 | - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" |
4435 | - fi |
4436 | -} |
4437 | -# end func_convert_path_msys_to_w32 |
4438 | - |
4439 | - |
4440 | -# func_convert_path_cygwin_to_w32 ARG |
4441 | -# Convert path ARG from Cygwin to w32 format. Returns result in |
4442 | -# func_to_host_file_result. |
4443 | -func_convert_path_cygwin_to_w32 () |
4444 | -{ |
4445 | - $opt_debug |
4446 | - func_to_host_path_result="$1" |
4447 | - if test -n "$1"; then |
4448 | - # See func_convert_path_msys_to_w32: |
4449 | - func_stripname : : "$1" |
4450 | - func_to_host_path_tmp1=$func_stripname_result |
4451 | - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` |
4452 | - func_convert_path_check : ";" \ |
4453 | - "$func_to_host_path_tmp1" "$func_to_host_path_result" |
4454 | - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" |
4455 | - fi |
4456 | -} |
4457 | -# end func_convert_path_cygwin_to_w32 |
4458 | - |
4459 | - |
4460 | -# func_convert_path_nix_to_w32 ARG |
4461 | -# Convert path ARG from *nix to w32 format. Requires a wine environment and |
4462 | -# a working winepath. Returns result in func_to_host_file_result. |
4463 | -func_convert_path_nix_to_w32 () |
4464 | -{ |
4465 | - $opt_debug |
4466 | - func_to_host_path_result="$1" |
4467 | - if test -n "$1"; then |
4468 | - # See func_convert_path_msys_to_w32: |
4469 | - func_stripname : : "$1" |
4470 | - func_to_host_path_tmp1=$func_stripname_result |
4471 | - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" |
4472 | - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" |
4473 | - func_convert_path_check : ";" \ |
4474 | - "$func_to_host_path_tmp1" "$func_to_host_path_result" |
4475 | - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" |
4476 | - fi |
4477 | -} |
4478 | -# end func_convert_path_nix_to_w32 |
4479 | - |
4480 | - |
4481 | -# func_convert_path_msys_to_cygwin ARG |
4482 | -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. |
4483 | -# Returns result in func_to_host_file_result. |
4484 | -func_convert_path_msys_to_cygwin () |
4485 | -{ |
4486 | - $opt_debug |
4487 | - func_to_host_path_result="$1" |
4488 | - if test -n "$1"; then |
4489 | - # See func_convert_path_msys_to_w32: |
4490 | - func_stripname : : "$1" |
4491 | - func_to_host_path_tmp1=$func_stripname_result |
4492 | - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" |
4493 | - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" |
4494 | - func_to_host_path_result="$func_cygpath_result" |
4495 | - func_convert_path_check : : \ |
4496 | - "$func_to_host_path_tmp1" "$func_to_host_path_result" |
4497 | - func_convert_path_front_back_pathsep ":*" "*:" : "$1" |
4498 | - fi |
4499 | -} |
4500 | -# end func_convert_path_msys_to_cygwin |
4501 | - |
4502 | - |
4503 | -# func_convert_path_nix_to_cygwin ARG |
4504 | -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a |
4505 | -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in |
4506 | -# func_to_host_file_result. |
4507 | -func_convert_path_nix_to_cygwin () |
4508 | -{ |
4509 | - $opt_debug |
4510 | - func_to_host_path_result="$1" |
4511 | - if test -n "$1"; then |
4512 | - # Remove leading and trailing path separator characters from |
4513 | - # ARG. msys behavior is inconsistent here, cygpath turns them |
4514 | - # into '.;' and ';.', and winepath ignores them completely. |
4515 | - func_stripname : : "$1" |
4516 | - func_to_host_path_tmp1=$func_stripname_result |
4517 | - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" |
4518 | - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" |
4519 | - func_to_host_path_result="$func_cygpath_result" |
4520 | - func_convert_path_check : : \ |
4521 | - "$func_to_host_path_tmp1" "$func_to_host_path_result" |
4522 | - func_convert_path_front_back_pathsep ":*" "*:" : "$1" |
4523 | - fi |
4524 | -} |
4525 | -# end func_convert_path_nix_to_cygwin |
4526 | - |
4527 | - |
4528 | -# func_mode_compile arg... |
4529 | -func_mode_compile () |
4530 | -{ |
4531 | - $opt_debug |
4532 | - # Get the compilation command and the source file. |
4533 | - base_compile= |
4534 | - srcfile="$nonopt" # always keep a non-empty value in "srcfile" |
4535 | - suppress_opt=yes |
4536 | - suppress_output= |
4537 | - arg_mode=normal |
4538 | - libobj= |
4539 | - later= |
4540 | - pie_flag= |
4541 | - |
4542 | - for arg |
4543 | - do |
4544 | - case $arg_mode in |
4545 | - arg ) |
4546 | - # do not "continue". Instead, add this to base_compile |
4547 | - lastarg="$arg" |
4548 | - arg_mode=normal |
4549 | - ;; |
4550 | - |
4551 | - target ) |
4552 | - libobj="$arg" |
4553 | - arg_mode=normal |
4554 | - continue |
4555 | - ;; |
4556 | - |
4557 | - normal ) |
4558 | - # Accept any command-line options. |
4559 | - case $arg in |
4560 | - -o) |
4561 | - test -n "$libobj" && \ |
4562 | - func_fatal_error "you cannot specify \`-o' more than once" |
4563 | - arg_mode=target |
4564 | - continue |
4565 | - ;; |
4566 | - |
4567 | - -pie | -fpie | -fPIE) |
4568 | - func_append pie_flag " $arg" |
4569 | - continue |
4570 | - ;; |
4571 | - |
4572 | - -shared | -static | -prefer-pic | -prefer-non-pic) |
4573 | - func_append later " $arg" |
4574 | - continue |
4575 | - ;; |
4576 | - |
4577 | - -no-suppress) |
4578 | - suppress_opt=no |
4579 | - continue |
4580 | - ;; |
4581 | - |
4582 | - -Xcompiler) |
4583 | - arg_mode=arg # the next one goes into the "base_compile" arg list |
4584 | - continue # The current "srcfile" will either be retained or |
4585 | - ;; # replaced later. I would guess that would be a bug. |
4586 | - |
4587 | - -Wc,*) |
4588 | - func_stripname '-Wc,' '' "$arg" |
4589 | - args=$func_stripname_result |
4590 | - lastarg= |
4591 | - save_ifs="$IFS"; IFS=',' |
4592 | - for arg in $args; do |
4593 | - IFS="$save_ifs" |
4594 | - func_append_quoted lastarg "$arg" |
4595 | - done |
4596 | - IFS="$save_ifs" |
4597 | - func_stripname ' ' '' "$lastarg" |
4598 | - lastarg=$func_stripname_result |
4599 | - |
4600 | - # Add the arguments to base_compile. |
4601 | - func_append base_compile " $lastarg" |
4602 | - continue |
4603 | - ;; |
4604 | - |
4605 | - *) |
4606 | - # Accept the current argument as the source file. |
4607 | - # The previous "srcfile" becomes the current argument. |
4608 | - # |
4609 | - lastarg="$srcfile" |
4610 | - srcfile="$arg" |
4611 | - ;; |
4612 | - esac # case $arg |
4613 | - ;; |
4614 | - esac # case $arg_mode |
4615 | - |
4616 | - # Aesthetically quote the previous argument. |
4617 | - func_append_quoted base_compile "$lastarg" |
4618 | - done # for arg |
4619 | - |
4620 | - case $arg_mode in |
4621 | - arg) |
4622 | - func_fatal_error "you must specify an argument for -Xcompile" |
4623 | - ;; |
4624 | - target) |
4625 | - func_fatal_error "you must specify a target with \`-o'" |
4626 | - ;; |
4627 | - *) |
4628 | - # Get the name of the library object. |
4629 | - test -z "$libobj" && { |
4630 | - func_basename "$srcfile" |
4631 | - libobj="$func_basename_result" |
4632 | - } |
4633 | - ;; |
4634 | - esac |
4635 | - |
4636 | - # Recognize several different file suffixes. |
4637 | - # If the user specifies -o file.o, it is replaced with file.lo |
4638 | - case $libobj in |
4639 | - *.[cCFSifmso] | \ |
4640 | - *.ada | *.adb | *.ads | *.asm | \ |
4641 | - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ |
4642 | - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) |
4643 | - func_xform "$libobj" |
4644 | - libobj=$func_xform_result |
4645 | - ;; |
4646 | - esac |
4647 | - |
4648 | - case $libobj in |
4649 | - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; |
4650 | - *) |
4651 | - func_fatal_error "cannot determine name of library object from \`$libobj'" |
4652 | - ;; |
4653 | - esac |
4654 | - |
4655 | - func_infer_tag $base_compile |
4656 | - |
4657 | - for arg in $later; do |
4658 | - case $arg in |
4659 | - -shared) |
4660 | - test "$build_libtool_libs" != yes && \ |
4661 | - func_fatal_configuration "can not build a shared library" |
4662 | - build_old_libs=no |
4663 | - continue |
4664 | - ;; |
4665 | - |
4666 | - -static) |
4667 | - build_libtool_libs=no |
4668 | - build_old_libs=yes |
4669 | - continue |
4670 | - ;; |
4671 | - |
4672 | - -prefer-pic) |
4673 | - pic_mode=yes |
4674 | - continue |
4675 | - ;; |
4676 | - |
4677 | - -prefer-non-pic) |
4678 | - pic_mode=no |
4679 | - continue |
4680 | - ;; |
4681 | - esac |
4682 | - done |
4683 | - |
4684 | - func_quote_for_eval "$libobj" |
4685 | - test "X$libobj" != "X$func_quote_for_eval_result" \ |
4686 | - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
4687 | - && func_warning "libobj name \`$libobj' may not contain shell special characters." |
4688 | - func_dirname_and_basename "$obj" "/" "" |
4689 | - objname="$func_basename_result" |
4690 | - xdir="$func_dirname_result" |
4691 | - lobj=${xdir}$objdir/$objname |
4692 | - |
4693 | - test -z "$base_compile" && \ |
4694 | - func_fatal_help "you must specify a compilation command" |
4695 | - |
4696 | - # Delete any leftover library objects. |
4697 | - if test "$build_old_libs" = yes; then |
4698 | - removelist="$obj $lobj $libobj ${libobj}T" |
4699 | - else |
4700 | - removelist="$lobj $libobj ${libobj}T" |
4701 | - fi |
4702 | - |
4703 | - # On Cygwin there's no "real" PIC flag so we must build both object types |
4704 | - case $host_os in |
4705 | - cygwin* | mingw* | pw32* | os2* | cegcc*) |
4706 | - pic_mode=default |
4707 | - ;; |
4708 | - esac |
4709 | - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then |
4710 | - # non-PIC code in shared libraries is not supported |
4711 | - pic_mode=default |
4712 | - fi |
4713 | - |
4714 | - # Calculate the filename of the output object if compiler does |
4715 | - # not support -o with -c |
4716 | - if test "$compiler_c_o" = no; then |
4717 | - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} |
4718 | - lockfile="$output_obj.lock" |
4719 | - else |
4720 | - output_obj= |
4721 | - need_locks=no |
4722 | - lockfile= |
4723 | - fi |
4724 | - |
4725 | - # Lock this critical section if it is needed |
4726 | - # We use this script file to make the link, it avoids creating a new file |
4727 | - if test "$need_locks" = yes; then |
4728 | - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do |
4729 | - func_echo "Waiting for $lockfile to be removed" |
4730 | - sleep 2 |
4731 | - done |
4732 | - elif test "$need_locks" = warn; then |
4733 | - if test -f "$lockfile"; then |
4734 | - $ECHO "\ |
4735 | -*** ERROR, $lockfile exists and contains: |
4736 | -`cat $lockfile 2>/dev/null` |
4737 | - |
4738 | -This indicates that another process is trying to use the same |
4739 | -temporary object file, and libtool could not work around it because |
4740 | -your compiler does not support \`-c' and \`-o' together. If you |
4741 | -repeat this compilation, it may succeed, by chance, but you had better |
4742 | -avoid parallel builds (make -j) in this platform, or get a better |
4743 | -compiler." |
4744 | - |
4745 | - $opt_dry_run || $RM $removelist |
4746 | - exit $EXIT_FAILURE |
4747 | - fi |
4748 | - func_append removelist " $output_obj" |
4749 | - $ECHO "$srcfile" > "$lockfile" |
4750 | - fi |
4751 | - |
4752 | - $opt_dry_run || $RM $removelist |
4753 | - func_append removelist " $lockfile" |
4754 | - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 |
4755 | - |
4756 | - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 |
4757 | - srcfile=$func_to_tool_file_result |
4758 | - func_quote_for_eval "$srcfile" |
4759 | - qsrcfile=$func_quote_for_eval_result |
4760 | - |
4761 | - # Only build a PIC object if we are building libtool libraries. |
4762 | - if test "$build_libtool_libs" = yes; then |
4763 | - # Without this assignment, base_compile gets emptied. |
4764 | - fbsd_hideous_sh_bug=$base_compile |
4765 | - |
4766 | - if test "$pic_mode" != no; then |
4767 | - command="$base_compile $qsrcfile $pic_flag" |
4768 | - else |
4769 | - # Don't build PIC code |
4770 | - command="$base_compile $qsrcfile" |
4771 | - fi |
4772 | - |
4773 | - func_mkdir_p "$xdir$objdir" |
4774 | - |
4775 | - if test -z "$output_obj"; then |
4776 | - # Place PIC objects in $objdir |
4777 | - func_append command " -o $lobj" |
4778 | - fi |
4779 | - |
4780 | - func_show_eval_locale "$command" \ |
4781 | - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' |
4782 | - |
4783 | - if test "$need_locks" = warn && |
4784 | - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
4785 | - $ECHO "\ |
4786 | -*** ERROR, $lockfile contains: |
4787 | -`cat $lockfile 2>/dev/null` |
4788 | - |
4789 | -but it should contain: |
4790 | -$srcfile |
4791 | - |
4792 | -This indicates that another process is trying to use the same |
4793 | -temporary object file, and libtool could not work around it because |
4794 | -your compiler does not support \`-c' and \`-o' together. If you |
4795 | -repeat this compilation, it may succeed, by chance, but you had better |
4796 | -avoid parallel builds (make -j) in this platform, or get a better |
4797 | -compiler." |
4798 | - |
4799 | - $opt_dry_run || $RM $removelist |
4800 | - exit $EXIT_FAILURE |
4801 | - fi |
4802 | - |
4803 | - # Just move the object if needed, then go on to compile the next one |
4804 | - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then |
4805 | - func_show_eval '$MV "$output_obj" "$lobj"' \ |
4806 | - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' |
4807 | - fi |
4808 | - |
4809 | - # Allow error messages only from the first compilation. |
4810 | - if test "$suppress_opt" = yes; then |
4811 | - suppress_output=' >/dev/null 2>&1' |
4812 | - fi |
4813 | - fi |
4814 | - |
4815 | - # Only build a position-dependent object if we build old libraries. |
4816 | - if test "$build_old_libs" = yes; then |
4817 | - if test "$pic_mode" != yes; then |
4818 | - # Don't build PIC code |
4819 | - command="$base_compile $qsrcfile$pie_flag" |
4820 | - else |
4821 | - command="$base_compile $qsrcfile $pic_flag" |
4822 | - fi |
4823 | - if test "$compiler_c_o" = yes; then |
4824 | - func_append command " -o $obj" |
4825 | - fi |
4826 | - |
4827 | - # Suppress compiler output if we already did a PIC compilation. |
4828 | - func_append command "$suppress_output" |
4829 | - func_show_eval_locale "$command" \ |
4830 | - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' |
4831 | - |
4832 | - if test "$need_locks" = warn && |
4833 | - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
4834 | - $ECHO "\ |
4835 | -*** ERROR, $lockfile contains: |
4836 | -`cat $lockfile 2>/dev/null` |
4837 | - |
4838 | -but it should contain: |
4839 | -$srcfile |
4840 | - |
4841 | -This indicates that another process is trying to use the same |
4842 | -temporary object file, and libtool could not work around it because |
4843 | -your compiler does not support \`-c' and \`-o' together. If you |
4844 | -repeat this compilation, it may succeed, by chance, but you had better |
4845 | -avoid parallel builds (make -j) in this platform, or get a better |
4846 | -compiler." |
4847 | - |
4848 | - $opt_dry_run || $RM $removelist |
4849 | - exit $EXIT_FAILURE |
4850 | - fi |
4851 | - |
4852 | - # Just move the object if needed |
4853 | - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then |
4854 | - func_show_eval '$MV "$output_obj" "$obj"' \ |
4855 | - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' |
4856 | - fi |
4857 | - fi |
4858 | - |
4859 | - $opt_dry_run || { |
4860 | - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" |
4861 | - |
4862 | - # Unlock the critical section if it was locked |
4863 | - if test "$need_locks" != no; then |
4864 | - removelist=$lockfile |
4865 | - $RM "$lockfile" |
4866 | - fi |
4867 | - } |
4868 | - |
4869 | - exit $EXIT_SUCCESS |
4870 | -} |
4871 | - |
4872 | -$opt_help || { |
4873 | - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} |
4874 | -} |
4875 | - |
4876 | -func_mode_help () |
4877 | -{ |
4878 | - # We need to display help for each of the modes. |
4879 | - case $opt_mode in |
4880 | - "") |
4881 | - # Generic help is extracted from the usage comments |
4882 | - # at the start of this file. |
4883 | - func_help |
4884 | - ;; |
4885 | - |
4886 | - clean) |
4887 | - $ECHO \ |
4888 | -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... |
4889 | - |
4890 | -Remove files from the build directory. |
4891 | - |
4892 | -RM is the name of the program to use to delete files associated with each FILE |
4893 | -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
4894 | -to RM. |
4895 | - |
4896 | -If FILE is a libtool library, object or program, all the files associated |
4897 | -with it are deleted. Otherwise, only FILE itself is deleted using RM." |
4898 | - ;; |
4899 | - |
4900 | - compile) |
4901 | - $ECHO \ |
4902 | -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE |
4903 | - |
4904 | -Compile a source file into a libtool library object. |
4905 | - |
4906 | -This mode accepts the following additional options: |
4907 | - |
4908 | - -o OUTPUT-FILE set the output file name to OUTPUT-FILE |
4909 | - -no-suppress do not suppress compiler output for multiple passes |
4910 | - -prefer-pic try to build PIC objects only |
4911 | - -prefer-non-pic try to build non-PIC objects only |
4912 | - -shared do not build a \`.o' file suitable for static linking |
4913 | - -static only build a \`.o' file suitable for static linking |
4914 | - -Wc,FLAG pass FLAG directly to the compiler |
4915 | - |
4916 | -COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
4917 | -from the given SOURCEFILE. |
4918 | - |
4919 | -The output file name is determined by removing the directory component from |
4920 | -SOURCEFILE, then substituting the C source code suffix \`.c' with the |
4921 | -library object suffix, \`.lo'." |
4922 | - ;; |
4923 | - |
4924 | - execute) |
4925 | - $ECHO \ |
4926 | -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... |
4927 | - |
4928 | -Automatically set library path, then run a program. |
4929 | - |
4930 | -This mode accepts the following additional options: |
4931 | - |
4932 | - -dlopen FILE add the directory containing FILE to the library path |
4933 | - |
4934 | -This mode sets the library path environment variable according to \`-dlopen' |
4935 | -flags. |
4936 | - |
4937 | -If any of the ARGS are libtool executable wrappers, then they are translated |
4938 | -into their corresponding uninstalled binary, and any of their required library |
4939 | -directories are added to the library path. |
4940 | - |
4941 | -Then, COMMAND is executed, with ARGS as arguments." |
4942 | - ;; |
4943 | - |
4944 | - finish) |
4945 | - $ECHO \ |
4946 | -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... |
4947 | - |
4948 | -Complete the installation of libtool libraries. |
4949 | - |
4950 | -Each LIBDIR is a directory that contains libtool libraries. |
4951 | - |
4952 | -The commands that this mode executes may require superuser privileges. Use |
4953 | -the \`--dry-run' option if you just want to see what would be executed." |
4954 | - ;; |
4955 | - |
4956 | - install) |
4957 | - $ECHO \ |
4958 | -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... |
4959 | - |
4960 | -Install executables or libraries. |
4961 | - |
4962 | -INSTALL-COMMAND is the installation command. The first component should be |
4963 | -either the \`install' or \`cp' program. |
4964 | - |
4965 | -The following components of INSTALL-COMMAND are treated specially: |
4966 | - |
4967 | - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation |
4968 | - |
4969 | -The rest of the components are interpreted as arguments to that command (only |
4970 | -BSD-compatible install options are recognized)." |
4971 | - ;; |
4972 | - |
4973 | - link) |
4974 | - $ECHO \ |
4975 | -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... |
4976 | - |
4977 | -Link object files or libraries together to form another library, or to |
4978 | -create an executable program. |
4979 | - |
4980 | -LINK-COMMAND is a command using the C compiler that you would use to create |
4981 | -a program from several object files. |
4982 | - |
4983 | -The following components of LINK-COMMAND are treated specially: |
4984 | - |
4985 | - -all-static do not do any dynamic linking at all |
4986 | - -avoid-version do not add a version suffix if possible |
4987 | - -bindir BINDIR specify path to binaries directory (for systems where |
4988 | - libraries must be found in the PATH setting at runtime) |
4989 | - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime |
4990 | - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols |
4991 | - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) |
4992 | - -export-symbols SYMFILE |
4993 | - try to export only the symbols listed in SYMFILE |
4994 | - -export-symbols-regex REGEX |
4995 | - try to export only the symbols matching REGEX |
4996 | - -LLIBDIR search LIBDIR for required installed libraries |
4997 | - -lNAME OUTPUT-FILE requires the installed library libNAME |
4998 | - -module build a library that can dlopened |
4999 | - -no-fast-install disable the fast-install mode |
5000 | - -no-install link a not-installable executable |
The diff has been truncated for viewing.
Thanks, this looks ok, not too many reverse dependencies:
Reverse- Build-Depends ======= ======= data-server
=======
* evolution
* evolution-
* gnome-clocks
* gnome-panel
This update will stay in -proposed until all the reverse deps are transitioned, will you care for this as well? Thanks!