Codebase list telepathy-ring / 20557ba
New upstream version 2.3.24 Adrian Heine 7 years ago
149 changed file(s) with 13104 addition(s) and 49223 deletion(s). Raw diff Collapse all Expand all
0 /m4/libtool.m4
1 /m4/ltoptions.m4
2 /m4/ltsugar.m4
3 /m4/ltversion.m4
4 /m4/lt~obsolete.m4
5 /install-sh
6 /ltmain.sh
7 /depcomp
8 /missing
9 /libtool
10 /aclocal.m4
11 /autom4te.cache
12 /config.*
13 /configure
14 /modem/tests/test-modem
15 /modem/signals-marshal.c
16 /modem/signals-marshal.h
17 /debian/stamp-autogen
18 /debian/stamp-autotools-files
19 /ring-extensions/all.xml
20 /ring-extensions/_gen
21 /sms-glib/tests/test-sms-glib
22 /stamp-h1
23 *.[oa]
24 *.lo
25 *.la
26 *.pyc
27 *.pyo
28 .*.swp
29 .deps
30 .libs
31 Makefile.in
32 Makefile
33 cscope.out
34 tags
35 /telepathy-ring-*.tar.gz
36 /src/telepathy-ring
37 /src/org.freedesktop.Telepathy.ConnectionManager.ring.service
38 /tools/telepathy-glib-env
39 /configure.lineno
40 /modem/_gen
41 /src/test-ring
42
43 tests/twisted/config.py
44 tests/twisted/ring-twisted-tests.list
45 tests/twisted/run-test.sh
46 tests/twisted/tools/exec-with-log.sh
47 tests/twisted/tools/org.freedesktop.Telepathy.ConnectionManager.ring.service
48 tests/twisted/tools/ring-testing.log
49 tests/twisted/tools/tmp-session-bus.conf
0 release 2.2.1
1 Added always_dispatch flag to mcp account
2
3 release 2.2.0
4 Added mission-control plugin
5
6 release 2.1.3
7 BMC#12164, 12932: emitting correct message type
8 Added manual page, updated documentation
9 Not using sms-glib
10 Add manager for Conference channels
11 Fix problems closing channels when disconnecting
12
13 release 2.1.2
14 Fix emitting Closed and ChannelClosed signals
15 Implement Channel.Interface.SMS
16 Improved conferencing support.
17 BMC#12873: implement Telepathy Hold model properly with oFono
18
19 release 2.1.1
20 Initial conferencing support.
21 fd.o #32718: return InvalidHandle if calling to self or anonymous handle
22 fd.o #30954: advertize Message mixin immutable properties
23 fd.o #31726: use TpBaseChannel
24 fd.o #31664: avoid deprecated tp_get_bus
25
26 release 2.1.0
27 Initial release for oFono 0.33 and later.
28 Refactored modem interface.
29 Basic calls and sending SMSs work.
30
031 release 2.0.1
132 Initial release for oFono 0.26.
233 Basic calls, sending and receiving SMSs work.
0 GENERAL
1 =======
2
3 Telepathy-Ring is a GSM connection manager that provides call and messaging
4 services through the standard Telepathy interfaces on the session bus.
5 Telepathy-Ring was originally written atop CSD, the Cellular Services Daemon
6 shipped on the Nokia N900. The current backend (work in progress...) is
7 Ofono <http://www.ofono.org>.
8
9
10 REQUIRED LIBRARIES
11 ==================
12
13 Telepathy-Ring is based on telepathy-glib and rtcom-telepathy-glib. The latter
14 will, however, be made redundant soon enough when the ring-specific interfaces
15 hit upstream.
16
17 The unit testing framework of choice is 'check'.
18
19 There is a Python test script (tests/check-ring.py) based on python-telepathy,
20 python-dbus, and python-gobject.
21
22
23 CONNECTION MANAGER AND CONNECTION OBJECT
24 ========================================
25
26 The connection manager itself can be found in "src/" subdirectory. Each
27 object is in a module of its own.
28
29 The connection object is based on TpBaseConnection and implements two
30 'requestotron'-supporting channel manager objects: RingMediaManager and
31 RingTextManager. It also supports the standard 'Contacts' and 'Capabilities'
32 interfaces. The extension interface 'Emergency' can be used to query
33 the known emergency numbers. The extension interface 'StoredMessages'
34 is used to expunge SMSes spooled on disk.
35
36 The GSM interface is used to access GSM-specific settings.
37
38
39 CONTACT HANDLES
40 ===============
41
42 The RingConnection object manages the contact handles. The function
43 ring_normalize_name() in ring-connection.c processes contact handles, or
44 normalizes them. It gets called when a Telepathy client calls RequestHandles
45 in order to call or send an SMS, or when a call or an SMS is received from
46 network.
47
48 The contact handles can be phone numbers (e.g., "+12345556789"), emergency
49 call urns ("urn:service:sos"), or, strings of 11 UTF-8 characters (SMS
50 TP-Originator-Address in alphanumeric format).
51
52 Note that ring_normalize_name() strips away whitespace and commonly used
53 punctuation from phone numbers (i.e., "+1-(234)-555-6789" becomes
54 "+12345556789").
55
56 As it is not usually possible to get the phone number used by the handset
57 ("MS ISDN") the self handle corresponds to a well-known string "<SelfHandle>".
58
59 The alphanumeric SMS addresses are used when an SMS is sent from a service
60 like 'My Nokia'. Please note that alphanumeric SMS addresses are SMSC-specific
61 and they can not be used to send SMSes.
62
63 Also note that any special handle, such as the self handle, must use
64 a representation that can not be normalized. Anything longer than 11 UTF-8
65 characters suffices, however, if it cannot be normalized as a phone number.
66
67
68 MEDIA CHANNELS
69 ==============
70
71 RingMediaManager manages two kind of media channels, ordinary peer-to-peer
72 calls (RingCallChannel) and conferencing channels (RingConferenceChannel).
73 The StreamedMedia interface is implemented by RingMediaChannel, which is
74 used as a base object for these two.
75
76 The RingMediaChannel implements also Hold, DTMF and DialStrings interfaces.
77 Hold interface can be used to put call on hold. DTMF interface is used to
78 send DTMF digits, DialStrings interface dial strings with more automated
79 processing.
80
81 There are numerous additional channel interfaces required in addition to the
82 StreamedMedia. Group interface is used to accept and release calls. It is
83 implemented in quite different way in the RingCallChannel and
84 RingConferenceChannel, RingCallChannel is a peer-to-peer implementation and
85 RingConferenceChannel can have multiple participants.
86
87 The CallState interface is used to indicate various states, such as call
88 waiting or remote hold. The Emergency interface is used to handle emergency
89 calls and indicate that the given call has been given emergency priority.
90
91 The Conference, MergeableConference, and Splittable interfaces are used to control
92 conferences. Setting up a conference requires at least two participants.
93
94
95 TONE GENERATION
96 ===============
97
98 The tone generator service is used to generate DTMF feedback tones and error
99 tones in case a call ends unexpectedly. The tone generation is driven by
100 RingMediaChannel class. Currently only RingCallChannels are using the tone
101 generation.
102
103 The error tones are generated while the call is in 'released' state
104 until the call enters the 'terminated' state.
105
106 An alerting tone is played if the network is known not to generate the
107 tone (i.e. if there is no user connection, see 3GPP 24.008 sect. 5.2.1.5).
108
109 TEXT CHANNELS
110 =============
111
112 RingTextManager manages textual channels (sending and receiving SMSes).
113 The implementation supports o.f.T.Channel.Interface.Messages interface with
114 text/plain and text/x-vcard (vCard 2.1) media types. The text/x-calendar
115 (vCalendar 1.0) support is there, but it has not been enabled yet.
116
117 The SMSes are spooled on disk by the cellular backend, and they have to be
118 explicitly expunged by the client (after it has logged them securely). The
119 client should use the Connection.Interface.StoredMessages interface for this.
120
121 Text channels used to receive class 0 (flash SMSs) are a special case; it is
122 not possible to send on such a channel. Likewise, a channel created for
123 receiving an SMS with alphanumeric address cannot be sent on.
124
125
126 MODEM INTERFACE LIBRARY
127 =======================
128
129 Modem interface library found from "modem/" subdirectory is used to
130 communicate with the Ofono services over D-Bus. The library shields the
131 application from usual D-Bus-isms and tries to provide an ordinary
132 GObject-esque experience with it.
133
134 Note that only the minimal set of functionality used by Telepathy-Ring is
135 provided. The services supported are call (for making CS calls), sms (for
136 sending, receiving, and manipulating spooled SMSs) and sim (for accessing
137 some SIM information).
138
139
140 TESTING
141 =======
142
143 There is a Python script testing basic functionality (tests/check-ring.py)
144 and a shell script for setting up suitable test environment and running the
145 python script (tests/check-ring.sh).
146
147
148 FURTHER READING
149 ===============
150
151 In addition to the Telepathy specifications, the following 3GPP documents
152 are useful when trying to understand how speech calls and short messages
153 work in GSM and UMTS:
154
155 * 3GPP TS 22.001, 24.008 (call signaling)
156 * 3GPP TS 24.011, 23,038, 23.040, 27.005 (SMS)
157 * 3GPP TS 11.11 (SIM)
77
88 ACLOCAL_AMFLAGS = -I m4
99
10 SUBDIRS = tests ring-extensions sms-glib modem src docs tools scripts
10 SUBDIRS = tests ring-extensions modem src docs tools scripts mc-plugin
1111
1212 TAGS:
13 find src sms-glib modem ring-extensions -name '*.[hc]' | \
13 find src modem ring-extensions -name '*.[hc]' | \
1414 xargs etags
1515
1616 EXTRA_DIST = \
+0
-730
Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 #
18 # Makefile.am for telepathy-ring
19 #
20 # Copyright (C) 2007 Nokia Corporation
21 # Contact: Pekka Pessi <first.surname@nokia.com>
22 # See file COPYING.
23 #
24 VPATH = @srcdir@
25 pkgdatadir = $(datadir)/@PACKAGE@
26 pkgincludedir = $(includedir)/@PACKAGE@
27 pkglibdir = $(libdir)/@PACKAGE@
28 pkglibexecdir = $(libexecdir)/@PACKAGE@
29 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
30 install_sh_DATA = $(install_sh) -c -m 644
31 install_sh_PROGRAM = $(install_sh) -c
32 install_sh_SCRIPT = $(install_sh) -c
33 INSTALL_HEADER = $(INSTALL_DATA)
34 transform = $(program_transform_name)
35 NORMAL_INSTALL = :
36 PRE_INSTALL = :
37 POST_INSTALL = :
38 NORMAL_UNINSTALL = :
39 PRE_UNINSTALL = :
40 POST_UNINSTALL = :
41 build_triplet = @build@
42 host_triplet = @host@
43 subdir = .
44 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
45 $(srcdir)/Makefile.in $(srcdir)/config.h.in \
46 $(top_srcdir)/configure AUTHORS COPYING ChangeLog config.guess \
47 config.sub depcomp install-sh ltmain.sh missing
48 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
49 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
53 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
56 configure.lineno config.status.lineno
57 mkinstalldirs = $(install_sh) -d
58 CONFIG_HEADER = config.h
59 CONFIG_CLEAN_FILES =
60 CONFIG_CLEAN_VPATH_FILES =
61 AM_V_GEN = $(am__v_GEN_$(V))
62 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
63 am__v_GEN_0 = @echo " GEN " $@;
64 AM_V_at = $(am__v_at_$(V))
65 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
66 am__v_at_0 = @
67 SOURCES =
68 DIST_SOURCES =
69 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
70 html-recursive info-recursive install-data-recursive \
71 install-dvi-recursive install-exec-recursive \
72 install-html-recursive install-info-recursive \
73 install-pdf-recursive install-ps-recursive install-recursive \
74 installcheck-recursive installdirs-recursive pdf-recursive \
75 ps-recursive uninstall-recursive
76 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
77 distclean-recursive maintainer-clean-recursive
78 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
79 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
80 distdir dist dist-all distcheck
81 ETAGS = etags
82 CTAGS = ctags
83 DIST_SUBDIRS = $(SUBDIRS)
84 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
85 distdir = $(PACKAGE)-$(VERSION)
86 top_distdir = $(distdir)
87 am__remove_distdir = \
88 { test ! -d "$(distdir)" \
89 || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
90 && rm -fr "$(distdir)"; }; }
91 am__relativize = \
92 dir0=`pwd`; \
93 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
94 sed_rest='s,^[^/]*/*,,'; \
95 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
96 sed_butlast='s,/*[^/]*$$,,'; \
97 while test -n "$$dir1"; do \
98 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
99 if test "$$first" != "."; then \
100 if test "$$first" = ".."; then \
101 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
102 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
103 else \
104 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
105 if test "$$first2" = "$$first"; then \
106 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
107 else \
108 dir2="../$$dir2"; \
109 fi; \
110 dir0="$$dir0"/"$$first"; \
111 fi; \
112 fi; \
113 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
114 done; \
115 reldir="$$dir2"
116 DIST_ARCHIVES = $(distdir).tar.gz
117 GZIP_ENV = --best
118 distuninstallcheck_listfiles = find . -type f -print
119 distcleancheck_listfiles = find . -type f -print
120 ACLOCAL = @ACLOCAL@
121 AMTAR = @AMTAR@
122 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
123 AR = @AR@
124 AUTOCONF = @AUTOCONF@
125 AUTOHEADER = @AUTOHEADER@
126 AUTOMAKE = @AUTOMAKE@
127 AWK = @AWK@
128 CC = @CC@
129 CCDEPMODE = @CCDEPMODE@
130 CFLAGS = @CFLAGS@
131 CHECK_CFLAGS = @CHECK_CFLAGS@
132 CHECK_LIBS = @CHECK_LIBS@
133 CPP = @CPP@
134 CPPFLAGS = @CPPFLAGS@
135 CYGPATH_W = @CYGPATH_W@
136 DATADIR = @DATADIR@
137 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
138 DBUS_CFLAGS = @DBUS_CFLAGS@
139 DBUS_LIBS = @DBUS_LIBS@
140 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
141 DEFS = @DEFS@
142 DEPDIR = @DEPDIR@
143 DSYMUTIL = @DSYMUTIL@
144 DUMPBIN = @DUMPBIN@
145 ECHO_C = @ECHO_C@
146 ECHO_N = @ECHO_N@
147 ECHO_T = @ECHO_T@
148 EGREP = @EGREP@
149 ERROR_CFLAGS = @ERROR_CFLAGS@
150 EXEEXT = @EXEEXT@
151 FGREP = @FGREP@
152 GLIB_CFLAGS = @GLIB_CFLAGS@
153 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
154 GLIB_LIBS = @GLIB_LIBS@
155 GREP = @GREP@
156 INSTALL = @INSTALL@
157 INSTALL_DATA = @INSTALL_DATA@
158 INSTALL_PROGRAM = @INSTALL_PROGRAM@
159 INSTALL_SCRIPT = @INSTALL_SCRIPT@
160 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
161 LD = @LD@
162 LDFLAGS = @LDFLAGS@
163 LIBOBJS = @LIBOBJS@
164 LIBS = @LIBS@
165 LIBTOOL = @LIBTOOL@
166 LIPO = @LIPO@
167 LN_S = @LN_S@
168 LTLIBOBJS = @LTLIBOBJS@
169 MAINT = @MAINT@
170 MAKEINFO = @MAKEINFO@
171 MKDIR_P = @MKDIR_P@
172 NM = @NM@
173 NMEDIT = @NMEDIT@
174 OBJDUMP = @OBJDUMP@
175 OBJEXT = @OBJEXT@
176 OTOOL = @OTOOL@
177 OTOOL64 = @OTOOL64@
178 PACKAGE = @PACKAGE@
179 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
180 PACKAGE_NAME = @PACKAGE_NAME@
181 PACKAGE_STRING = @PACKAGE_STRING@
182 PACKAGE_TARNAME = @PACKAGE_TARNAME@
183 PACKAGE_URL = @PACKAGE_URL@
184 PACKAGE_VERSION = @PACKAGE_VERSION@
185 PATH_SEPARATOR = @PATH_SEPARATOR@
186 PKG_CONFIG = @PKG_CONFIG@
187 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
188 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
189 PYTHON = @PYTHON@
190 RANLIB = @RANLIB@
191 SED = @SED@
192 SET_MAKE = @SET_MAKE@
193 SHELL = @SHELL@
194 STRIP = @STRIP@
195 TP_CFLAGS = @TP_CFLAGS@
196 TP_LIBS = @TP_LIBS@
197 UUID_CFLAGS = @UUID_CFLAGS@
198 UUID_LIBS = @UUID_LIBS@
199 VERSION = @VERSION@
200 XSLTPROC = @XSLTPROC@
201 abs_builddir = @abs_builddir@
202 abs_srcdir = @abs_srcdir@
203 abs_top_builddir = @abs_top_builddir@
204 abs_top_srcdir = @abs_top_srcdir@
205 ac_ct_CC = @ac_ct_CC@
206 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207 am__include = @am__include@
208 am__leading_dot = @am__leading_dot@
209 am__quote = @am__quote@
210 am__tar = @am__tar@
211 am__untar = @am__untar@
212 bindir = @bindir@
213 build = @build@
214 build_alias = @build_alias@
215 build_cpu = @build_cpu@
216 build_os = @build_os@
217 build_vendor = @build_vendor@
218 builddir = @builddir@
219 datadir = @datadir@
220 datarootdir = @datarootdir@
221 docdir = @docdir@
222 dvidir = @dvidir@
223 exec_prefix = @exec_prefix@
224 host = @host@
225 host_alias = @host_alias@
226 host_cpu = @host_cpu@
227 host_os = @host_os@
228 host_vendor = @host_vendor@
229 htmldir = @htmldir@
230 includedir = @includedir@
231 includemodemdir = @includemodemdir@
232 includesmsdir = @includesmsdir@
233 infodir = @infodir@
234 install_sh = @install_sh@
235 libdir = @libdir@
236 libexecdir = @libexecdir@
237 localedir = @localedir@
238 localstatedir = @localstatedir@
239 lt_ECHO = @lt_ECHO@
240 mandir = @mandir@
241 mkdir_p = @mkdir_p@
242 oldincludedir = @oldincludedir@
243 pdfdir = @pdfdir@
244 prefix = @prefix@
245 program_transform_name = @program_transform_name@
246 psdir = @psdir@
247 sbindir = @sbindir@
248 sharedstatedir = @sharedstatedir@
249 srcdir = @srcdir@
250 sysconfdir = @sysconfdir@
251 target_alias = @target_alias@
252 testdir = @testdir@
253 top_build_prefix = @top_build_prefix@
254 top_builddir = @top_builddir@
255 top_srcdir = @top_srcdir@
256 ACLOCAL_AMFLAGS = -I m4
257 SUBDIRS = tests ring-extensions sms-glib modem src docs tools scripts
258 EXTRA_DIST = \
259 autogen.sh
260
261 all: config.h
262 $(MAKE) $(AM_MAKEFLAGS) all-recursive
263
264 .SUFFIXES:
265 am--refresh:
266 @:
267 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
268 @for dep in $?; do \
269 case '$(am__configure_deps)' in \
270 *$$dep*) \
271 echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
272 $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
273 && exit 0; \
274 exit 1;; \
275 esac; \
276 done; \
277 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
278 $(am__cd) $(top_srcdir) && \
279 $(AUTOMAKE) --foreign Makefile
280 .PRECIOUS: Makefile
281 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
282 @case '$?' in \
283 *config.status*) \
284 echo ' $(SHELL) ./config.status'; \
285 $(SHELL) ./config.status;; \
286 *) \
287 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
288 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
289 esac;
290
291 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
292 $(SHELL) ./config.status --recheck
293
294 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
295 $(am__cd) $(srcdir) && $(AUTOCONF)
296 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
297 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
298 $(am__aclocal_m4_deps):
299
300 config.h: stamp-h1
301 @if test ! -f $@; then \
302 rm -f stamp-h1; \
303 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
304 else :; fi
305
306 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
307 @rm -f stamp-h1
308 cd $(top_builddir) && $(SHELL) ./config.status config.h
309 $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
310 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
311 rm -f stamp-h1
312 touch $@
313
314 distclean-hdr:
315 -rm -f config.h stamp-h1
316
317 mostlyclean-libtool:
318 -rm -f *.lo
319
320 clean-libtool:
321 -rm -rf .libs _libs
322
323 distclean-libtool:
324 -rm -f libtool config.lt
325
326 # This directory's subdirectories are mostly independent; you can cd
327 # into them and run `make' without going through this Makefile.
328 # To change the values of `make' variables: instead of editing Makefiles,
329 # (1) if the variable is set in `config.status', edit `config.status'
330 # (which will cause the Makefiles to be regenerated when you run `make');
331 # (2) otherwise, pass the desired values on the `make' command line.
332 $(RECURSIVE_TARGETS):
333 @fail= failcom='exit 1'; \
334 for f in x $$MAKEFLAGS; do \
335 case $$f in \
336 *=* | --[!k]*);; \
337 *k*) failcom='fail=yes';; \
338 esac; \
339 done; \
340 dot_seen=no; \
341 target=`echo $@ | sed s/-recursive//`; \
342 list='$(SUBDIRS)'; for subdir in $$list; do \
343 echo "Making $$target in $$subdir"; \
344 if test "$$subdir" = "."; then \
345 dot_seen=yes; \
346 local_target="$$target-am"; \
347 else \
348 local_target="$$target"; \
349 fi; \
350 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
351 || eval $$failcom; \
352 done; \
353 if test "$$dot_seen" = "no"; then \
354 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
355 fi; test -z "$$fail"
356
357 $(RECURSIVE_CLEAN_TARGETS):
358 @fail= failcom='exit 1'; \
359 for f in x $$MAKEFLAGS; do \
360 case $$f in \
361 *=* | --[!k]*);; \
362 *k*) failcom='fail=yes';; \
363 esac; \
364 done; \
365 dot_seen=no; \
366 case "$@" in \
367 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
368 *) list='$(SUBDIRS)' ;; \
369 esac; \
370 rev=''; for subdir in $$list; do \
371 if test "$$subdir" = "."; then :; else \
372 rev="$$subdir $$rev"; \
373 fi; \
374 done; \
375 rev="$$rev ."; \
376 target=`echo $@ | sed s/-recursive//`; \
377 for subdir in $$rev; do \
378 echo "Making $$target in $$subdir"; \
379 if test "$$subdir" = "."; then \
380 local_target="$$target-am"; \
381 else \
382 local_target="$$target"; \
383 fi; \
384 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
385 || eval $$failcom; \
386 done && test -z "$$fail"
387 tags-recursive:
388 list='$(SUBDIRS)'; for subdir in $$list; do \
389 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
390 done
391 ctags-recursive:
392 list='$(SUBDIRS)'; for subdir in $$list; do \
393 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
394 done
395
396 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
397 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
398 unique=`for i in $$list; do \
399 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
400 done | \
401 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
402 END { if (nonempty) { for (i in files) print i; }; }'`; \
403 mkid -fID $$unique
404 tags: TAGS
405 ctags: CTAGS
406 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
407 $(TAGS_FILES) $(LISP)
408 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
409 unique=`for i in $$list; do \
410 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
411 done | \
412 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
413 END { if (nonempty) { for (i in files) print i; }; }'`; \
414 test -z "$(CTAGS_ARGS)$$unique" \
415 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
416 $$unique
417
418 GTAGS:
419 here=`$(am__cd) $(top_builddir) && pwd` \
420 && $(am__cd) $(top_srcdir) \
421 && gtags -i $(GTAGS_ARGS) "$$here"
422
423 distclean-tags:
424 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
425
426 distdir: $(DISTFILES)
427 $(am__remove_distdir)
428 test -d "$(distdir)" || mkdir "$(distdir)"
429 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
430 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
431 list='$(DISTFILES)'; \
432 dist_files=`for file in $$list; do echo $$file; done | \
433 sed -e "s|^$$srcdirstrip/||;t" \
434 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
435 case $$dist_files in \
436 */*) $(MKDIR_P) `echo "$$dist_files" | \
437 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
438 sort -u` ;; \
439 esac; \
440 for file in $$dist_files; do \
441 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
442 if test -d $$d/$$file; then \
443 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
444 if test -d "$(distdir)/$$file"; then \
445 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
446 fi; \
447 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
448 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
449 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
450 fi; \
451 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
452 else \
453 test -f "$(distdir)/$$file" \
454 || cp -p $$d/$$file "$(distdir)/$$file" \
455 || exit 1; \
456 fi; \
457 done
458 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
459 if test "$$subdir" = .; then :; else \
460 test -d "$(distdir)/$$subdir" \
461 || $(MKDIR_P) "$(distdir)/$$subdir" \
462 || exit 1; \
463 fi; \
464 done
465 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
466 if test "$$subdir" = .; then :; else \
467 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
468 $(am__relativize); \
469 new_distdir=$$reldir; \
470 dir1=$$subdir; dir2="$(top_distdir)"; \
471 $(am__relativize); \
472 new_top_distdir=$$reldir; \
473 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
474 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
475 ($(am__cd) $$subdir && \
476 $(MAKE) $(AM_MAKEFLAGS) \
477 top_distdir="$$new_top_distdir" \
478 distdir="$$new_distdir" \
479 am__remove_distdir=: \
480 am__skip_length_check=: \
481 am__skip_mode_fix=: \
482 distdir) \
483 || exit 1; \
484 fi; \
485 done
486 -test -n "$(am__skip_mode_fix)" \
487 || find "$(distdir)" -type d ! -perm -755 \
488 -exec chmod u+rwx,go+rx {} \; -o \
489 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
490 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
491 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
492 || chmod -R a+r "$(distdir)"
493 dist-gzip: distdir
494 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
495 $(am__remove_distdir)
496
497 dist-bzip2: distdir
498 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
499 $(am__remove_distdir)
500
501 dist-lzma: distdir
502 tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
503 $(am__remove_distdir)
504
505 dist-xz: distdir
506 tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
507 $(am__remove_distdir)
508
509 dist-tarZ: distdir
510 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
511 $(am__remove_distdir)
512
513 dist-shar: distdir
514 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
515 $(am__remove_distdir)
516
517 dist-zip: distdir
518 -rm -f $(distdir).zip
519 zip -rq $(distdir).zip $(distdir)
520 $(am__remove_distdir)
521
522 dist dist-all: distdir
523 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
524 $(am__remove_distdir)
525
526 # This target untars the dist file and tries a VPATH configuration. Then
527 # it guarantees that the distribution is self-contained by making another
528 # tarfile.
529 distcheck: dist
530 case '$(DIST_ARCHIVES)' in \
531 *.tar.gz*) \
532 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
533 *.tar.bz2*) \
534 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
535 *.tar.lzma*) \
536 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
537 *.tar.xz*) \
538 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
539 *.tar.Z*) \
540 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
541 *.shar.gz*) \
542 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
543 *.zip*) \
544 unzip $(distdir).zip ;;\
545 esac
546 chmod -R a-w $(distdir); chmod a+w $(distdir)
547 mkdir $(distdir)/_build
548 mkdir $(distdir)/_inst
549 chmod a-w $(distdir)
550 test -d $(distdir)/_build || exit 0; \
551 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
552 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
553 && am__cwd=`pwd` \
554 && $(am__cd) $(distdir)/_build \
555 && ../configure --srcdir=.. --prefix="$$dc_install_base" \
556 $(DISTCHECK_CONFIGURE_FLAGS) \
557 && $(MAKE) $(AM_MAKEFLAGS) \
558 && $(MAKE) $(AM_MAKEFLAGS) dvi \
559 && $(MAKE) $(AM_MAKEFLAGS) check \
560 && $(MAKE) $(AM_MAKEFLAGS) install \
561 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
562 && $(MAKE) $(AM_MAKEFLAGS) uninstall \
563 && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
564 distuninstallcheck \
565 && chmod -R a-w "$$dc_install_base" \
566 && ({ \
567 (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
568 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
569 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
570 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
571 distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
572 } || { rm -rf "$$dc_destdir"; exit 1; }) \
573 && rm -rf "$$dc_destdir" \
574 && $(MAKE) $(AM_MAKEFLAGS) dist \
575 && rm -rf $(DIST_ARCHIVES) \
576 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
577 && cd "$$am__cwd" \
578 || exit 1
579 $(am__remove_distdir)
580 @(echo "$(distdir) archives ready for distribution: "; \
581 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
582 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
583 distuninstallcheck:
584 @$(am__cd) '$(distuninstallcheck_dir)' \
585 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
586 || { echo "ERROR: files left after uninstall:" ; \
587 if test -n "$(DESTDIR)"; then \
588 echo " (check DESTDIR support)"; \
589 fi ; \
590 $(distuninstallcheck_listfiles) ; \
591 exit 1; } >&2
592 distcleancheck: distclean
593 @if test '$(srcdir)' = . ; then \
594 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
595 exit 1 ; \
596 fi
597 @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
598 || { echo "ERROR: files left in build directory after distclean:" ; \
599 $(distcleancheck_listfiles) ; \
600 exit 1; } >&2
601 check-am: all-am
602 check: check-recursive
603 all-am: Makefile config.h
604 installdirs: installdirs-recursive
605 installdirs-am:
606 install: install-recursive
607 install-exec: install-exec-recursive
608 install-data: install-data-recursive
609 uninstall: uninstall-recursive
610
611 install-am: all-am
612 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
613
614 installcheck: installcheck-recursive
615 install-strip:
616 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
617 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
618 `test -z '$(STRIP)' || \
619 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
620 mostlyclean-generic:
621
622 clean-generic:
623
624 distclean-generic:
625 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
626 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
627
628 maintainer-clean-generic:
629 @echo "This command is intended for maintainers to use"
630 @echo "it deletes files that may require special tools to rebuild."
631 clean: clean-recursive
632
633 clean-am: clean-generic clean-libtool mostlyclean-am
634
635 distclean: distclean-recursive
636 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
637 -rm -f Makefile
638 distclean-am: clean-am distclean-generic distclean-hdr \
639 distclean-libtool distclean-tags
640
641 dvi: dvi-recursive
642
643 dvi-am:
644
645 html: html-recursive
646
647 html-am:
648
649 info: info-recursive
650
651 info-am:
652
653 install-data-am:
654
655 install-dvi: install-dvi-recursive
656
657 install-dvi-am:
658
659 install-exec-am:
660
661 install-html: install-html-recursive
662
663 install-html-am:
664
665 install-info: install-info-recursive
666
667 install-info-am:
668
669 install-man:
670
671 install-pdf: install-pdf-recursive
672
673 install-pdf-am:
674
675 install-ps: install-ps-recursive
676
677 install-ps-am:
678
679 installcheck-am:
680
681 maintainer-clean: maintainer-clean-recursive
682 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
683 -rm -rf $(top_srcdir)/autom4te.cache
684 -rm -f Makefile
685 maintainer-clean-am: distclean-am maintainer-clean-generic
686
687 mostlyclean: mostlyclean-recursive
688
689 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
690
691 pdf: pdf-recursive
692
693 pdf-am:
694
695 ps: ps-recursive
696
697 ps-am:
698
699 uninstall-am:
700
701 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
702 ctags-recursive install-am install-strip tags-recursive
703
704 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
705 all all-am am--refresh check check-am clean clean-generic \
706 clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
707 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
708 distcheck distclean distclean-generic distclean-hdr \
709 distclean-libtool distclean-tags distcleancheck distdir \
710 distuninstallcheck dvi dvi-am html html-am info info-am \
711 install install-am install-data install-data-am install-dvi \
712 install-dvi-am install-exec install-exec-am install-html \
713 install-html-am install-info install-info-am install-man \
714 install-pdf install-pdf-am install-ps install-ps-am \
715 install-strip installcheck installcheck-am installdirs \
716 installdirs-am maintainer-clean maintainer-clean-generic \
717 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
718 ps ps-am tags tags-recursive uninstall uninstall-am
719
720
721 TAGS:
722 find src sms-glib modem ring-extensions -name '*.[hc]' | \
723 xargs etags
724
725 .PHONY: TAGS
726
727 # Tell versions [3.59,3.63) of GNU make to not export all variables.
728 # Otherwise a system limit (for SysV at least) may be exceeded.
729 .NOEXPORT:
+0
-1194
aclocal.m4 less more
0 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 # PARTICULAR PURPOSE.
12
13 m4_ifndef([AC_AUTOCONF_VERSION],
14 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
15 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
16 [m4_warning([this file was generated for autoconf 2.67.
17 You have another version of autoconf. It may work, but is not guaranteed to.
18 If you have problems, you may need to regenerate the build system entirely.
19 To do so, use the procedure documented by the package, typically `autoreconf'.])])
20
21 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
22 # serial 1 (pkg-config-0.24)
23 #
24 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25 #
26 # This program is free software; you can redistribute it and/or modify
27 # it under the terms of the GNU General Public License as published by
28 # the Free Software Foundation; either version 2 of the License, or
29 # (at your option) any later version.
30 #
31 # This program is distributed in the hope that it will be useful, but
32 # WITHOUT ANY WARRANTY; without even the implied warranty of
33 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 # General Public License for more details.
35 #
36 # You should have received a copy of the GNU General Public License
37 # along with this program; if not, write to the Free Software
38 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #
40 # As a special exception to the GNU General Public License, if you
41 # distribute this file as part of a program that contains a
42 # configuration script generated by Autoconf, you may include it under
43 # the same distribution terms that you use for the rest of that program.
44
45 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
46 # ----------------------------------
47 AC_DEFUN([PKG_PROG_PKG_CONFIG],
48 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
51 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
52 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
53
54 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
55 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
56 fi
57 if test -n "$PKG_CONFIG"; then
58 _pkg_min_version=m4_default([$1], [0.9.0])
59 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
60 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
61 AC_MSG_RESULT([yes])
62 else
63 AC_MSG_RESULT([no])
64 PKG_CONFIG=""
65 fi
66 fi[]dnl
67 ])# PKG_PROG_PKG_CONFIG
68
69 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
70 #
71 # Check to see whether a particular set of modules exists. Similar
72 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
73 #
74 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
75 # only at the first occurence in configure.ac, so if the first place
76 # it's called might be skipped (such as if it is within an "if", you
77 # have to call PKG_CHECK_EXISTS manually
78 # --------------------------------------------------------------
79 AC_DEFUN([PKG_CHECK_EXISTS],
80 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
81 if test -n "$PKG_CONFIG" && \
82 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
83 m4_default([$2], [:])
84 m4_ifvaln([$3], [else
85 $3])dnl
86 fi])
87
88 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
89 # ---------------------------------------------
90 m4_define([_PKG_CONFIG],
91 [if test -n "$$1"; then
92 pkg_cv_[]$1="$$1"
93 elif test -n "$PKG_CONFIG"; then
94 PKG_CHECK_EXISTS([$3],
95 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
96 [pkg_failed=yes])
97 else
98 pkg_failed=untried
99 fi[]dnl
100 ])# _PKG_CONFIG
101
102 # _PKG_SHORT_ERRORS_SUPPORTED
103 # -----------------------------
104 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
105 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
106 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
107 _pkg_short_errors_supported=yes
108 else
109 _pkg_short_errors_supported=no
110 fi[]dnl
111 ])# _PKG_SHORT_ERRORS_SUPPORTED
112
113
114 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
115 # [ACTION-IF-NOT-FOUND])
116 #
117 #
118 # Note that if there is a possibility the first call to
119 # PKG_CHECK_MODULES might not happen, you should be sure to include an
120 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
121 #
122 #
123 # --------------------------------------------------------------
124 AC_DEFUN([PKG_CHECK_MODULES],
125 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
126 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
127 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
128
129 pkg_failed=no
130 AC_MSG_CHECKING([for $1])
131
132 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
133 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
134
135 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
136 and $1[]_LIBS to avoid the need to call pkg-config.
137 See the pkg-config man page for more details.])
138
139 if test $pkg_failed = yes; then
140 AC_MSG_RESULT([no])
141 _PKG_SHORT_ERRORS_SUPPORTED
142 if test $_pkg_short_errors_supported = yes; then
143 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
144 else
145 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
146 fi
147 # Put the nasty error message in config.log where it belongs
148 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
149
150 m4_default([$4], [AC_MSG_ERROR(
151 [Package requirements ($2) were not met:
152
153 $$1_PKG_ERRORS
154
155 Consider adjusting the PKG_CONFIG_PATH environment variable if you
156 installed software in a non-standard prefix.
157
158 _PKG_TEXT])dnl
159 ])
160 elif test $pkg_failed = untried; then
161 AC_MSG_RESULT([no])
162 m4_default([$4], [AC_MSG_FAILURE(
163 [The pkg-config script could not be found or is too old. Make sure it
164 is in your PATH or set the PKG_CONFIG environment variable to the full
165 path to pkg-config.
166
167 _PKG_TEXT
168
169 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
170 ])
171 else
172 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
173 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
174 AC_MSG_RESULT([yes])
175 $3
176 fi[]dnl
177 ])# PKG_CHECK_MODULES
178
179 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
180 #
181 # This file is free software; the Free Software Foundation
182 # gives unlimited permission to copy and/or distribute it,
183 # with or without modifications, as long as this notice is preserved.
184
185 # AM_AUTOMAKE_VERSION(VERSION)
186 # ----------------------------
187 # Automake X.Y traces this macro to ensure aclocal.m4 has been
188 # generated from the m4 files accompanying Automake X.Y.
189 # (This private macro should not be called outside this file.)
190 AC_DEFUN([AM_AUTOMAKE_VERSION],
191 [am__api_version='1.11'
192 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
193 dnl require some minimum version. Point them to the right macro.
194 m4_if([$1], [1.11.1], [],
195 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
196 ])
197
198 # _AM_AUTOCONF_VERSION(VERSION)
199 # -----------------------------
200 # aclocal traces this macro to find the Autoconf version.
201 # This is a private macro too. Using m4_define simplifies
202 # the logic in aclocal, which can simply ignore this definition.
203 m4_define([_AM_AUTOCONF_VERSION], [])
204
205 # AM_SET_CURRENT_AUTOMAKE_VERSION
206 # -------------------------------
207 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
208 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
209 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
210 [AM_AUTOMAKE_VERSION([1.11.1])dnl
211 m4_ifndef([AC_AUTOCONF_VERSION],
212 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
213 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
214
215 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
216
217 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
218 #
219 # This file is free software; the Free Software Foundation
220 # gives unlimited permission to copy and/or distribute it,
221 # with or without modifications, as long as this notice is preserved.
222
223 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
224 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
225 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
226 #
227 # Of course, Automake must honor this variable whenever it calls a
228 # tool from the auxiliary directory. The problem is that $srcdir (and
229 # therefore $ac_aux_dir as well) can be either absolute or relative,
230 # depending on how configure is run. This is pretty annoying, since
231 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
232 # source directory, any form will work fine, but in subdirectories a
233 # relative path needs to be adjusted first.
234 #
235 # $ac_aux_dir/missing
236 # fails when called from a subdirectory if $ac_aux_dir is relative
237 # $top_srcdir/$ac_aux_dir/missing
238 # fails if $ac_aux_dir is absolute,
239 # fails when called from a subdirectory in a VPATH build with
240 # a relative $ac_aux_dir
241 #
242 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
243 # are both prefixed by $srcdir. In an in-source build this is usually
244 # harmless because $srcdir is `.', but things will broke when you
245 # start a VPATH build or use an absolute $srcdir.
246 #
247 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
248 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
249 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
250 # and then we would define $MISSING as
251 # MISSING="\${SHELL} $am_aux_dir/missing"
252 # This will work as long as MISSING is not called from configure, because
253 # unfortunately $(top_srcdir) has no meaning in configure.
254 # However there are other variables, like CC, which are often used in
255 # configure, and could therefore not use this "fixed" $ac_aux_dir.
256 #
257 # Another solution, used here, is to always expand $ac_aux_dir to an
258 # absolute PATH. The drawback is that using absolute paths prevent a
259 # configured tree to be moved without reconfiguration.
260
261 AC_DEFUN([AM_AUX_DIR_EXPAND],
262 [dnl Rely on autoconf to set up CDPATH properly.
263 AC_PREREQ([2.50])dnl
264 # expand $ac_aux_dir to an absolute path
265 am_aux_dir=`cd $ac_aux_dir && pwd`
266 ])
267
268 # AM_CONDITIONAL -*- Autoconf -*-
269
270 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
271 # Free Software Foundation, Inc.
272 #
273 # This file is free software; the Free Software Foundation
274 # gives unlimited permission to copy and/or distribute it,
275 # with or without modifications, as long as this notice is preserved.
276
277 # serial 9
278
279 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
280 # -------------------------------------
281 # Define a conditional.
282 AC_DEFUN([AM_CONDITIONAL],
283 [AC_PREREQ(2.52)dnl
284 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
285 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
286 AC_SUBST([$1_TRUE])dnl
287 AC_SUBST([$1_FALSE])dnl
288 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
289 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
290 m4_define([_AM_COND_VALUE_$1], [$2])dnl
291 if $2; then
292 $1_TRUE=
293 $1_FALSE='#'
294 else
295 $1_TRUE='#'
296 $1_FALSE=
297 fi
298 AC_CONFIG_COMMANDS_PRE(
299 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
300 AC_MSG_ERROR([[conditional "$1" was never defined.
301 Usually this means the macro was only invoked conditionally.]])
302 fi])])
303
304 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
305 # Free Software Foundation, Inc.
306 #
307 # This file is free software; the Free Software Foundation
308 # gives unlimited permission to copy and/or distribute it,
309 # with or without modifications, as long as this notice is preserved.
310
311 # serial 10
312
313 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
314 # written in clear, in which case automake, when reading aclocal.m4,
315 # will think it sees a *use*, and therefore will trigger all it's
316 # C support machinery. Also note that it means that autoscan, seeing
317 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
318
319
320 # _AM_DEPENDENCIES(NAME)
321 # ----------------------
322 # See how the compiler implements dependency checking.
323 # NAME is "CC", "CXX", "GCJ", or "OBJC".
324 # We try a few techniques and use that to set a single cache variable.
325 #
326 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
327 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
328 # dependency, and given that the user is not expected to run this macro,
329 # just rely on AC_PROG_CC.
330 AC_DEFUN([_AM_DEPENDENCIES],
331 [AC_REQUIRE([AM_SET_DEPDIR])dnl
332 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
333 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
334 AC_REQUIRE([AM_DEP_TRACK])dnl
335
336 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
337 [$1], CXX, [depcc="$CXX" am_compiler_list=],
338 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
339 [$1], UPC, [depcc="$UPC" am_compiler_list=],
340 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
341 [depcc="$$1" am_compiler_list=])
342
343 AC_CACHE_CHECK([dependency style of $depcc],
344 [am_cv_$1_dependencies_compiler_type],
345 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
346 # We make a subdir and do the tests there. Otherwise we can end up
347 # making bogus files that we don't know about and never remove. For
348 # instance it was reported that on HP-UX the gcc test will end up
349 # making a dummy file named `D' -- because `-MD' means `put the output
350 # in D'.
351 mkdir conftest.dir
352 # Copy depcomp to subdir because otherwise we won't find it if we're
353 # using a relative directory.
354 cp "$am_depcomp" conftest.dir
355 cd conftest.dir
356 # We will build objects and dependencies in a subdirectory because
357 # it helps to detect inapplicable dependency modes. For instance
358 # both Tru64's cc and ICC support -MD to output dependencies as a
359 # side effect of compilation, but ICC will put the dependencies in
360 # the current directory while Tru64 will put them in the object
361 # directory.
362 mkdir sub
363
364 am_cv_$1_dependencies_compiler_type=none
365 if test "$am_compiler_list" = ""; then
366 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
367 fi
368 am__universal=false
369 m4_case([$1], [CC],
370 [case " $depcc " in #(
371 *\ -arch\ *\ -arch\ *) am__universal=true ;;
372 esac],
373 [CXX],
374 [case " $depcc " in #(
375 *\ -arch\ *\ -arch\ *) am__universal=true ;;
376 esac])
377
378 for depmode in $am_compiler_list; do
379 # Setup a source with many dependencies, because some compilers
380 # like to wrap large dependency lists on column 80 (with \), and
381 # we should not choose a depcomp mode which is confused by this.
382 #
383 # We need to recreate these files for each test, as the compiler may
384 # overwrite some of them when testing with obscure command lines.
385 # This happens at least with the AIX C compiler.
386 : > sub/conftest.c
387 for i in 1 2 3 4 5 6; do
388 echo '#include "conftst'$i'.h"' >> sub/conftest.c
389 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
390 # Solaris 8's {/usr,}/bin/sh.
391 touch sub/conftst$i.h
392 done
393 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
394
395 # We check with `-c' and `-o' for the sake of the "dashmstdout"
396 # mode. It turns out that the SunPro C++ compiler does not properly
397 # handle `-M -o', and we need to detect this. Also, some Intel
398 # versions had trouble with output in subdirs
399 am__obj=sub/conftest.${OBJEXT-o}
400 am__minus_obj="-o $am__obj"
401 case $depmode in
402 gcc)
403 # This depmode causes a compiler race in universal mode.
404 test "$am__universal" = false || continue
405 ;;
406 nosideeffect)
407 # after this tag, mechanisms are not by side-effect, so they'll
408 # only be used when explicitly requested
409 if test "x$enable_dependency_tracking" = xyes; then
410 continue
411 else
412 break
413 fi
414 ;;
415 msvisualcpp | msvcmsys)
416 # This compiler won't grok `-c -o', but also, the minuso test has
417 # not run yet. These depmodes are late enough in the game, and
418 # so weak that their functioning should not be impacted.
419 am__obj=conftest.${OBJEXT-o}
420 am__minus_obj=
421 ;;
422 none) break ;;
423 esac
424 if depmode=$depmode \
425 source=sub/conftest.c object=$am__obj \
426 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
427 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
428 >/dev/null 2>conftest.err &&
429 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
430 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
431 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
432 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
433 # icc doesn't choke on unknown options, it will just issue warnings
434 # or remarks (even with -Werror). So we grep stderr for any message
435 # that says an option was ignored or not supported.
436 # When given -MP, icc 7.0 and 7.1 complain thusly:
437 # icc: Command line warning: ignoring option '-M'; no argument required
438 # The diagnosis changed in icc 8.0:
439 # icc: Command line remark: option '-MP' not supported
440 if (grep 'ignoring option' conftest.err ||
441 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
442 am_cv_$1_dependencies_compiler_type=$depmode
443 break
444 fi
445 fi
446 done
447
448 cd ..
449 rm -rf conftest.dir
450 else
451 am_cv_$1_dependencies_compiler_type=none
452 fi
453 ])
454 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
455 AM_CONDITIONAL([am__fastdep$1], [
456 test "x$enable_dependency_tracking" != xno \
457 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
458 ])
459
460
461 # AM_SET_DEPDIR
462 # -------------
463 # Choose a directory name for dependency files.
464 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
465 AC_DEFUN([AM_SET_DEPDIR],
466 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
467 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
468 ])
469
470
471 # AM_DEP_TRACK
472 # ------------
473 AC_DEFUN([AM_DEP_TRACK],
474 [AC_ARG_ENABLE(dependency-tracking,
475 [ --disable-dependency-tracking speeds up one-time build
476 --enable-dependency-tracking do not reject slow dependency extractors])
477 if test "x$enable_dependency_tracking" != xno; then
478 am_depcomp="$ac_aux_dir/depcomp"
479 AMDEPBACKSLASH='\'
480 fi
481 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
482 AC_SUBST([AMDEPBACKSLASH])dnl
483 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
484 ])
485
486 # Generate code to set up dependency tracking. -*- Autoconf -*-
487
488 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
489 # Free Software Foundation, Inc.
490 #
491 # This file is free software; the Free Software Foundation
492 # gives unlimited permission to copy and/or distribute it,
493 # with or without modifications, as long as this notice is preserved.
494
495 #serial 5
496
497 # _AM_OUTPUT_DEPENDENCY_COMMANDS
498 # ------------------------------
499 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
500 [{
501 # Autoconf 2.62 quotes --file arguments for eval, but not when files
502 # are listed without --file. Let's play safe and only enable the eval
503 # if we detect the quoting.
504 case $CONFIG_FILES in
505 *\'*) eval set x "$CONFIG_FILES" ;;
506 *) set x $CONFIG_FILES ;;
507 esac
508 shift
509 for mf
510 do
511 # Strip MF so we end up with the name of the file.
512 mf=`echo "$mf" | sed -e 's/:.*$//'`
513 # Check whether this is an Automake generated Makefile or not.
514 # We used to match only the files named `Makefile.in', but
515 # some people rename them; so instead we look at the file content.
516 # Grep'ing the first line is not enough: some people post-process
517 # each Makefile.in and add a new line on top of each file to say so.
518 # Grep'ing the whole file is not good either: AIX grep has a line
519 # limit of 2048, but all sed's we know have understand at least 4000.
520 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
521 dirpart=`AS_DIRNAME("$mf")`
522 else
523 continue
524 fi
525 # Extract the definition of DEPDIR, am__include, and am__quote
526 # from the Makefile without running `make'.
527 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
528 test -z "$DEPDIR" && continue
529 am__include=`sed -n 's/^am__include = //p' < "$mf"`
530 test -z "am__include" && continue
531 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
532 # When using ansi2knr, U may be empty or an underscore; expand it
533 U=`sed -n 's/^U = //p' < "$mf"`
534 # Find all dependency output files, they are included files with
535 # $(DEPDIR) in their names. We invoke sed twice because it is the
536 # simplest approach to changing $(DEPDIR) to its actual value in the
537 # expansion.
538 for file in `sed -n "
539 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
540 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
541 # Make sure the directory exists.
542 test -f "$dirpart/$file" && continue
543 fdir=`AS_DIRNAME(["$file"])`
544 AS_MKDIR_P([$dirpart/$fdir])
545 # echo "creating $dirpart/$file"
546 echo '# dummy' > "$dirpart/$file"
547 done
548 done
549 }
550 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
551
552
553 # AM_OUTPUT_DEPENDENCY_COMMANDS
554 # -----------------------------
555 # This macro should only be invoked once -- use via AC_REQUIRE.
556 #
557 # This code is only required when automatic dependency tracking
558 # is enabled. FIXME. This creates each `.P' file that we will
559 # need in order to bootstrap the dependency handling code.
560 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
561 [AC_CONFIG_COMMANDS([depfiles],
562 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
563 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
564 ])
565
566 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
567 # Free Software Foundation, Inc.
568 #
569 # This file is free software; the Free Software Foundation
570 # gives unlimited permission to copy and/or distribute it,
571 # with or without modifications, as long as this notice is preserved.
572
573 # serial 8
574
575 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
576 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
577
578 # Do all the work for Automake. -*- Autoconf -*-
579
580 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
581 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
582 #
583 # This file is free software; the Free Software Foundation
584 # gives unlimited permission to copy and/or distribute it,
585 # with or without modifications, as long as this notice is preserved.
586
587 # serial 16
588
589 # This macro actually does too much. Some checks are only needed if
590 # your package does certain things. But this isn't really a big deal.
591
592 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
593 # AM_INIT_AUTOMAKE([OPTIONS])
594 # -----------------------------------------------
595 # The call with PACKAGE and VERSION arguments is the old style
596 # call (pre autoconf-2.50), which is being phased out. PACKAGE
597 # and VERSION should now be passed to AC_INIT and removed from
598 # the call to AM_INIT_AUTOMAKE.
599 # We support both call styles for the transition. After
600 # the next Automake release, Autoconf can make the AC_INIT
601 # arguments mandatory, and then we can depend on a new Autoconf
602 # release and drop the old call support.
603 AC_DEFUN([AM_INIT_AUTOMAKE],
604 [AC_PREREQ([2.62])dnl
605 dnl Autoconf wants to disallow AM_ names. We explicitly allow
606 dnl the ones we care about.
607 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
608 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
609 AC_REQUIRE([AC_PROG_INSTALL])dnl
610 if test "`cd $srcdir && pwd`" != "`pwd`"; then
611 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
612 # is not polluted with repeated "-I."
613 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
614 # test to see if srcdir already configured
615 if test -f $srcdir/config.status; then
616 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
617 fi
618 fi
619
620 # test whether we have cygpath
621 if test -z "$CYGPATH_W"; then
622 if (cygpath --version) >/dev/null 2>/dev/null; then
623 CYGPATH_W='cygpath -w'
624 else
625 CYGPATH_W=echo
626 fi
627 fi
628 AC_SUBST([CYGPATH_W])
629
630 # Define the identity of the package.
631 dnl Distinguish between old-style and new-style calls.
632 m4_ifval([$2],
633 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
634 AC_SUBST([PACKAGE], [$1])dnl
635 AC_SUBST([VERSION], [$2])],
636 [_AM_SET_OPTIONS([$1])dnl
637 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
638 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
639 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
640 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
641 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
642
643 _AM_IF_OPTION([no-define],,
644 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
645 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
646
647 # Some tools Automake needs.
648 AC_REQUIRE([AM_SANITY_CHECK])dnl
649 AC_REQUIRE([AC_ARG_PROGRAM])dnl
650 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
651 AM_MISSING_PROG(AUTOCONF, autoconf)
652 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
653 AM_MISSING_PROG(AUTOHEADER, autoheader)
654 AM_MISSING_PROG(MAKEINFO, makeinfo)
655 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
656 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
657 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
658 # We need awk for the "check" target. The system "awk" is bad on
659 # some platforms.
660 AC_REQUIRE([AC_PROG_AWK])dnl
661 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
662 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
663 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
664 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
665 [_AM_PROG_TAR([v7])])])
666 _AM_IF_OPTION([no-dependencies],,
667 [AC_PROVIDE_IFELSE([AC_PROG_CC],
668 [_AM_DEPENDENCIES(CC)],
669 [define([AC_PROG_CC],
670 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
671 AC_PROVIDE_IFELSE([AC_PROG_CXX],
672 [_AM_DEPENDENCIES(CXX)],
673 [define([AC_PROG_CXX],
674 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
675 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
676 [_AM_DEPENDENCIES(OBJC)],
677 [define([AC_PROG_OBJC],
678 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
679 ])
680 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
681 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
682 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
683 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
684 AC_CONFIG_COMMANDS_PRE(dnl
685 [m4_provide_if([_AM_COMPILER_EXEEXT],
686 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
687 ])
688
689 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
690 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
691 dnl mangled by Autoconf and run in a shell conditional statement.
692 m4_define([_AC_COMPILER_EXEEXT],
693 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
694
695
696 # When config.status generates a header, we must update the stamp-h file.
697 # This file resides in the same directory as the config header
698 # that is generated. The stamp files are numbered to have different names.
699
700 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
701 # loop where config.status creates the headers, so we can generate
702 # our stamp files there.
703 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
704 [# Compute $1's index in $config_headers.
705 _am_arg=$1
706 _am_stamp_count=1
707 for _am_header in $config_headers :; do
708 case $_am_header in
709 $_am_arg | $_am_arg:* )
710 break ;;
711 * )
712 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
713 esac
714 done
715 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
716
717 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
718 #
719 # This file is free software; the Free Software Foundation
720 # gives unlimited permission to copy and/or distribute it,
721 # with or without modifications, as long as this notice is preserved.
722
723 # AM_PROG_INSTALL_SH
724 # ------------------
725 # Define $install_sh.
726 AC_DEFUN([AM_PROG_INSTALL_SH],
727 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
728 if test x"${install_sh}" != xset; then
729 case $am_aux_dir in
730 *\ * | *\ *)
731 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
732 *)
733 install_sh="\${SHELL} $am_aux_dir/install-sh"
734 esac
735 fi
736 AC_SUBST(install_sh)])
737
738 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
739 #
740 # This file is free software; the Free Software Foundation
741 # gives unlimited permission to copy and/or distribute it,
742 # with or without modifications, as long as this notice is preserved.
743
744 # serial 2
745
746 # Check whether the underlying file-system supports filenames
747 # with a leading dot. For instance MS-DOS doesn't.
748 AC_DEFUN([AM_SET_LEADING_DOT],
749 [rm -rf .tst 2>/dev/null
750 mkdir .tst 2>/dev/null
751 if test -d .tst; then
752 am__leading_dot=.
753 else
754 am__leading_dot=_
755 fi
756 rmdir .tst 2>/dev/null
757 AC_SUBST([am__leading_dot])])
758
759 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
760 # From Jim Meyering
761
762 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
763 # Free Software Foundation, Inc.
764 #
765 # This file is free software; the Free Software Foundation
766 # gives unlimited permission to copy and/or distribute it,
767 # with or without modifications, as long as this notice is preserved.
768
769 # serial 5
770
771 # AM_MAINTAINER_MODE([DEFAULT-MODE])
772 # ----------------------------------
773 # Control maintainer-specific portions of Makefiles.
774 # Default is to disable them, unless `enable' is passed literally.
775 # For symmetry, `disable' may be passed as well. Anyway, the user
776 # can override the default with the --enable/--disable switch.
777 AC_DEFUN([AM_MAINTAINER_MODE],
778 [m4_case(m4_default([$1], [disable]),
779 [enable], [m4_define([am_maintainer_other], [disable])],
780 [disable], [m4_define([am_maintainer_other], [enable])],
781 [m4_define([am_maintainer_other], [enable])
782 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
783 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
784 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
785 AC_ARG_ENABLE([maintainer-mode],
786 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
787 (and sometimes confusing) to the casual installer],
788 [USE_MAINTAINER_MODE=$enableval],
789 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
790 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
791 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
792 MAINT=$MAINTAINER_MODE_TRUE
793 AC_SUBST([MAINT])dnl
794 ]
795 )
796
797 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
798
799 # Check to see how 'make' treats includes. -*- Autoconf -*-
800
801 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
802 #
803 # This file is free software; the Free Software Foundation
804 # gives unlimited permission to copy and/or distribute it,
805 # with or without modifications, as long as this notice is preserved.
806
807 # serial 4
808
809 # AM_MAKE_INCLUDE()
810 # -----------------
811 # Check to see how make treats includes.
812 AC_DEFUN([AM_MAKE_INCLUDE],
813 [am_make=${MAKE-make}
814 cat > confinc << 'END'
815 am__doit:
816 @echo this is the am__doit target
817 .PHONY: am__doit
818 END
819 # If we don't find an include directive, just comment out the code.
820 AC_MSG_CHECKING([for style of include used by $am_make])
821 am__include="#"
822 am__quote=
823 _am_result=none
824 # First try GNU make style include.
825 echo "include confinc" > confmf
826 # Ignore all kinds of additional output from `make'.
827 case `$am_make -s -f confmf 2> /dev/null` in #(
828 *the\ am__doit\ target*)
829 am__include=include
830 am__quote=
831 _am_result=GNU
832 ;;
833 esac
834 # Now try BSD make style include.
835 if test "$am__include" = "#"; then
836 echo '.include "confinc"' > confmf
837 case `$am_make -s -f confmf 2> /dev/null` in #(
838 *the\ am__doit\ target*)
839 am__include=.include
840 am__quote="\""
841 _am_result=BSD
842 ;;
843 esac
844 fi
845 AC_SUBST([am__include])
846 AC_SUBST([am__quote])
847 AC_MSG_RESULT([$_am_result])
848 rm -f confinc confmf
849 ])
850
851 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
852
853 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
854 # Free Software Foundation, Inc.
855 #
856 # This file is free software; the Free Software Foundation
857 # gives unlimited permission to copy and/or distribute it,
858 # with or without modifications, as long as this notice is preserved.
859
860 # serial 6
861
862 # AM_MISSING_PROG(NAME, PROGRAM)
863 # ------------------------------
864 AC_DEFUN([AM_MISSING_PROG],
865 [AC_REQUIRE([AM_MISSING_HAS_RUN])
866 $1=${$1-"${am_missing_run}$2"}
867 AC_SUBST($1)])
868
869
870 # AM_MISSING_HAS_RUN
871 # ------------------
872 # Define MISSING if not defined so far and test if it supports --run.
873 # If it does, set am_missing_run to use it, otherwise, to nothing.
874 AC_DEFUN([AM_MISSING_HAS_RUN],
875 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
876 AC_REQUIRE_AUX_FILE([missing])dnl
877 if test x"${MISSING+set}" != xset; then
878 case $am_aux_dir in
879 *\ * | *\ *)
880 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
881 *)
882 MISSING="\${SHELL} $am_aux_dir/missing" ;;
883 esac
884 fi
885 # Use eval to expand $SHELL
886 if eval "$MISSING --run true"; then
887 am_missing_run="$MISSING --run "
888 else
889 am_missing_run=
890 AC_MSG_WARN([`missing' script is too old or missing])
891 fi
892 ])
893
894 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
895 #
896 # This file is free software; the Free Software Foundation
897 # gives unlimited permission to copy and/or distribute it,
898 # with or without modifications, as long as this notice is preserved.
899
900 # AM_PROG_MKDIR_P
901 # ---------------
902 # Check for `mkdir -p'.
903 AC_DEFUN([AM_PROG_MKDIR_P],
904 [AC_PREREQ([2.60])dnl
905 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
906 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
907 dnl while keeping a definition of mkdir_p for backward compatibility.
908 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
909 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
910 dnl Makefile.ins that do not define MKDIR_P, so we do our own
911 dnl adjustment using top_builddir (which is defined more often than
912 dnl MKDIR_P).
913 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
914 case $mkdir_p in
915 [[\\/$]]* | ?:[[\\/]]*) ;;
916 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
917 esac
918 ])
919
920 # Helper functions for option handling. -*- Autoconf -*-
921
922 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
923 #
924 # This file is free software; the Free Software Foundation
925 # gives unlimited permission to copy and/or distribute it,
926 # with or without modifications, as long as this notice is preserved.
927
928 # serial 4
929
930 # _AM_MANGLE_OPTION(NAME)
931 # -----------------------
932 AC_DEFUN([_AM_MANGLE_OPTION],
933 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
934
935 # _AM_SET_OPTION(NAME)
936 # ------------------------------
937 # Set option NAME. Presently that only means defining a flag for this option.
938 AC_DEFUN([_AM_SET_OPTION],
939 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
940
941 # _AM_SET_OPTIONS(OPTIONS)
942 # ----------------------------------
943 # OPTIONS is a space-separated list of Automake options.
944 AC_DEFUN([_AM_SET_OPTIONS],
945 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
946
947 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
948 # -------------------------------------------
949 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
950 AC_DEFUN([_AM_IF_OPTION],
951 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
952
953 # Check to make sure that the build environment is sane. -*- Autoconf -*-
954
955 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
956 # Free Software Foundation, Inc.
957 #
958 # This file is free software; the Free Software Foundation
959 # gives unlimited permission to copy and/or distribute it,
960 # with or without modifications, as long as this notice is preserved.
961
962 # serial 5
963
964 # AM_SANITY_CHECK
965 # ---------------
966 AC_DEFUN([AM_SANITY_CHECK],
967 [AC_MSG_CHECKING([whether build environment is sane])
968 # Just in case
969 sleep 1
970 echo timestamp > conftest.file
971 # Reject unsafe characters in $srcdir or the absolute working directory
972 # name. Accept space and tab only in the latter.
973 am_lf='
974 '
975 case `pwd` in
976 *[[\\\"\#\$\&\'\`$am_lf]]*)
977 AC_MSG_ERROR([unsafe absolute working directory name]);;
978 esac
979 case $srcdir in
980 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
981 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
982 esac
983
984 # Do `set' in a subshell so we don't clobber the current shell's
985 # arguments. Must try -L first in case configure is actually a
986 # symlink; some systems play weird games with the mod time of symlinks
987 # (eg FreeBSD returns the mod time of the symlink's containing
988 # directory).
989 if (
990 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
991 if test "$[*]" = "X"; then
992 # -L didn't work.
993 set X `ls -t "$srcdir/configure" conftest.file`
994 fi
995 rm -f conftest.file
996 if test "$[*]" != "X $srcdir/configure conftest.file" \
997 && test "$[*]" != "X conftest.file $srcdir/configure"; then
998
999 # If neither matched, then we have a broken ls. This can happen
1000 # if, for instance, CONFIG_SHELL is bash and it inherits a
1001 # broken ls alias from the environment. This has actually
1002 # happened. Such a system could not be considered "sane".
1003 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1004 alias in your environment])
1005 fi
1006
1007 test "$[2]" = conftest.file
1008 )
1009 then
1010 # Ok.
1011 :
1012 else
1013 AC_MSG_ERROR([newly created file is older than distributed files!
1014 Check your system clock])
1015 fi
1016 AC_MSG_RESULT(yes)])
1017
1018 # Copyright (C) 2009 Free Software Foundation, Inc.
1019 #
1020 # This file is free software; the Free Software Foundation
1021 # gives unlimited permission to copy and/or distribute it,
1022 # with or without modifications, as long as this notice is preserved.
1023
1024 # serial 1
1025
1026 # AM_SILENT_RULES([DEFAULT])
1027 # --------------------------
1028 # Enable less verbose build rules; with the default set to DEFAULT
1029 # (`yes' being less verbose, `no' or empty being verbose).
1030 AC_DEFUN([AM_SILENT_RULES],
1031 [AC_ARG_ENABLE([silent-rules],
1032 [ --enable-silent-rules less verbose build output (undo: `make V=1')
1033 --disable-silent-rules verbose build output (undo: `make V=0')])
1034 case $enable_silent_rules in
1035 yes) AM_DEFAULT_VERBOSITY=0;;
1036 no) AM_DEFAULT_VERBOSITY=1;;
1037 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1038 esac
1039 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1040 AM_BACKSLASH='\'
1041 AC_SUBST([AM_BACKSLASH])dnl
1042 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1043 ])
1044
1045 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1046 #
1047 # This file is free software; the Free Software Foundation
1048 # gives unlimited permission to copy and/or distribute it,
1049 # with or without modifications, as long as this notice is preserved.
1050
1051 # AM_PROG_INSTALL_STRIP
1052 # ---------------------
1053 # One issue with vendor `install' (even GNU) is that you can't
1054 # specify the program used to strip binaries. This is especially
1055 # annoying in cross-compiling environments, where the build's strip
1056 # is unlikely to handle the host's binaries.
1057 # Fortunately install-sh will honor a STRIPPROG variable, so we
1058 # always use install-sh in `make install-strip', and initialize
1059 # STRIPPROG with the value of the STRIP variable (set by the user).
1060 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1061 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1062 # Installed binaries are usually stripped using `strip' when the user
1063 # run `make install-strip'. However `strip' might not be the right
1064 # tool to use in cross-compilation environments, therefore Automake
1065 # will honor the `STRIP' environment variable to overrule this program.
1066 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1067 if test "$cross_compiling" != no; then
1068 AC_CHECK_TOOL([STRIP], [strip], :)
1069 fi
1070 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1071 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1072
1073 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
1074 #
1075 # This file is free software; the Free Software Foundation
1076 # gives unlimited permission to copy and/or distribute it,
1077 # with or without modifications, as long as this notice is preserved.
1078
1079 # serial 2
1080
1081 # _AM_SUBST_NOTMAKE(VARIABLE)
1082 # ---------------------------
1083 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1084 # This macro is traced by Automake.
1085 AC_DEFUN([_AM_SUBST_NOTMAKE])
1086
1087 # AM_SUBST_NOTMAKE(VARIABLE)
1088 # ---------------------------
1089 # Public sister of _AM_SUBST_NOTMAKE.
1090 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1091
1092 # Check how to create a tarball. -*- Autoconf -*-
1093
1094 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
1095 #
1096 # This file is free software; the Free Software Foundation
1097 # gives unlimited permission to copy and/or distribute it,
1098 # with or without modifications, as long as this notice is preserved.
1099
1100 # serial 2
1101
1102 # _AM_PROG_TAR(FORMAT)
1103 # --------------------
1104 # Check how to create a tarball in format FORMAT.
1105 # FORMAT should be one of `v7', `ustar', or `pax'.
1106 #
1107 # Substitute a variable $(am__tar) that is a command
1108 # writing to stdout a FORMAT-tarball containing the directory
1109 # $tardir.
1110 # tardir=directory && $(am__tar) > result.tar
1111 #
1112 # Substitute a variable $(am__untar) that extract such
1113 # a tarball read from stdin.
1114 # $(am__untar) < result.tar
1115 AC_DEFUN([_AM_PROG_TAR],
1116 [# Always define AMTAR for backward compatibility.
1117 AM_MISSING_PROG([AMTAR], [tar])
1118 m4_if([$1], [v7],
1119 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1120 [m4_case([$1], [ustar],, [pax],,
1121 [m4_fatal([Unknown tar format])])
1122 AC_MSG_CHECKING([how to create a $1 tar archive])
1123 # Loop over all known methods to create a tar archive until one works.
1124 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1125 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1126 # Do not fold the above two line into one, because Tru64 sh and
1127 # Solaris sh will not grok spaces in the rhs of `-'.
1128 for _am_tool in $_am_tools
1129 do
1130 case $_am_tool in
1131 gnutar)
1132 for _am_tar in tar gnutar gtar;
1133 do
1134 AM_RUN_LOG([$_am_tar --version]) && break
1135 done
1136 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1137 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1138 am__untar="$_am_tar -xf -"
1139 ;;
1140 plaintar)
1141 # Must skip GNU tar: if it does not support --format= it doesn't create
1142 # ustar tarball either.
1143 (tar --version) >/dev/null 2>&1 && continue
1144 am__tar='tar chf - "$$tardir"'
1145 am__tar_='tar chf - "$tardir"'
1146 am__untar='tar xf -'
1147 ;;
1148 pax)
1149 am__tar='pax -L -x $1 -w "$$tardir"'
1150 am__tar_='pax -L -x $1 -w "$tardir"'
1151 am__untar='pax -r'
1152 ;;
1153 cpio)
1154 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1155 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1156 am__untar='cpio -i -H $1 -d'
1157 ;;
1158 none)
1159 am__tar=false
1160 am__tar_=false
1161 am__untar=false
1162 ;;
1163 esac
1164
1165 # If the value was cached, stop now. We just wanted to have am__tar
1166 # and am__untar set.
1167 test -n "${am_cv_prog_tar_$1}" && break
1168
1169 # tar/untar a dummy directory, and stop if the command works
1170 rm -rf conftest.dir
1171 mkdir conftest.dir
1172 echo GrepMe > conftest.dir/file
1173 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1174 rm -rf conftest.dir
1175 if test -s conftest.tar; then
1176 AM_RUN_LOG([$am__untar <conftest.tar])
1177 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1178 fi
1179 done
1180 rm -rf conftest.dir
1181
1182 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1183 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1184 AC_SUBST([am__tar])
1185 AC_SUBST([am__untar])
1186 ]) # _AM_PROG_TAR
1187
1188 m4_include([m4/libtool.m4])
1189 m4_include([m4/ltoptions.m4])
1190 m4_include([m4/ltsugar.m4])
1191 m4_include([m4/ltversion.m4])
1192 m4_include([m4/lt~obsolete.m4])
1193 m4_include([acinclude.m4])
+0
-1533
config.guess less more
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 # Free Software Foundation, Inc.
5
6 timestamp='2009-06-10'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner <per@bothner.com>.
30 # Please send patches to <config-patches@gnu.org>. Submit a context
31 # diff and a properly formatted ChangeLog entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # The plan is that this can be called by configure scripts if you
38 # don't specify an explicit build system type.
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
59 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60
61 This is free software; see the source for copying conditions. There is NO
62 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64 help="
65 Try \`$me --help' for more information."
66
67 # Parse command line
68 while test $# -gt 0 ; do
69 case $1 in
70 --time-stamp | --time* | -t )
71 echo "$timestamp" ; exit ;;
72 --version | -v )
73 echo "$version" ; exit ;;
74 --help | --h* | -h )
75 echo "$usage"; exit ;;
76 -- ) # Stop option processing
77 shift; break ;;
78 - ) # Use stdin as input.
79 break ;;
80 -* )
81 echo "$me: invalid option $1$help" >&2
82 exit 1 ;;
83 * )
84 break ;;
85 esac
86 done
87
88 if test $# != 0; then
89 echo "$me: too many arguments$help" >&2
90 exit 1
91 fi
92
93 trap 'exit 1' 1 2 15
94
95 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96 # compiler to aid in system detection is discouraged as it requires
97 # temporary files to be created and, as you can see below, it is a
98 # headache to deal with in a portable fashion.
99
100 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101 # use `HOST_CC' if defined, but it is deprecated.
102
103 # Portable tmp directory creation inspired by the Autoconf team.
104
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
129
130 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133 PATH=$PATH:/.attbin ; export PATH
134 fi
135
136 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141 # Note: order is significant - the case branches are not exclusive.
142
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old
149 # object file format. This provides both forward
150 # compatibility and a consistent mechanism for selecting the
151 # object file format.
152 #
153 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
159 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165 esac
166 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep -q __ELF__
173 then
174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175 # Return netbsd for either. FIX?
176 os=netbsd
177 else
178 os=netbsdelf
179 fi
180 ;;
181 *)
182 os=netbsd
183 ;;
184 esac
185 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
191 Debian*)
192 release='-gnu'
193 ;;
194 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212 exit ;;
213 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215 exit ;;
216 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218 exit ;;
219 alpha:OSF1:*:*)
220 case $UNAME_RELEASE in
221 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223 ;;
224 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226 ;;
227 esac
228 # According to Compaq, /usr/sbin/psrinfo has been available on
229 # OSF/1 and Tru64 systems produced since 1995. I hope that
230 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in
234 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
236 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
240 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
242 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
244 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
246 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
248 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
250 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
252 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
254 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
260 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
262 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
264 esac
265 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
281 Amiga*:UNIX_System_V:4.0:*)
282 echo m68k-unknown-sysv4
283 exit ;;
284 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
286 exit ;;
287 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
289 exit ;;
290 *:OS/390:*:*)
291 echo i370-ibm-openedition
292 exit ;;
293 *:z/VM:*:*)
294 echo s390-ibm-zvmoe
295 exit ;;
296 *:OS400:*:*)
297 echo powerpc-ibm-os400
298 exit ;;
299 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
303 echo arm-unknown-riscos
304 exit ;;
305 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
306 echo hppa1.1-hitachi-hiuxmpp
307 exit ;;
308 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
309 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
310 if test "`(/bin/universe) 2>/dev/null`" = att ; then
311 echo pyramid-pyramid-sysv3
312 else
313 echo pyramid-pyramid-bsd
314 fi
315 exit ;;
316 NILE*:*:*:dcosx)
317 echo pyramid-pyramid-svr4
318 exit ;;
319 DRS?6000:unix:4.0:6*)
320 echo sparc-icl-nx6
321 exit ;;
322 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
323 case `/usr/bin/uname -p` in
324 sparc) echo sparc-icl-nx7; exit ;;
325 esac ;;
326 s390x:SunOS:*:*)
327 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
328 exit ;;
329 sun4H:SunOS:5.*:*)
330 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331 exit ;;
332 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
333 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334 exit ;;
335 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
336 eval $set_cc_for_build
337 SUN_ARCH="i386"
338 # If there is a compiler, see if it is configured for 64-bit objects.
339 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
340 # This test works for both compilers.
341 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
342 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
343 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
344 grep IS_64BIT_ARCH >/dev/null
345 then
346 SUN_ARCH="x86_64"
347 fi
348 fi
349 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
350 exit ;;
351 sun4*:SunOS:6*:*)
352 # According to config.sub, this is the proper way to canonicalize
353 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
354 # it's likely to be more like Solaris than SunOS4.
355 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356 exit ;;
357 sun4*:SunOS:*:*)
358 case "`/usr/bin/arch -k`" in
359 Series*|S4*)
360 UNAME_RELEASE=`uname -v`
361 ;;
362 esac
363 # Japanese Language versions have a version number like `4.1.3-JL'.
364 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
365 exit ;;
366 sun3*:SunOS:*:*)
367 echo m68k-sun-sunos${UNAME_RELEASE}
368 exit ;;
369 sun*:*:4.2BSD:*)
370 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
371 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
372 case "`/bin/arch`" in
373 sun3)
374 echo m68k-sun-sunos${UNAME_RELEASE}
375 ;;
376 sun4)
377 echo sparc-sun-sunos${UNAME_RELEASE}
378 ;;
379 esac
380 exit ;;
381 aushp:SunOS:*:*)
382 echo sparc-auspex-sunos${UNAME_RELEASE}
383 exit ;;
384 # The situation for MiNT is a little confusing. The machine name
385 # can be virtually everything (everything which is not
386 # "atarist" or "atariste" at least should have a processor
387 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
388 # to the lowercase version "mint" (or "freemint"). Finally
389 # the system name "TOS" denotes a system which is actually not
390 # MiNT. But MiNT is downward compatible to TOS, so this should
391 # be no problem.
392 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
393 echo m68k-atari-mint${UNAME_RELEASE}
394 exit ;;
395 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
396 echo m68k-atari-mint${UNAME_RELEASE}
397 exit ;;
398 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
399 echo m68k-atari-mint${UNAME_RELEASE}
400 exit ;;
401 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
402 echo m68k-milan-mint${UNAME_RELEASE}
403 exit ;;
404 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
405 echo m68k-hades-mint${UNAME_RELEASE}
406 exit ;;
407 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
408 echo m68k-unknown-mint${UNAME_RELEASE}
409 exit ;;
410 m68k:machten:*:*)
411 echo m68k-apple-machten${UNAME_RELEASE}
412 exit ;;
413 powerpc:machten:*:*)
414 echo powerpc-apple-machten${UNAME_RELEASE}
415 exit ;;
416 RISC*:Mach:*:*)
417 echo mips-dec-mach_bsd4.3
418 exit ;;
419 RISC*:ULTRIX:*:*)
420 echo mips-dec-ultrix${UNAME_RELEASE}
421 exit ;;
422 VAX*:ULTRIX*:*:*)
423 echo vax-dec-ultrix${UNAME_RELEASE}
424 exit ;;
425 2020:CLIX:*:* | 2430:CLIX:*:*)
426 echo clipper-intergraph-clix${UNAME_RELEASE}
427 exit ;;
428 mips:*:*:UMIPS | mips:*:*:RISCos)
429 eval $set_cc_for_build
430 sed 's/^ //' << EOF >$dummy.c
431 #ifdef __cplusplus
432 #include <stdio.h> /* for printf() prototype */
433 int main (int argc, char *argv[]) {
434 #else
435 int main (argc, argv) int argc; char *argv[]; {
436 #endif
437 #if defined (host_mips) && defined (MIPSEB)
438 #if defined (SYSTYPE_SYSV)
439 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
440 #endif
441 #if defined (SYSTYPE_SVR4)
442 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
443 #endif
444 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
445 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
446 #endif
447 #endif
448 exit (-1);
449 }
450 EOF
451 $CC_FOR_BUILD -o $dummy $dummy.c &&
452 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
453 SYSTEM_NAME=`$dummy $dummyarg` &&
454 { echo "$SYSTEM_NAME"; exit; }
455 echo mips-mips-riscos${UNAME_RELEASE}
456 exit ;;
457 Motorola:PowerMAX_OS:*:*)
458 echo powerpc-motorola-powermax
459 exit ;;
460 Motorola:*:4.3:PL8-*)
461 echo powerpc-harris-powermax
462 exit ;;
463 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
464 echo powerpc-harris-powermax
465 exit ;;
466 Night_Hawk:Power_UNIX:*:*)
467 echo powerpc-harris-powerunix
468 exit ;;
469 m88k:CX/UX:7*:*)
470 echo m88k-harris-cxux7
471 exit ;;
472 m88k:*:4*:R4*)
473 echo m88k-motorola-sysv4
474 exit ;;
475 m88k:*:3*:R3*)
476 echo m88k-motorola-sysv3
477 exit ;;
478 AViiON:dgux:*:*)
479 # DG/UX returns AViiON for all architectures
480 UNAME_PROCESSOR=`/usr/bin/uname -p`
481 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
482 then
483 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
484 [ ${TARGET_BINARY_INTERFACE}x = x ]
485 then
486 echo m88k-dg-dgux${UNAME_RELEASE}
487 else
488 echo m88k-dg-dguxbcs${UNAME_RELEASE}
489 fi
490 else
491 echo i586-dg-dgux${UNAME_RELEASE}
492 fi
493 exit ;;
494 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
495 echo m88k-dolphin-sysv3
496 exit ;;
497 M88*:*:R3*:*)
498 # Delta 88k system running SVR3
499 echo m88k-motorola-sysv3
500 exit ;;
501 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
502 echo m88k-tektronix-sysv3
503 exit ;;
504 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
505 echo m68k-tektronix-bsd
506 exit ;;
507 *:IRIX*:*:*)
508 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
509 exit ;;
510 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
511 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
512 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
513 i*86:AIX:*:*)
514 echo i386-ibm-aix
515 exit ;;
516 ia64:AIX:*:*)
517 if [ -x /usr/bin/oslevel ] ; then
518 IBM_REV=`/usr/bin/oslevel`
519 else
520 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
521 fi
522 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
523 exit ;;
524 *:AIX:2:3)
525 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
526 eval $set_cc_for_build
527 sed 's/^ //' << EOF >$dummy.c
528 #include <sys/systemcfg.h>
529
530 main()
531 {
532 if (!__power_pc())
533 exit(1);
534 puts("powerpc-ibm-aix3.2.5");
535 exit(0);
536 }
537 EOF
538 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
539 then
540 echo "$SYSTEM_NAME"
541 else
542 echo rs6000-ibm-aix3.2.5
543 fi
544 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
545 echo rs6000-ibm-aix3.2.4
546 else
547 echo rs6000-ibm-aix3.2
548 fi
549 exit ;;
550 *:AIX:*:[456])
551 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
552 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
553 IBM_ARCH=rs6000
554 else
555 IBM_ARCH=powerpc
556 fi
557 if [ -x /usr/bin/oslevel ] ; then
558 IBM_REV=`/usr/bin/oslevel`
559 else
560 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
561 fi
562 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
563 exit ;;
564 *:AIX:*:*)
565 echo rs6000-ibm-aix
566 exit ;;
567 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
568 echo romp-ibm-bsd4.4
569 exit ;;
570 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
571 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
572 exit ;; # report: romp-ibm BSD 4.3
573 *:BOSX:*:*)
574 echo rs6000-bull-bosx
575 exit ;;
576 DPX/2?00:B.O.S.:*:*)
577 echo m68k-bull-sysv3
578 exit ;;
579 9000/[34]??:4.3bsd:1.*:*)
580 echo m68k-hp-bsd
581 exit ;;
582 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
583 echo m68k-hp-bsd4.4
584 exit ;;
585 9000/[34678]??:HP-UX:*:*)
586 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
587 case "${UNAME_MACHINE}" in
588 9000/31? ) HP_ARCH=m68000 ;;
589 9000/[34]?? ) HP_ARCH=m68k ;;
590 9000/[678][0-9][0-9])
591 if [ -x /usr/bin/getconf ]; then
592 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
593 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
594 case "${sc_cpu_version}" in
595 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
596 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
597 532) # CPU_PA_RISC2_0
598 case "${sc_kernel_bits}" in
599 32) HP_ARCH="hppa2.0n" ;;
600 64) HP_ARCH="hppa2.0w" ;;
601 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
602 esac ;;
603 esac
604 fi
605 if [ "${HP_ARCH}" = "" ]; then
606 eval $set_cc_for_build
607 sed 's/^ //' << EOF >$dummy.c
608
609 #define _HPUX_SOURCE
610 #include <stdlib.h>
611 #include <unistd.h>
612
613 int main ()
614 {
615 #if defined(_SC_KERNEL_BITS)
616 long bits = sysconf(_SC_KERNEL_BITS);
617 #endif
618 long cpu = sysconf (_SC_CPU_VERSION);
619
620 switch (cpu)
621 {
622 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
623 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
624 case CPU_PA_RISC2_0:
625 #if defined(_SC_KERNEL_BITS)
626 switch (bits)
627 {
628 case 64: puts ("hppa2.0w"); break;
629 case 32: puts ("hppa2.0n"); break;
630 default: puts ("hppa2.0"); break;
631 } break;
632 #else /* !defined(_SC_KERNEL_BITS) */
633 puts ("hppa2.0"); break;
634 #endif
635 default: puts ("hppa1.0"); break;
636 }
637 exit (0);
638 }
639 EOF
640 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
641 test -z "$HP_ARCH" && HP_ARCH=hppa
642 fi ;;
643 esac
644 if [ ${HP_ARCH} = "hppa2.0w" ]
645 then
646 eval $set_cc_for_build
647
648 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
649 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
650 # generating 64-bit code. GNU and HP use different nomenclature:
651 #
652 # $ CC_FOR_BUILD=cc ./config.guess
653 # => hppa2.0w-hp-hpux11.23
654 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
655 # => hppa64-hp-hpux11.23
656
657 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
658 grep -q __LP64__
659 then
660 HP_ARCH="hppa2.0w"
661 else
662 HP_ARCH="hppa64"
663 fi
664 fi
665 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
666 exit ;;
667 ia64:HP-UX:*:*)
668 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
669 echo ia64-hp-hpux${HPUX_REV}
670 exit ;;
671 3050*:HI-UX:*:*)
672 eval $set_cc_for_build
673 sed 's/^ //' << EOF >$dummy.c
674 #include <unistd.h>
675 int
676 main ()
677 {
678 long cpu = sysconf (_SC_CPU_VERSION);
679 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
680 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
681 results, however. */
682 if (CPU_IS_PA_RISC (cpu))
683 {
684 switch (cpu)
685 {
686 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
687 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
688 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
689 default: puts ("hppa-hitachi-hiuxwe2"); break;
690 }
691 }
692 else if (CPU_IS_HP_MC68K (cpu))
693 puts ("m68k-hitachi-hiuxwe2");
694 else puts ("unknown-hitachi-hiuxwe2");
695 exit (0);
696 }
697 EOF
698 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
699 { echo "$SYSTEM_NAME"; exit; }
700 echo unknown-hitachi-hiuxwe2
701 exit ;;
702 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
703 echo hppa1.1-hp-bsd
704 exit ;;
705 9000/8??:4.3bsd:*:*)
706 echo hppa1.0-hp-bsd
707 exit ;;
708 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
709 echo hppa1.0-hp-mpeix
710 exit ;;
711 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
712 echo hppa1.1-hp-osf
713 exit ;;
714 hp8??:OSF1:*:*)
715 echo hppa1.0-hp-osf
716 exit ;;
717 i*86:OSF1:*:*)
718 if [ -x /usr/sbin/sysversion ] ; then
719 echo ${UNAME_MACHINE}-unknown-osf1mk
720 else
721 echo ${UNAME_MACHINE}-unknown-osf1
722 fi
723 exit ;;
724 parisc*:Lites*:*:*)
725 echo hppa1.1-hp-lites
726 exit ;;
727 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
728 echo c1-convex-bsd
729 exit ;;
730 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
731 if getsysinfo -f scalar_acc
732 then echo c32-convex-bsd
733 else echo c2-convex-bsd
734 fi
735 exit ;;
736 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
737 echo c34-convex-bsd
738 exit ;;
739 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
740 echo c38-convex-bsd
741 exit ;;
742 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
743 echo c4-convex-bsd
744 exit ;;
745 CRAY*Y-MP:*:*:*)
746 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
747 exit ;;
748 CRAY*[A-Z]90:*:*:*)
749 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
750 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
751 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
752 -e 's/\.[^.]*$/.X/'
753 exit ;;
754 CRAY*TS:*:*:*)
755 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
756 exit ;;
757 CRAY*T3E:*:*:*)
758 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
759 exit ;;
760 CRAY*SV1:*:*:*)
761 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
762 exit ;;
763 *:UNICOS/mp:*:*)
764 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
765 exit ;;
766 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
767 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
768 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
769 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
770 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
771 exit ;;
772 5000:UNIX_System_V:4.*:*)
773 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
774 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
775 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776 exit ;;
777 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
778 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
779 exit ;;
780 sparc*:BSD/OS:*:*)
781 echo sparc-unknown-bsdi${UNAME_RELEASE}
782 exit ;;
783 *:BSD/OS:*:*)
784 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
785 exit ;;
786 *:FreeBSD:*:*)
787 case ${UNAME_MACHINE} in
788 pc98)
789 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
790 amd64)
791 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
792 *)
793 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
794 esac
795 exit ;;
796 i*:CYGWIN*:*)
797 echo ${UNAME_MACHINE}-pc-cygwin
798 exit ;;
799 *:MINGW*:*)
800 echo ${UNAME_MACHINE}-pc-mingw32
801 exit ;;
802 i*:windows32*:*)
803 # uname -m includes "-pc" on this system.
804 echo ${UNAME_MACHINE}-mingw32
805 exit ;;
806 i*:PW*:*)
807 echo ${UNAME_MACHINE}-pc-pw32
808 exit ;;
809 *:Interix*:[3456]*)
810 case ${UNAME_MACHINE} in
811 x86)
812 echo i586-pc-interix${UNAME_RELEASE}
813 exit ;;
814 EM64T | authenticamd | genuineintel)
815 echo x86_64-unknown-interix${UNAME_RELEASE}
816 exit ;;
817 IA64)
818 echo ia64-unknown-interix${UNAME_RELEASE}
819 exit ;;
820 esac ;;
821 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
822 echo i${UNAME_MACHINE}-pc-mks
823 exit ;;
824 8664:Windows_NT:*)
825 echo x86_64-pc-mks
826 exit ;;
827 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
828 # How do we know it's Interix rather than the generic POSIX subsystem?
829 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
830 # UNAME_MACHINE based on the output of uname instead of i386?
831 echo i586-pc-interix
832 exit ;;
833 i*:UWIN*:*)
834 echo ${UNAME_MACHINE}-pc-uwin
835 exit ;;
836 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
837 echo x86_64-unknown-cygwin
838 exit ;;
839 p*:CYGWIN*:*)
840 echo powerpcle-unknown-cygwin
841 exit ;;
842 prep*:SunOS:5.*:*)
843 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
844 exit ;;
845 *:GNU:*:*)
846 # the GNU system
847 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
848 exit ;;
849 *:GNU/*:*:*)
850 # other systems with GNU libc and userland
851 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
852 exit ;;
853 i*86:Minix:*:*)
854 echo ${UNAME_MACHINE}-pc-minix
855 exit ;;
856 arm*:Linux:*:*)
857 eval $set_cc_for_build
858 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
859 | grep -q __ARM_EABI__
860 then
861 echo ${UNAME_MACHINE}-unknown-linux-gnu
862 else
863 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
864 fi
865 exit ;;
866 avr32*:Linux:*:*)
867 echo ${UNAME_MACHINE}-unknown-linux-gnu
868 exit ;;
869 cris:Linux:*:*)
870 echo cris-axis-linux-gnu
871 exit ;;
872 crisv32:Linux:*:*)
873 echo crisv32-axis-linux-gnu
874 exit ;;
875 frv:Linux:*:*)
876 echo frv-unknown-linux-gnu
877 exit ;;
878 ia64:Linux:*:*)
879 echo ${UNAME_MACHINE}-unknown-linux-gnu
880 exit ;;
881 m32r*:Linux:*:*)
882 echo ${UNAME_MACHINE}-unknown-linux-gnu
883 exit ;;
884 m68*:Linux:*:*)
885 echo ${UNAME_MACHINE}-unknown-linux-gnu
886 exit ;;
887 mips:Linux:*:* | mips64:Linux:*:*)
888 eval $set_cc_for_build
889 sed 's/^ //' << EOF >$dummy.c
890 #undef CPU
891 #undef ${UNAME_MACHINE}
892 #undef ${UNAME_MACHINE}el
893 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
894 CPU=${UNAME_MACHINE}el
895 #else
896 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
897 CPU=${UNAME_MACHINE}
898 #else
899 CPU=
900 #endif
901 #endif
902 EOF
903 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
904 /^CPU/{
905 s: ::g
906 p
907 }'`"
908 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
909 ;;
910 or32:Linux:*:*)
911 echo or32-unknown-linux-gnu
912 exit ;;
913 ppc:Linux:*:*)
914 echo powerpc-unknown-linux-gnu
915 exit ;;
916 ppc64:Linux:*:*)
917 echo powerpc64-unknown-linux-gnu
918 exit ;;
919 alpha:Linux:*:*)
920 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
921 EV5) UNAME_MACHINE=alphaev5 ;;
922 EV56) UNAME_MACHINE=alphaev56 ;;
923 PCA56) UNAME_MACHINE=alphapca56 ;;
924 PCA57) UNAME_MACHINE=alphapca56 ;;
925 EV6) UNAME_MACHINE=alphaev6 ;;
926 EV67) UNAME_MACHINE=alphaev67 ;;
927 EV68*) UNAME_MACHINE=alphaev68 ;;
928 esac
929 objdump --private-headers /bin/sh | grep -q ld.so.1
930 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
931 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
932 exit ;;
933 padre:Linux:*:*)
934 echo sparc-unknown-linux-gnu
935 exit ;;
936 parisc:Linux:*:* | hppa:Linux:*:*)
937 # Look for CPU level
938 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
939 PA7*) echo hppa1.1-unknown-linux-gnu ;;
940 PA8*) echo hppa2.0-unknown-linux-gnu ;;
941 *) echo hppa-unknown-linux-gnu ;;
942 esac
943 exit ;;
944 parisc64:Linux:*:* | hppa64:Linux:*:*)
945 echo hppa64-unknown-linux-gnu
946 exit ;;
947 s390:Linux:*:* | s390x:Linux:*:*)
948 echo ${UNAME_MACHINE}-ibm-linux
949 exit ;;
950 sh64*:Linux:*:*)
951 echo ${UNAME_MACHINE}-unknown-linux-gnu
952 exit ;;
953 sh*:Linux:*:*)
954 echo ${UNAME_MACHINE}-unknown-linux-gnu
955 exit ;;
956 sparc:Linux:*:* | sparc64:Linux:*:*)
957 echo ${UNAME_MACHINE}-unknown-linux-gnu
958 exit ;;
959 vax:Linux:*:*)
960 echo ${UNAME_MACHINE}-dec-linux-gnu
961 exit ;;
962 x86_64:Linux:*:*)
963 echo x86_64-unknown-linux-gnu
964 exit ;;
965 xtensa*:Linux:*:*)
966 echo ${UNAME_MACHINE}-unknown-linux-gnu
967 exit ;;
968 i*86:Linux:*:*)
969 # The BFD linker knows what the default object file format is, so
970 # first see if it will tell us. cd to the root directory to prevent
971 # problems with other programs or directories called `ld' in the path.
972 # Set LC_ALL=C to ensure ld outputs messages in English.
973 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
974 | sed -ne '/supported targets:/!d
975 s/[ ][ ]*/ /g
976 s/.*supported targets: *//
977 s/ .*//
978 p'`
979 case "$ld_supported_targets" in
980 elf32-i386)
981 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
982 ;;
983 esac
984 # Determine whether the default compiler is a.out or elf
985 eval $set_cc_for_build
986 sed 's/^ //' << EOF >$dummy.c
987 #include <features.h>
988 #ifdef __ELF__
989 # ifdef __GLIBC__
990 # if __GLIBC__ >= 2
991 LIBC=gnu
992 # else
993 LIBC=gnulibc1
994 # endif
995 # else
996 LIBC=gnulibc1
997 # endif
998 #else
999 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1000 LIBC=gnu
1001 #else
1002 LIBC=gnuaout
1003 #endif
1004 #endif
1005 #ifdef __dietlibc__
1006 LIBC=dietlibc
1007 #endif
1008 EOF
1009 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1010 /^LIBC/{
1011 s: ::g
1012 p
1013 }'`"
1014 test x"${LIBC}" != x && {
1015 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1016 exit
1017 }
1018 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1019 ;;
1020 i*86:DYNIX/ptx:4*:*)
1021 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1022 # earlier versions are messed up and put the nodename in both
1023 # sysname and nodename.
1024 echo i386-sequent-sysv4
1025 exit ;;
1026 i*86:UNIX_SV:4.2MP:2.*)
1027 # Unixware is an offshoot of SVR4, but it has its own version
1028 # number series starting with 2...
1029 # I am not positive that other SVR4 systems won't match this,
1030 # I just have to hope. -- rms.
1031 # Use sysv4.2uw... so that sysv4* matches it.
1032 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1033 exit ;;
1034 i*86:OS/2:*:*)
1035 # If we were able to find `uname', then EMX Unix compatibility
1036 # is probably installed.
1037 echo ${UNAME_MACHINE}-pc-os2-emx
1038 exit ;;
1039 i*86:XTS-300:*:STOP)
1040 echo ${UNAME_MACHINE}-unknown-stop
1041 exit ;;
1042 i*86:atheos:*:*)
1043 echo ${UNAME_MACHINE}-unknown-atheos
1044 exit ;;
1045 i*86:syllable:*:*)
1046 echo ${UNAME_MACHINE}-pc-syllable
1047 exit ;;
1048 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1049 echo i386-unknown-lynxos${UNAME_RELEASE}
1050 exit ;;
1051 i*86:*DOS:*:*)
1052 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1053 exit ;;
1054 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1055 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1056 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1057 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1058 else
1059 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1060 fi
1061 exit ;;
1062 i*86:*:5:[678]*)
1063 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1064 case `/bin/uname -X | grep "^Machine"` in
1065 *486*) UNAME_MACHINE=i486 ;;
1066 *Pentium) UNAME_MACHINE=i586 ;;
1067 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1068 esac
1069 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1070 exit ;;
1071 i*86:*:3.2:*)
1072 if test -f /usr/options/cb.name; then
1073 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1074 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1075 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1076 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1077 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1078 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1079 && UNAME_MACHINE=i586
1080 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1081 && UNAME_MACHINE=i686
1082 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1083 && UNAME_MACHINE=i686
1084 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1085 else
1086 echo ${UNAME_MACHINE}-pc-sysv32
1087 fi
1088 exit ;;
1089 pc:*:*:*)
1090 # Left here for compatibility:
1091 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1092 # the processor, so we play safe by assuming i586.
1093 # Note: whatever this is, it MUST be the same as what config.sub
1094 # prints for the "djgpp" host, or else GDB configury will decide that
1095 # this is a cross-build.
1096 echo i586-pc-msdosdjgpp
1097 exit ;;
1098 Intel:Mach:3*:*)
1099 echo i386-pc-mach3
1100 exit ;;
1101 paragon:*:*:*)
1102 echo i860-intel-osf1
1103 exit ;;
1104 i860:*:4.*:*) # i860-SVR4
1105 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1106 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1107 else # Add other i860-SVR4 vendors below as they are discovered.
1108 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1109 fi
1110 exit ;;
1111 mini*:CTIX:SYS*5:*)
1112 # "miniframe"
1113 echo m68010-convergent-sysv
1114 exit ;;
1115 mc68k:UNIX:SYSTEM5:3.51m)
1116 echo m68k-convergent-sysv
1117 exit ;;
1118 M680?0:D-NIX:5.3:*)
1119 echo m68k-diab-dnix
1120 exit ;;
1121 M68*:*:R3V[5678]*:*)
1122 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1123 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1124 OS_REL=''
1125 test -r /etc/.relid \
1126 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1127 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1128 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1129 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1130 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1131 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1132 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1133 && { echo i486-ncr-sysv4; exit; } ;;
1134 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1135 OS_REL='.3'
1136 test -r /etc/.relid \
1137 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1138 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1139 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1140 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1141 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1142 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1143 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1144 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1145 echo m68k-unknown-lynxos${UNAME_RELEASE}
1146 exit ;;
1147 mc68030:UNIX_System_V:4.*:*)
1148 echo m68k-atari-sysv4
1149 exit ;;
1150 TSUNAMI:LynxOS:2.*:*)
1151 echo sparc-unknown-lynxos${UNAME_RELEASE}
1152 exit ;;
1153 rs6000:LynxOS:2.*:*)
1154 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1155 exit ;;
1156 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1157 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1158 exit ;;
1159 SM[BE]S:UNIX_SV:*:*)
1160 echo mips-dde-sysv${UNAME_RELEASE}
1161 exit ;;
1162 RM*:ReliantUNIX-*:*:*)
1163 echo mips-sni-sysv4
1164 exit ;;
1165 RM*:SINIX-*:*:*)
1166 echo mips-sni-sysv4
1167 exit ;;
1168 *:SINIX-*:*:*)
1169 if uname -p 2>/dev/null >/dev/null ; then
1170 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1171 echo ${UNAME_MACHINE}-sni-sysv4
1172 else
1173 echo ns32k-sni-sysv
1174 fi
1175 exit ;;
1176 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1177 # says <Richard.M.Bartel@ccMail.Census.GOV>
1178 echo i586-unisys-sysv4
1179 exit ;;
1180 *:UNIX_System_V:4*:FTX*)
1181 # From Gerald Hewes <hewes@openmarket.com>.
1182 # How about differentiating between stratus architectures? -djm
1183 echo hppa1.1-stratus-sysv4
1184 exit ;;
1185 *:*:*:FTX*)
1186 # From seanf@swdc.stratus.com.
1187 echo i860-stratus-sysv4
1188 exit ;;
1189 i*86:VOS:*:*)
1190 # From Paul.Green@stratus.com.
1191 echo ${UNAME_MACHINE}-stratus-vos
1192 exit ;;
1193 *:VOS:*:*)
1194 # From Paul.Green@stratus.com.
1195 echo hppa1.1-stratus-vos
1196 exit ;;
1197 mc68*:A/UX:*:*)
1198 echo m68k-apple-aux${UNAME_RELEASE}
1199 exit ;;
1200 news*:NEWS-OS:6*:*)
1201 echo mips-sony-newsos6
1202 exit ;;
1203 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1204 if [ -d /usr/nec ]; then
1205 echo mips-nec-sysv${UNAME_RELEASE}
1206 else
1207 echo mips-unknown-sysv${UNAME_RELEASE}
1208 fi
1209 exit ;;
1210 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1211 echo powerpc-be-beos
1212 exit ;;
1213 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1214 echo powerpc-apple-beos
1215 exit ;;
1216 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1217 echo i586-pc-beos
1218 exit ;;
1219 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1220 echo i586-pc-haiku
1221 exit ;;
1222 SX-4:SUPER-UX:*:*)
1223 echo sx4-nec-superux${UNAME_RELEASE}
1224 exit ;;
1225 SX-5:SUPER-UX:*:*)
1226 echo sx5-nec-superux${UNAME_RELEASE}
1227 exit ;;
1228 SX-6:SUPER-UX:*:*)
1229 echo sx6-nec-superux${UNAME_RELEASE}
1230 exit ;;
1231 SX-7:SUPER-UX:*:*)
1232 echo sx7-nec-superux${UNAME_RELEASE}
1233 exit ;;
1234 SX-8:SUPER-UX:*:*)
1235 echo sx8-nec-superux${UNAME_RELEASE}
1236 exit ;;
1237 SX-8R:SUPER-UX:*:*)
1238 echo sx8r-nec-superux${UNAME_RELEASE}
1239 exit ;;
1240 Power*:Rhapsody:*:*)
1241 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1242 exit ;;
1243 *:Rhapsody:*:*)
1244 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1245 exit ;;
1246 *:Darwin:*:*)
1247 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1248 case $UNAME_PROCESSOR in
1249 unknown) UNAME_PROCESSOR=powerpc ;;
1250 esac
1251 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1252 exit ;;
1253 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1254 UNAME_PROCESSOR=`uname -p`
1255 if test "$UNAME_PROCESSOR" = "x86"; then
1256 UNAME_PROCESSOR=i386
1257 UNAME_MACHINE=pc
1258 fi
1259 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1260 exit ;;
1261 *:QNX:*:4*)
1262 echo i386-pc-qnx
1263 exit ;;
1264 NSE-?:NONSTOP_KERNEL:*:*)
1265 echo nse-tandem-nsk${UNAME_RELEASE}
1266 exit ;;
1267 NSR-?:NONSTOP_KERNEL:*:*)
1268 echo nsr-tandem-nsk${UNAME_RELEASE}
1269 exit ;;
1270 *:NonStop-UX:*:*)
1271 echo mips-compaq-nonstopux
1272 exit ;;
1273 BS2000:POSIX*:*:*)
1274 echo bs2000-siemens-sysv
1275 exit ;;
1276 DS/*:UNIX_System_V:*:*)
1277 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1278 exit ;;
1279 *:Plan9:*:*)
1280 # "uname -m" is not consistent, so use $cputype instead. 386
1281 # is converted to i386 for consistency with other x86
1282 # operating systems.
1283 if test "$cputype" = "386"; then
1284 UNAME_MACHINE=i386
1285 else
1286 UNAME_MACHINE="$cputype"
1287 fi
1288 echo ${UNAME_MACHINE}-unknown-plan9
1289 exit ;;
1290 *:TOPS-10:*:*)
1291 echo pdp10-unknown-tops10
1292 exit ;;
1293 *:TENEX:*:*)
1294 echo pdp10-unknown-tenex
1295 exit ;;
1296 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1297 echo pdp10-dec-tops20
1298 exit ;;
1299 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1300 echo pdp10-xkl-tops20
1301 exit ;;
1302 *:TOPS-20:*:*)
1303 echo pdp10-unknown-tops20
1304 exit ;;
1305 *:ITS:*:*)
1306 echo pdp10-unknown-its
1307 exit ;;
1308 SEI:*:*:SEIUX)
1309 echo mips-sei-seiux${UNAME_RELEASE}
1310 exit ;;
1311 *:DragonFly:*:*)
1312 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1313 exit ;;
1314 *:*VMS:*:*)
1315 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1316 case "${UNAME_MACHINE}" in
1317 A*) echo alpha-dec-vms ; exit ;;
1318 I*) echo ia64-dec-vms ; exit ;;
1319 V*) echo vax-dec-vms ; exit ;;
1320 esac ;;
1321 *:XENIX:*:SysV)
1322 echo i386-pc-xenix
1323 exit ;;
1324 i*86:skyos:*:*)
1325 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1326 exit ;;
1327 i*86:rdos:*:*)
1328 echo ${UNAME_MACHINE}-pc-rdos
1329 exit ;;
1330 i*86:AROS:*:*)
1331 echo ${UNAME_MACHINE}-pc-aros
1332 exit ;;
1333 esac
1334
1335 #echo '(No uname command or uname output not recognized.)' 1>&2
1336 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1337
1338 eval $set_cc_for_build
1339 cat >$dummy.c <<EOF
1340 #ifdef _SEQUENT_
1341 # include <sys/types.h>
1342 # include <sys/utsname.h>
1343 #endif
1344 main ()
1345 {
1346 #if defined (sony)
1347 #if defined (MIPSEB)
1348 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1349 I don't know.... */
1350 printf ("mips-sony-bsd\n"); exit (0);
1351 #else
1352 #include <sys/param.h>
1353 printf ("m68k-sony-newsos%s\n",
1354 #ifdef NEWSOS4
1355 "4"
1356 #else
1357 ""
1358 #endif
1359 ); exit (0);
1360 #endif
1361 #endif
1362
1363 #if defined (__arm) && defined (__acorn) && defined (__unix)
1364 printf ("arm-acorn-riscix\n"); exit (0);
1365 #endif
1366
1367 #if defined (hp300) && !defined (hpux)
1368 printf ("m68k-hp-bsd\n"); exit (0);
1369 #endif
1370
1371 #if defined (NeXT)
1372 #if !defined (__ARCHITECTURE__)
1373 #define __ARCHITECTURE__ "m68k"
1374 #endif
1375 int version;
1376 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1377 if (version < 4)
1378 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1379 else
1380 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1381 exit (0);
1382 #endif
1383
1384 #if defined (MULTIMAX) || defined (n16)
1385 #if defined (UMAXV)
1386 printf ("ns32k-encore-sysv\n"); exit (0);
1387 #else
1388 #if defined (CMU)
1389 printf ("ns32k-encore-mach\n"); exit (0);
1390 #else
1391 printf ("ns32k-encore-bsd\n"); exit (0);
1392 #endif
1393 #endif
1394 #endif
1395
1396 #if defined (__386BSD__)
1397 printf ("i386-pc-bsd\n"); exit (0);
1398 #endif
1399
1400 #if defined (sequent)
1401 #if defined (i386)
1402 printf ("i386-sequent-dynix\n"); exit (0);
1403 #endif
1404 #if defined (ns32000)
1405 printf ("ns32k-sequent-dynix\n"); exit (0);
1406 #endif
1407 #endif
1408
1409 #if defined (_SEQUENT_)
1410 struct utsname un;
1411
1412 uname(&un);
1413
1414 if (strncmp(un.version, "V2", 2) == 0) {
1415 printf ("i386-sequent-ptx2\n"); exit (0);
1416 }
1417 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1418 printf ("i386-sequent-ptx1\n"); exit (0);
1419 }
1420 printf ("i386-sequent-ptx\n"); exit (0);
1421
1422 #endif
1423
1424 #if defined (vax)
1425 # if !defined (ultrix)
1426 # include <sys/param.h>
1427 # if defined (BSD)
1428 # if BSD == 43
1429 printf ("vax-dec-bsd4.3\n"); exit (0);
1430 # else
1431 # if BSD == 199006
1432 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1433 # else
1434 printf ("vax-dec-bsd\n"); exit (0);
1435 # endif
1436 # endif
1437 # else
1438 printf ("vax-dec-bsd\n"); exit (0);
1439 # endif
1440 # else
1441 printf ("vax-dec-ultrix\n"); exit (0);
1442 # endif
1443 #endif
1444
1445 #if defined (alliant) && defined (i860)
1446 printf ("i860-alliant-bsd\n"); exit (0);
1447 #endif
1448
1449 exit (1);
1450 }
1451 EOF
1452
1453 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1454 { echo "$SYSTEM_NAME"; exit; }
1455
1456 # Apollos put the system type in the environment.
1457
1458 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1459
1460 # Convex versions that predate uname can use getsysinfo(1)
1461
1462 if [ -x /usr/convex/getsysinfo ]
1463 then
1464 case `getsysinfo -f cpu_type` in
1465 c1*)
1466 echo c1-convex-bsd
1467 exit ;;
1468 c2*)
1469 if getsysinfo -f scalar_acc
1470 then echo c32-convex-bsd
1471 else echo c2-convex-bsd
1472 fi
1473 exit ;;
1474 c34*)
1475 echo c34-convex-bsd
1476 exit ;;
1477 c38*)
1478 echo c38-convex-bsd
1479 exit ;;
1480 c4*)
1481 echo c4-convex-bsd
1482 exit ;;
1483 esac
1484 fi
1485
1486 cat >&2 <<EOF
1487 $0: unable to guess system type
1488
1489 This script, last modified $timestamp, has failed to recognize
1490 the operating system you are using. It is advised that you
1491 download the most up to date version of the config scripts from
1492
1493 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1494 and
1495 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1496
1497 If the version you run ($0) is already up to date, please
1498 send the following data and any information you think might be
1499 pertinent to <config-patches@gnu.org> in order to provide the needed
1500 information to handle your system.
1501
1502 config.guess timestamp = $timestamp
1503
1504 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1505 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1506 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1507 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1508
1509 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1510 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1511
1512 hostinfo = `(hostinfo) 2>/dev/null`
1513 /bin/universe = `(/bin/universe) 2>/dev/null`
1514 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1515 /bin/arch = `(/bin/arch) 2>/dev/null`
1516 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1517 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1518
1519 UNAME_MACHINE = ${UNAME_MACHINE}
1520 UNAME_RELEASE = ${UNAME_RELEASE}
1521 UNAME_SYSTEM = ${UNAME_SYSTEM}
1522 UNAME_VERSION = ${UNAME_VERSION}
1523 EOF
1524
1525 exit 1
1526
1527 # Local variables:
1528 # eval: (add-hook 'write-file-hooks 'time-stamp)
1529 # time-stamp-start: "timestamp='"
1530 # time-stamp-format: "%:y-%02m-%02d"
1531 # time-stamp-end: "'"
1532 # End:
+0
-83
config.h.in less more
0 /* config.h.in. Generated from configure.ac by autoheader. */
1
2 /* DBus services directory */
3 #undef DBUS_SERVICES_DIR
4
5 /* Enable debug code */
6 #undef ENABLE_DEBUG
7
8 /* Define to 1 if you have the <dlfcn.h> header file. */
9 #undef HAVE_DLFCN_H
10
11 /* Define to 1 if you have the <inttypes.h> header file. */
12 #undef HAVE_INTTYPES_H
13
14 /* Define to 1 if you have the `mlocknice' library (-lmlocknice). */
15 #undef HAVE_LIBMLOCKNICE
16
17 /* Define to 1 if you have the <memory.h> header file. */
18 #undef HAVE_MEMORY_H
19
20 /* Define to 1 if you have the <stdint.h> header file. */
21 #undef HAVE_STDINT_H
22
23 /* Define to 1 if you have the <stdlib.h> header file. */
24 #undef HAVE_STDLIB_H
25
26 /* Define to 1 if you have the <strings.h> header file. */
27 #undef HAVE_STRINGS_H
28
29 /* Define to 1 if you have the <string.h> header file. */
30 #undef HAVE_STRING_H
31
32 /* Define to 1 if you have the <sys/stat.h> header file. */
33 #undef HAVE_SYS_STAT_H
34
35 /* Define to 1 if you have the <sys/types.h> header file. */
36 #undef HAVE_SYS_TYPES_H
37
38 /* Can you generate extensions */
39 #undef HAVE_TP_EXTENSIONS
40
41 /* Define to 1 if you have the <unistd.h> header file. */
42 #undef HAVE_UNISTD_H
43
44 /* Define to the sub-directory in which libtool stores uninstalled libraries.
45 */
46 #undef LT_OBJDIR
47
48 /* Name of package */
49 #undef PACKAGE
50
51 /* Define to the address where bug reports for this package should be sent. */
52 #undef PACKAGE_BUGREPORT
53
54 /* Define to the full name of this package. */
55 #undef PACKAGE_NAME
56
57 /* Define to the full name and version of this package. */
58 #undef PACKAGE_STRING
59
60 /* Define to the one symbol short name of this package. */
61 #undef PACKAGE_TARNAME
62
63 /* Define to the home page for this package. */
64 #undef PACKAGE_URL
65
66 /* Define to the version of this package. */
67 #undef PACKAGE_VERSION
68
69 /* Define to 1 if you have the ANSI C header files. */
70 #undef STDC_HEADERS
71
72 /* Version number of package */
73 #undef VERSION
74
75 /* Enable GNU extensions */
76 #undef _GNU_SOURCE
77
78 /* Define to `__inline__' or `__inline' if that's what the C compiler
79 calls it, or to nothing if 'inline' is not supported under any name. */
80 #ifndef __cplusplus
81 #undef inline
82 #endif
+0
-1693
config.sub less more
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 # Free Software Foundation, Inc.
5
6 timestamp='2009-06-11'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # This file is supposed to be the same for all GNU packages
42 # and recognize all the CPU types, system types and aliases
43 # that are meaningful with *any* GNU software.
44 # Each package is responsible for reporting which valid configurations
45 # it does not support. The user should be able to distinguish
46 # a failure to support a valid configuration from a meaningless
47 # configuration.
48
49 # The goal of this file is to map all the various variations of a given
50 # machine specification into a single specification in the form:
51 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
52 # or in some cases, the newer four-part form:
53 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
54 # It is wrong to echo any other type of specification.
55
56 me=`echo "$0" | sed -e 's,.*/,,'`
57
58 usage="\
59 Usage: $0 [OPTION] CPU-MFR-OPSYS
60 $0 [OPTION] ALIAS
61
62 Canonicalize a configuration name.
63
64 Operation modes:
65 -h, --help print this help, then exit
66 -t, --time-stamp print date of last modification, then exit
67 -v, --version print version number, then exit
68
69 Report bugs and patches to <config-patches@gnu.org>."
70
71 version="\
72 GNU config.sub ($timestamp)
73
74 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
75 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
76
77 This is free software; see the source for copying conditions. There is NO
78 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
79
80 help="
81 Try \`$me --help' for more information."
82
83 # Parse command line
84 while test $# -gt 0 ; do
85 case $1 in
86 --time-stamp | --time* | -t )
87 echo "$timestamp" ; exit ;;
88 --version | -v )
89 echo "$version" ; exit ;;
90 --help | --h* | -h )
91 echo "$usage"; exit ;;
92 -- ) # Stop option processing
93 shift; break ;;
94 - ) # Use stdin as input.
95 break ;;
96 -* )
97 echo "$me: invalid option $1$help"
98 exit 1 ;;
99
100 *local*)
101 # First pass through any local machine types.
102 echo $1
103 exit ;;
104
105 * )
106 break ;;
107 esac
108 done
109
110 case $# in
111 0) echo "$me: missing argument$help" >&2
112 exit 1;;
113 1) ;;
114 *) echo "$me: too many arguments$help" >&2
115 exit 1;;
116 esac
117
118 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
119 # Here we must recognize all the valid KERNEL-OS combinations.
120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121 case $maybe_os in
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 kopensolaris*-gnu* | \
125 storm-chaos* | os2-emx* | rtmk-nova*)
126 os=-$maybe_os
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
128 ;;
129 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
133 else os=; fi
134 ;;
135 esac
136
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work. We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142 -sun*os*)
143 # Prevent following clause from handling this invalid input.
144 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151 -apple | -axis | -knuth | -cray)
152 os=
153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
157 ;;
158 -sim | -cisco | -oki | -wec | -winbond)
159 os=
160 basic_machine=$1
161 ;;
162 -scout)
163 ;;
164 -wrs)
165 os=-vxworks
166 basic_machine=$1
167 ;;
168 -chorusos*)
169 os=-chorusos
170 basic_machine=$1
171 ;;
172 -chorusrdb)
173 os=-chorusrdb
174 basic_machine=$1
175 ;;
176 -hiux*)
177 os=-hiuxwe2
178 ;;
179 -sco6)
180 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco5)
184 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco4)
188 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -sco*)
204 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -isc)
211 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213 ;;
214 -clix*)
215 basic_machine=clipper-intergraph
216 ;;
217 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -lynx*)
221 os=-lynxos
222 ;;
223 -ptx*)
224 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
225 ;;
226 -windowsnt*)
227 os=`echo $os | sed -e 's/windowsnt/winnt/'`
228 ;;
229 -psos*)
230 os=-psos
231 ;;
232 -mint | -mint[0-9]*)
233 basic_machine=m68k-atari
234 os=-mint
235 ;;
236 esac
237
238 # Decode aliases for certain CPU-COMPANY combinations.
239 case $basic_machine in
240 # Recognize the basic CPU types without company name.
241 # Some are omitted here because they have special meanings below.
242 1750a | 580 \
243 | a29k \
244 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
245 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
246 | am33_2.0 \
247 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
248 | bfin \
249 | c4x | clipper \
250 | d10v | d30v | dlx | dsp16xx \
251 | fido | fr30 | frv \
252 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
253 | i370 | i860 | i960 | ia64 \
254 | ip2k | iq2000 \
255 | lm32 \
256 | m32c | m32r | m32rle | m68000 | m68k | m88k \
257 | maxq | mb | microblaze | mcore | mep | metag \
258 | mips | mipsbe | mipseb | mipsel | mipsle \
259 | mips16 \
260 | mips64 | mips64el \
261 | mips64octeon | mips64octeonel \
262 | mips64orion | mips64orionel \
263 | mips64r5900 | mips64r5900el \
264 | mips64vr | mips64vrel \
265 | mips64vr4100 | mips64vr4100el \
266 | mips64vr4300 | mips64vr4300el \
267 | mips64vr5000 | mips64vr5000el \
268 | mips64vr5900 | mips64vr5900el \
269 | mipsisa32 | mipsisa32el \
270 | mipsisa32r2 | mipsisa32r2el \
271 | mipsisa64 | mipsisa64el \
272 | mipsisa64r2 | mipsisa64r2el \
273 | mipsisa64sb1 | mipsisa64sb1el \
274 | mipsisa64sr71k | mipsisa64sr71kel \
275 | mipstx39 | mipstx39el \
276 | mn10200 | mn10300 \
277 | moxie \
278 | mt \
279 | msp430 \
280 | nios | nios2 \
281 | ns16k | ns32k \
282 | or32 \
283 | pdp10 | pdp11 | pj | pjl \
284 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
285 | pyramid \
286 | score \
287 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
288 | sh64 | sh64le \
289 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
290 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
291 | spu | strongarm \
292 | tahoe | thumb | tic4x | tic80 | tron \
293 | v850 | v850e \
294 | we32k \
295 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
296 | z8k | z80)
297 basic_machine=$basic_machine-unknown
298 ;;
299 m6811 | m68hc11 | m6812 | m68hc12)
300 # Motorola 68HC11/12.
301 basic_machine=$basic_machine-unknown
302 os=-none
303 ;;
304 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
305 ;;
306 ms1)
307 basic_machine=mt-unknown
308 ;;
309
310 # We use `pc' rather than `unknown'
311 # because (1) that's what they normally are, and
312 # (2) the word "unknown" tends to confuse beginning users.
313 i*86 | x86_64)
314 basic_machine=$basic_machine-pc
315 ;;
316 # Object if more than one company name word.
317 *-*-*)
318 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
319 exit 1
320 ;;
321 # Recognize the basic CPU types with company name.
322 580-* \
323 | a29k-* \
324 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
325 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
326 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
327 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
328 | avr-* | avr32-* \
329 | bfin-* | bs2000-* \
330 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
331 | clipper-* | craynv-* | cydra-* \
332 | d10v-* | d30v-* | dlx-* \
333 | elxsi-* \
334 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
335 | h8300-* | h8500-* \
336 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
337 | i*86-* | i860-* | i960-* | ia64-* \
338 | ip2k-* | iq2000-* \
339 | lm32-* \
340 | m32c-* | m32r-* | m32rle-* \
341 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
342 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
343 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
344 | mips16-* \
345 | mips64-* | mips64el-* \
346 | mips64octeon-* | mips64octeonel-* \
347 | mips64orion-* | mips64orionel-* \
348 | mips64r5900-* | mips64r5900el-* \
349 | mips64vr-* | mips64vrel-* \
350 | mips64vr4100-* | mips64vr4100el-* \
351 | mips64vr4300-* | mips64vr4300el-* \
352 | mips64vr5000-* | mips64vr5000el-* \
353 | mips64vr5900-* | mips64vr5900el-* \
354 | mipsisa32-* | mipsisa32el-* \
355 | mipsisa32r2-* | mipsisa32r2el-* \
356 | mipsisa64-* | mipsisa64el-* \
357 | mipsisa64r2-* | mipsisa64r2el-* \
358 | mipsisa64sb1-* | mipsisa64sb1el-* \
359 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
360 | mipstx39-* | mipstx39el-* \
361 | mmix-* \
362 | mt-* \
363 | msp430-* \
364 | nios-* | nios2-* \
365 | none-* | np1-* | ns16k-* | ns32k-* \
366 | orion-* \
367 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
368 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
369 | pyramid-* \
370 | romp-* | rs6000-* \
371 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
372 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
373 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
374 | sparclite-* \
375 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
376 | tahoe-* | thumb-* \
377 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
378 | tron-* \
379 | v850-* | v850e-* | vax-* \
380 | we32k-* \
381 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
382 | xstormy16-* | xtensa*-* \
383 | ymp-* \
384 | z8k-* | z80-*)
385 ;;
386 # Recognize the basic CPU types without company name, with glob match.
387 xtensa*)
388 basic_machine=$basic_machine-unknown
389 ;;
390 # Recognize the various machine names and aliases which stand
391 # for a CPU type and a company and sometimes even an OS.
392 386bsd)
393 basic_machine=i386-unknown
394 os=-bsd
395 ;;
396 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
397 basic_machine=m68000-att
398 ;;
399 3b*)
400 basic_machine=we32k-att
401 ;;
402 a29khif)
403 basic_machine=a29k-amd
404 os=-udi
405 ;;
406 abacus)
407 basic_machine=abacus-unknown
408 ;;
409 adobe68k)
410 basic_machine=m68010-adobe
411 os=-scout
412 ;;
413 alliant | fx80)
414 basic_machine=fx80-alliant
415 ;;
416 altos | altos3068)
417 basic_machine=m68k-altos
418 ;;
419 am29k)
420 basic_machine=a29k-none
421 os=-bsd
422 ;;
423 amd64)
424 basic_machine=x86_64-pc
425 ;;
426 amd64-*)
427 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
428 ;;
429 amdahl)
430 basic_machine=580-amdahl
431 os=-sysv
432 ;;
433 amiga | amiga-*)
434 basic_machine=m68k-unknown
435 ;;
436 amigaos | amigados)
437 basic_machine=m68k-unknown
438 os=-amigaos
439 ;;
440 amigaunix | amix)
441 basic_machine=m68k-unknown
442 os=-sysv4
443 ;;
444 apollo68)
445 basic_machine=m68k-apollo
446 os=-sysv
447 ;;
448 apollo68bsd)
449 basic_machine=m68k-apollo
450 os=-bsd
451 ;;
452 aros)
453 basic_machine=i386-pc
454 os=-aros
455 ;;
456 aux)
457 basic_machine=m68k-apple
458 os=-aux
459 ;;
460 balance)
461 basic_machine=ns32k-sequent
462 os=-dynix
463 ;;
464 blackfin)
465 basic_machine=bfin-unknown
466 os=-linux
467 ;;
468 blackfin-*)
469 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
470 os=-linux
471 ;;
472 bluegene*)
473 basic_machine=powerpc-ibm
474 os=-cnk
475 ;;
476 c90)
477 basic_machine=c90-cray
478 os=-unicos
479 ;;
480 cegcc)
481 basic_machine=arm-unknown
482 os=-cegcc
483 ;;
484 convex-c1)
485 basic_machine=c1-convex
486 os=-bsd
487 ;;
488 convex-c2)
489 basic_machine=c2-convex
490 os=-bsd
491 ;;
492 convex-c32)
493 basic_machine=c32-convex
494 os=-bsd
495 ;;
496 convex-c34)
497 basic_machine=c34-convex
498 os=-bsd
499 ;;
500 convex-c38)
501 basic_machine=c38-convex
502 os=-bsd
503 ;;
504 cray | j90)
505 basic_machine=j90-cray
506 os=-unicos
507 ;;
508 craynv)
509 basic_machine=craynv-cray
510 os=-unicosmp
511 ;;
512 cr16)
513 basic_machine=cr16-unknown
514 os=-elf
515 ;;
516 crds | unos)
517 basic_machine=m68k-crds
518 ;;
519 crisv32 | crisv32-* | etraxfs*)
520 basic_machine=crisv32-axis
521 ;;
522 cris | cris-* | etrax*)
523 basic_machine=cris-axis
524 ;;
525 crx)
526 basic_machine=crx-unknown
527 os=-elf
528 ;;
529 da30 | da30-*)
530 basic_machine=m68k-da30
531 ;;
532 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
533 basic_machine=mips-dec
534 ;;
535 decsystem10* | dec10*)
536 basic_machine=pdp10-dec
537 os=-tops10
538 ;;
539 decsystem20* | dec20*)
540 basic_machine=pdp10-dec
541 os=-tops20
542 ;;
543 delta | 3300 | motorola-3300 | motorola-delta \
544 | 3300-motorola | delta-motorola)
545 basic_machine=m68k-motorola
546 ;;
547 delta88)
548 basic_machine=m88k-motorola
549 os=-sysv3
550 ;;
551 dicos)
552 basic_machine=i686-pc
553 os=-dicos
554 ;;
555 djgpp)
556 basic_machine=i586-pc
557 os=-msdosdjgpp
558 ;;
559 dpx20 | dpx20-*)
560 basic_machine=rs6000-bull
561 os=-bosx
562 ;;
563 dpx2* | dpx2*-bull)
564 basic_machine=m68k-bull
565 os=-sysv3
566 ;;
567 ebmon29k)
568 basic_machine=a29k-amd
569 os=-ebmon
570 ;;
571 elxsi)
572 basic_machine=elxsi-elxsi
573 os=-bsd
574 ;;
575 encore | umax | mmax)
576 basic_machine=ns32k-encore
577 ;;
578 es1800 | OSE68k | ose68k | ose | OSE)
579 basic_machine=m68k-ericsson
580 os=-ose
581 ;;
582 fx2800)
583 basic_machine=i860-alliant
584 ;;
585 genix)
586 basic_machine=ns32k-ns
587 ;;
588 gmicro)
589 basic_machine=tron-gmicro
590 os=-sysv
591 ;;
592 go32)
593 basic_machine=i386-pc
594 os=-go32
595 ;;
596 h3050r* | hiux*)
597 basic_machine=hppa1.1-hitachi
598 os=-hiuxwe2
599 ;;
600 h8300hms)
601 basic_machine=h8300-hitachi
602 os=-hms
603 ;;
604 h8300xray)
605 basic_machine=h8300-hitachi
606 os=-xray
607 ;;
608 h8500hms)
609 basic_machine=h8500-hitachi
610 os=-hms
611 ;;
612 harris)
613 basic_machine=m88k-harris
614 os=-sysv3
615 ;;
616 hp300-*)
617 basic_machine=m68k-hp
618 ;;
619 hp300bsd)
620 basic_machine=m68k-hp
621 os=-bsd
622 ;;
623 hp300hpux)
624 basic_machine=m68k-hp
625 os=-hpux
626 ;;
627 hp3k9[0-9][0-9] | hp9[0-9][0-9])
628 basic_machine=hppa1.0-hp
629 ;;
630 hp9k2[0-9][0-9] | hp9k31[0-9])
631 basic_machine=m68000-hp
632 ;;
633 hp9k3[2-9][0-9])
634 basic_machine=m68k-hp
635 ;;
636 hp9k6[0-9][0-9] | hp6[0-9][0-9])
637 basic_machine=hppa1.0-hp
638 ;;
639 hp9k7[0-79][0-9] | hp7[0-79][0-9])
640 basic_machine=hppa1.1-hp
641 ;;
642 hp9k78[0-9] | hp78[0-9])
643 # FIXME: really hppa2.0-hp
644 basic_machine=hppa1.1-hp
645 ;;
646 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
647 # FIXME: really hppa2.0-hp
648 basic_machine=hppa1.1-hp
649 ;;
650 hp9k8[0-9][13679] | hp8[0-9][13679])
651 basic_machine=hppa1.1-hp
652 ;;
653 hp9k8[0-9][0-9] | hp8[0-9][0-9])
654 basic_machine=hppa1.0-hp
655 ;;
656 hppa-next)
657 os=-nextstep3
658 ;;
659 hppaosf)
660 basic_machine=hppa1.1-hp
661 os=-osf
662 ;;
663 hppro)
664 basic_machine=hppa1.1-hp
665 os=-proelf
666 ;;
667 i370-ibm* | ibm*)
668 basic_machine=i370-ibm
669 ;;
670 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
671 i*86v32)
672 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
673 os=-sysv32
674 ;;
675 i*86v4*)
676 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
677 os=-sysv4
678 ;;
679 i*86v)
680 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
681 os=-sysv
682 ;;
683 i*86sol2)
684 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
685 os=-solaris2
686 ;;
687 i386mach)
688 basic_machine=i386-mach
689 os=-mach
690 ;;
691 i386-vsta | vsta)
692 basic_machine=i386-unknown
693 os=-vsta
694 ;;
695 iris | iris4d)
696 basic_machine=mips-sgi
697 case $os in
698 -irix*)
699 ;;
700 *)
701 os=-irix4
702 ;;
703 esac
704 ;;
705 isi68 | isi)
706 basic_machine=m68k-isi
707 os=-sysv
708 ;;
709 m68knommu)
710 basic_machine=m68k-unknown
711 os=-linux
712 ;;
713 m68knommu-*)
714 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
715 os=-linux
716 ;;
717 m88k-omron*)
718 basic_machine=m88k-omron
719 ;;
720 magnum | m3230)
721 basic_machine=mips-mips
722 os=-sysv
723 ;;
724 merlin)
725 basic_machine=ns32k-utek
726 os=-sysv
727 ;;
728 mingw32)
729 basic_machine=i386-pc
730 os=-mingw32
731 ;;
732 mingw32ce)
733 basic_machine=arm-unknown
734 os=-mingw32ce
735 ;;
736 miniframe)
737 basic_machine=m68000-convergent
738 ;;
739 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
740 basic_machine=m68k-atari
741 os=-mint
742 ;;
743 mips3*-*)
744 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
745 ;;
746 mips3*)
747 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
748 ;;
749 monitor)
750 basic_machine=m68k-rom68k
751 os=-coff
752 ;;
753 morphos)
754 basic_machine=powerpc-unknown
755 os=-morphos
756 ;;
757 msdos)
758 basic_machine=i386-pc
759 os=-msdos
760 ;;
761 ms1-*)
762 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
763 ;;
764 mvs)
765 basic_machine=i370-ibm
766 os=-mvs
767 ;;
768 ncr3000)
769 basic_machine=i486-ncr
770 os=-sysv4
771 ;;
772 netbsd386)
773 basic_machine=i386-unknown
774 os=-netbsd
775 ;;
776 netwinder)
777 basic_machine=armv4l-rebel
778 os=-linux
779 ;;
780 news | news700 | news800 | news900)
781 basic_machine=m68k-sony
782 os=-newsos
783 ;;
784 news1000)
785 basic_machine=m68030-sony
786 os=-newsos
787 ;;
788 news-3600 | risc-news)
789 basic_machine=mips-sony
790 os=-newsos
791 ;;
792 necv70)
793 basic_machine=v70-nec
794 os=-sysv
795 ;;
796 next | m*-next )
797 basic_machine=m68k-next
798 case $os in
799 -nextstep* )
800 ;;
801 -ns2*)
802 os=-nextstep2
803 ;;
804 *)
805 os=-nextstep3
806 ;;
807 esac
808 ;;
809 nh3000)
810 basic_machine=m68k-harris
811 os=-cxux
812 ;;
813 nh[45]000)
814 basic_machine=m88k-harris
815 os=-cxux
816 ;;
817 nindy960)
818 basic_machine=i960-intel
819 os=-nindy
820 ;;
821 mon960)
822 basic_machine=i960-intel
823 os=-mon960
824 ;;
825 nonstopux)
826 basic_machine=mips-compaq
827 os=-nonstopux
828 ;;
829 np1)
830 basic_machine=np1-gould
831 ;;
832 nsr-tandem)
833 basic_machine=nsr-tandem
834 ;;
835 op50n-* | op60c-*)
836 basic_machine=hppa1.1-oki
837 os=-proelf
838 ;;
839 openrisc | openrisc-*)
840 basic_machine=or32-unknown
841 ;;
842 os400)
843 basic_machine=powerpc-ibm
844 os=-os400
845 ;;
846 OSE68000 | ose68000)
847 basic_machine=m68000-ericsson
848 os=-ose
849 ;;
850 os68k)
851 basic_machine=m68k-none
852 os=-os68k
853 ;;
854 pa-hitachi)
855 basic_machine=hppa1.1-hitachi
856 os=-hiuxwe2
857 ;;
858 paragon)
859 basic_machine=i860-intel
860 os=-osf
861 ;;
862 parisc)
863 basic_machine=hppa-unknown
864 os=-linux
865 ;;
866 parisc-*)
867 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
868 os=-linux
869 ;;
870 pbd)
871 basic_machine=sparc-tti
872 ;;
873 pbb)
874 basic_machine=m68k-tti
875 ;;
876 pc532 | pc532-*)
877 basic_machine=ns32k-pc532
878 ;;
879 pc98)
880 basic_machine=i386-pc
881 ;;
882 pc98-*)
883 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
884 ;;
885 pentium | p5 | k5 | k6 | nexgen | viac3)
886 basic_machine=i586-pc
887 ;;
888 pentiumpro | p6 | 6x86 | athlon | athlon_*)
889 basic_machine=i686-pc
890 ;;
891 pentiumii | pentium2 | pentiumiii | pentium3)
892 basic_machine=i686-pc
893 ;;
894 pentium4)
895 basic_machine=i786-pc
896 ;;
897 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
898 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
899 ;;
900 pentiumpro-* | p6-* | 6x86-* | athlon-*)
901 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
902 ;;
903 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
904 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
905 ;;
906 pentium4-*)
907 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
908 ;;
909 pn)
910 basic_machine=pn-gould
911 ;;
912 power) basic_machine=power-ibm
913 ;;
914 ppc) basic_machine=powerpc-unknown
915 ;;
916 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
917 ;;
918 ppcle | powerpclittle | ppc-le | powerpc-little)
919 basic_machine=powerpcle-unknown
920 ;;
921 ppcle-* | powerpclittle-*)
922 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
923 ;;
924 ppc64) basic_machine=powerpc64-unknown
925 ;;
926 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
927 ;;
928 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
929 basic_machine=powerpc64le-unknown
930 ;;
931 ppc64le-* | powerpc64little-*)
932 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
933 ;;
934 ps2)
935 basic_machine=i386-ibm
936 ;;
937 pw32)
938 basic_machine=i586-unknown
939 os=-pw32
940 ;;
941 rdos)
942 basic_machine=i386-pc
943 os=-rdos
944 ;;
945 rom68k)
946 basic_machine=m68k-rom68k
947 os=-coff
948 ;;
949 rm[46]00)
950 basic_machine=mips-siemens
951 ;;
952 rtpc | rtpc-*)
953 basic_machine=romp-ibm
954 ;;
955 s390 | s390-*)
956 basic_machine=s390-ibm
957 ;;
958 s390x | s390x-*)
959 basic_machine=s390x-ibm
960 ;;
961 sa29200)
962 basic_machine=a29k-amd
963 os=-udi
964 ;;
965 sb1)
966 basic_machine=mipsisa64sb1-unknown
967 ;;
968 sb1el)
969 basic_machine=mipsisa64sb1el-unknown
970 ;;
971 sde)
972 basic_machine=mipsisa32-sde
973 os=-elf
974 ;;
975 sei)
976 basic_machine=mips-sei
977 os=-seiux
978 ;;
979 sequent)
980 basic_machine=i386-sequent
981 ;;
982 sh)
983 basic_machine=sh-hitachi
984 os=-hms
985 ;;
986 sh5el)
987 basic_machine=sh5le-unknown
988 ;;
989 sh64)
990 basic_machine=sh64-unknown
991 ;;
992 sparclite-wrs | simso-wrs)
993 basic_machine=sparclite-wrs
994 os=-vxworks
995 ;;
996 sps7)
997 basic_machine=m68k-bull
998 os=-sysv2
999 ;;
1000 spur)
1001 basic_machine=spur-unknown
1002 ;;
1003 st2000)
1004 basic_machine=m68k-tandem
1005 ;;
1006 stratus)
1007 basic_machine=i860-stratus
1008 os=-sysv4
1009 ;;
1010 sun2)
1011 basic_machine=m68000-sun
1012 ;;
1013 sun2os3)
1014 basic_machine=m68000-sun
1015 os=-sunos3
1016 ;;
1017 sun2os4)
1018 basic_machine=m68000-sun
1019 os=-sunos4
1020 ;;
1021 sun3os3)
1022 basic_machine=m68k-sun
1023 os=-sunos3
1024 ;;
1025 sun3os4)
1026 basic_machine=m68k-sun
1027 os=-sunos4
1028 ;;
1029 sun4os3)
1030 basic_machine=sparc-sun
1031 os=-sunos3
1032 ;;
1033 sun4os4)
1034 basic_machine=sparc-sun
1035 os=-sunos4
1036 ;;
1037 sun4sol2)
1038 basic_machine=sparc-sun
1039 os=-solaris2
1040 ;;
1041 sun3 | sun3-*)
1042 basic_machine=m68k-sun
1043 ;;
1044 sun4)
1045 basic_machine=sparc-sun
1046 ;;
1047 sun386 | sun386i | roadrunner)
1048 basic_machine=i386-sun
1049 ;;
1050 sv1)
1051 basic_machine=sv1-cray
1052 os=-unicos
1053 ;;
1054 symmetry)
1055 basic_machine=i386-sequent
1056 os=-dynix
1057 ;;
1058 t3e)
1059 basic_machine=alphaev5-cray
1060 os=-unicos
1061 ;;
1062 t90)
1063 basic_machine=t90-cray
1064 os=-unicos
1065 ;;
1066 tic54x | c54x*)
1067 basic_machine=tic54x-unknown
1068 os=-coff
1069 ;;
1070 tic55x | c55x*)
1071 basic_machine=tic55x-unknown
1072 os=-coff
1073 ;;
1074 tic6x | c6x*)
1075 basic_machine=tic6x-unknown
1076 os=-coff
1077 ;;
1078 tile*)
1079 basic_machine=tile-unknown
1080 os=-linux-gnu
1081 ;;
1082 tx39)
1083 basic_machine=mipstx39-unknown
1084 ;;
1085 tx39el)
1086 basic_machine=mipstx39el-unknown
1087 ;;
1088 toad1)
1089 basic_machine=pdp10-xkl
1090 os=-tops20
1091 ;;
1092 tower | tower-32)
1093 basic_machine=m68k-ncr
1094 ;;
1095 tpf)
1096 basic_machine=s390x-ibm
1097 os=-tpf
1098 ;;
1099 udi29k)
1100 basic_machine=a29k-amd
1101 os=-udi
1102 ;;
1103 ultra3)
1104 basic_machine=a29k-nyu
1105 os=-sym1
1106 ;;
1107 v810 | necv810)
1108 basic_machine=v810-nec
1109 os=-none
1110 ;;
1111 vaxv)
1112 basic_machine=vax-dec
1113 os=-sysv
1114 ;;
1115 vms)
1116 basic_machine=vax-dec
1117 os=-vms
1118 ;;
1119 vpp*|vx|vx-*)
1120 basic_machine=f301-fujitsu
1121 ;;
1122 vxworks960)
1123 basic_machine=i960-wrs
1124 os=-vxworks
1125 ;;
1126 vxworks68)
1127 basic_machine=m68k-wrs
1128 os=-vxworks
1129 ;;
1130 vxworks29k)
1131 basic_machine=a29k-wrs
1132 os=-vxworks
1133 ;;
1134 w65*)
1135 basic_machine=w65-wdc
1136 os=-none
1137 ;;
1138 w89k-*)
1139 basic_machine=hppa1.1-winbond
1140 os=-proelf
1141 ;;
1142 xbox)
1143 basic_machine=i686-pc
1144 os=-mingw32
1145 ;;
1146 xps | xps100)
1147 basic_machine=xps100-honeywell
1148 ;;
1149 ymp)
1150 basic_machine=ymp-cray
1151 os=-unicos
1152 ;;
1153 z8k-*-coff)
1154 basic_machine=z8k-unknown
1155 os=-sim
1156 ;;
1157 z80-*-coff)
1158 basic_machine=z80-unknown
1159 os=-sim
1160 ;;
1161 none)
1162 basic_machine=none-none
1163 os=-none
1164 ;;
1165
1166 # Here we handle the default manufacturer of certain CPU types. It is in
1167 # some cases the only manufacturer, in others, it is the most popular.
1168 w89k)
1169 basic_machine=hppa1.1-winbond
1170 ;;
1171 op50n)
1172 basic_machine=hppa1.1-oki
1173 ;;
1174 op60c)
1175 basic_machine=hppa1.1-oki
1176 ;;
1177 romp)
1178 basic_machine=romp-ibm
1179 ;;
1180 mmix)
1181 basic_machine=mmix-knuth
1182 ;;
1183 rs6000)
1184 basic_machine=rs6000-ibm
1185 ;;
1186 vax)
1187 basic_machine=vax-dec
1188 ;;
1189 pdp10)
1190 # there are many clones, so DEC is not a safe bet
1191 basic_machine=pdp10-unknown
1192 ;;
1193 pdp11)
1194 basic_machine=pdp11-dec
1195 ;;
1196 we32k)
1197 basic_machine=we32k-att
1198 ;;
1199 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1200 basic_machine=sh-unknown
1201 ;;
1202 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1203 basic_machine=sparc-sun
1204 ;;
1205 cydra)
1206 basic_machine=cydra-cydrome
1207 ;;
1208 orion)
1209 basic_machine=orion-highlevel
1210 ;;
1211 orion105)
1212 basic_machine=clipper-highlevel
1213 ;;
1214 mac | mpw | mac-mpw)
1215 basic_machine=m68k-apple
1216 ;;
1217 pmac | pmac-mpw)
1218 basic_machine=powerpc-apple
1219 ;;
1220 *-unknown)
1221 # Make sure to match an already-canonicalized machine name.
1222 ;;
1223 *)
1224 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1225 exit 1
1226 ;;
1227 esac
1228
1229 # Here we canonicalize certain aliases for manufacturers.
1230 case $basic_machine in
1231 *-digital*)
1232 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1233 ;;
1234 *-commodore*)
1235 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1236 ;;
1237 *)
1238 ;;
1239 esac
1240
1241 # Decode manufacturer-specific aliases for certain operating systems.
1242
1243 if [ x"$os" != x"" ]
1244 then
1245 case $os in
1246 # First match some system type aliases
1247 # that might get confused with valid system types.
1248 # -solaris* is a basic system type, with this one exception.
1249 -solaris1 | -solaris1.*)
1250 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1251 ;;
1252 -solaris)
1253 os=-solaris2
1254 ;;
1255 -svr4*)
1256 os=-sysv4
1257 ;;
1258 -unixware*)
1259 os=-sysv4.2uw
1260 ;;
1261 -gnu/linux*)
1262 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1263 ;;
1264 # First accept the basic system types.
1265 # The portable systems comes first.
1266 # Each alternative MUST END IN A *, to match a version number.
1267 # -sysv* is not here because it comes later, after sysvr4.
1268 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1269 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1270 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1271 | -kopensolaris* \
1272 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1273 | -aos* | -aros* \
1274 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1275 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1276 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1277 | -openbsd* | -solidbsd* \
1278 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1279 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1280 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1281 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1282 | -chorusos* | -chorusrdb* | -cegcc* \
1283 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1284 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1285 | -uxpv* | -beos* | -mpeix* | -udk* \
1286 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1287 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1288 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1289 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1290 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1291 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1292 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1293 # Remember, each alternative MUST END IN *, to match a version number.
1294 ;;
1295 -qnx*)
1296 case $basic_machine in
1297 x86-* | i*86-*)
1298 ;;
1299 *)
1300 os=-nto$os
1301 ;;
1302 esac
1303 ;;
1304 -nto-qnx*)
1305 ;;
1306 -nto*)
1307 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1308 ;;
1309 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1310 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1311 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1312 ;;
1313 -mac*)
1314 os=`echo $os | sed -e 's|mac|macos|'`
1315 ;;
1316 -linux-dietlibc)
1317 os=-linux-dietlibc
1318 ;;
1319 -linux*)
1320 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1321 ;;
1322 -sunos5*)
1323 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1324 ;;
1325 -sunos6*)
1326 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1327 ;;
1328 -opened*)
1329 os=-openedition
1330 ;;
1331 -os400*)
1332 os=-os400
1333 ;;
1334 -wince*)
1335 os=-wince
1336 ;;
1337 -osfrose*)
1338 os=-osfrose
1339 ;;
1340 -osf*)
1341 os=-osf
1342 ;;
1343 -utek*)
1344 os=-bsd
1345 ;;
1346 -dynix*)
1347 os=-bsd
1348 ;;
1349 -acis*)
1350 os=-aos
1351 ;;
1352 -atheos*)
1353 os=-atheos
1354 ;;
1355 -syllable*)
1356 os=-syllable
1357 ;;
1358 -386bsd)
1359 os=-bsd
1360 ;;
1361 -ctix* | -uts*)
1362 os=-sysv
1363 ;;
1364 -nova*)
1365 os=-rtmk-nova
1366 ;;
1367 -ns2 )
1368 os=-nextstep2
1369 ;;
1370 -nsk*)
1371 os=-nsk
1372 ;;
1373 # Preserve the version number of sinix5.
1374 -sinix5.*)
1375 os=`echo $os | sed -e 's|sinix|sysv|'`
1376 ;;
1377 -sinix*)
1378 os=-sysv4
1379 ;;
1380 -tpf*)
1381 os=-tpf
1382 ;;
1383 -triton*)
1384 os=-sysv3
1385 ;;
1386 -oss*)
1387 os=-sysv3
1388 ;;
1389 -svr4)
1390 os=-sysv4
1391 ;;
1392 -svr3)
1393 os=-sysv3
1394 ;;
1395 -sysvr4)
1396 os=-sysv4
1397 ;;
1398 # This must come after -sysvr4.
1399 -sysv*)
1400 ;;
1401 -ose*)
1402 os=-ose
1403 ;;
1404 -es1800*)
1405 os=-ose
1406 ;;
1407 -xenix)
1408 os=-xenix
1409 ;;
1410 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1411 os=-mint
1412 ;;
1413 -aros*)
1414 os=-aros
1415 ;;
1416 -kaos*)
1417 os=-kaos
1418 ;;
1419 -zvmoe)
1420 os=-zvmoe
1421 ;;
1422 -dicos*)
1423 os=-dicos
1424 ;;
1425 -none)
1426 ;;
1427 *)
1428 # Get rid of the `-' at the beginning of $os.
1429 os=`echo $os | sed 's/[^-]*-//'`
1430 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1431 exit 1
1432 ;;
1433 esac
1434 else
1435
1436 # Here we handle the default operating systems that come with various machines.
1437 # The value should be what the vendor currently ships out the door with their
1438 # machine or put another way, the most popular os provided with the machine.
1439
1440 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1441 # "-sun"), then you have to tell the case statement up towards the top
1442 # that MANUFACTURER isn't an operating system. Otherwise, code above
1443 # will signal an error saying that MANUFACTURER isn't an operating
1444 # system, and we'll never get to this point.
1445
1446 case $basic_machine in
1447 score-*)
1448 os=-elf
1449 ;;
1450 spu-*)
1451 os=-elf
1452 ;;
1453 *-acorn)
1454 os=-riscix1.2
1455 ;;
1456 arm*-rebel)
1457 os=-linux
1458 ;;
1459 arm*-semi)
1460 os=-aout
1461 ;;
1462 c4x-* | tic4x-*)
1463 os=-coff
1464 ;;
1465 # This must come before the *-dec entry.
1466 pdp10-*)
1467 os=-tops20
1468 ;;
1469 pdp11-*)
1470 os=-none
1471 ;;
1472 *-dec | vax-*)
1473 os=-ultrix4.2
1474 ;;
1475 m68*-apollo)
1476 os=-domain
1477 ;;
1478 i386-sun)
1479 os=-sunos4.0.2
1480 ;;
1481 m68000-sun)
1482 os=-sunos3
1483 # This also exists in the configure program, but was not the
1484 # default.
1485 # os=-sunos4
1486 ;;
1487 m68*-cisco)
1488 os=-aout
1489 ;;
1490 mep-*)
1491 os=-elf
1492 ;;
1493 mips*-cisco)
1494 os=-elf
1495 ;;
1496 mips*-*)
1497 os=-elf
1498 ;;
1499 or32-*)
1500 os=-coff
1501 ;;
1502 *-tti) # must be before sparc entry or we get the wrong os.
1503 os=-sysv3
1504 ;;
1505 sparc-* | *-sun)
1506 os=-sunos4.1.1
1507 ;;
1508 *-be)
1509 os=-beos
1510 ;;
1511 *-haiku)
1512 os=-haiku
1513 ;;
1514 *-ibm)
1515 os=-aix
1516 ;;
1517 *-knuth)
1518 os=-mmixware
1519 ;;
1520 *-wec)
1521 os=-proelf
1522 ;;
1523 *-winbond)
1524 os=-proelf
1525 ;;
1526 *-oki)
1527 os=-proelf
1528 ;;
1529 *-hp)
1530 os=-hpux
1531 ;;
1532 *-hitachi)
1533 os=-hiux
1534 ;;
1535 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1536 os=-sysv
1537 ;;
1538 *-cbm)
1539 os=-amigaos
1540 ;;
1541 *-dg)
1542 os=-dgux
1543 ;;
1544 *-dolphin)
1545 os=-sysv3
1546 ;;
1547 m68k-ccur)
1548 os=-rtu
1549 ;;
1550 m88k-omron*)
1551 os=-luna
1552 ;;
1553 *-next )
1554 os=-nextstep
1555 ;;
1556 *-sequent)
1557 os=-ptx
1558 ;;
1559 *-crds)
1560 os=-unos
1561 ;;
1562 *-ns)
1563 os=-genix
1564 ;;
1565 i370-*)
1566 os=-mvs
1567 ;;
1568 *-next)
1569 os=-nextstep3
1570 ;;
1571 *-gould)
1572 os=-sysv
1573 ;;
1574 *-highlevel)
1575 os=-bsd
1576 ;;
1577 *-encore)
1578 os=-bsd
1579 ;;
1580 *-sgi)
1581 os=-irix
1582 ;;
1583 *-siemens)
1584 os=-sysv4
1585 ;;
1586 *-masscomp)
1587 os=-rtu
1588 ;;
1589 f30[01]-fujitsu | f700-fujitsu)
1590 os=-uxpv
1591 ;;
1592 *-rom68k)
1593 os=-coff
1594 ;;
1595 *-*bug)
1596 os=-coff
1597 ;;
1598 *-apple)
1599 os=-macos
1600 ;;
1601 *-atari*)
1602 os=-mint
1603 ;;
1604 *)
1605 os=-none
1606 ;;
1607 esac
1608 fi
1609
1610 # Here we handle the case where we know the os, and the CPU type, but not the
1611 # manufacturer. We pick the logical manufacturer.
1612 vendor=unknown
1613 case $basic_machine in
1614 *-unknown)
1615 case $os in
1616 -riscix*)
1617 vendor=acorn
1618 ;;
1619 -sunos*)
1620 vendor=sun
1621 ;;
1622 -cnk*|-aix*)
1623 vendor=ibm
1624 ;;
1625 -beos*)
1626 vendor=be
1627 ;;
1628 -hpux*)
1629 vendor=hp
1630 ;;
1631 -mpeix*)
1632 vendor=hp
1633 ;;
1634 -hiux*)
1635 vendor=hitachi
1636 ;;
1637 -unos*)
1638 vendor=crds
1639 ;;
1640 -dgux*)
1641 vendor=dg
1642 ;;
1643 -luna*)
1644 vendor=omron
1645 ;;
1646 -genix*)
1647 vendor=ns
1648 ;;
1649 -mvs* | -opened*)
1650 vendor=ibm
1651 ;;
1652 -os400*)
1653 vendor=ibm
1654 ;;
1655 -ptx*)
1656 vendor=sequent
1657 ;;
1658 -tpf*)
1659 vendor=ibm
1660 ;;
1661 -vxsim* | -vxworks* | -windiss*)
1662 vendor=wrs
1663 ;;
1664 -aux*)
1665 vendor=apple
1666 ;;
1667 -hms*)
1668 vendor=hitachi
1669 ;;
1670 -mpw* | -macos*)
1671 vendor=apple
1672 ;;
1673 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1674 vendor=atari
1675 ;;
1676 -vos*)
1677 vendor=stratus
1678 ;;
1679 esac
1680 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1681 ;;
1682 esac
1683
1684 echo $basic_machine$os
1685 exit
1686
1687 # Local variables:
1688 # eval: (add-hook 'write-file-hooks 'time-stamp)
1689 # time-stamp-start: "timestamp='"
1690 # time-stamp-format: "%:y-%02m-%02d"
1691 # time-stamp-end: "'"
1692 # End:
+0
-14205
configure less more
0 #! /bin/sh
1 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.67 for telepathy-ring 2.1.0.
3 #
4 #
5 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
6 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
7 # Foundation, Inc.
8 #
9 #
10 # This configure script is free software; the Free Software Foundation
11 # gives unlimited permission to copy, distribute and modify it.
12 ## -------------------- ##
13 ## M4sh Initialization. ##
14 ## -------------------- ##
15
16 # Be more Bourne compatible
17 DUALCASE=1; export DUALCASE # for MKS sh
18 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
19 emulate sh
20 NULLCMD=:
21 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
22 # is contrary to our usage. Disable this feature.
23 alias -g '${1+"$@"}'='"$@"'
24 setopt NO_GLOB_SUBST
25 else
26 case `(set -o) 2>/dev/null` in #(
27 *posix*) :
28 set -o posix ;; #(
29 *) :
30 ;;
31 esac
32 fi
33
34
35 as_nl='
36 '
37 export as_nl
38 # Printing a long string crashes Solaris 7 /usr/bin/printf.
39 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
40 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
41 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
42 # Prefer a ksh shell builtin over an external printf program on Solaris,
43 # but without wasting forks for bash or zsh.
44 if test -z "$BASH_VERSION$ZSH_VERSION" \
45 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
46 as_echo='print -r --'
47 as_echo_n='print -rn --'
48 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
49 as_echo='printf %s\n'
50 as_echo_n='printf %s'
51 else
52 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
53 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
54 as_echo_n='/usr/ucb/echo -n'
55 else
56 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
57 as_echo_n_body='eval
58 arg=$1;
59 case $arg in #(
60 *"$as_nl"*)
61 expr "X$arg" : "X\\(.*\\)$as_nl";
62 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
63 esac;
64 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
65 '
66 export as_echo_n_body
67 as_echo_n='sh -c $as_echo_n_body as_echo'
68 fi
69 export as_echo_body
70 as_echo='sh -c $as_echo_body as_echo'
71 fi
72
73 # The user is always right.
74 if test "${PATH_SEPARATOR+set}" != set; then
75 PATH_SEPARATOR=:
76 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
77 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
78 PATH_SEPARATOR=';'
79 }
80 fi
81
82
83 # IFS
84 # We need space, tab and new line, in precisely that order. Quoting is
85 # there to prevent editors from complaining about space-tab.
86 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
87 # splitting by setting IFS to empty value.)
88 IFS=" "" $as_nl"
89
90 # Find who we are. Look in the path if we contain no directory separator.
91 case $0 in #((
92 *[\\/]* ) as_myself=$0 ;;
93 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
94 for as_dir in $PATH
95 do
96 IFS=$as_save_IFS
97 test -z "$as_dir" && as_dir=.
98 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
99 done
100 IFS=$as_save_IFS
101
102 ;;
103 esac
104 # We did not find ourselves, most probably we were run as `sh COMMAND'
105 # in which case we are not to be found in the path.
106 if test "x$as_myself" = x; then
107 as_myself=$0
108 fi
109 if test ! -f "$as_myself"; then
110 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111 exit 1
112 fi
113
114 # Unset variables that we do not need and which cause bugs (e.g. in
115 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
116 # suppresses any "Segmentation fault" message there. '((' could
117 # trigger a bug in pdksh 5.2.14.
118 for as_var in BASH_ENV ENV MAIL MAILPATH
119 do eval test x\${$as_var+set} = xset \
120 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
121 done
122 PS1='$ '
123 PS2='> '
124 PS4='+ '
125
126 # NLS nuisances.
127 LC_ALL=C
128 export LC_ALL
129 LANGUAGE=C
130 export LANGUAGE
131
132 # CDPATH.
133 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
134
135 if test "x$CONFIG_SHELL" = x; then
136 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
137 emulate sh
138 NULLCMD=:
139 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
140 # is contrary to our usage. Disable this feature.
141 alias -g '\${1+\"\$@\"}'='\"\$@\"'
142 setopt NO_GLOB_SUBST
143 else
144 case \`(set -o) 2>/dev/null\` in #(
145 *posix*) :
146 set -o posix ;; #(
147 *) :
148 ;;
149 esac
150 fi
151 "
152 as_required="as_fn_return () { (exit \$1); }
153 as_fn_success () { as_fn_return 0; }
154 as_fn_failure () { as_fn_return 1; }
155 as_fn_ret_success () { return 0; }
156 as_fn_ret_failure () { return 1; }
157
158 exitcode=0
159 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
160 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
161 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
162 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
163 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
164
165 else
166 exitcode=1; echo positional parameters were not saved.
167 fi
168 test x\$exitcode = x0 || exit 1"
169 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
170 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
171 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
172 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
173 test \$(( 1 + 1 )) = 2 || exit 1"
174 if (eval "$as_required") 2>/dev/null; then :
175 as_have_required=yes
176 else
177 as_have_required=no
178 fi
179 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
180
181 else
182 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
183 as_found=false
184 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
185 do
186 IFS=$as_save_IFS
187 test -z "$as_dir" && as_dir=.
188 as_found=:
189 case $as_dir in #(
190 /*)
191 for as_base in sh bash ksh sh5; do
192 # Try only shells that exist, to save several forks.
193 as_shell=$as_dir/$as_base
194 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
195 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
196 CONFIG_SHELL=$as_shell as_have_required=yes
197 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
198 break 2
199 fi
200 fi
201 done;;
202 esac
203 as_found=false
204 done
205 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
206 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
207 CONFIG_SHELL=$SHELL as_have_required=yes
208 fi; }
209 IFS=$as_save_IFS
210
211
212 if test "x$CONFIG_SHELL" != x; then :
213 # We cannot yet assume a decent shell, so we have to provide a
214 # neutralization value for shells without unset; and this also
215 # works around shells that cannot unset nonexistent variables.
216 BASH_ENV=/dev/null
217 ENV=/dev/null
218 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
219 export CONFIG_SHELL
220 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
221 fi
222
223 if test x$as_have_required = xno; then :
224 $as_echo "$0: This script requires a shell more modern than all"
225 $as_echo "$0: the shells that I found on your system."
226 if test x${ZSH_VERSION+set} = xset ; then
227 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
228 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
229 else
230 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
231 $0: including any error possibly output before this
232 $0: message. Then install a modern shell, or manually run
233 $0: the script under such a shell if you do have one."
234 fi
235 exit 1
236 fi
237 fi
238 fi
239 SHELL=${CONFIG_SHELL-/bin/sh}
240 export SHELL
241 # Unset more variables known to interfere with behavior of common tools.
242 CLICOLOR_FORCE= GREP_OPTIONS=
243 unset CLICOLOR_FORCE GREP_OPTIONS
244
245 ## --------------------- ##
246 ## M4sh Shell Functions. ##
247 ## --------------------- ##
248 # as_fn_unset VAR
249 # ---------------
250 # Portably unset VAR.
251 as_fn_unset ()
252 {
253 { eval $1=; unset $1;}
254 }
255 as_unset=as_fn_unset
256
257 # as_fn_set_status STATUS
258 # -----------------------
259 # Set $? to STATUS, without forking.
260 as_fn_set_status ()
261 {
262 return $1
263 } # as_fn_set_status
264
265 # as_fn_exit STATUS
266 # -----------------
267 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
268 as_fn_exit ()
269 {
270 set +e
271 as_fn_set_status $1
272 exit $1
273 } # as_fn_exit
274
275 # as_fn_mkdir_p
276 # -------------
277 # Create "$as_dir" as a directory, including parents if necessary.
278 as_fn_mkdir_p ()
279 {
280
281 case $as_dir in #(
282 -*) as_dir=./$as_dir;;
283 esac
284 test -d "$as_dir" || eval $as_mkdir_p || {
285 as_dirs=
286 while :; do
287 case $as_dir in #(
288 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
289 *) as_qdir=$as_dir;;
290 esac
291 as_dirs="'$as_qdir' $as_dirs"
292 as_dir=`$as_dirname -- "$as_dir" ||
293 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
294 X"$as_dir" : 'X\(//\)[^/]' \| \
295 X"$as_dir" : 'X\(//\)$' \| \
296 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
297 $as_echo X"$as_dir" |
298 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
299 s//\1/
300 q
301 }
302 /^X\(\/\/\)[^/].*/{
303 s//\1/
304 q
305 }
306 /^X\(\/\/\)$/{
307 s//\1/
308 q
309 }
310 /^X\(\/\).*/{
311 s//\1/
312 q
313 }
314 s/.*/./; q'`
315 test -d "$as_dir" && break
316 done
317 test -z "$as_dirs" || eval "mkdir $as_dirs"
318 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
319
320
321 } # as_fn_mkdir_p
322 # as_fn_append VAR VALUE
323 # ----------------------
324 # Append the text in VALUE to the end of the definition contained in VAR. Take
325 # advantage of any shell optimizations that allow amortized linear growth over
326 # repeated appends, instead of the typical quadratic growth present in naive
327 # implementations.
328 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
329 eval 'as_fn_append ()
330 {
331 eval $1+=\$2
332 }'
333 else
334 as_fn_append ()
335 {
336 eval $1=\$$1\$2
337 }
338 fi # as_fn_append
339
340 # as_fn_arith ARG...
341 # ------------------
342 # Perform arithmetic evaluation on the ARGs, and store the result in the
343 # global $as_val. Take advantage of shells that can avoid forks. The arguments
344 # must be portable across $(()) and expr.
345 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
346 eval 'as_fn_arith ()
347 {
348 as_val=$(( $* ))
349 }'
350 else
351 as_fn_arith ()
352 {
353 as_val=`expr "$@" || test $? -eq 1`
354 }
355 fi # as_fn_arith
356
357
358 # as_fn_error STATUS ERROR [LINENO LOG_FD]
359 # ----------------------------------------
360 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
361 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
362 # script with STATUS, using 1 if that was 0.
363 as_fn_error ()
364 {
365 as_status=$1; test $as_status -eq 0 && as_status=1
366 if test "$4"; then
367 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
368 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
369 fi
370 $as_echo "$as_me: error: $2" >&2
371 as_fn_exit $as_status
372 } # as_fn_error
373
374 if expr a : '\(a\)' >/dev/null 2>&1 &&
375 test "X`expr 00001 : '.*\(...\)'`" = X001; then
376 as_expr=expr
377 else
378 as_expr=false
379 fi
380
381 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
382 as_basename=basename
383 else
384 as_basename=false
385 fi
386
387 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
388 as_dirname=dirname
389 else
390 as_dirname=false
391 fi
392
393 as_me=`$as_basename -- "$0" ||
394 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
395 X"$0" : 'X\(//\)$' \| \
396 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
397 $as_echo X/"$0" |
398 sed '/^.*\/\([^/][^/]*\)\/*$/{
399 s//\1/
400 q
401 }
402 /^X\/\(\/\/\)$/{
403 s//\1/
404 q
405 }
406 /^X\/\(\/\).*/{
407 s//\1/
408 q
409 }
410 s/.*/./; q'`
411
412 # Avoid depending upon Character Ranges.
413 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
414 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
415 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
416 as_cr_digits='0123456789'
417 as_cr_alnum=$as_cr_Letters$as_cr_digits
418
419
420 as_lineno_1=$LINENO as_lineno_1a=$LINENO
421 as_lineno_2=$LINENO as_lineno_2a=$LINENO
422 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
423 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
424 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
425 sed -n '
426 p
427 /[$]LINENO/=
428 ' <$as_myself |
429 sed '
430 s/[$]LINENO.*/&-/
431 t lineno
432 b
433 :lineno
434 N
435 :loop
436 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
437 t loop
438 s/-\n.*//
439 ' >$as_me.lineno &&
440 chmod +x "$as_me.lineno" ||
441 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
442
443 # Don't try to exec as it changes $[0], causing all sort of problems
444 # (the dirname of $[0] is not the place where we might find the
445 # original and so on. Autoconf is especially sensitive to this).
446 . "./$as_me.lineno"
447 # Exit status is that of the last command.
448 exit
449 }
450
451 ECHO_C= ECHO_N= ECHO_T=
452 case `echo -n x` in #(((((
453 -n*)
454 case `echo 'xy\c'` in
455 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
456 xy) ECHO_C='\c';;
457 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
458 ECHO_T=' ';;
459 esac;;
460 *)
461 ECHO_N='-n';;
462 esac
463
464 rm -f conf$$ conf$$.exe conf$$.file
465 if test -d conf$$.dir; then
466 rm -f conf$$.dir/conf$$.file
467 else
468 rm -f conf$$.dir
469 mkdir conf$$.dir 2>/dev/null
470 fi
471 if (echo >conf$$.file) 2>/dev/null; then
472 if ln -s conf$$.file conf$$ 2>/dev/null; then
473 as_ln_s='ln -s'
474 # ... but there are two gotchas:
475 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
476 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
477 # In both cases, we have to default to `cp -p'.
478 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
479 as_ln_s='cp -p'
480 elif ln conf$$.file conf$$ 2>/dev/null; then
481 as_ln_s=ln
482 else
483 as_ln_s='cp -p'
484 fi
485 else
486 as_ln_s='cp -p'
487 fi
488 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
489 rmdir conf$$.dir 2>/dev/null
490
491 if mkdir -p . 2>/dev/null; then
492 as_mkdir_p='mkdir -p "$as_dir"'
493 else
494 test -d ./-p && rmdir ./-p
495 as_mkdir_p=false
496 fi
497
498 if test -x / >/dev/null 2>&1; then
499 as_test_x='test -x'
500 else
501 if ls -dL / >/dev/null 2>&1; then
502 as_ls_L_option=L
503 else
504 as_ls_L_option=
505 fi
506 as_test_x='
507 eval sh -c '\''
508 if test -d "$1"; then
509 test -d "$1/.";
510 else
511 case $1 in #(
512 -*)set "./$1";;
513 esac;
514 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
515 ???[sx]*):;;*)false;;esac;fi
516 '\'' sh
517 '
518 fi
519 as_executable_p=$as_test_x
520
521 # Sed expression to map a string onto a valid CPP name.
522 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
523
524 # Sed expression to map a string onto a valid variable name.
525 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
526
527
528
529 # Check that we are running under the correct shell.
530 SHELL=${CONFIG_SHELL-/bin/sh}
531
532 case X$lt_ECHO in
533 X*--fallback-echo)
534 # Remove one level of quotation (which was required for Make).
535 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
536 ;;
537 esac
538
539 ECHO=${lt_ECHO-echo}
540 if test "X$1" = X--no-reexec; then
541 # Discard the --no-reexec flag, and continue.
542 shift
543 elif test "X$1" = X--fallback-echo; then
544 # Avoid inline document here, it may be left over
545 :
546 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
547 # Yippee, $ECHO works!
548 :
549 else
550 # Restart under the correct shell.
551 exec $SHELL "$0" --no-reexec ${1+"$@"}
552 fi
553
554 if test "X$1" = X--fallback-echo; then
555 # used as fallback echo
556 shift
557 cat <<_LT_EOF
558 $*
559 _LT_EOF
560 exit 0
561 fi
562
563 # The HP-UX ksh and POSIX shell print the target directory to stdout
564 # if CDPATH is set.
565 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
566
567 if test -z "$lt_ECHO"; then
568 if test "X${echo_test_string+set}" != Xset; then
569 # find a string as large as possible, as long as the shell can cope with it
570 for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
571 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
572 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
573 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
574 then
575 break
576 fi
577 done
578 fi
579
580 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
581 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
582 test "X$echo_testing_string" = "X$echo_test_string"; then
583 :
584 else
585 # The Solaris, AIX, and Digital Unix default echo programs unquote
586 # backslashes. This makes it impossible to quote backslashes using
587 # echo "$something" | sed 's/\\/\\\\/g'
588 #
589 # So, first we look for a working echo in the user's PATH.
590
591 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
592 for dir in $PATH /usr/ucb; do
593 IFS="$lt_save_ifs"
594 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
595 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
596 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
597 test "X$echo_testing_string" = "X$echo_test_string"; then
598 ECHO="$dir/echo"
599 break
600 fi
601 done
602 IFS="$lt_save_ifs"
603
604 if test "X$ECHO" = Xecho; then
605 # We didn't find a better echo, so look for alternatives.
606 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
607 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
608 test "X$echo_testing_string" = "X$echo_test_string"; then
609 # This shell has a builtin print -r that does the trick.
610 ECHO='print -r'
611 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
612 test "X$CONFIG_SHELL" != X/bin/ksh; then
613 # If we have ksh, try running configure again with it.
614 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
615 export ORIGINAL_CONFIG_SHELL
616 CONFIG_SHELL=/bin/ksh
617 export CONFIG_SHELL
618 exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
619 else
620 # Try using printf.
621 ECHO='printf %s\n'
622 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
623 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
624 test "X$echo_testing_string" = "X$echo_test_string"; then
625 # Cool, printf works
626 :
627 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
628 test "X$echo_testing_string" = 'X\t' &&
629 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
630 test "X$echo_testing_string" = "X$echo_test_string"; then
631 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
632 export CONFIG_SHELL
633 SHELL="$CONFIG_SHELL"
634 export SHELL
635 ECHO="$CONFIG_SHELL $0 --fallback-echo"
636 elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
637 test "X$echo_testing_string" = 'X\t' &&
638 echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
639 test "X$echo_testing_string" = "X$echo_test_string"; then
640 ECHO="$CONFIG_SHELL $0 --fallback-echo"
641 else
642 # maybe with a smaller string...
643 prev=:
644
645 for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
646 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
647 then
648 break
649 fi
650 prev="$cmd"
651 done
652
653 if test "$prev" != 'sed 50q "$0"'; then
654 echo_test_string=`eval $prev`
655 export echo_test_string
656 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
657 else
658 # Oops. We lost completely, so just stick with echo.
659 ECHO=echo
660 fi
661 fi
662 fi
663 fi
664 fi
665 fi
666
667 # Copy echo and quote the copy suitably for passing to libtool from
668 # the Makefile, instead of quoting the original, which is used later.
669 lt_ECHO=$ECHO
670 if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
671 lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
672 fi
673
674
675
676
677 test -n "$DJDIR" || exec 7<&0 </dev/null
678 exec 6>&1
679
680 # Name of the host.
681 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
682 # so uname gets run too.
683 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
684
685 #
686 # Initializations.
687 #
688 ac_default_prefix=/usr/local
689 ac_clean_files=
690 ac_config_libobj_dir=.
691 LIBOBJS=
692 cross_compiling=no
693 subdirs=
694 MFLAGS=
695 MAKEFLAGS=
696
697 # Identity of this package.
698 PACKAGE_NAME='telepathy-ring'
699 PACKAGE_TARNAME='telepathy-ring'
700 PACKAGE_VERSION='2.1.0'
701 PACKAGE_STRING='telepathy-ring 2.1.0'
702 PACKAGE_BUGREPORT=''
703 PACKAGE_URL=''
704
705 # Factoring default headers for most tests.
706 ac_includes_default="\
707 #include <stdio.h>
708 #ifdef HAVE_SYS_TYPES_H
709 # include <sys/types.h>
710 #endif
711 #ifdef HAVE_SYS_STAT_H
712 # include <sys/stat.h>
713 #endif
714 #ifdef STDC_HEADERS
715 # include <stdlib.h>
716 # include <stddef.h>
717 #else
718 # ifdef HAVE_STDLIB_H
719 # include <stdlib.h>
720 # endif
721 #endif
722 #ifdef HAVE_STRING_H
723 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
724 # include <memory.h>
725 # endif
726 # include <string.h>
727 #endif
728 #ifdef HAVE_STRINGS_H
729 # include <strings.h>
730 #endif
731 #ifdef HAVE_INTTYPES_H
732 # include <inttypes.h>
733 #endif
734 #ifdef HAVE_STDINT_H
735 # include <stdint.h>
736 #endif
737 #ifdef HAVE_UNISTD_H
738 # include <unistd.h>
739 #endif"
740
741 ac_subst_vars='am__EXEEXT_FALSE
742 am__EXEEXT_TRUE
743 LTLIBOBJS
744 LIBOBJS
745 includesmsdir
746 includemodemdir
747 testdir
748 HAVE_TP_EXTENSIONS_FALSE
749 HAVE_TP_EXTENSIONS_TRUE
750 PYTHON
751 DBUS_BINDING_TOOL
752 XSLTPROC
753 TP_LIBS
754 TP_CFLAGS
755 DBUS_SERVICES_DIR
756 DATADIR
757 UUID_LIBS
758 UUID_CFLAGS
759 DBUS_LIBS
760 DBUS_CFLAGS
761 CHECK_LIBS
762 CHECK_CFLAGS
763 GLIB_GENMARSHAL
764 GLIB_LIBS
765 GLIB_CFLAGS
766 PKG_CONFIG_LIBDIR
767 PKG_CONFIG_PATH
768 PKG_CONFIG
769 MAINT
770 MAINTAINER_MODE_FALSE
771 MAINTAINER_MODE_TRUE
772 ERROR_CFLAGS
773 CPP
774 OTOOL64
775 OTOOL
776 LIPO
777 NMEDIT
778 DSYMUTIL
779 lt_ECHO
780 RANLIB
781 AR
782 OBJDUMP
783 LN_S
784 NM
785 ac_ct_DUMPBIN
786 DUMPBIN
787 LD
788 FGREP
789 EGREP
790 GREP
791 SED
792 host_os
793 host_vendor
794 host_cpu
795 host
796 build_os
797 build_vendor
798 build_cpu
799 build
800 LIBTOOL
801 am__fastdepCC_FALSE
802 am__fastdepCC_TRUE
803 CCDEPMODE
804 AMDEPBACKSLASH
805 AMDEP_FALSE
806 AMDEP_TRUE
807 am__quote
808 am__include
809 DEPDIR
810 OBJEXT
811 EXEEXT
812 ac_ct_CC
813 CPPFLAGS
814 LDFLAGS
815 CFLAGS
816 CC
817 AM_BACKSLASH
818 AM_DEFAULT_VERBOSITY
819 am__untar
820 am__tar
821 AMTAR
822 am__leading_dot
823 SET_MAKE
824 AWK
825 mkdir_p
826 MKDIR_P
827 INSTALL_STRIP_PROGRAM
828 STRIP
829 install_sh
830 MAKEINFO
831 AUTOHEADER
832 AUTOMAKE
833 AUTOCONF
834 ACLOCAL
835 VERSION
836 PACKAGE
837 CYGPATH_W
838 am__isrc
839 INSTALL_DATA
840 INSTALL_SCRIPT
841 INSTALL_PROGRAM
842 target_alias
843 host_alias
844 build_alias
845 LIBS
846 ECHO_T
847 ECHO_N
848 ECHO_C
849 DEFS
850 mandir
851 localedir
852 libdir
853 psdir
854 pdfdir
855 dvidir
856 htmldir
857 infodir
858 docdir
859 oldincludedir
860 includedir
861 localstatedir
862 sharedstatedir
863 sysconfdir
864 datadir
865 datarootdir
866 libexecdir
867 sbindir
868 bindir
869 program_transform_name
870 prefix
871 exec_prefix
872 PACKAGE_URL
873 PACKAGE_BUGREPORT
874 PACKAGE_STRING
875 PACKAGE_VERSION
876 PACKAGE_TARNAME
877 PACKAGE_NAME
878 PATH_SEPARATOR
879 SHELL'
880 ac_subst_files=''
881 ac_user_opts='
882 enable_option_checking
883 enable_silent_rules
884 enable_dependency_tracking
885 enable_shared
886 enable_static
887 with_pic
888 enable_fast_install
889 with_gnu_ld
890 enable_libtool_lock
891 enable_maintainer_mode
892 enable_debug
893 '
894 ac_precious_vars='build_alias
895 host_alias
896 target_alias
897 CC
898 CFLAGS
899 LDFLAGS
900 LIBS
901 CPPFLAGS
902 CPP
903 PKG_CONFIG
904 PKG_CONFIG_PATH
905 PKG_CONFIG_LIBDIR
906 GLIB_CFLAGS
907 GLIB_LIBS
908 CHECK_CFLAGS
909 CHECK_LIBS
910 DBUS_CFLAGS
911 DBUS_LIBS
912 UUID_CFLAGS
913 UUID_LIBS
914 TP_CFLAGS
915 TP_LIBS'
916
917
918 # Initialize some variables set by options.
919 ac_init_help=
920 ac_init_version=false
921 ac_unrecognized_opts=
922 ac_unrecognized_sep=
923 # The variables have the same names as the options, with
924 # dashes changed to underlines.
925 cache_file=/dev/null
926 exec_prefix=NONE
927 no_create=
928 no_recursion=
929 prefix=NONE
930 program_prefix=NONE
931 program_suffix=NONE
932 program_transform_name=s,x,x,
933 silent=
934 site=
935 srcdir=
936 verbose=
937 x_includes=NONE
938 x_libraries=NONE
939
940 # Installation directory options.
941 # These are left unexpanded so users can "make install exec_prefix=/foo"
942 # and all the variables that are supposed to be based on exec_prefix
943 # by default will actually change.
944 # Use braces instead of parens because sh, perl, etc. also accept them.
945 # (The list follows the same order as the GNU Coding Standards.)
946 bindir='${exec_prefix}/bin'
947 sbindir='${exec_prefix}/sbin'
948 libexecdir='${exec_prefix}/libexec'
949 datarootdir='${prefix}/share'
950 datadir='${datarootdir}'
951 sysconfdir='${prefix}/etc'
952 sharedstatedir='${prefix}/com'
953 localstatedir='${prefix}/var'
954 includedir='${prefix}/include'
955 oldincludedir='/usr/include'
956 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
957 infodir='${datarootdir}/info'
958 htmldir='${docdir}'
959 dvidir='${docdir}'
960 pdfdir='${docdir}'
961 psdir='${docdir}'
962 libdir='${exec_prefix}/lib'
963 localedir='${datarootdir}/locale'
964 mandir='${datarootdir}/man'
965
966 ac_prev=
967 ac_dashdash=
968 for ac_option
969 do
970 # If the previous option needs an argument, assign it.
971 if test -n "$ac_prev"; then
972 eval $ac_prev=\$ac_option
973 ac_prev=
974 continue
975 fi
976
977 case $ac_option in
978 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
979 *=) ac_optarg= ;;
980 *) ac_optarg=yes ;;
981 esac
982
983 # Accept the important Cygnus configure options, so we can diagnose typos.
984
985 case $ac_dashdash$ac_option in
986 --)
987 ac_dashdash=yes ;;
988
989 -bindir | --bindir | --bindi | --bind | --bin | --bi)
990 ac_prev=bindir ;;
991 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
992 bindir=$ac_optarg ;;
993
994 -build | --build | --buil | --bui | --bu)
995 ac_prev=build_alias ;;
996 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
997 build_alias=$ac_optarg ;;
998
999 -cache-file | --cache-file | --cache-fil | --cache-fi \
1000 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1001 ac_prev=cache_file ;;
1002 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1003 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1004 cache_file=$ac_optarg ;;
1005
1006 --config-cache | -C)
1007 cache_file=config.cache ;;
1008
1009 -datadir | --datadir | --datadi | --datad)
1010 ac_prev=datadir ;;
1011 -datadir=* | --datadir=* | --datadi=* | --datad=*)
1012 datadir=$ac_optarg ;;
1013
1014 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
1015 | --dataroo | --dataro | --datar)
1016 ac_prev=datarootdir ;;
1017 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
1018 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
1019 datarootdir=$ac_optarg ;;
1020
1021 -disable-* | --disable-*)
1022 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1023 # Reject names that are not valid shell variable names.
1024 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1025 as_fn_error $? "invalid feature name: $ac_useropt"
1026 ac_useropt_orig=$ac_useropt
1027 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1028 case $ac_user_opts in
1029 *"
1030 "enable_$ac_useropt"
1031 "*) ;;
1032 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1033 ac_unrecognized_sep=', ';;
1034 esac
1035 eval enable_$ac_useropt=no ;;
1036
1037 -docdir | --docdir | --docdi | --doc | --do)
1038 ac_prev=docdir ;;
1039 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1040 docdir=$ac_optarg ;;
1041
1042 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1043 ac_prev=dvidir ;;
1044 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1045 dvidir=$ac_optarg ;;
1046
1047 -enable-* | --enable-*)
1048 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1049 # Reject names that are not valid shell variable names.
1050 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1051 as_fn_error $? "invalid feature name: $ac_useropt"
1052 ac_useropt_orig=$ac_useropt
1053 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1054 case $ac_user_opts in
1055 *"
1056 "enable_$ac_useropt"
1057 "*) ;;
1058 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1059 ac_unrecognized_sep=', ';;
1060 esac
1061 eval enable_$ac_useropt=\$ac_optarg ;;
1062
1063 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1064 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1065 | --exec | --exe | --ex)
1066 ac_prev=exec_prefix ;;
1067 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1068 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1069 | --exec=* | --exe=* | --ex=*)
1070 exec_prefix=$ac_optarg ;;
1071
1072 -gas | --gas | --ga | --g)
1073 # Obsolete; use --with-gas.
1074 with_gas=yes ;;
1075
1076 -help | --help | --hel | --he | -h)
1077 ac_init_help=long ;;
1078 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1079 ac_init_help=recursive ;;
1080 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1081 ac_init_help=short ;;
1082
1083 -host | --host | --hos | --ho)
1084 ac_prev=host_alias ;;
1085 -host=* | --host=* | --hos=* | --ho=*)
1086 host_alias=$ac_optarg ;;
1087
1088 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1089 ac_prev=htmldir ;;
1090 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1091 | --ht=*)
1092 htmldir=$ac_optarg ;;
1093
1094 -includedir | --includedir | --includedi | --included | --include \
1095 | --includ | --inclu | --incl | --inc)
1096 ac_prev=includedir ;;
1097 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1098 | --includ=* | --inclu=* | --incl=* | --inc=*)
1099 includedir=$ac_optarg ;;
1100
1101 -infodir | --infodir | --infodi | --infod | --info | --inf)
1102 ac_prev=infodir ;;
1103 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1104 infodir=$ac_optarg ;;
1105
1106 -libdir | --libdir | --libdi | --libd)
1107 ac_prev=libdir ;;
1108 -libdir=* | --libdir=* | --libdi=* | --libd=*)
1109 libdir=$ac_optarg ;;
1110
1111 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1112 | --libexe | --libex | --libe)
1113 ac_prev=libexecdir ;;
1114 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1115 | --libexe=* | --libex=* | --libe=*)
1116 libexecdir=$ac_optarg ;;
1117
1118 -localedir | --localedir | --localedi | --localed | --locale)
1119 ac_prev=localedir ;;
1120 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1121 localedir=$ac_optarg ;;
1122
1123 -localstatedir | --localstatedir | --localstatedi | --localstated \
1124 | --localstate | --localstat | --localsta | --localst | --locals)
1125 ac_prev=localstatedir ;;
1126 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1127 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1128 localstatedir=$ac_optarg ;;
1129
1130 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1131 ac_prev=mandir ;;
1132 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1133 mandir=$ac_optarg ;;
1134
1135 -nfp | --nfp | --nf)
1136 # Obsolete; use --without-fp.
1137 with_fp=no ;;
1138
1139 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1140 | --no-cr | --no-c | -n)
1141 no_create=yes ;;
1142
1143 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1144 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1145 no_recursion=yes ;;
1146
1147 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1148 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1149 | --oldin | --oldi | --old | --ol | --o)
1150 ac_prev=oldincludedir ;;
1151 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1152 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1153 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1154 oldincludedir=$ac_optarg ;;
1155
1156 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1157 ac_prev=prefix ;;
1158 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1159 prefix=$ac_optarg ;;
1160
1161 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1162 | --program-pre | --program-pr | --program-p)
1163 ac_prev=program_prefix ;;
1164 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1165 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1166 program_prefix=$ac_optarg ;;
1167
1168 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1169 | --program-suf | --program-su | --program-s)
1170 ac_prev=program_suffix ;;
1171 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1172 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1173 program_suffix=$ac_optarg ;;
1174
1175 -program-transform-name | --program-transform-name \
1176 | --program-transform-nam | --program-transform-na \
1177 | --program-transform-n | --program-transform- \
1178 | --program-transform | --program-transfor \
1179 | --program-transfo | --program-transf \
1180 | --program-trans | --program-tran \
1181 | --progr-tra | --program-tr | --program-t)
1182 ac_prev=program_transform_name ;;
1183 -program-transform-name=* | --program-transform-name=* \
1184 | --program-transform-nam=* | --program-transform-na=* \
1185 | --program-transform-n=* | --program-transform-=* \
1186 | --program-transform=* | --program-transfor=* \
1187 | --program-transfo=* | --program-transf=* \
1188 | --program-trans=* | --program-tran=* \
1189 | --progr-tra=* | --program-tr=* | --program-t=*)
1190 program_transform_name=$ac_optarg ;;
1191
1192 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1193 ac_prev=pdfdir ;;
1194 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1195 pdfdir=$ac_optarg ;;
1196
1197 -psdir | --psdir | --psdi | --psd | --ps)
1198 ac_prev=psdir ;;
1199 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1200 psdir=$ac_optarg ;;
1201
1202 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1203 | -silent | --silent | --silen | --sile | --sil)
1204 silent=yes ;;
1205
1206 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1207 ac_prev=sbindir ;;
1208 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1209 | --sbi=* | --sb=*)
1210 sbindir=$ac_optarg ;;
1211
1212 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1213 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1214 | --sharedst | --shareds | --shared | --share | --shar \
1215 | --sha | --sh)
1216 ac_prev=sharedstatedir ;;
1217 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1218 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1219 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1220 | --sha=* | --sh=*)
1221 sharedstatedir=$ac_optarg ;;
1222
1223 -site | --site | --sit)
1224 ac_prev=site ;;
1225 -site=* | --site=* | --sit=*)
1226 site=$ac_optarg ;;
1227
1228 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1229 ac_prev=srcdir ;;
1230 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1231 srcdir=$ac_optarg ;;
1232
1233 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1234 | --syscon | --sysco | --sysc | --sys | --sy)
1235 ac_prev=sysconfdir ;;
1236 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1237 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1238 sysconfdir=$ac_optarg ;;
1239
1240 -target | --target | --targe | --targ | --tar | --ta | --t)
1241 ac_prev=target_alias ;;
1242 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1243 target_alias=$ac_optarg ;;
1244
1245 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1246 verbose=yes ;;
1247
1248 -version | --version | --versio | --versi | --vers | -V)
1249 ac_init_version=: ;;
1250
1251 -with-* | --with-*)
1252 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1253 # Reject names that are not valid shell variable names.
1254 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1255 as_fn_error $? "invalid package name: $ac_useropt"
1256 ac_useropt_orig=$ac_useropt
1257 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1258 case $ac_user_opts in
1259 *"
1260 "with_$ac_useropt"
1261 "*) ;;
1262 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1263 ac_unrecognized_sep=', ';;
1264 esac
1265 eval with_$ac_useropt=\$ac_optarg ;;
1266
1267 -without-* | --without-*)
1268 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1269 # Reject names that are not valid shell variable names.
1270 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1271 as_fn_error $? "invalid package name: $ac_useropt"
1272 ac_useropt_orig=$ac_useropt
1273 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1274 case $ac_user_opts in
1275 *"
1276 "with_$ac_useropt"
1277 "*) ;;
1278 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1279 ac_unrecognized_sep=', ';;
1280 esac
1281 eval with_$ac_useropt=no ;;
1282
1283 --x)
1284 # Obsolete; use --with-x.
1285 with_x=yes ;;
1286
1287 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1288 | --x-incl | --x-inc | --x-in | --x-i)
1289 ac_prev=x_includes ;;
1290 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1291 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1292 x_includes=$ac_optarg ;;
1293
1294 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1295 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1296 ac_prev=x_libraries ;;
1297 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1298 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1299 x_libraries=$ac_optarg ;;
1300
1301 -*) as_fn_error $? "unrecognized option: \`$ac_option'
1302 Try \`$0 --help' for more information"
1303 ;;
1304
1305 *=*)
1306 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1307 # Reject names that are not valid shell variable names.
1308 case $ac_envvar in #(
1309 '' | [0-9]* | *[!_$as_cr_alnum]* )
1310 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1311 esac
1312 eval $ac_envvar=\$ac_optarg
1313 export $ac_envvar ;;
1314
1315 *)
1316 # FIXME: should be removed in autoconf 3.0.
1317 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1318 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1319 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1320 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1321 ;;
1322
1323 esac
1324 done
1325
1326 if test -n "$ac_prev"; then
1327 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1328 as_fn_error $? "missing argument to $ac_option"
1329 fi
1330
1331 if test -n "$ac_unrecognized_opts"; then
1332 case $enable_option_checking in
1333 no) ;;
1334 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1335 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1336 esac
1337 fi
1338
1339 # Check all directory arguments for consistency.
1340 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1341 datadir sysconfdir sharedstatedir localstatedir includedir \
1342 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1343 libdir localedir mandir
1344 do
1345 eval ac_val=\$$ac_var
1346 # Remove trailing slashes.
1347 case $ac_val in
1348 */ )
1349 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1350 eval $ac_var=\$ac_val;;
1351 esac
1352 # Be sure to have absolute directory names.
1353 case $ac_val in
1354 [\\/$]* | ?:[\\/]* ) continue;;
1355 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1356 esac
1357 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1358 done
1359
1360 # There might be people who depend on the old broken behavior: `$host'
1361 # used to hold the argument of --host etc.
1362 # FIXME: To remove some day.
1363 build=$build_alias
1364 host=$host_alias
1365 target=$target_alias
1366
1367 # FIXME: To remove some day.
1368 if test "x$host_alias" != x; then
1369 if test "x$build_alias" = x; then
1370 cross_compiling=maybe
1371 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1372 If a cross compiler is detected then cross compile mode will be used" >&2
1373 elif test "x$build_alias" != "x$host_alias"; then
1374 cross_compiling=yes
1375 fi
1376 fi
1377
1378 ac_tool_prefix=
1379 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1380
1381 test "$silent" = yes && exec 6>/dev/null
1382
1383
1384 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1385 ac_ls_di=`ls -di .` &&
1386 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1387 as_fn_error $? "working directory cannot be determined"
1388 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1389 as_fn_error $? "pwd does not report name of working directory"
1390
1391
1392 # Find the source files, if location was not specified.
1393 if test -z "$srcdir"; then
1394 ac_srcdir_defaulted=yes
1395 # Try the directory containing this script, then the parent directory.
1396 ac_confdir=`$as_dirname -- "$as_myself" ||
1397 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1398 X"$as_myself" : 'X\(//\)[^/]' \| \
1399 X"$as_myself" : 'X\(//\)$' \| \
1400 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1401 $as_echo X"$as_myself" |
1402 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1403 s//\1/
1404 q
1405 }
1406 /^X\(\/\/\)[^/].*/{
1407 s//\1/
1408 q
1409 }
1410 /^X\(\/\/\)$/{
1411 s//\1/
1412 q
1413 }
1414 /^X\(\/\).*/{
1415 s//\1/
1416 q
1417 }
1418 s/.*/./; q'`
1419 srcdir=$ac_confdir
1420 if test ! -r "$srcdir/$ac_unique_file"; then
1421 srcdir=..
1422 fi
1423 else
1424 ac_srcdir_defaulted=no
1425 fi
1426 if test ! -r "$srcdir/$ac_unique_file"; then
1427 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1428 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1429 fi
1430 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1431 ac_abs_confdir=`(
1432 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1433 pwd)`
1434 # When building in place, set srcdir=.
1435 if test "$ac_abs_confdir" = "$ac_pwd"; then
1436 srcdir=.
1437 fi
1438 # Remove unnecessary trailing slashes from srcdir.
1439 # Double slashes in file names in object file debugging info
1440 # mess up M-x gdb in Emacs.
1441 case $srcdir in
1442 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1443 esac
1444 for ac_var in $ac_precious_vars; do
1445 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1446 eval ac_env_${ac_var}_value=\$${ac_var}
1447 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1448 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1449 done
1450
1451 #
1452 # Report the --help message.
1453 #
1454 if test "$ac_init_help" = "long"; then
1455 # Omit some internal or obsolete options to make the list less imposing.
1456 # This message is too long to be a string in the A/UX 3.1 sh.
1457 cat <<_ACEOF
1458 \`configure' configures telepathy-ring 2.1.0 to adapt to many kinds of systems.
1459
1460 Usage: $0 [OPTION]... [VAR=VALUE]...
1461
1462 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1463 VAR=VALUE. See below for descriptions of some of the useful variables.
1464
1465 Defaults for the options are specified in brackets.
1466
1467 Configuration:
1468 -h, --help display this help and exit
1469 --help=short display options specific to this package
1470 --help=recursive display the short help of all the included packages
1471 -V, --version display version information and exit
1472 -q, --quiet, --silent do not print \`checking ...' messages
1473 --cache-file=FILE cache test results in FILE [disabled]
1474 -C, --config-cache alias for \`--cache-file=config.cache'
1475 -n, --no-create do not create output files
1476 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1477
1478 Installation directories:
1479 --prefix=PREFIX install architecture-independent files in PREFIX
1480 [$ac_default_prefix]
1481 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1482 [PREFIX]
1483
1484 By default, \`make install' will install all the files in
1485 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1486 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1487 for instance \`--prefix=\$HOME'.
1488
1489 For better control, use the options below.
1490
1491 Fine tuning of the installation directories:
1492 --bindir=DIR user executables [EPREFIX/bin]
1493 --sbindir=DIR system admin executables [EPREFIX/sbin]
1494 --libexecdir=DIR program executables [EPREFIX/libexec]
1495 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1496 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1497 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1498 --libdir=DIR object code libraries [EPREFIX/lib]
1499 --includedir=DIR C header files [PREFIX/include]
1500 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1501 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1502 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1503 --infodir=DIR info documentation [DATAROOTDIR/info]
1504 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1505 --mandir=DIR man documentation [DATAROOTDIR/man]
1506 --docdir=DIR documentation root [DATAROOTDIR/doc/telepathy-ring]
1507 --htmldir=DIR html documentation [DOCDIR]
1508 --dvidir=DIR dvi documentation [DOCDIR]
1509 --pdfdir=DIR pdf documentation [DOCDIR]
1510 --psdir=DIR ps documentation [DOCDIR]
1511 _ACEOF
1512
1513 cat <<\_ACEOF
1514
1515 Program names:
1516 --program-prefix=PREFIX prepend PREFIX to installed program names
1517 --program-suffix=SUFFIX append SUFFIX to installed program names
1518 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1519
1520 System types:
1521 --build=BUILD configure for building on BUILD [guessed]
1522 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1523 _ACEOF
1524 fi
1525
1526 if test -n "$ac_init_help"; then
1527 case $ac_init_help in
1528 short | recursive ) echo "Configuration of telepathy-ring 2.1.0:";;
1529 esac
1530 cat <<\_ACEOF
1531
1532 Optional Features:
1533 --disable-option-checking ignore unrecognized --enable/--with options
1534 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1535 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1536 --enable-silent-rules less verbose build output (undo: `make V=1')
1537 --disable-silent-rules verbose build output (undo: `make V=0')
1538 --disable-dependency-tracking speeds up one-time build
1539 --enable-dependency-tracking do not reject slow dependency extractors
1540 --enable-shared[=PKGS] build shared libraries [default=no]
1541 --enable-static[=PKGS] build static libraries [default=yes]
1542 --enable-fast-install[=PKGS]
1543 optimize for fast installation [default=yes]
1544 --disable-libtool-lock avoid locking (might break parallel builds)
1545 --enable-maintainer-mode enable make rules and dependencies not useful
1546 (and sometimes confusing) to the casual installer
1547 --disable-debug omit debug code
1548
1549 Optional Packages:
1550 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1551 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1552 --with-pic try to use only PIC/non-PIC objects [default=use
1553 both]
1554 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1555
1556 Some influential environment variables:
1557 CC C compiler command
1558 CFLAGS C compiler flags
1559 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1560 nonstandard directory <lib dir>
1561 LIBS libraries to pass to the linker, e.g. -l<library>
1562 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1563 you have headers in a nonstandard directory <include dir>
1564 CPP C preprocessor
1565 PKG_CONFIG path to pkg-config utility
1566 PKG_CONFIG_PATH
1567 directories to add to pkg-config's search path
1568 PKG_CONFIG_LIBDIR
1569 path overriding pkg-config's built-in search path
1570 GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
1571 GLIB_LIBS linker flags for GLIB, overriding pkg-config
1572 CHECK_CFLAGS
1573 C compiler flags for CHECK, overriding pkg-config
1574 CHECK_LIBS linker flags for CHECK, overriding pkg-config
1575 DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config
1576 DBUS_LIBS linker flags for DBUS, overriding pkg-config
1577 UUID_CFLAGS C compiler flags for UUID, overriding pkg-config
1578 UUID_LIBS linker flags for UUID, overriding pkg-config
1579 TP_CFLAGS C compiler flags for TP, overriding pkg-config
1580 TP_LIBS linker flags for TP, overriding pkg-config
1581
1582 Use these variables to override the choices made by `configure' or to help
1583 it to find libraries and programs with nonstandard names/locations.
1584
1585 Report bugs to the package provider.
1586 _ACEOF
1587 ac_status=$?
1588 fi
1589
1590 if test "$ac_init_help" = "recursive"; then
1591 # If there are subdirs, report their specific --help.
1592 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1593 test -d "$ac_dir" ||
1594 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1595 continue
1596 ac_builddir=.
1597
1598 case "$ac_dir" in
1599 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1600 *)
1601 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1602 # A ".." for each directory in $ac_dir_suffix.
1603 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1604 case $ac_top_builddir_sub in
1605 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1606 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1607 esac ;;
1608 esac
1609 ac_abs_top_builddir=$ac_pwd
1610 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1611 # for backward compatibility:
1612 ac_top_builddir=$ac_top_build_prefix
1613
1614 case $srcdir in
1615 .) # We are building in place.
1616 ac_srcdir=.
1617 ac_top_srcdir=$ac_top_builddir_sub
1618 ac_abs_top_srcdir=$ac_pwd ;;
1619 [\\/]* | ?:[\\/]* ) # Absolute name.
1620 ac_srcdir=$srcdir$ac_dir_suffix;
1621 ac_top_srcdir=$srcdir
1622 ac_abs_top_srcdir=$srcdir ;;
1623 *) # Relative name.
1624 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1625 ac_top_srcdir=$ac_top_build_prefix$srcdir
1626 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1627 esac
1628 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1629
1630 cd "$ac_dir" || { ac_status=$?; continue; }
1631 # Check for guested configure.
1632 if test -f "$ac_srcdir/configure.gnu"; then
1633 echo &&
1634 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1635 elif test -f "$ac_srcdir/configure"; then
1636 echo &&
1637 $SHELL "$ac_srcdir/configure" --help=recursive
1638 else
1639 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1640 fi || ac_status=$?
1641 cd "$ac_pwd" || { ac_status=$?; break; }
1642 done
1643 fi
1644
1645 test -n "$ac_init_help" && exit $ac_status
1646 if $ac_init_version; then
1647 cat <<\_ACEOF
1648 telepathy-ring configure 2.1.0
1649 generated by GNU Autoconf 2.67
1650
1651 Copyright (C) 2010 Free Software Foundation, Inc.
1652 This configure script is free software; the Free Software Foundation
1653 gives unlimited permission to copy, distribute and modify it.
1654 _ACEOF
1655 exit
1656 fi
1657
1658 ## ------------------------ ##
1659 ## Autoconf initialization. ##
1660 ## ------------------------ ##
1661
1662 # ac_fn_c_try_compile LINENO
1663 # --------------------------
1664 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1665 ac_fn_c_try_compile ()
1666 {
1667 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1668 rm -f conftest.$ac_objext
1669 if { { ac_try="$ac_compile"
1670 case "(($ac_try" in
1671 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1672 *) ac_try_echo=$ac_try;;
1673 esac
1674 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1675 $as_echo "$ac_try_echo"; } >&5
1676 (eval "$ac_compile") 2>conftest.err
1677 ac_status=$?
1678 if test -s conftest.err; then
1679 grep -v '^ *+' conftest.err >conftest.er1
1680 cat conftest.er1 >&5
1681 mv -f conftest.er1 conftest.err
1682 fi
1683 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1684 test $ac_status = 0; } && {
1685 test -z "$ac_c_werror_flag" ||
1686 test ! -s conftest.err
1687 } && test -s conftest.$ac_objext; then :
1688 ac_retval=0
1689 else
1690 $as_echo "$as_me: failed program was:" >&5
1691 sed 's/^/| /' conftest.$ac_ext >&5
1692
1693 ac_retval=1
1694 fi
1695 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1696 as_fn_set_status $ac_retval
1697
1698 } # ac_fn_c_try_compile
1699
1700 # ac_fn_c_try_link LINENO
1701 # -----------------------
1702 # Try to link conftest.$ac_ext, and return whether this succeeded.
1703 ac_fn_c_try_link ()
1704 {
1705 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1706 rm -f conftest.$ac_objext conftest$ac_exeext
1707 if { { ac_try="$ac_link"
1708 case "(($ac_try" in
1709 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1710 *) ac_try_echo=$ac_try;;
1711 esac
1712 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1713 $as_echo "$ac_try_echo"; } >&5
1714 (eval "$ac_link") 2>conftest.err
1715 ac_status=$?
1716 if test -s conftest.err; then
1717 grep -v '^ *+' conftest.err >conftest.er1
1718 cat conftest.er1 >&5
1719 mv -f conftest.er1 conftest.err
1720 fi
1721 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1722 test $ac_status = 0; } && {
1723 test -z "$ac_c_werror_flag" ||
1724 test ! -s conftest.err
1725 } && test -s conftest$ac_exeext && {
1726 test "$cross_compiling" = yes ||
1727 $as_test_x conftest$ac_exeext
1728 }; then :
1729 ac_retval=0
1730 else
1731 $as_echo "$as_me: failed program was:" >&5
1732 sed 's/^/| /' conftest.$ac_ext >&5
1733
1734 ac_retval=1
1735 fi
1736 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1737 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1738 # interfere with the next link command; also delete a directory that is
1739 # left behind by Apple's compiler. We do this before executing the actions.
1740 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1741 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1742 as_fn_set_status $ac_retval
1743
1744 } # ac_fn_c_try_link
1745
1746 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1747 # -------------------------------------------------------
1748 # Tests whether HEADER exists and can be compiled using the include files in
1749 # INCLUDES, setting the cache variable VAR accordingly.
1750 ac_fn_c_check_header_compile ()
1751 {
1752 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1753 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1754 $as_echo_n "checking for $2... " >&6; }
1755 if eval "test \"\${$3+set}\"" = set; then :
1756 $as_echo_n "(cached) " >&6
1757 else
1758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1759 /* end confdefs.h. */
1760 $4
1761 #include <$2>
1762 _ACEOF
1763 if ac_fn_c_try_compile "$LINENO"; then :
1764 eval "$3=yes"
1765 else
1766 eval "$3=no"
1767 fi
1768 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1769 fi
1770 eval ac_res=\$$3
1771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1772 $as_echo "$ac_res" >&6; }
1773 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1774
1775 } # ac_fn_c_check_header_compile
1776
1777 # ac_fn_c_try_cpp LINENO
1778 # ----------------------
1779 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1780 ac_fn_c_try_cpp ()
1781 {
1782 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1783 if { { ac_try="$ac_cpp conftest.$ac_ext"
1784 case "(($ac_try" in
1785 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1786 *) ac_try_echo=$ac_try;;
1787 esac
1788 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1789 $as_echo "$ac_try_echo"; } >&5
1790 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1791 ac_status=$?
1792 if test -s conftest.err; then
1793 grep -v '^ *+' conftest.err >conftest.er1
1794 cat conftest.er1 >&5
1795 mv -f conftest.er1 conftest.err
1796 fi
1797 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1798 test $ac_status = 0; } > conftest.i && {
1799 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1800 test ! -s conftest.err
1801 }; then :
1802 ac_retval=0
1803 else
1804 $as_echo "$as_me: failed program was:" >&5
1805 sed 's/^/| /' conftest.$ac_ext >&5
1806
1807 ac_retval=1
1808 fi
1809 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1810 as_fn_set_status $ac_retval
1811
1812 } # ac_fn_c_try_cpp
1813
1814 # ac_fn_c_try_run LINENO
1815 # ----------------------
1816 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1817 # that executables *can* be run.
1818 ac_fn_c_try_run ()
1819 {
1820 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1821 if { { ac_try="$ac_link"
1822 case "(($ac_try" in
1823 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1824 *) ac_try_echo=$ac_try;;
1825 esac
1826 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1827 $as_echo "$ac_try_echo"; } >&5
1828 (eval "$ac_link") 2>&5
1829 ac_status=$?
1830 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1831 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1832 { { case "(($ac_try" in
1833 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1834 *) ac_try_echo=$ac_try;;
1835 esac
1836 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1837 $as_echo "$ac_try_echo"; } >&5
1838 (eval "$ac_try") 2>&5
1839 ac_status=$?
1840 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1841 test $ac_status = 0; }; }; then :
1842 ac_retval=0
1843 else
1844 $as_echo "$as_me: program exited with status $ac_status" >&5
1845 $as_echo "$as_me: failed program was:" >&5
1846 sed 's/^/| /' conftest.$ac_ext >&5
1847
1848 ac_retval=$ac_status
1849 fi
1850 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1851 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1852 as_fn_set_status $ac_retval
1853
1854 } # ac_fn_c_try_run
1855
1856 # ac_fn_c_check_func LINENO FUNC VAR
1857 # ----------------------------------
1858 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1859 ac_fn_c_check_func ()
1860 {
1861 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1862 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1863 $as_echo_n "checking for $2... " >&6; }
1864 if eval "test \"\${$3+set}\"" = set; then :
1865 $as_echo_n "(cached) " >&6
1866 else
1867 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1868 /* end confdefs.h. */
1869 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1870 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1871 #define $2 innocuous_$2
1872
1873 /* System header to define __stub macros and hopefully few prototypes,
1874 which can conflict with char $2 (); below.
1875 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1876 <limits.h> exists even on freestanding compilers. */
1877
1878 #ifdef __STDC__
1879 # include <limits.h>
1880 #else
1881 # include <assert.h>
1882 #endif
1883
1884 #undef $2
1885
1886 /* Override any GCC internal prototype to avoid an error.
1887 Use char because int might match the return type of a GCC
1888 builtin and then its argument prototype would still apply. */
1889 #ifdef __cplusplus
1890 extern "C"
1891 #endif
1892 char $2 ();
1893 /* The GNU C library defines this for functions which it implements
1894 to always fail with ENOSYS. Some functions are actually named
1895 something starting with __ and the normal name is an alias. */
1896 #if defined __stub_$2 || defined __stub___$2
1897 choke me
1898 #endif
1899
1900 int
1901 main ()
1902 {
1903 return $2 ();
1904 ;
1905 return 0;
1906 }
1907 _ACEOF
1908 if ac_fn_c_try_link "$LINENO"; then :
1909 eval "$3=yes"
1910 else
1911 eval "$3=no"
1912 fi
1913 rm -f core conftest.err conftest.$ac_objext \
1914 conftest$ac_exeext conftest.$ac_ext
1915 fi
1916 eval ac_res=\$$3
1917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1918 $as_echo "$ac_res" >&6; }
1919 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
1920
1921 } # ac_fn_c_check_func
1922 cat >config.log <<_ACEOF
1923 This file contains any messages produced by compilers while
1924 running configure, to aid debugging if configure makes a mistake.
1925
1926 It was created by telepathy-ring $as_me 2.1.0, which was
1927 generated by GNU Autoconf 2.67. Invocation command line was
1928
1929 $ $0 $@
1930
1931 _ACEOF
1932 exec 5>>config.log
1933 {
1934 cat <<_ASUNAME
1935 ## --------- ##
1936 ## Platform. ##
1937 ## --------- ##
1938
1939 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1940 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1941 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1942 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1943 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1944
1945 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1946 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1947
1948 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1949 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1950 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1951 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1952 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1953 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1954 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1955
1956 _ASUNAME
1957
1958 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1959 for as_dir in $PATH
1960 do
1961 IFS=$as_save_IFS
1962 test -z "$as_dir" && as_dir=.
1963 $as_echo "PATH: $as_dir"
1964 done
1965 IFS=$as_save_IFS
1966
1967 } >&5
1968
1969 cat >&5 <<_ACEOF
1970
1971
1972 ## ----------- ##
1973 ## Core tests. ##
1974 ## ----------- ##
1975
1976 _ACEOF
1977
1978
1979 # Keep a trace of the command line.
1980 # Strip out --no-create and --no-recursion so they do not pile up.
1981 # Strip out --silent because we don't want to record it for future runs.
1982 # Also quote any args containing shell meta-characters.
1983 # Make two passes to allow for proper duplicate-argument suppression.
1984 ac_configure_args=
1985 ac_configure_args0=
1986 ac_configure_args1=
1987 ac_must_keep_next=false
1988 for ac_pass in 1 2
1989 do
1990 for ac_arg
1991 do
1992 case $ac_arg in
1993 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1994 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1995 | -silent | --silent | --silen | --sile | --sil)
1996 continue ;;
1997 *\'*)
1998 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1999 esac
2000 case $ac_pass in
2001 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2002 2)
2003 as_fn_append ac_configure_args1 " '$ac_arg'"
2004 if test $ac_must_keep_next = true; then
2005 ac_must_keep_next=false # Got value, back to normal.
2006 else
2007 case $ac_arg in
2008 *=* | --config-cache | -C | -disable-* | --disable-* \
2009 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2010 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2011 | -with-* | --with-* | -without-* | --without-* | --x)
2012 case "$ac_configure_args0 " in
2013 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2014 esac
2015 ;;
2016 -* ) ac_must_keep_next=true ;;
2017 esac
2018 fi
2019 as_fn_append ac_configure_args " '$ac_arg'"
2020 ;;
2021 esac
2022 done
2023 done
2024 { ac_configure_args0=; unset ac_configure_args0;}
2025 { ac_configure_args1=; unset ac_configure_args1;}
2026
2027 # When interrupted or exit'd, cleanup temporary files, and complete
2028 # config.log. We remove comments because anyway the quotes in there
2029 # would cause problems or look ugly.
2030 # WARNING: Use '\'' to represent an apostrophe within the trap.
2031 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2032 trap 'exit_status=$?
2033 # Save into config.log some information that might help in debugging.
2034 {
2035 echo
2036
2037 $as_echo "## ---------------- ##
2038 ## Cache variables. ##
2039 ## ---------------- ##"
2040 echo
2041 # The following way of writing the cache mishandles newlines in values,
2042 (
2043 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2044 eval ac_val=\$$ac_var
2045 case $ac_val in #(
2046 *${as_nl}*)
2047 case $ac_var in #(
2048 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2049 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2050 esac
2051 case $ac_var in #(
2052 _ | IFS | as_nl) ;; #(
2053 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2054 *) { eval $ac_var=; unset $ac_var;} ;;
2055 esac ;;
2056 esac
2057 done
2058 (set) 2>&1 |
2059 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2060 *${as_nl}ac_space=\ *)
2061 sed -n \
2062 "s/'\''/'\''\\\\'\'''\''/g;
2063 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2064 ;; #(
2065 *)
2066 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2067 ;;
2068 esac |
2069 sort
2070 )
2071 echo
2072
2073 $as_echo "## ----------------- ##
2074 ## Output variables. ##
2075 ## ----------------- ##"
2076 echo
2077 for ac_var in $ac_subst_vars
2078 do
2079 eval ac_val=\$$ac_var
2080 case $ac_val in
2081 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2082 esac
2083 $as_echo "$ac_var='\''$ac_val'\''"
2084 done | sort
2085 echo
2086
2087 if test -n "$ac_subst_files"; then
2088 $as_echo "## ------------------- ##
2089 ## File substitutions. ##
2090 ## ------------------- ##"
2091 echo
2092 for ac_var in $ac_subst_files
2093 do
2094 eval ac_val=\$$ac_var
2095 case $ac_val in
2096 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2097 esac
2098 $as_echo "$ac_var='\''$ac_val'\''"
2099 done | sort
2100 echo
2101 fi
2102
2103 if test -s confdefs.h; then
2104 $as_echo "## ----------- ##
2105 ## confdefs.h. ##
2106 ## ----------- ##"
2107 echo
2108 cat confdefs.h
2109 echo
2110 fi
2111 test "$ac_signal" != 0 &&
2112 $as_echo "$as_me: caught signal $ac_signal"
2113 $as_echo "$as_me: exit $exit_status"
2114 } >&5
2115 rm -f core *.core core.conftest.* &&
2116 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2117 exit $exit_status
2118 ' 0
2119 for ac_signal in 1 2 13 15; do
2120 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2121 done
2122 ac_signal=0
2123
2124 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2125 rm -f -r conftest* confdefs.h
2126
2127 $as_echo "/* confdefs.h */" > confdefs.h
2128
2129 # Predefined preprocessor variables.
2130
2131 cat >>confdefs.h <<_ACEOF
2132 #define PACKAGE_NAME "$PACKAGE_NAME"
2133 _ACEOF
2134
2135 cat >>confdefs.h <<_ACEOF
2136 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2137 _ACEOF
2138
2139 cat >>confdefs.h <<_ACEOF
2140 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2141 _ACEOF
2142
2143 cat >>confdefs.h <<_ACEOF
2144 #define PACKAGE_STRING "$PACKAGE_STRING"
2145 _ACEOF
2146
2147 cat >>confdefs.h <<_ACEOF
2148 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2149 _ACEOF
2150
2151 cat >>confdefs.h <<_ACEOF
2152 #define PACKAGE_URL "$PACKAGE_URL"
2153 _ACEOF
2154
2155
2156 # Let the site file select an alternate cache file if it wants to.
2157 # Prefer an explicitly selected file to automatically selected ones.
2158 ac_site_file1=NONE
2159 ac_site_file2=NONE
2160 if test -n "$CONFIG_SITE"; then
2161 # We do not want a PATH search for config.site.
2162 case $CONFIG_SITE in #((
2163 -*) ac_site_file1=./$CONFIG_SITE;;
2164 */*) ac_site_file1=$CONFIG_SITE;;
2165 *) ac_site_file1=./$CONFIG_SITE;;
2166 esac
2167 elif test "x$prefix" != xNONE; then
2168 ac_site_file1=$prefix/share/config.site
2169 ac_site_file2=$prefix/etc/config.site
2170 else
2171 ac_site_file1=$ac_default_prefix/share/config.site
2172 ac_site_file2=$ac_default_prefix/etc/config.site
2173 fi
2174 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2175 do
2176 test "x$ac_site_file" = xNONE && continue
2177 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2178 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2179 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2180 sed 's/^/| /' "$ac_site_file" >&5
2181 . "$ac_site_file" \
2182 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2183 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2184 as_fn_error $? "failed to load site script $ac_site_file
2185 See \`config.log' for more details" "$LINENO" 5 ; }
2186 fi
2187 done
2188
2189 if test -r "$cache_file"; then
2190 # Some versions of bash will fail to source /dev/null (special files
2191 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
2192 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2193 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2194 $as_echo "$as_me: loading cache $cache_file" >&6;}
2195 case $cache_file in
2196 [\\/]* | ?:[\\/]* ) . "$cache_file";;
2197 *) . "./$cache_file";;
2198 esac
2199 fi
2200 else
2201 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2202 $as_echo "$as_me: creating cache $cache_file" >&6;}
2203 >$cache_file
2204 fi
2205
2206 # Check that the precious variables saved in the cache have kept the same
2207 # value.
2208 ac_cache_corrupted=false
2209 for ac_var in $ac_precious_vars; do
2210 eval ac_old_set=\$ac_cv_env_${ac_var}_set
2211 eval ac_new_set=\$ac_env_${ac_var}_set
2212 eval ac_old_val=\$ac_cv_env_${ac_var}_value
2213 eval ac_new_val=\$ac_env_${ac_var}_value
2214 case $ac_old_set,$ac_new_set in
2215 set,)
2216 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2217 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2218 ac_cache_corrupted=: ;;
2219 ,set)
2220 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2221 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2222 ac_cache_corrupted=: ;;
2223 ,);;
2224 *)
2225 if test "x$ac_old_val" != "x$ac_new_val"; then
2226 # differences in whitespace do not lead to failure.
2227 ac_old_val_w=`echo x $ac_old_val`
2228 ac_new_val_w=`echo x $ac_new_val`
2229 if test "$ac_old_val_w" != "$ac_new_val_w"; then
2230 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2231 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2232 ac_cache_corrupted=:
2233 else
2234 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2235 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2236 eval $ac_var=\$ac_old_val
2237 fi
2238 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
2239 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
2240 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
2241 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
2242 fi;;
2243 esac
2244 # Pass precious variables to config.status.
2245 if test "$ac_new_set" = set; then
2246 case $ac_new_val in
2247 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2248 *) ac_arg=$ac_var=$ac_new_val ;;
2249 esac
2250 case " $ac_configure_args " in
2251 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2252 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2253 esac
2254 fi
2255 done
2256 if $ac_cache_corrupted; then
2257 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2258 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2259 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2260 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2261 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2262 fi
2263 ## -------------------- ##
2264 ## Main body of script. ##
2265 ## -------------------- ##
2266
2267 ac_ext=c
2268 ac_cpp='$CPP $CPPFLAGS'
2269 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2270 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2271 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2272
2273
2274
2275 am__api_version='1.11'
2276
2277 ac_aux_dir=
2278 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2279 if test -f "$ac_dir/install-sh"; then
2280 ac_aux_dir=$ac_dir
2281 ac_install_sh="$ac_aux_dir/install-sh -c"
2282 break
2283 elif test -f "$ac_dir/install.sh"; then
2284 ac_aux_dir=$ac_dir
2285 ac_install_sh="$ac_aux_dir/install.sh -c"
2286 break
2287 elif test -f "$ac_dir/shtool"; then
2288 ac_aux_dir=$ac_dir
2289 ac_install_sh="$ac_aux_dir/shtool install -c"
2290 break
2291 fi
2292 done
2293 if test -z "$ac_aux_dir"; then
2294 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
2295 fi
2296
2297 # These three variables are undocumented and unsupported,
2298 # and are intended to be withdrawn in a future Autoconf release.
2299 # They can cause serious problems if a builder's source tree is in a directory
2300 # whose full name contains unusual characters.
2301 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
2302 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
2303 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
2304
2305
2306 # Find a good install program. We prefer a C program (faster),
2307 # so one script is as good as another. But avoid the broken or
2308 # incompatible versions:
2309 # SysV /etc/install, /usr/sbin/install
2310 # SunOS /usr/etc/install
2311 # IRIX /sbin/install
2312 # AIX /bin/install
2313 # AmigaOS /C/install, which installs bootblocks on floppy discs
2314 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2315 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2316 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2317 # OS/2's system install, which has a completely different semantic
2318 # ./install, which can be erroneously created by make from ./install.sh.
2319 # Reject install programs that cannot install multiple files.
2320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
2321 $as_echo_n "checking for a BSD-compatible install... " >&6; }
2322 if test -z "$INSTALL"; then
2323 if test "${ac_cv_path_install+set}" = set; then :
2324 $as_echo_n "(cached) " >&6
2325 else
2326 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2327 for as_dir in $PATH
2328 do
2329 IFS=$as_save_IFS
2330 test -z "$as_dir" && as_dir=.
2331 # Account for people who put trailing slashes in PATH elements.
2332 case $as_dir/ in #((
2333 ./ | .// | /[cC]/* | \
2334 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2335 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
2336 /usr/ucb/* ) ;;
2337 *)
2338 # OSF1 and SCO ODT 3.0 have their own names for install.
2339 # Don't use installbsd from OSF since it installs stuff as root
2340 # by default.
2341 for ac_prog in ginstall scoinst install; do
2342 for ac_exec_ext in '' $ac_executable_extensions; do
2343 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2344 if test $ac_prog = install &&
2345 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2346 # AIX install. It has an incompatible calling convention.
2347 :
2348 elif test $ac_prog = install &&
2349 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2350 # program-specific install script used by HP pwplus--don't use.
2351 :
2352 else
2353 rm -rf conftest.one conftest.two conftest.dir
2354 echo one > conftest.one
2355 echo two > conftest.two
2356 mkdir conftest.dir
2357 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2358 test -s conftest.one && test -s conftest.two &&
2359 test -s conftest.dir/conftest.one &&
2360 test -s conftest.dir/conftest.two
2361 then
2362 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2363 break 3
2364 fi
2365 fi
2366 fi
2367 done
2368 done
2369 ;;
2370 esac
2371
2372 done
2373 IFS=$as_save_IFS
2374
2375 rm -rf conftest.one conftest.two conftest.dir
2376
2377 fi
2378 if test "${ac_cv_path_install+set}" = set; then
2379 INSTALL=$ac_cv_path_install
2380 else
2381 # As a last resort, use the slow shell script. Don't cache a
2382 # value for INSTALL within a source directory, because that will
2383 # break other packages using the cache if that directory is
2384 # removed, or if the value is a relative name.
2385 INSTALL=$ac_install_sh
2386 fi
2387 fi
2388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
2389 $as_echo "$INSTALL" >&6; }
2390
2391 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2392 # It thinks the first close brace ends the variable substitution.
2393 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2394
2395 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2396
2397 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2398
2399 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2400 $as_echo_n "checking whether build environment is sane... " >&6; }
2401 # Just in case
2402 sleep 1
2403 echo timestamp > conftest.file
2404 # Reject unsafe characters in $srcdir or the absolute working directory
2405 # name. Accept space and tab only in the latter.
2406 am_lf='
2407 '
2408 case `pwd` in
2409 *[\\\"\#\$\&\'\`$am_lf]*)
2410 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
2411 esac
2412 case $srcdir in
2413 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2414 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
2415 esac
2416
2417 # Do `set' in a subshell so we don't clobber the current shell's
2418 # arguments. Must try -L first in case configure is actually a
2419 # symlink; some systems play weird games with the mod time of symlinks
2420 # (eg FreeBSD returns the mod time of the symlink's containing
2421 # directory).
2422 if (
2423 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2424 if test "$*" = "X"; then
2425 # -L didn't work.
2426 set X `ls -t "$srcdir/configure" conftest.file`
2427 fi
2428 rm -f conftest.file
2429 if test "$*" != "X $srcdir/configure conftest.file" \
2430 && test "$*" != "X conftest.file $srcdir/configure"; then
2431
2432 # If neither matched, then we have a broken ls. This can happen
2433 # if, for instance, CONFIG_SHELL is bash and it inherits a
2434 # broken ls alias from the environment. This has actually
2435 # happened. Such a system could not be considered "sane".
2436 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
2437 alias in your environment" "$LINENO" 5
2438 fi
2439
2440 test "$2" = conftest.file
2441 )
2442 then
2443 # Ok.
2444 :
2445 else
2446 as_fn_error $? "newly created file is older than distributed files!
2447 Check your system clock" "$LINENO" 5
2448 fi
2449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2450 $as_echo "yes" >&6; }
2451 test "$program_prefix" != NONE &&
2452 program_transform_name="s&^&$program_prefix&;$program_transform_name"
2453 # Use a double $ so make ignores it.
2454 test "$program_suffix" != NONE &&
2455 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2456 # Double any \ or $.
2457 # By default was `s,x,x', remove it if useless.
2458 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2459 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2460
2461 # expand $ac_aux_dir to an absolute path
2462 am_aux_dir=`cd $ac_aux_dir && pwd`
2463
2464 if test x"${MISSING+set}" != xset; then
2465 case $am_aux_dir in
2466 *\ * | *\ *)
2467 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2468 *)
2469 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2470 esac
2471 fi
2472 # Use eval to expand $SHELL
2473 if eval "$MISSING --run true"; then
2474 am_missing_run="$MISSING --run "
2475 else
2476 am_missing_run=
2477 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
2478 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
2479 fi
2480
2481 if test x"${install_sh}" != xset; then
2482 case $am_aux_dir in
2483 *\ * | *\ *)
2484 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2485 *)
2486 install_sh="\${SHELL} $am_aux_dir/install-sh"
2487 esac
2488 fi
2489
2490 # Installed binaries are usually stripped using `strip' when the user
2491 # run `make install-strip'. However `strip' might not be the right
2492 # tool to use in cross-compilation environments, therefore Automake
2493 # will honor the `STRIP' environment variable to overrule this program.
2494 if test "$cross_compiling" != no; then
2495 if test -n "$ac_tool_prefix"; then
2496 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2497 set dummy ${ac_tool_prefix}strip; ac_word=$2
2498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2499 $as_echo_n "checking for $ac_word... " >&6; }
2500 if test "${ac_cv_prog_STRIP+set}" = set; then :
2501 $as_echo_n "(cached) " >&6
2502 else
2503 if test -n "$STRIP"; then
2504 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2505 else
2506 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2507 for as_dir in $PATH
2508 do
2509 IFS=$as_save_IFS
2510 test -z "$as_dir" && as_dir=.
2511 for ac_exec_ext in '' $ac_executable_extensions; do
2512 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2513 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2514 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2515 break 2
2516 fi
2517 done
2518 done
2519 IFS=$as_save_IFS
2520
2521 fi
2522 fi
2523 STRIP=$ac_cv_prog_STRIP
2524 if test -n "$STRIP"; then
2525 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
2526 $as_echo "$STRIP" >&6; }
2527 else
2528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2529 $as_echo "no" >&6; }
2530 fi
2531
2532
2533 fi
2534 if test -z "$ac_cv_prog_STRIP"; then
2535 ac_ct_STRIP=$STRIP
2536 # Extract the first word of "strip", so it can be a program name with args.
2537 set dummy strip; ac_word=$2
2538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2539 $as_echo_n "checking for $ac_word... " >&6; }
2540 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
2541 $as_echo_n "(cached) " >&6
2542 else
2543 if test -n "$ac_ct_STRIP"; then
2544 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
2545 else
2546 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2547 for as_dir in $PATH
2548 do
2549 IFS=$as_save_IFS
2550 test -z "$as_dir" && as_dir=.
2551 for ac_exec_ext in '' $ac_executable_extensions; do
2552 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2553 ac_cv_prog_ac_ct_STRIP="strip"
2554 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2555 break 2
2556 fi
2557 done
2558 done
2559 IFS=$as_save_IFS
2560
2561 fi
2562 fi
2563 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
2564 if test -n "$ac_ct_STRIP"; then
2565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
2566 $as_echo "$ac_ct_STRIP" >&6; }
2567 else
2568 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2569 $as_echo "no" >&6; }
2570 fi
2571
2572 if test "x$ac_ct_STRIP" = x; then
2573 STRIP=":"
2574 else
2575 case $cross_compiling:$ac_tool_warned in
2576 yes:)
2577 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2578 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2579 ac_tool_warned=yes ;;
2580 esac
2581 STRIP=$ac_ct_STRIP
2582 fi
2583 else
2584 STRIP="$ac_cv_prog_STRIP"
2585 fi
2586
2587 fi
2588 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2589
2590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
2591 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
2592 if test -z "$MKDIR_P"; then
2593 if test "${ac_cv_path_mkdir+set}" = set; then :
2594 $as_echo_n "(cached) " >&6
2595 else
2596 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2597 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
2598 do
2599 IFS=$as_save_IFS
2600 test -z "$as_dir" && as_dir=.
2601 for ac_prog in mkdir gmkdir; do
2602 for ac_exec_ext in '' $ac_executable_extensions; do
2603 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
2604 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2605 'mkdir (GNU coreutils) '* | \
2606 'mkdir (coreutils) '* | \
2607 'mkdir (fileutils) '4.1*)
2608 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
2609 break 3;;
2610 esac
2611 done
2612 done
2613 done
2614 IFS=$as_save_IFS
2615
2616 fi
2617
2618 test -d ./--version && rmdir ./--version
2619 if test "${ac_cv_path_mkdir+set}" = set; then
2620 MKDIR_P="$ac_cv_path_mkdir -p"
2621 else
2622 # As a last resort, use the slow shell script. Don't cache a
2623 # value for MKDIR_P within a source directory, because that will
2624 # break other packages using the cache if that directory is
2625 # removed, or if the value is a relative name.
2626 MKDIR_P="$ac_install_sh -d"
2627 fi
2628 fi
2629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
2630 $as_echo "$MKDIR_P" >&6; }
2631
2632 mkdir_p="$MKDIR_P"
2633 case $mkdir_p in
2634 [\\/$]* | ?:[\\/]*) ;;
2635 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2636 esac
2637
2638 for ac_prog in gawk mawk nawk awk
2639 do
2640 # Extract the first word of "$ac_prog", so it can be a program name with args.
2641 set dummy $ac_prog; ac_word=$2
2642 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2643 $as_echo_n "checking for $ac_word... " >&6; }
2644 if test "${ac_cv_prog_AWK+set}" = set; then :
2645 $as_echo_n "(cached) " >&6
2646 else
2647 if test -n "$AWK"; then
2648 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2649 else
2650 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2651 for as_dir in $PATH
2652 do
2653 IFS=$as_save_IFS
2654 test -z "$as_dir" && as_dir=.
2655 for ac_exec_ext in '' $ac_executable_extensions; do
2656 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2657 ac_cv_prog_AWK="$ac_prog"
2658 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2659 break 2
2660 fi
2661 done
2662 done
2663 IFS=$as_save_IFS
2664
2665 fi
2666 fi
2667 AWK=$ac_cv_prog_AWK
2668 if test -n "$AWK"; then
2669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
2670 $as_echo "$AWK" >&6; }
2671 else
2672 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2673 $as_echo "no" >&6; }
2674 fi
2675
2676
2677 test -n "$AWK" && break
2678 done
2679
2680 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2681 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
2682 set x ${MAKE-make}
2683 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2684 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
2685 $as_echo_n "(cached) " >&6
2686 else
2687 cat >conftest.make <<\_ACEOF
2688 SHELL = /bin/sh
2689 all:
2690 @echo '@@@%%%=$(MAKE)=@@@%%%'
2691 _ACEOF
2692 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
2693 case `${MAKE-make} -f conftest.make 2>/dev/null` in
2694 *@@@%%%=?*=@@@%%%*)
2695 eval ac_cv_prog_make_${ac_make}_set=yes;;
2696 *)
2697 eval ac_cv_prog_make_${ac_make}_set=no;;
2698 esac
2699 rm -f conftest.make
2700 fi
2701 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2702 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2703 $as_echo "yes" >&6; }
2704 SET_MAKE=
2705 else
2706 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2707 $as_echo "no" >&6; }
2708 SET_MAKE="MAKE=${MAKE-make}"
2709 fi
2710
2711 rm -rf .tst 2>/dev/null
2712 mkdir .tst 2>/dev/null
2713 if test -d .tst; then
2714 am__leading_dot=.
2715 else
2716 am__leading_dot=_
2717 fi
2718 rmdir .tst 2>/dev/null
2719
2720 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2721 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2722 # is not polluted with repeated "-I."
2723 am__isrc=' -I$(srcdir)'
2724 # test to see if srcdir already configured
2725 if test -f $srcdir/config.status; then
2726 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
2727 fi
2728 fi
2729
2730 # test whether we have cygpath
2731 if test -z "$CYGPATH_W"; then
2732 if (cygpath --version) >/dev/null 2>/dev/null; then
2733 CYGPATH_W='cygpath -w'
2734 else
2735 CYGPATH_W=echo
2736 fi
2737 fi
2738
2739
2740 # Define the identity of the package.
2741 PACKAGE='telepathy-ring'
2742 VERSION='2.1.0'
2743
2744
2745 cat >>confdefs.h <<_ACEOF
2746 #define PACKAGE "$PACKAGE"
2747 _ACEOF
2748
2749
2750 cat >>confdefs.h <<_ACEOF
2751 #define VERSION "$VERSION"
2752 _ACEOF
2753
2754 # Some tools Automake needs.
2755
2756 ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
2757
2758
2759 AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
2760
2761
2762 AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
2763
2764
2765 AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2766
2767
2768 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2769
2770 # We need awk for the "check" target. The system "awk" is bad on
2771 # some platforms.
2772 # Always define AMTAR for backward compatibility.
2773
2774 AMTAR=${AMTAR-"${am_missing_run}tar"}
2775
2776 am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
2777
2778
2779
2780
2781
2782 # Check whether --enable-silent-rules was given.
2783 if test "${enable_silent_rules+set}" = set; then :
2784 enableval=$enable_silent_rules;
2785 fi
2786
2787 case $enable_silent_rules in
2788 yes) AM_DEFAULT_VERBOSITY=0;;
2789 no) AM_DEFAULT_VERBOSITY=1;;
2790 *) AM_DEFAULT_VERBOSITY=1;;
2791 esac
2792 AM_BACKSLASH='\'
2793
2794
2795
2796
2797 ac_config_headers="$ac_config_headers config.h"
2798
2799
2800 ac_ext=c
2801 ac_cpp='$CPP $CPPFLAGS'
2802 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2803 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2804 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2805 if test -n "$ac_tool_prefix"; then
2806 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2807 set dummy ${ac_tool_prefix}gcc; ac_word=$2
2808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2809 $as_echo_n "checking for $ac_word... " >&6; }
2810 if test "${ac_cv_prog_CC+set}" = set; then :
2811 $as_echo_n "(cached) " >&6
2812 else
2813 if test -n "$CC"; then
2814 ac_cv_prog_CC="$CC" # Let the user override the test.
2815 else
2816 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2817 for as_dir in $PATH
2818 do
2819 IFS=$as_save_IFS
2820 test -z "$as_dir" && as_dir=.
2821 for ac_exec_ext in '' $ac_executable_extensions; do
2822 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2823 ac_cv_prog_CC="${ac_tool_prefix}gcc"
2824 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2825 break 2
2826 fi
2827 done
2828 done
2829 IFS=$as_save_IFS
2830
2831 fi
2832 fi
2833 CC=$ac_cv_prog_CC
2834 if test -n "$CC"; then
2835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2836 $as_echo "$CC" >&6; }
2837 else
2838 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2839 $as_echo "no" >&6; }
2840 fi
2841
2842
2843 fi
2844 if test -z "$ac_cv_prog_CC"; then
2845 ac_ct_CC=$CC
2846 # Extract the first word of "gcc", so it can be a program name with args.
2847 set dummy gcc; ac_word=$2
2848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2849 $as_echo_n "checking for $ac_word... " >&6; }
2850 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
2851 $as_echo_n "(cached) " >&6
2852 else
2853 if test -n "$ac_ct_CC"; then
2854 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2855 else
2856 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2857 for as_dir in $PATH
2858 do
2859 IFS=$as_save_IFS
2860 test -z "$as_dir" && as_dir=.
2861 for ac_exec_ext in '' $ac_executable_extensions; do
2862 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2863 ac_cv_prog_ac_ct_CC="gcc"
2864 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2865 break 2
2866 fi
2867 done
2868 done
2869 IFS=$as_save_IFS
2870
2871 fi
2872 fi
2873 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2874 if test -n "$ac_ct_CC"; then
2875 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2876 $as_echo "$ac_ct_CC" >&6; }
2877 else
2878 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2879 $as_echo "no" >&6; }
2880 fi
2881
2882 if test "x$ac_ct_CC" = x; then
2883 CC=""
2884 else
2885 case $cross_compiling:$ac_tool_warned in
2886 yes:)
2887 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2888 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2889 ac_tool_warned=yes ;;
2890 esac
2891 CC=$ac_ct_CC
2892 fi
2893 else
2894 CC="$ac_cv_prog_CC"
2895 fi
2896
2897 if test -z "$CC"; then
2898 if test -n "$ac_tool_prefix"; then
2899 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2900 set dummy ${ac_tool_prefix}cc; ac_word=$2
2901 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2902 $as_echo_n "checking for $ac_word... " >&6; }
2903 if test "${ac_cv_prog_CC+set}" = set; then :
2904 $as_echo_n "(cached) " >&6
2905 else
2906 if test -n "$CC"; then
2907 ac_cv_prog_CC="$CC" # Let the user override the test.
2908 else
2909 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2910 for as_dir in $PATH
2911 do
2912 IFS=$as_save_IFS
2913 test -z "$as_dir" && as_dir=.
2914 for ac_exec_ext in '' $ac_executable_extensions; do
2915 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2916 ac_cv_prog_CC="${ac_tool_prefix}cc"
2917 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2918 break 2
2919 fi
2920 done
2921 done
2922 IFS=$as_save_IFS
2923
2924 fi
2925 fi
2926 CC=$ac_cv_prog_CC
2927 if test -n "$CC"; then
2928 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2929 $as_echo "$CC" >&6; }
2930 else
2931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2932 $as_echo "no" >&6; }
2933 fi
2934
2935
2936 fi
2937 fi
2938 if test -z "$CC"; then
2939 # Extract the first word of "cc", so it can be a program name with args.
2940 set dummy cc; ac_word=$2
2941 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2942 $as_echo_n "checking for $ac_word... " >&6; }
2943 if test "${ac_cv_prog_CC+set}" = set; then :
2944 $as_echo_n "(cached) " >&6
2945 else
2946 if test -n "$CC"; then
2947 ac_cv_prog_CC="$CC" # Let the user override the test.
2948 else
2949 ac_prog_rejected=no
2950 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2951 for as_dir in $PATH
2952 do
2953 IFS=$as_save_IFS
2954 test -z "$as_dir" && as_dir=.
2955 for ac_exec_ext in '' $ac_executable_extensions; do
2956 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2957 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2958 ac_prog_rejected=yes
2959 continue
2960 fi
2961 ac_cv_prog_CC="cc"
2962 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2963 break 2
2964 fi
2965 done
2966 done
2967 IFS=$as_save_IFS
2968
2969 if test $ac_prog_rejected = yes; then
2970 # We found a bogon in the path, so make sure we never use it.
2971 set dummy $ac_cv_prog_CC
2972 shift
2973 if test $# != 0; then
2974 # We chose a different compiler from the bogus one.
2975 # However, it has the same basename, so the bogon will be chosen
2976 # first if we set CC to just the basename; use the full file name.
2977 shift
2978 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2979 fi
2980 fi
2981 fi
2982 fi
2983 CC=$ac_cv_prog_CC
2984 if test -n "$CC"; then
2985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2986 $as_echo "$CC" >&6; }
2987 else
2988 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2989 $as_echo "no" >&6; }
2990 fi
2991
2992
2993 fi
2994 if test -z "$CC"; then
2995 if test -n "$ac_tool_prefix"; then
2996 for ac_prog in cl.exe
2997 do
2998 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2999 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3000 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3001 $as_echo_n "checking for $ac_word... " >&6; }
3002 if test "${ac_cv_prog_CC+set}" = set; then :
3003 $as_echo_n "(cached) " >&6
3004 else
3005 if test -n "$CC"; then
3006 ac_cv_prog_CC="$CC" # Let the user override the test.
3007 else
3008 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3009 for as_dir in $PATH
3010 do
3011 IFS=$as_save_IFS
3012 test -z "$as_dir" && as_dir=.
3013 for ac_exec_ext in '' $ac_executable_extensions; do
3014 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3015 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3016 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3017 break 2
3018 fi
3019 done
3020 done
3021 IFS=$as_save_IFS
3022
3023 fi
3024 fi
3025 CC=$ac_cv_prog_CC
3026 if test -n "$CC"; then
3027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3028 $as_echo "$CC" >&6; }
3029 else
3030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3031 $as_echo "no" >&6; }
3032 fi
3033
3034
3035 test -n "$CC" && break
3036 done
3037 fi
3038 if test -z "$CC"; then
3039 ac_ct_CC=$CC
3040 for ac_prog in cl.exe
3041 do
3042 # Extract the first word of "$ac_prog", so it can be a program name with args.
3043 set dummy $ac_prog; ac_word=$2
3044 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3045 $as_echo_n "checking for $ac_word... " >&6; }
3046 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
3047 $as_echo_n "(cached) " >&6
3048 else
3049 if test -n "$ac_ct_CC"; then
3050 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3051 else
3052 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3053 for as_dir in $PATH
3054 do
3055 IFS=$as_save_IFS
3056 test -z "$as_dir" && as_dir=.
3057 for ac_exec_ext in '' $ac_executable_extensions; do
3058 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3059 ac_cv_prog_ac_ct_CC="$ac_prog"
3060 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3061 break 2
3062 fi
3063 done
3064 done
3065 IFS=$as_save_IFS
3066
3067 fi
3068 fi
3069 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3070 if test -n "$ac_ct_CC"; then
3071 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3072 $as_echo "$ac_ct_CC" >&6; }
3073 else
3074 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3075 $as_echo "no" >&6; }
3076 fi
3077
3078
3079 test -n "$ac_ct_CC" && break
3080 done
3081
3082 if test "x$ac_ct_CC" = x; then
3083 CC=""
3084 else
3085 case $cross_compiling:$ac_tool_warned in
3086 yes:)
3087 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3088 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3089 ac_tool_warned=yes ;;
3090 esac
3091 CC=$ac_ct_CC
3092 fi
3093 fi
3094
3095 fi
3096
3097
3098 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3099 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3100 as_fn_error $? "no acceptable C compiler found in \$PATH
3101 See \`config.log' for more details" "$LINENO" 5 ; }
3102
3103 # Provide some information about the compiler.
3104 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3105 set X $ac_compile
3106 ac_compiler=$2
3107 for ac_option in --version -v -V -qversion; do
3108 { { ac_try="$ac_compiler $ac_option >&5"
3109 case "(($ac_try" in
3110 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3111 *) ac_try_echo=$ac_try;;
3112 esac
3113 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3114 $as_echo "$ac_try_echo"; } >&5
3115 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3116 ac_status=$?
3117 if test -s conftest.err; then
3118 sed '10a\
3119 ... rest of stderr output deleted ...
3120 10q' conftest.err >conftest.er1
3121 cat conftest.er1 >&5
3122 fi
3123 rm -f conftest.er1 conftest.err
3124 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3125 test $ac_status = 0; }
3126 done
3127
3128 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3129 /* end confdefs.h. */
3130
3131 int
3132 main ()
3133 {
3134
3135 ;
3136 return 0;
3137 }
3138 _ACEOF
3139 ac_clean_files_save=$ac_clean_files
3140 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3141 # Try to create an executable without -o first, disregard a.out.
3142 # It will help us diagnose broken compilers, and finding out an intuition
3143 # of exeext.
3144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3145 $as_echo_n "checking whether the C compiler works... " >&6; }
3146 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3147
3148 # The possible output files:
3149 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3150
3151 ac_rmfiles=
3152 for ac_file in $ac_files
3153 do
3154 case $ac_file in
3155 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3156 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3157 esac
3158 done
3159 rm -f $ac_rmfiles
3160
3161 if { { ac_try="$ac_link_default"
3162 case "(($ac_try" in
3163 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3164 *) ac_try_echo=$ac_try;;
3165 esac
3166 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3167 $as_echo "$ac_try_echo"; } >&5
3168 (eval "$ac_link_default") 2>&5
3169 ac_status=$?
3170 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3171 test $ac_status = 0; }; then :
3172 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3173 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3174 # in a Makefile. We should not override ac_cv_exeext if it was cached,
3175 # so that the user can short-circuit this test for compilers unknown to
3176 # Autoconf.
3177 for ac_file in $ac_files ''
3178 do
3179 test -f "$ac_file" || continue
3180 case $ac_file in
3181 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3182 ;;
3183 [ab].out )
3184 # We found the default executable, but exeext='' is most
3185 # certainly right.
3186 break;;
3187 *.* )
3188 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3189 then :; else
3190 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3191 fi
3192 # We set ac_cv_exeext here because the later test for it is not
3193 # safe: cross compilers may not add the suffix if given an `-o'
3194 # argument, so we may need to know it at that point already.
3195 # Even if this section looks crufty: it has the advantage of
3196 # actually working.
3197 break;;
3198 * )
3199 break;;
3200 esac
3201 done
3202 test "$ac_cv_exeext" = no && ac_cv_exeext=
3203
3204 else
3205 ac_file=''
3206 fi
3207 if test -z "$ac_file"; then :
3208 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3209 $as_echo "no" >&6; }
3210 $as_echo "$as_me: failed program was:" >&5
3211 sed 's/^/| /' conftest.$ac_ext >&5
3212
3213 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3214 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3215 as_fn_error 77 "C compiler cannot create executables
3216 See \`config.log' for more details" "$LINENO" 5 ; }
3217 else
3218 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3219 $as_echo "yes" >&6; }
3220 fi
3221 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3222 $as_echo_n "checking for C compiler default output file name... " >&6; }
3223 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3224 $as_echo "$ac_file" >&6; }
3225 ac_exeext=$ac_cv_exeext
3226
3227 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3228 ac_clean_files=$ac_clean_files_save
3229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3230 $as_echo_n "checking for suffix of executables... " >&6; }
3231 if { { ac_try="$ac_link"
3232 case "(($ac_try" in
3233 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3234 *) ac_try_echo=$ac_try;;
3235 esac
3236 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3237 $as_echo "$ac_try_echo"; } >&5
3238 (eval "$ac_link") 2>&5
3239 ac_status=$?
3240 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3241 test $ac_status = 0; }; then :
3242 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3243 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3244 # work properly (i.e., refer to `conftest.exe'), while it won't with
3245 # `rm'.
3246 for ac_file in conftest.exe conftest conftest.*; do
3247 test -f "$ac_file" || continue
3248 case $ac_file in
3249 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3250 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3251 break;;
3252 * ) break;;
3253 esac
3254 done
3255 else
3256 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3257 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3258 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3259 See \`config.log' for more details" "$LINENO" 5 ; }
3260 fi
3261 rm -f conftest conftest$ac_cv_exeext
3262 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3263 $as_echo "$ac_cv_exeext" >&6; }
3264
3265 rm -f conftest.$ac_ext
3266 EXEEXT=$ac_cv_exeext
3267 ac_exeext=$EXEEXT
3268 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3269 /* end confdefs.h. */
3270 #include <stdio.h>
3271 int
3272 main ()
3273 {
3274 FILE *f = fopen ("conftest.out", "w");
3275 return ferror (f) || fclose (f) != 0;
3276
3277 ;
3278 return 0;
3279 }
3280 _ACEOF
3281 ac_clean_files="$ac_clean_files conftest.out"
3282 # Check that the compiler produces executables we can run. If not, either
3283 # the compiler is broken, or we cross compile.
3284 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3285 $as_echo_n "checking whether we are cross compiling... " >&6; }
3286 if test "$cross_compiling" != yes; then
3287 { { ac_try="$ac_link"
3288 case "(($ac_try" in
3289 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3290 *) ac_try_echo=$ac_try;;
3291 esac
3292 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3293 $as_echo "$ac_try_echo"; } >&5
3294 (eval "$ac_link") 2>&5
3295 ac_status=$?
3296 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3297 test $ac_status = 0; }
3298 if { ac_try='./conftest$ac_cv_exeext'
3299 { { case "(($ac_try" in
3300 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3301 *) ac_try_echo=$ac_try;;
3302 esac
3303 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3304 $as_echo "$ac_try_echo"; } >&5
3305 (eval "$ac_try") 2>&5
3306 ac_status=$?
3307 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3308 test $ac_status = 0; }; }; then
3309 cross_compiling=no
3310 else
3311 if test "$cross_compiling" = maybe; then
3312 cross_compiling=yes
3313 else
3314 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3315 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3316 as_fn_error $? "cannot run C compiled programs.
3317 If you meant to cross compile, use \`--host'.
3318 See \`config.log' for more details" "$LINENO" 5 ; }
3319 fi
3320 fi
3321 fi
3322 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3323 $as_echo "$cross_compiling" >&6; }
3324
3325 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3326 ac_clean_files=$ac_clean_files_save
3327 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3328 $as_echo_n "checking for suffix of object files... " >&6; }
3329 if test "${ac_cv_objext+set}" = set; then :
3330 $as_echo_n "(cached) " >&6
3331 else
3332 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3333 /* end confdefs.h. */
3334
3335 int
3336 main ()
3337 {
3338
3339 ;
3340 return 0;
3341 }
3342 _ACEOF
3343 rm -f conftest.o conftest.obj
3344 if { { ac_try="$ac_compile"
3345 case "(($ac_try" in
3346 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3347 *) ac_try_echo=$ac_try;;
3348 esac
3349 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3350 $as_echo "$ac_try_echo"; } >&5
3351 (eval "$ac_compile") 2>&5
3352 ac_status=$?
3353 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3354 test $ac_status = 0; }; then :
3355 for ac_file in conftest.o conftest.obj conftest.*; do
3356 test -f "$ac_file" || continue;
3357 case $ac_file in
3358 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3359 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3360 break;;
3361 esac
3362 done
3363 else
3364 $as_echo "$as_me: failed program was:" >&5
3365 sed 's/^/| /' conftest.$ac_ext >&5
3366
3367 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3368 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3369 as_fn_error $? "cannot compute suffix of object files: cannot compile
3370 See \`config.log' for more details" "$LINENO" 5 ; }
3371 fi
3372 rm -f conftest.$ac_cv_objext conftest.$ac_ext
3373 fi
3374 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3375 $as_echo "$ac_cv_objext" >&6; }
3376 OBJEXT=$ac_cv_objext
3377 ac_objext=$OBJEXT
3378 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
3379 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3380 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
3381 $as_echo_n "(cached) " >&6
3382 else
3383 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3384 /* end confdefs.h. */
3385
3386 int
3387 main ()
3388 {
3389 #ifndef __GNUC__
3390 choke me
3391 #endif
3392
3393 ;
3394 return 0;
3395 }
3396 _ACEOF
3397 if ac_fn_c_try_compile "$LINENO"; then :
3398 ac_compiler_gnu=yes
3399 else
3400 ac_compiler_gnu=no
3401 fi
3402 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3403 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3404
3405 fi
3406 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3407 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
3408 if test $ac_compiler_gnu = yes; then
3409 GCC=yes
3410 else
3411 GCC=
3412 fi
3413 ac_test_CFLAGS=${CFLAGS+set}
3414 ac_save_CFLAGS=$CFLAGS
3415 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3416 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3417 if test "${ac_cv_prog_cc_g+set}" = set; then :
3418 $as_echo_n "(cached) " >&6
3419 else
3420 ac_save_c_werror_flag=$ac_c_werror_flag
3421 ac_c_werror_flag=yes
3422 ac_cv_prog_cc_g=no
3423 CFLAGS="-g"
3424 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3425 /* end confdefs.h. */
3426
3427 int
3428 main ()
3429 {
3430
3431 ;
3432 return 0;
3433 }
3434 _ACEOF
3435 if ac_fn_c_try_compile "$LINENO"; then :
3436 ac_cv_prog_cc_g=yes
3437 else
3438 CFLAGS=""
3439 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3440 /* end confdefs.h. */
3441
3442 int
3443 main ()
3444 {
3445
3446 ;
3447 return 0;
3448 }
3449 _ACEOF
3450 if ac_fn_c_try_compile "$LINENO"; then :
3451
3452 else
3453 ac_c_werror_flag=$ac_save_c_werror_flag
3454 CFLAGS="-g"
3455 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3456 /* end confdefs.h. */
3457
3458 int
3459 main ()
3460 {
3461
3462 ;
3463 return 0;
3464 }
3465 _ACEOF
3466 if ac_fn_c_try_compile "$LINENO"; then :
3467 ac_cv_prog_cc_g=yes
3468 fi
3469 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3470 fi
3471 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3472 fi
3473 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3474 ac_c_werror_flag=$ac_save_c_werror_flag
3475 fi
3476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
3477 $as_echo "$ac_cv_prog_cc_g" >&6; }
3478 if test "$ac_test_CFLAGS" = set; then
3479 CFLAGS=$ac_save_CFLAGS
3480 elif test $ac_cv_prog_cc_g = yes; then
3481 if test "$GCC" = yes; then
3482 CFLAGS="-g -O2"
3483 else
3484 CFLAGS="-g"
3485 fi
3486 else
3487 if test "$GCC" = yes; then
3488 CFLAGS="-O2"
3489 else
3490 CFLAGS=
3491 fi
3492 fi
3493 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
3494 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3495 if test "${ac_cv_prog_cc_c89+set}" = set; then :
3496 $as_echo_n "(cached) " >&6
3497 else
3498 ac_cv_prog_cc_c89=no
3499 ac_save_CC=$CC
3500 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3501 /* end confdefs.h. */
3502 #include <stdarg.h>
3503 #include <stdio.h>
3504 #include <sys/types.h>
3505 #include <sys/stat.h>
3506 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3507 struct buf { int x; };
3508 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3509 static char *e (p, i)
3510 char **p;
3511 int i;
3512 {
3513 return p[i];
3514 }
3515 static char *f (char * (*g) (char **, int), char **p, ...)
3516 {
3517 char *s;
3518 va_list v;
3519 va_start (v,p);
3520 s = g (p, va_arg (v,int));
3521 va_end (v);
3522 return s;
3523 }
3524
3525 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3526 function prototypes and stuff, but not '\xHH' hex character constants.
3527 These don't provoke an error unfortunately, instead are silently treated
3528 as 'x'. The following induces an error, until -std is added to get
3529 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3530 array size at least. It's necessary to write '\x00'==0 to get something
3531 that's true only with -std. */
3532 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3533
3534 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3535 inside strings and character constants. */
3536 #define FOO(x) 'x'
3537 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3538
3539 int test (int i, double x);
3540 struct s1 {int (*f) (int a);};
3541 struct s2 {int (*f) (double a);};
3542 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3543 int argc;
3544 char **argv;
3545 int
3546 main ()
3547 {
3548 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3549 ;
3550 return 0;
3551 }
3552 _ACEOF
3553 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3554 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3555 do
3556 CC="$ac_save_CC $ac_arg"
3557 if ac_fn_c_try_compile "$LINENO"; then :
3558 ac_cv_prog_cc_c89=$ac_arg
3559 fi
3560 rm -f core conftest.err conftest.$ac_objext
3561 test "x$ac_cv_prog_cc_c89" != "xno" && break
3562 done
3563 rm -f conftest.$ac_ext
3564 CC=$ac_save_CC
3565
3566 fi
3567 # AC_CACHE_VAL
3568 case "x$ac_cv_prog_cc_c89" in
3569 x)
3570 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3571 $as_echo "none needed" >&6; } ;;
3572 xno)
3573 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3574 $as_echo "unsupported" >&6; } ;;
3575 *)
3576 CC="$CC $ac_cv_prog_cc_c89"
3577 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
3578 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3579 esac
3580 if test "x$ac_cv_prog_cc_c89" != xno; then :
3581
3582 fi
3583
3584 ac_ext=c
3585 ac_cpp='$CPP $CPPFLAGS'
3586 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3587 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3588 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3589 DEPDIR="${am__leading_dot}deps"
3590
3591 ac_config_commands="$ac_config_commands depfiles"
3592
3593
3594 am_make=${MAKE-make}
3595 cat > confinc << 'END'
3596 am__doit:
3597 @echo this is the am__doit target
3598 .PHONY: am__doit
3599 END
3600 # If we don't find an include directive, just comment out the code.
3601 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3602 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3603 am__include="#"
3604 am__quote=
3605 _am_result=none
3606 # First try GNU make style include.
3607 echo "include confinc" > confmf
3608 # Ignore all kinds of additional output from `make'.
3609 case `$am_make -s -f confmf 2> /dev/null` in #(
3610 *the\ am__doit\ target*)
3611 am__include=include
3612 am__quote=
3613 _am_result=GNU
3614 ;;
3615 esac
3616 # Now try BSD make style include.
3617 if test "$am__include" = "#"; then
3618 echo '.include "confinc"' > confmf
3619 case `$am_make -s -f confmf 2> /dev/null` in #(
3620 *the\ am__doit\ target*)
3621 am__include=.include
3622 am__quote="\""
3623 _am_result=BSD
3624 ;;
3625 esac
3626 fi
3627
3628
3629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3630 $as_echo "$_am_result" >&6; }
3631 rm -f confinc confmf
3632
3633 # Check whether --enable-dependency-tracking was given.
3634 if test "${enable_dependency_tracking+set}" = set; then :
3635 enableval=$enable_dependency_tracking;
3636 fi
3637
3638 if test "x$enable_dependency_tracking" != xno; then
3639 am_depcomp="$ac_aux_dir/depcomp"
3640 AMDEPBACKSLASH='\'
3641 fi
3642 if test "x$enable_dependency_tracking" != xno; then
3643 AMDEP_TRUE=
3644 AMDEP_FALSE='#'
3645 else
3646 AMDEP_TRUE='#'
3647 AMDEP_FALSE=
3648 fi
3649
3650
3651
3652 depcc="$CC" am_compiler_list=
3653
3654 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
3655 $as_echo_n "checking dependency style of $depcc... " >&6; }
3656 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
3657 $as_echo_n "(cached) " >&6
3658 else
3659 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3660 # We make a subdir and do the tests there. Otherwise we can end up
3661 # making bogus files that we don't know about and never remove. For
3662 # instance it was reported that on HP-UX the gcc test will end up
3663 # making a dummy file named `D' -- because `-MD' means `put the output
3664 # in D'.
3665 mkdir conftest.dir
3666 # Copy depcomp to subdir because otherwise we won't find it if we're
3667 # using a relative directory.
3668 cp "$am_depcomp" conftest.dir
3669 cd conftest.dir
3670 # We will build objects and dependencies in a subdirectory because
3671 # it helps to detect inapplicable dependency modes. For instance
3672 # both Tru64's cc and ICC support -MD to output dependencies as a
3673 # side effect of compilation, but ICC will put the dependencies in
3674 # the current directory while Tru64 will put them in the object
3675 # directory.
3676 mkdir sub
3677
3678 am_cv_CC_dependencies_compiler_type=none
3679 if test "$am_compiler_list" = ""; then
3680 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
3681 fi
3682 am__universal=false
3683 case " $depcc " in #(
3684 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3685 esac
3686
3687 for depmode in $am_compiler_list; do
3688 # Setup a source with many dependencies, because some compilers
3689 # like to wrap large dependency lists on column 80 (with \), and
3690 # we should not choose a depcomp mode which is confused by this.
3691 #
3692 # We need to recreate these files for each test, as the compiler may
3693 # overwrite some of them when testing with obscure command lines.
3694 # This happens at least with the AIX C compiler.
3695 : > sub/conftest.c
3696 for i in 1 2 3 4 5 6; do
3697 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3698 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3699 # Solaris 8's {/usr,}/bin/sh.
3700 touch sub/conftst$i.h
3701 done
3702 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3703
3704 # We check with `-c' and `-o' for the sake of the "dashmstdout"
3705 # mode. It turns out that the SunPro C++ compiler does not properly
3706 # handle `-M -o', and we need to detect this. Also, some Intel
3707 # versions had trouble with output in subdirs
3708 am__obj=sub/conftest.${OBJEXT-o}
3709 am__minus_obj="-o $am__obj"
3710 case $depmode in
3711 gcc)
3712 # This depmode causes a compiler race in universal mode.
3713 test "$am__universal" = false || continue
3714 ;;
3715 nosideeffect)
3716 # after this tag, mechanisms are not by side-effect, so they'll
3717 # only be used when explicitly requested
3718 if test "x$enable_dependency_tracking" = xyes; then
3719 continue
3720 else
3721 break
3722 fi
3723 ;;
3724 msvisualcpp | msvcmsys)
3725 # This compiler won't grok `-c -o', but also, the minuso test has
3726 # not run yet. These depmodes are late enough in the game, and
3727 # so weak that their functioning should not be impacted.
3728 am__obj=conftest.${OBJEXT-o}
3729 am__minus_obj=
3730 ;;
3731 none) break ;;
3732 esac
3733 if depmode=$depmode \
3734 source=sub/conftest.c object=$am__obj \
3735 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3736 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3737 >/dev/null 2>conftest.err &&
3738 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3739 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3740 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3741 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3742 # icc doesn't choke on unknown options, it will just issue warnings
3743 # or remarks (even with -Werror). So we grep stderr for any message
3744 # that says an option was ignored or not supported.
3745 # When given -MP, icc 7.0 and 7.1 complain thusly:
3746 # icc: Command line warning: ignoring option '-M'; no argument required
3747 # The diagnosis changed in icc 8.0:
3748 # icc: Command line remark: option '-MP' not supported
3749 if (grep 'ignoring option' conftest.err ||
3750 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3751 am_cv_CC_dependencies_compiler_type=$depmode
3752 break
3753 fi
3754 fi
3755 done
3756
3757 cd ..
3758 rm -rf conftest.dir
3759 else
3760 am_cv_CC_dependencies_compiler_type=none
3761 fi
3762
3763 fi
3764 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
3765 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
3766 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
3767
3768 if
3769 test "x$enable_dependency_tracking" != xno \
3770 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
3771 am__fastdepCC_TRUE=
3772 am__fastdepCC_FALSE='#'
3773 else
3774 am__fastdepCC_TRUE='#'
3775 am__fastdepCC_FALSE=
3776 fi
3777
3778
3779 case $ac_cv_prog_cc_stdc in #(
3780 no) :
3781 ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
3782 *) :
3783 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
3784 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
3785 if test "${ac_cv_prog_cc_c99+set}" = set; then :
3786 $as_echo_n "(cached) " >&6
3787 else
3788 ac_cv_prog_cc_c99=no
3789 ac_save_CC=$CC
3790 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3791 /* end confdefs.h. */
3792 #include <stdarg.h>
3793 #include <stdbool.h>
3794 #include <stdlib.h>
3795 #include <wchar.h>
3796 #include <stdio.h>
3797
3798 // Check varargs macros. These examples are taken from C99 6.10.3.5.
3799 #define debug(...) fprintf (stderr, __VA_ARGS__)
3800 #define showlist(...) puts (#__VA_ARGS__)
3801 #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
3802 static void
3803 test_varargs_macros (void)
3804 {
3805 int x = 1234;
3806 int y = 5678;
3807 debug ("Flag");
3808 debug ("X = %d\n", x);
3809 showlist (The first, second, and third items.);
3810 report (x>y, "x is %d but y is %d", x, y);
3811 }
3812
3813 // Check long long types.
3814 #define BIG64 18446744073709551615ull
3815 #define BIG32 4294967295ul
3816 #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
3817 #if !BIG_OK
3818 your preprocessor is broken;
3819 #endif
3820 #if BIG_OK
3821 #else
3822 your preprocessor is broken;
3823 #endif
3824 static long long int bignum = -9223372036854775807LL;
3825 static unsigned long long int ubignum = BIG64;
3826
3827 struct incomplete_array
3828 {
3829 int datasize;
3830 double data[];
3831 };
3832
3833 struct named_init {
3834 int number;
3835 const wchar_t *name;
3836 double average;
3837 };
3838
3839 typedef const char *ccp;
3840
3841 static inline int
3842 test_restrict (ccp restrict text)
3843 {
3844 // See if C++-style comments work.
3845 // Iterate through items via the restricted pointer.
3846 // Also check for declarations in for loops.
3847 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
3848 continue;
3849 return 0;
3850 }
3851
3852 // Check varargs and va_copy.
3853 static void
3854 test_varargs (const char *format, ...)
3855 {
3856 va_list args;
3857 va_start (args, format);
3858 va_list args_copy;
3859 va_copy (args_copy, args);
3860
3861 const char *str;
3862 int number;
3863 float fnumber;
3864
3865 while (*format)
3866 {
3867 switch (*format++)
3868 {
3869 case 's': // string
3870 str = va_arg (args_copy, const char *);
3871 break;
3872 case 'd': // int
3873 number = va_arg (args_copy, int);
3874 break;
3875 case 'f': // float
3876 fnumber = va_arg (args_copy, double);
3877 break;
3878 default:
3879 break;
3880 }
3881 }
3882 va_end (args_copy);
3883 va_end (args);
3884 }
3885
3886 int
3887 main ()
3888 {
3889
3890 // Check bool.
3891 _Bool success = false;
3892
3893 // Check restrict.
3894 if (test_restrict ("String literal") == 0)
3895 success = true;
3896 char *restrict newvar = "Another string";
3897
3898 // Check varargs.
3899 test_varargs ("s, d' f .", "string", 65, 34.234);
3900 test_varargs_macros ();
3901
3902 // Check flexible array members.
3903 struct incomplete_array *ia =
3904 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
3905 ia->datasize = 10;
3906 for (int i = 0; i < ia->datasize; ++i)
3907 ia->data[i] = i * 1.234;
3908
3909 // Check named initializers.
3910 struct named_init ni = {
3911 .number = 34,
3912 .name = L"Test wide string",
3913 .average = 543.34343,
3914 };
3915
3916 ni.number = 58;
3917
3918 int dynamic_array[ni.number];
3919 dynamic_array[ni.number - 1] = 543;
3920
3921 // work around unused variable warnings
3922 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
3923 || dynamic_array[ni.number - 1] != 543);
3924
3925 ;
3926 return 0;
3927 }
3928 _ACEOF
3929 for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
3930 do
3931 CC="$ac_save_CC $ac_arg"
3932 if ac_fn_c_try_compile "$LINENO"; then :
3933 ac_cv_prog_cc_c99=$ac_arg
3934 fi
3935 rm -f core conftest.err conftest.$ac_objext
3936 test "x$ac_cv_prog_cc_c99" != "xno" && break
3937 done
3938 rm -f conftest.$ac_ext
3939 CC=$ac_save_CC
3940
3941 fi
3942 # AC_CACHE_VAL
3943 case "x$ac_cv_prog_cc_c99" in
3944 x)
3945 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3946 $as_echo "none needed" >&6; } ;;
3947 xno)
3948 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3949 $as_echo "unsupported" >&6; } ;;
3950 *)
3951 CC="$CC $ac_cv_prog_cc_c99"
3952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
3953 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
3954 esac
3955 if test "x$ac_cv_prog_cc_c99" != xno; then :
3956 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
3957 else
3958 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
3959 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3960 if test "${ac_cv_prog_cc_c89+set}" = set; then :
3961 $as_echo_n "(cached) " >&6
3962 else
3963 ac_cv_prog_cc_c89=no
3964 ac_save_CC=$CC
3965 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3966 /* end confdefs.h. */
3967 #include <stdarg.h>
3968 #include <stdio.h>
3969 #include <sys/types.h>
3970 #include <sys/stat.h>
3971 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3972 struct buf { int x; };
3973 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3974 static char *e (p, i)
3975 char **p;
3976 int i;
3977 {
3978 return p[i];
3979 }
3980 static char *f (char * (*g) (char **, int), char **p, ...)
3981 {
3982 char *s;
3983 va_list v;
3984 va_start (v,p);
3985 s = g (p, va_arg (v,int));
3986 va_end (v);
3987 return s;
3988 }
3989
3990 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3991 function prototypes and stuff, but not '\xHH' hex character constants.
3992 These don't provoke an error unfortunately, instead are silently treated
3993 as 'x'. The following induces an error, until -std is added to get
3994 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3995 array size at least. It's necessary to write '\x00'==0 to get something
3996 that's true only with -std. */
3997 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3998
3999 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4000 inside strings and character constants. */
4001 #define FOO(x) 'x'
4002 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4003
4004 int test (int i, double x);
4005 struct s1 {int (*f) (int a);};
4006 struct s2 {int (*f) (double a);};
4007 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4008 int argc;
4009 char **argv;
4010 int
4011 main ()
4012 {
4013 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
4014 ;
4015 return 0;
4016 }
4017 _ACEOF
4018 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4019 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4020 do
4021 CC="$ac_save_CC $ac_arg"
4022 if ac_fn_c_try_compile "$LINENO"; then :
4023 ac_cv_prog_cc_c89=$ac_arg
4024 fi
4025 rm -f core conftest.err conftest.$ac_objext
4026 test "x$ac_cv_prog_cc_c89" != "xno" && break
4027 done
4028 rm -f conftest.$ac_ext
4029 CC=$ac_save_CC
4030
4031 fi
4032 # AC_CACHE_VAL
4033 case "x$ac_cv_prog_cc_c89" in
4034 x)
4035 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4036 $as_echo "none needed" >&6; } ;;
4037 xno)
4038 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4039 $as_echo "unsupported" >&6; } ;;
4040 *)
4041 CC="$CC $ac_cv_prog_cc_c89"
4042 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4043 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4044 esac
4045 if test "x$ac_cv_prog_cc_c89" != xno; then :
4046 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
4047 else
4048 ac_cv_prog_cc_stdc=no
4049 fi
4050
4051 fi
4052 ;;
4053 esac
4054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
4055 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
4056 if test "${ac_cv_prog_cc_stdc+set}" = set; then :
4057 $as_echo_n "(cached) " >&6
4058 fi
4059
4060 case $ac_cv_prog_cc_stdc in #(
4061 no) :
4062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4063 $as_echo "unsupported" >&6; } ;; #(
4064 '') :
4065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4066 $as_echo "none needed" >&6; } ;; #(
4067 *) :
4068 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
4069 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
4070 esac
4071
4072
4073 # Check whether --enable-shared was given.
4074 if test "${enable_shared+set}" = set; then :
4075 enableval=$enable_shared; p=${PACKAGE-default}
4076 case $enableval in
4077 yes) enable_shared=yes ;;
4078 no) enable_shared=no ;;
4079 *)
4080 enable_shared=no
4081 # Look at the argument we got. We use all the common list separators.
4082 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4083 for pkg in $enableval; do
4084 IFS="$lt_save_ifs"
4085 if test "X$pkg" = "X$p"; then
4086 enable_shared=yes
4087 fi
4088 done
4089 IFS="$lt_save_ifs"
4090 ;;
4091 esac
4092 else
4093 enable_shared=no
4094 fi
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104 case `pwd` in
4105 *\ * | *\ *)
4106 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
4107 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
4108 esac
4109
4110
4111
4112 macro_version='2.2.6b'
4113 macro_revision='1.3017'
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127 ltmain="$ac_aux_dir/ltmain.sh"
4128
4129 # Make sure we can run config.sub.
4130 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4131 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4132
4133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4134 $as_echo_n "checking build system type... " >&6; }
4135 if test "${ac_cv_build+set}" = set; then :
4136 $as_echo_n "(cached) " >&6
4137 else
4138 ac_build_alias=$build_alias
4139 test "x$ac_build_alias" = x &&
4140 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4141 test "x$ac_build_alias" = x &&
4142 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4143 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4144 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4145
4146 fi
4147 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4148 $as_echo "$ac_cv_build" >&6; }
4149 case $ac_cv_build in
4150 *-*-*) ;;
4151 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
4152 esac
4153 build=$ac_cv_build
4154 ac_save_IFS=$IFS; IFS='-'
4155 set x $ac_cv_build
4156 shift
4157 build_cpu=$1
4158 build_vendor=$2
4159 shift; shift
4160 # Remember, the first character of IFS is used to create $*,
4161 # except with old shells:
4162 build_os=$*
4163 IFS=$ac_save_IFS
4164 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
4165
4166
4167 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
4168 $as_echo_n "checking host system type... " >&6; }
4169 if test "${ac_cv_host+set}" = set; then :
4170 $as_echo_n "(cached) " >&6
4171 else
4172 if test "x$host_alias" = x; then
4173 ac_cv_host=$ac_cv_build
4174 else
4175 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4176 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4177 fi
4178
4179 fi
4180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
4181 $as_echo "$ac_cv_host" >&6; }
4182 case $ac_cv_host in
4183 *-*-*) ;;
4184 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
4185 esac
4186 host=$ac_cv_host
4187 ac_save_IFS=$IFS; IFS='-'
4188 set x $ac_cv_host
4189 shift
4190 host_cpu=$1
4191 host_vendor=$2
4192 shift; shift
4193 # Remember, the first character of IFS is used to create $*,
4194 # except with old shells:
4195 host_os=$*
4196 IFS=$ac_save_IFS
4197 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
4198
4199
4200 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4201 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4202 if test "${ac_cv_path_SED+set}" = set; then :
4203 $as_echo_n "(cached) " >&6
4204 else
4205 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4206 for ac_i in 1 2 3 4 5 6 7; do
4207 ac_script="$ac_script$as_nl$ac_script"
4208 done
4209 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4210 { ac_script=; unset ac_script;}
4211 if test -z "$SED"; then
4212 ac_path_SED_found=false
4213 # Loop through the user's path and test for each of PROGNAME-LIST
4214 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4215 for as_dir in $PATH
4216 do
4217 IFS=$as_save_IFS
4218 test -z "$as_dir" && as_dir=.
4219 for ac_prog in sed gsed; do
4220 for ac_exec_ext in '' $ac_executable_extensions; do
4221 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4222 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
4223 # Check for GNU ac_path_SED and select it if it is found.
4224 # Check for GNU $ac_path_SED
4225 case `"$ac_path_SED" --version 2>&1` in
4226 *GNU*)
4227 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4228 *)
4229 ac_count=0
4230 $as_echo_n 0123456789 >"conftest.in"
4231 while :
4232 do
4233 cat "conftest.in" "conftest.in" >"conftest.tmp"
4234 mv "conftest.tmp" "conftest.in"
4235 cp "conftest.in" "conftest.nl"
4236 $as_echo '' >> "conftest.nl"
4237 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4238 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4239 as_fn_arith $ac_count + 1 && ac_count=$as_val
4240 if test $ac_count -gt ${ac_path_SED_max-0}; then
4241 # Best one so far, save it but keep looking for a better one
4242 ac_cv_path_SED="$ac_path_SED"
4243 ac_path_SED_max=$ac_count
4244 fi
4245 # 10*(2^10) chars as input seems more than enough
4246 test $ac_count -gt 10 && break
4247 done
4248 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4249 esac
4250
4251 $ac_path_SED_found && break 3
4252 done
4253 done
4254 done
4255 IFS=$as_save_IFS
4256 if test -z "$ac_cv_path_SED"; then
4257 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
4258 fi
4259 else
4260 ac_cv_path_SED=$SED
4261 fi
4262
4263 fi
4264 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4265 $as_echo "$ac_cv_path_SED" >&6; }
4266 SED="$ac_cv_path_SED"
4267 rm -f conftest.sed
4268
4269 test -z "$SED" && SED=sed
4270 Xsed="$SED -e 1s/^X//"
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4283 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4284 if test "${ac_cv_path_GREP+set}" = set; then :
4285 $as_echo_n "(cached) " >&6
4286 else
4287 if test -z "$GREP"; then
4288 ac_path_GREP_found=false
4289 # Loop through the user's path and test for each of PROGNAME-LIST
4290 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4291 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4292 do
4293 IFS=$as_save_IFS
4294 test -z "$as_dir" && as_dir=.
4295 for ac_prog in grep ggrep; do
4296 for ac_exec_ext in '' $ac_executable_extensions; do
4297 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4298 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4299 # Check for GNU ac_path_GREP and select it if it is found.
4300 # Check for GNU $ac_path_GREP
4301 case `"$ac_path_GREP" --version 2>&1` in
4302 *GNU*)
4303 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4304 *)
4305 ac_count=0
4306 $as_echo_n 0123456789 >"conftest.in"
4307 while :
4308 do
4309 cat "conftest.in" "conftest.in" >"conftest.tmp"
4310 mv "conftest.tmp" "conftest.in"
4311 cp "conftest.in" "conftest.nl"
4312 $as_echo 'GREP' >> "conftest.nl"
4313 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4314 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4315 as_fn_arith $ac_count + 1 && ac_count=$as_val
4316 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4317 # Best one so far, save it but keep looking for a better one
4318 ac_cv_path_GREP="$ac_path_GREP"
4319 ac_path_GREP_max=$ac_count
4320 fi
4321 # 10*(2^10) chars as input seems more than enough
4322 test $ac_count -gt 10 && break
4323 done
4324 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4325 esac
4326
4327 $ac_path_GREP_found && break 3
4328 done
4329 done
4330 done
4331 IFS=$as_save_IFS
4332 if test -z "$ac_cv_path_GREP"; then
4333 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4334 fi
4335 else
4336 ac_cv_path_GREP=$GREP
4337 fi
4338
4339 fi
4340 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4341 $as_echo "$ac_cv_path_GREP" >&6; }
4342 GREP="$ac_cv_path_GREP"
4343
4344
4345 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4346 $as_echo_n "checking for egrep... " >&6; }
4347 if test "${ac_cv_path_EGREP+set}" = set; then :
4348 $as_echo_n "(cached) " >&6
4349 else
4350 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4351 then ac_cv_path_EGREP="$GREP -E"
4352 else
4353 if test -z "$EGREP"; then
4354 ac_path_EGREP_found=false
4355 # Loop through the user's path and test for each of PROGNAME-LIST
4356 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4357 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4358 do
4359 IFS=$as_save_IFS
4360 test -z "$as_dir" && as_dir=.
4361 for ac_prog in egrep; do
4362 for ac_exec_ext in '' $ac_executable_extensions; do
4363 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4364 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4365 # Check for GNU ac_path_EGREP and select it if it is found.
4366 # Check for GNU $ac_path_EGREP
4367 case `"$ac_path_EGREP" --version 2>&1` in
4368 *GNU*)
4369 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4370 *)
4371 ac_count=0
4372 $as_echo_n 0123456789 >"conftest.in"
4373 while :
4374 do
4375 cat "conftest.in" "conftest.in" >"conftest.tmp"
4376 mv "conftest.tmp" "conftest.in"
4377 cp "conftest.in" "conftest.nl"
4378 $as_echo 'EGREP' >> "conftest.nl"
4379 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4380 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4381 as_fn_arith $ac_count + 1 && ac_count=$as_val
4382 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4383 # Best one so far, save it but keep looking for a better one
4384 ac_cv_path_EGREP="$ac_path_EGREP"
4385 ac_path_EGREP_max=$ac_count
4386 fi
4387 # 10*(2^10) chars as input seems more than enough
4388 test $ac_count -gt 10 && break
4389 done
4390 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4391 esac
4392
4393 $ac_path_EGREP_found && break 3
4394 done
4395 done
4396 done
4397 IFS=$as_save_IFS
4398 if test -z "$ac_cv_path_EGREP"; then
4399 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4400 fi
4401 else
4402 ac_cv_path_EGREP=$EGREP
4403 fi
4404
4405 fi
4406 fi
4407 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4408 $as_echo "$ac_cv_path_EGREP" >&6; }
4409 EGREP="$ac_cv_path_EGREP"
4410
4411
4412 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4413 $as_echo_n "checking for fgrep... " >&6; }
4414 if test "${ac_cv_path_FGREP+set}" = set; then :
4415 $as_echo_n "(cached) " >&6
4416 else
4417 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4418 then ac_cv_path_FGREP="$GREP -F"
4419 else
4420 if test -z "$FGREP"; then
4421 ac_path_FGREP_found=false
4422 # Loop through the user's path and test for each of PROGNAME-LIST
4423 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4424 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4425 do
4426 IFS=$as_save_IFS
4427 test -z "$as_dir" && as_dir=.
4428 for ac_prog in fgrep; do
4429 for ac_exec_ext in '' $ac_executable_extensions; do
4430 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4431 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
4432 # Check for GNU ac_path_FGREP and select it if it is found.
4433 # Check for GNU $ac_path_FGREP
4434 case `"$ac_path_FGREP" --version 2>&1` in
4435 *GNU*)
4436 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4437 *)
4438 ac_count=0
4439 $as_echo_n 0123456789 >"conftest.in"
4440 while :
4441 do
4442 cat "conftest.in" "conftest.in" >"conftest.tmp"
4443 mv "conftest.tmp" "conftest.in"
4444 cp "conftest.in" "conftest.nl"
4445 $as_echo 'FGREP' >> "conftest.nl"
4446 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4447 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4448 as_fn_arith $ac_count + 1 && ac_count=$as_val
4449 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4450 # Best one so far, save it but keep looking for a better one
4451 ac_cv_path_FGREP="$ac_path_FGREP"
4452 ac_path_FGREP_max=$ac_count
4453 fi
4454 # 10*(2^10) chars as input seems more than enough
4455 test $ac_count -gt 10 && break
4456 done
4457 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4458 esac
4459
4460 $ac_path_FGREP_found && break 3
4461 done
4462 done
4463 done
4464 IFS=$as_save_IFS
4465 if test -z "$ac_cv_path_FGREP"; then
4466 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4467 fi
4468 else
4469 ac_cv_path_FGREP=$FGREP
4470 fi
4471
4472 fi
4473 fi
4474 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4475 $as_echo "$ac_cv_path_FGREP" >&6; }
4476 FGREP="$ac_cv_path_FGREP"
4477
4478
4479 test -z "$GREP" && GREP=grep
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499 # Check whether --with-gnu-ld was given.
4500 if test "${with_gnu_ld+set}" = set; then :
4501 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4502 else
4503 with_gnu_ld=no
4504 fi
4505
4506 ac_prog=ld
4507 if test "$GCC" = yes; then
4508 # Check if gcc -print-prog-name=ld gives a path.
4509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4510 $as_echo_n "checking for ld used by $CC... " >&6; }
4511 case $host in
4512 *-*-mingw*)
4513 # gcc leaves a trailing carriage return which upsets mingw
4514 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4515 *)
4516 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4517 esac
4518 case $ac_prog in
4519 # Accept absolute paths.
4520 [\\/]* | ?:[\\/]*)
4521 re_direlt='/[^/][^/]*/\.\./'
4522 # Canonicalize the pathname of ld
4523 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4524 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4525 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4526 done
4527 test -z "$LD" && LD="$ac_prog"
4528 ;;
4529 "")
4530 # If it fails, then pretend we aren't using GCC.
4531 ac_prog=ld
4532 ;;
4533 *)
4534 # If it is relative, then search for the first ld in PATH.
4535 with_gnu_ld=unknown
4536 ;;
4537 esac
4538 elif test "$with_gnu_ld" = yes; then
4539 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4540 $as_echo_n "checking for GNU ld... " >&6; }
4541 else
4542 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4543 $as_echo_n "checking for non-GNU ld... " >&6; }
4544 fi
4545 if test "${lt_cv_path_LD+set}" = set; then :
4546 $as_echo_n "(cached) " >&6
4547 else
4548 if test -z "$LD"; then
4549 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4550 for ac_dir in $PATH; do
4551 IFS="$lt_save_ifs"
4552 test -z "$ac_dir" && ac_dir=.
4553 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4554 lt_cv_path_LD="$ac_dir/$ac_prog"
4555 # Check to see if the program is GNU ld. I'd rather use --version,
4556 # but apparently some variants of GNU ld only accept -v.
4557 # Break only if it was the GNU/non-GNU ld that we prefer.
4558 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4559 *GNU* | *'with BFD'*)
4560 test "$with_gnu_ld" != no && break
4561 ;;
4562 *)
4563 test "$with_gnu_ld" != yes && break
4564 ;;
4565 esac
4566 fi
4567 done
4568 IFS="$lt_save_ifs"
4569 else
4570 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4571 fi
4572 fi
4573
4574 LD="$lt_cv_path_LD"
4575 if test -n "$LD"; then
4576 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4577 $as_echo "$LD" >&6; }
4578 else
4579 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4580 $as_echo "no" >&6; }
4581 fi
4582 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
4583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4584 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4585 if test "${lt_cv_prog_gnu_ld+set}" = set; then :
4586 $as_echo_n "(cached) " >&6
4587 else
4588 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4589 case `$LD -v 2>&1 </dev/null` in
4590 *GNU* | *'with BFD'*)
4591 lt_cv_prog_gnu_ld=yes
4592 ;;
4593 *)
4594 lt_cv_prog_gnu_ld=no
4595 ;;
4596 esac
4597 fi
4598 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4599 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
4600 with_gnu_ld=$lt_cv_prog_gnu_ld
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4611 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4612 if test "${lt_cv_path_NM+set}" = set; then :
4613 $as_echo_n "(cached) " >&6
4614 else
4615 if test -n "$NM"; then
4616 # Let the user override the test.
4617 lt_cv_path_NM="$NM"
4618 else
4619 lt_nm_to_check="${ac_tool_prefix}nm"
4620 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4621 lt_nm_to_check="$lt_nm_to_check nm"
4622 fi
4623 for lt_tmp_nm in $lt_nm_to_check; do
4624 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4625 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4626 IFS="$lt_save_ifs"
4627 test -z "$ac_dir" && ac_dir=.
4628 tmp_nm="$ac_dir/$lt_tmp_nm"
4629 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4630 # Check to see if the nm accepts a BSD-compat flag.
4631 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4632 # nm: unknown option "B" ignored
4633 # Tru64's nm complains that /dev/null is an invalid object file
4634 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4635 */dev/null* | *'Invalid file or object type'*)
4636 lt_cv_path_NM="$tmp_nm -B"
4637 break
4638 ;;
4639 *)
4640 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4641 */dev/null*)
4642 lt_cv_path_NM="$tmp_nm -p"
4643 break
4644 ;;
4645 *)
4646 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4647 continue # so that we can try to find one that supports BSD flags
4648 ;;
4649 esac
4650 ;;
4651 esac
4652 fi
4653 done
4654 IFS="$lt_save_ifs"
4655 done
4656 : ${lt_cv_path_NM=no}
4657 fi
4658 fi
4659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4660 $as_echo "$lt_cv_path_NM" >&6; }
4661 if test "$lt_cv_path_NM" != "no"; then
4662 NM="$lt_cv_path_NM"
4663 else
4664 # Didn't find any BSD compatible name lister, look for dumpbin.
4665 if test -n "$ac_tool_prefix"; then
4666 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4667 do
4668 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4669 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4671 $as_echo_n "checking for $ac_word... " >&6; }
4672 if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
4673 $as_echo_n "(cached) " >&6
4674 else
4675 if test -n "$DUMPBIN"; then
4676 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4677 else
4678 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4679 for as_dir in $PATH
4680 do
4681 IFS=$as_save_IFS
4682 test -z "$as_dir" && as_dir=.
4683 for ac_exec_ext in '' $ac_executable_extensions; do
4684 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4685 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4686 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4687 break 2
4688 fi
4689 done
4690 done
4691 IFS=$as_save_IFS
4692
4693 fi
4694 fi
4695 DUMPBIN=$ac_cv_prog_DUMPBIN
4696 if test -n "$DUMPBIN"; then
4697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4698 $as_echo "$DUMPBIN" >&6; }
4699 else
4700 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4701 $as_echo "no" >&6; }
4702 fi
4703
4704
4705 test -n "$DUMPBIN" && break
4706 done
4707 fi
4708 if test -z "$DUMPBIN"; then
4709 ac_ct_DUMPBIN=$DUMPBIN
4710 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4711 do
4712 # Extract the first word of "$ac_prog", so it can be a program name with args.
4713 set dummy $ac_prog; ac_word=$2
4714 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4715 $as_echo_n "checking for $ac_word... " >&6; }
4716 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
4717 $as_echo_n "(cached) " >&6
4718 else
4719 if test -n "$ac_ct_DUMPBIN"; then
4720 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4721 else
4722 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4723 for as_dir in $PATH
4724 do
4725 IFS=$as_save_IFS
4726 test -z "$as_dir" && as_dir=.
4727 for ac_exec_ext in '' $ac_executable_extensions; do
4728 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4729 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4730 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4731 break 2
4732 fi
4733 done
4734 done
4735 IFS=$as_save_IFS
4736
4737 fi
4738 fi
4739 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4740 if test -n "$ac_ct_DUMPBIN"; then
4741 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4742 $as_echo "$ac_ct_DUMPBIN" >&6; }
4743 else
4744 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4745 $as_echo "no" >&6; }
4746 fi
4747
4748
4749 test -n "$ac_ct_DUMPBIN" && break
4750 done
4751
4752 if test "x$ac_ct_DUMPBIN" = x; then
4753 DUMPBIN=":"
4754 else
4755 case $cross_compiling:$ac_tool_warned in
4756 yes:)
4757 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4758 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4759 ac_tool_warned=yes ;;
4760 esac
4761 DUMPBIN=$ac_ct_DUMPBIN
4762 fi
4763 fi
4764
4765
4766 if test "$DUMPBIN" != ":"; then
4767 NM="$DUMPBIN"
4768 fi
4769 fi
4770 test -z "$NM" && NM=nm
4771
4772
4773
4774
4775
4776
4777 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4778 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4779 if test "${lt_cv_nm_interface+set}" = set; then :
4780 $as_echo_n "(cached) " >&6
4781 else
4782 lt_cv_nm_interface="BSD nm"
4783 echo "int some_variable = 0;" > conftest.$ac_ext
4784 (eval echo "\"\$as_me:4785: $ac_compile\"" >&5)
4785 (eval "$ac_compile" 2>conftest.err)
4786 cat conftest.err >&5
4787 (eval echo "\"\$as_me:4788: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4788 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4789 cat conftest.err >&5
4790 (eval echo "\"\$as_me:4791: output\"" >&5)
4791 cat conftest.out >&5
4792 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4793 lt_cv_nm_interface="MS dumpbin"
4794 fi
4795 rm -f conftest*
4796 fi
4797 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4798 $as_echo "$lt_cv_nm_interface" >&6; }
4799
4800 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4801 $as_echo_n "checking whether ln -s works... " >&6; }
4802 LN_S=$as_ln_s
4803 if test "$LN_S" = "ln -s"; then
4804 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4805 $as_echo "yes" >&6; }
4806 else
4807 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4808 $as_echo "no, using $LN_S" >&6; }
4809 fi
4810
4811 # find the maximum length of command line arguments
4812 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4813 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4814 if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
4815 $as_echo_n "(cached) " >&6
4816 else
4817 i=0
4818 teststring="ABCD"
4819
4820 case $build_os in
4821 msdosdjgpp*)
4822 # On DJGPP, this test can blow up pretty badly due to problems in libc
4823 # (any single argument exceeding 2000 bytes causes a buffer overrun
4824 # during glob expansion). Even if it were fixed, the result of this
4825 # check would be larger than it should be.
4826 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4827 ;;
4828
4829 gnu*)
4830 # Under GNU Hurd, this test is not required because there is
4831 # no limit to the length of command line arguments.
4832 # Libtool will interpret -1 as no limit whatsoever
4833 lt_cv_sys_max_cmd_len=-1;
4834 ;;
4835
4836 cygwin* | mingw* | cegcc*)
4837 # On Win9x/ME, this test blows up -- it succeeds, but takes
4838 # about 5 minutes as the teststring grows exponentially.
4839 # Worse, since 9x/ME are not pre-emptively multitasking,
4840 # you end up with a "frozen" computer, even though with patience
4841 # the test eventually succeeds (with a max line length of 256k).
4842 # Instead, let's just punt: use the minimum linelength reported by
4843 # all of the supported platforms: 8192 (on NT/2K/XP).
4844 lt_cv_sys_max_cmd_len=8192;
4845 ;;
4846
4847 amigaos*)
4848 # On AmigaOS with pdksh, this test takes hours, literally.
4849 # So we just punt and use a minimum line length of 8192.
4850 lt_cv_sys_max_cmd_len=8192;
4851 ;;
4852
4853 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
4854 # This has been around since 386BSD, at least. Likely further.
4855 if test -x /sbin/sysctl; then
4856 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4857 elif test -x /usr/sbin/sysctl; then
4858 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4859 else
4860 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4861 fi
4862 # And add a safety zone
4863 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4864 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4865 ;;
4866
4867 interix*)
4868 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4869 lt_cv_sys_max_cmd_len=196608
4870 ;;
4871
4872 osf*)
4873 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4874 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4875 # nice to cause kernel panics so lets avoid the loop below.
4876 # First set a reasonable default.
4877 lt_cv_sys_max_cmd_len=16384
4878 #
4879 if test -x /sbin/sysconfig; then
4880 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4881 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4882 esac
4883 fi
4884 ;;
4885 sco3.2v5*)
4886 lt_cv_sys_max_cmd_len=102400
4887 ;;
4888 sysv5* | sco5v6* | sysv4.2uw2*)
4889 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4890 if test -n "$kargmax"; then
4891 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4892 else
4893 lt_cv_sys_max_cmd_len=32768
4894 fi
4895 ;;
4896 *)
4897 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4898 if test -n "$lt_cv_sys_max_cmd_len"; then
4899 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4900 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4901 else
4902 # Make teststring a little bigger before we do anything with it.
4903 # a 1K string should be a reasonable start.
4904 for i in 1 2 3 4 5 6 7 8 ; do
4905 teststring=$teststring$teststring
4906 done
4907 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4908 # If test is not a shell built-in, we'll probably end up computing a
4909 # maximum length that is only half of the actual maximum length, but
4910 # we can't tell.
4911 while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
4912 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
4913 test $i != 17 # 1/2 MB should be enough
4914 do
4915 i=`expr $i + 1`
4916 teststring=$teststring$teststring
4917 done
4918 # Only check the string length outside the loop.
4919 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4920 teststring=
4921 # Add a significant safety factor because C++ compilers can tack on
4922 # massive amounts of additional arguments before passing them to the
4923 # linker. It appears as though 1/2 is a usable value.
4924 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4925 fi
4926 ;;
4927 esac
4928
4929 fi
4930
4931 if test -n $lt_cv_sys_max_cmd_len ; then
4932 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4933 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4934 else
4935 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
4936 $as_echo "none" >&6; }
4937 fi
4938 max_cmd_len=$lt_cv_sys_max_cmd_len
4939
4940
4941
4942
4943
4944
4945 : ${CP="cp -f"}
4946 : ${MV="mv -f"}
4947 : ${RM="rm -f"}
4948
4949 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
4950 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
4951 # Try some XSI features
4952 xsi_shell=no
4953 ( _lt_dummy="a/b/c"
4954 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
4955 = c,a/b,, \
4956 && eval 'test $(( 1 + 1 )) -eq 2 \
4957 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
4958 && xsi_shell=yes
4959 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
4960 $as_echo "$xsi_shell" >&6; }
4961
4962
4963 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
4964 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
4965 lt_shell_append=no
4966 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
4967 >/dev/null 2>&1 \
4968 && lt_shell_append=yes
4969 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
4970 $as_echo "$lt_shell_append" >&6; }
4971
4972
4973 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
4974 lt_unset=unset
4975 else
4976 lt_unset=false
4977 fi
4978
4979
4980
4981
4982
4983 # test EBCDIC or ASCII
4984 case `echo X|tr X '\101'` in
4985 A) # ASCII based system
4986 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
4987 lt_SP2NL='tr \040 \012'
4988 lt_NL2SP='tr \015\012 \040\040'
4989 ;;
4990 *) # EBCDIC based system
4991 lt_SP2NL='tr \100 \n'
4992 lt_NL2SP='tr \r\n \100\100'
4993 ;;
4994 esac
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5005 $as_echo_n "checking for $LD option to reload object files... " >&6; }
5006 if test "${lt_cv_ld_reload_flag+set}" = set; then :
5007 $as_echo_n "(cached) " >&6
5008 else
5009 lt_cv_ld_reload_flag='-r'
5010 fi
5011 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5012 $as_echo "$lt_cv_ld_reload_flag" >&6; }
5013 reload_flag=$lt_cv_ld_reload_flag
5014 case $reload_flag in
5015 "" | " "*) ;;
5016 *) reload_flag=" $reload_flag" ;;
5017 esac
5018 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5019 case $host_os in
5020 darwin*)
5021 if test "$GCC" = yes; then
5022 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5023 else
5024 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5025 fi
5026 ;;
5027 esac
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037 if test -n "$ac_tool_prefix"; then
5038 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5039 set dummy ${ac_tool_prefix}objdump; ac_word=$2
5040 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5041 $as_echo_n "checking for $ac_word... " >&6; }
5042 if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
5043 $as_echo_n "(cached) " >&6
5044 else
5045 if test -n "$OBJDUMP"; then
5046 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5047 else
5048 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5049 for as_dir in $PATH
5050 do
5051 IFS=$as_save_IFS
5052 test -z "$as_dir" && as_dir=.
5053 for ac_exec_ext in '' $ac_executable_extensions; do
5054 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5055 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5056 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5057 break 2
5058 fi
5059 done
5060 done
5061 IFS=$as_save_IFS
5062
5063 fi
5064 fi
5065 OBJDUMP=$ac_cv_prog_OBJDUMP
5066 if test -n "$OBJDUMP"; then
5067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5068 $as_echo "$OBJDUMP" >&6; }
5069 else
5070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5071 $as_echo "no" >&6; }
5072 fi
5073
5074
5075 fi
5076 if test -z "$ac_cv_prog_OBJDUMP"; then
5077 ac_ct_OBJDUMP=$OBJDUMP
5078 # Extract the first word of "objdump", so it can be a program name with args.
5079 set dummy objdump; ac_word=$2
5080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5081 $as_echo_n "checking for $ac_word... " >&6; }
5082 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
5083 $as_echo_n "(cached) " >&6
5084 else
5085 if test -n "$ac_ct_OBJDUMP"; then
5086 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5087 else
5088 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5089 for as_dir in $PATH
5090 do
5091 IFS=$as_save_IFS
5092 test -z "$as_dir" && as_dir=.
5093 for ac_exec_ext in '' $ac_executable_extensions; do
5094 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5095 ac_cv_prog_ac_ct_OBJDUMP="objdump"
5096 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5097 break 2
5098 fi
5099 done
5100 done
5101 IFS=$as_save_IFS
5102
5103 fi
5104 fi
5105 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5106 if test -n "$ac_ct_OBJDUMP"; then
5107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5108 $as_echo "$ac_ct_OBJDUMP" >&6; }
5109 else
5110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5111 $as_echo "no" >&6; }
5112 fi
5113
5114 if test "x$ac_ct_OBJDUMP" = x; then
5115 OBJDUMP="false"
5116 else
5117 case $cross_compiling:$ac_tool_warned in
5118 yes:)
5119 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5120 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5121 ac_tool_warned=yes ;;
5122 esac
5123 OBJDUMP=$ac_ct_OBJDUMP
5124 fi
5125 else
5126 OBJDUMP="$ac_cv_prog_OBJDUMP"
5127 fi
5128
5129 test -z "$OBJDUMP" && OBJDUMP=objdump
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5140 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5141 if test "${lt_cv_deplibs_check_method+set}" = set; then :
5142 $as_echo_n "(cached) " >&6
5143 else
5144 lt_cv_file_magic_cmd='$MAGIC_CMD'
5145 lt_cv_file_magic_test_file=
5146 lt_cv_deplibs_check_method='unknown'
5147 # Need to set the preceding variable on all platforms that support
5148 # interlibrary dependencies.
5149 # 'none' -- dependencies not supported.
5150 # `unknown' -- same as none, but documents that we really don't know.
5151 # 'pass_all' -- all dependencies passed with no checks.
5152 # 'test_compile' -- check by making test program.
5153 # 'file_magic [[regex]]' -- check by looking for files in library path
5154 # which responds to the $file_magic_cmd with a given extended regex.
5155 # If you have `file' or equivalent on your system and you're not sure
5156 # whether `pass_all' will *always* work, you probably want this one.
5157
5158 case $host_os in
5159 aix[4-9]*)
5160 lt_cv_deplibs_check_method=pass_all
5161 ;;
5162
5163 beos*)
5164 lt_cv_deplibs_check_method=pass_all
5165 ;;
5166
5167 bsdi[45]*)
5168 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5169 lt_cv_file_magic_cmd='/usr/bin/file -L'
5170 lt_cv_file_magic_test_file=/shlib/libc.so
5171 ;;
5172
5173 cygwin*)
5174 # func_win32_libid is a shell function defined in ltmain.sh
5175 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5176 lt_cv_file_magic_cmd='func_win32_libid'
5177 ;;
5178
5179 mingw* | pw32*)
5180 # Base MSYS/MinGW do not provide the 'file' command needed by
5181 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5182 # unless we find 'file', for example because we are cross-compiling.
5183 if ( file / ) >/dev/null 2>&1; then
5184 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5185 lt_cv_file_magic_cmd='func_win32_libid'
5186 else
5187 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5188 lt_cv_file_magic_cmd='$OBJDUMP -f'
5189 fi
5190 ;;
5191
5192 cegcc)
5193 # use the weaker test based on 'objdump'. See mingw*.
5194 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5195 lt_cv_file_magic_cmd='$OBJDUMP -f'
5196 ;;
5197
5198 darwin* | rhapsody*)
5199 lt_cv_deplibs_check_method=pass_all
5200 ;;
5201
5202 freebsd* | dragonfly*)
5203 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5204 case $host_cpu in
5205 i*86 )
5206 # Not sure whether the presence of OpenBSD here was a mistake.
5207 # Let's accept both of them until this is cleared up.
5208 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5209 lt_cv_file_magic_cmd=/usr/bin/file
5210 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5211 ;;
5212 esac
5213 else
5214 lt_cv_deplibs_check_method=pass_all
5215 fi
5216 ;;
5217
5218 gnu*)
5219 lt_cv_deplibs_check_method=pass_all
5220 ;;
5221
5222 hpux10.20* | hpux11*)
5223 lt_cv_file_magic_cmd=/usr/bin/file
5224 case $host_cpu in
5225 ia64*)
5226 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5227 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5228 ;;
5229 hppa*64*)
5230 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
5231 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5232 ;;
5233 *)
5234 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
5235 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5236 ;;
5237 esac
5238 ;;
5239
5240 interix[3-9]*)
5241 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5242 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5243 ;;
5244
5245 irix5* | irix6* | nonstopux*)
5246 case $LD in
5247 *-32|*"-32 ") libmagic=32-bit;;
5248 *-n32|*"-n32 ") libmagic=N32;;
5249 *-64|*"-64 ") libmagic=64-bit;;
5250 *) libmagic=never-match;;
5251 esac
5252 lt_cv_deplibs_check_method=pass_all
5253 ;;
5254
5255 # This must be Linux ELF.
5256 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5257 lt_cv_deplibs_check_method=pass_all
5258 ;;
5259
5260 netbsd* | netbsdelf*-gnu)
5261 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5262 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5263 else
5264 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5265 fi
5266 ;;
5267
5268 newos6*)
5269 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5270 lt_cv_file_magic_cmd=/usr/bin/file
5271 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5272 ;;
5273
5274 *nto* | *qnx*)
5275 lt_cv_deplibs_check_method=pass_all
5276 ;;
5277
5278 openbsd*)
5279 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5280 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5281 else
5282 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5283 fi
5284 ;;
5285
5286 osf3* | osf4* | osf5*)
5287 lt_cv_deplibs_check_method=pass_all
5288 ;;
5289
5290 rdos*)
5291 lt_cv_deplibs_check_method=pass_all
5292 ;;
5293
5294 solaris*)
5295 lt_cv_deplibs_check_method=pass_all
5296 ;;
5297
5298 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5299 lt_cv_deplibs_check_method=pass_all
5300 ;;
5301
5302 sysv4 | sysv4.3*)
5303 case $host_vendor in
5304 motorola)
5305 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5306 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5307 ;;
5308 ncr)
5309 lt_cv_deplibs_check_method=pass_all
5310 ;;
5311 sequent)
5312 lt_cv_file_magic_cmd='/bin/file'
5313 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5314 ;;
5315 sni)
5316 lt_cv_file_magic_cmd='/bin/file'
5317 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5318 lt_cv_file_magic_test_file=/lib/libc.so
5319 ;;
5320 siemens)
5321 lt_cv_deplibs_check_method=pass_all
5322 ;;
5323 pc)
5324 lt_cv_deplibs_check_method=pass_all
5325 ;;
5326 esac
5327 ;;
5328
5329 tpf*)
5330 lt_cv_deplibs_check_method=pass_all
5331 ;;
5332 esac
5333
5334 fi
5335 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5336 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5337 file_magic_cmd=$lt_cv_file_magic_cmd
5338 deplibs_check_method=$lt_cv_deplibs_check_method
5339 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352 if test -n "$ac_tool_prefix"; then
5353 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5354 set dummy ${ac_tool_prefix}ar; ac_word=$2
5355 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5356 $as_echo_n "checking for $ac_word... " >&6; }
5357 if test "${ac_cv_prog_AR+set}" = set; then :
5358 $as_echo_n "(cached) " >&6
5359 else
5360 if test -n "$AR"; then
5361 ac_cv_prog_AR="$AR" # Let the user override the test.
5362 else
5363 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5364 for as_dir in $PATH
5365 do
5366 IFS=$as_save_IFS
5367 test -z "$as_dir" && as_dir=.
5368 for ac_exec_ext in '' $ac_executable_extensions; do
5369 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5370 ac_cv_prog_AR="${ac_tool_prefix}ar"
5371 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5372 break 2
5373 fi
5374 done
5375 done
5376 IFS=$as_save_IFS
5377
5378 fi
5379 fi
5380 AR=$ac_cv_prog_AR
5381 if test -n "$AR"; then
5382 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5383 $as_echo "$AR" >&6; }
5384 else
5385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5386 $as_echo "no" >&6; }
5387 fi
5388
5389
5390 fi
5391 if test -z "$ac_cv_prog_AR"; then
5392 ac_ct_AR=$AR
5393 # Extract the first word of "ar", so it can be a program name with args.
5394 set dummy ar; ac_word=$2
5395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5396 $as_echo_n "checking for $ac_word... " >&6; }
5397 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
5398 $as_echo_n "(cached) " >&6
5399 else
5400 if test -n "$ac_ct_AR"; then
5401 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5402 else
5403 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5404 for as_dir in $PATH
5405 do
5406 IFS=$as_save_IFS
5407 test -z "$as_dir" && as_dir=.
5408 for ac_exec_ext in '' $ac_executable_extensions; do
5409 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5410 ac_cv_prog_ac_ct_AR="ar"
5411 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5412 break 2
5413 fi
5414 done
5415 done
5416 IFS=$as_save_IFS
5417
5418 fi
5419 fi
5420 ac_ct_AR=$ac_cv_prog_ac_ct_AR
5421 if test -n "$ac_ct_AR"; then
5422 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5423 $as_echo "$ac_ct_AR" >&6; }
5424 else
5425 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5426 $as_echo "no" >&6; }
5427 fi
5428
5429 if test "x$ac_ct_AR" = x; then
5430 AR="false"
5431 else
5432 case $cross_compiling:$ac_tool_warned in
5433 yes:)
5434 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5435 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5436 ac_tool_warned=yes ;;
5437 esac
5438 AR=$ac_ct_AR
5439 fi
5440 else
5441 AR="$ac_cv_prog_AR"
5442 fi
5443
5444 test -z "$AR" && AR=ar
5445 test -z "$AR_FLAGS" && AR_FLAGS=cru
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457 if test -n "$ac_tool_prefix"; then
5458 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5459 set dummy ${ac_tool_prefix}strip; ac_word=$2
5460 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5461 $as_echo_n "checking for $ac_word... " >&6; }
5462 if test "${ac_cv_prog_STRIP+set}" = set; then :
5463 $as_echo_n "(cached) " >&6
5464 else
5465 if test -n "$STRIP"; then
5466 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5467 else
5468 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5469 for as_dir in $PATH
5470 do
5471 IFS=$as_save_IFS
5472 test -z "$as_dir" && as_dir=.
5473 for ac_exec_ext in '' $ac_executable_extensions; do
5474 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5475 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5476 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5477 break 2
5478 fi
5479 done
5480 done
5481 IFS=$as_save_IFS
5482
5483 fi
5484 fi
5485 STRIP=$ac_cv_prog_STRIP
5486 if test -n "$STRIP"; then
5487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5488 $as_echo "$STRIP" >&6; }
5489 else
5490 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5491 $as_echo "no" >&6; }
5492 fi
5493
5494
5495 fi
5496 if test -z "$ac_cv_prog_STRIP"; then
5497 ac_ct_STRIP=$STRIP
5498 # Extract the first word of "strip", so it can be a program name with args.
5499 set dummy strip; ac_word=$2
5500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5501 $as_echo_n "checking for $ac_word... " >&6; }
5502 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
5503 $as_echo_n "(cached) " >&6
5504 else
5505 if test -n "$ac_ct_STRIP"; then
5506 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5507 else
5508 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5509 for as_dir in $PATH
5510 do
5511 IFS=$as_save_IFS
5512 test -z "$as_dir" && as_dir=.
5513 for ac_exec_ext in '' $ac_executable_extensions; do
5514 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5515 ac_cv_prog_ac_ct_STRIP="strip"
5516 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5517 break 2
5518 fi
5519 done
5520 done
5521 IFS=$as_save_IFS
5522
5523 fi
5524 fi
5525 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5526 if test -n "$ac_ct_STRIP"; then
5527 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5528 $as_echo "$ac_ct_STRIP" >&6; }
5529 else
5530 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5531 $as_echo "no" >&6; }
5532 fi
5533
5534 if test "x$ac_ct_STRIP" = x; then
5535 STRIP=":"
5536 else
5537 case $cross_compiling:$ac_tool_warned in
5538 yes:)
5539 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5540 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5541 ac_tool_warned=yes ;;
5542 esac
5543 STRIP=$ac_ct_STRIP
5544 fi
5545 else
5546 STRIP="$ac_cv_prog_STRIP"
5547 fi
5548
5549 test -z "$STRIP" && STRIP=:
5550
5551
5552
5553
5554
5555
5556 if test -n "$ac_tool_prefix"; then
5557 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5558 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5559 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5560 $as_echo_n "checking for $ac_word... " >&6; }
5561 if test "${ac_cv_prog_RANLIB+set}" = set; then :
5562 $as_echo_n "(cached) " >&6
5563 else
5564 if test -n "$RANLIB"; then
5565 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5566 else
5567 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5568 for as_dir in $PATH
5569 do
5570 IFS=$as_save_IFS
5571 test -z "$as_dir" && as_dir=.
5572 for ac_exec_ext in '' $ac_executable_extensions; do
5573 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5574 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5575 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5576 break 2
5577 fi
5578 done
5579 done
5580 IFS=$as_save_IFS
5581
5582 fi
5583 fi
5584 RANLIB=$ac_cv_prog_RANLIB
5585 if test -n "$RANLIB"; then
5586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5587 $as_echo "$RANLIB" >&6; }
5588 else
5589 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5590 $as_echo "no" >&6; }
5591 fi
5592
5593
5594 fi
5595 if test -z "$ac_cv_prog_RANLIB"; then
5596 ac_ct_RANLIB=$RANLIB
5597 # Extract the first word of "ranlib", so it can be a program name with args.
5598 set dummy ranlib; ac_word=$2
5599 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5600 $as_echo_n "checking for $ac_word... " >&6; }
5601 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
5602 $as_echo_n "(cached) " >&6
5603 else
5604 if test -n "$ac_ct_RANLIB"; then
5605 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5606 else
5607 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5608 for as_dir in $PATH
5609 do
5610 IFS=$as_save_IFS
5611 test -z "$as_dir" && as_dir=.
5612 for ac_exec_ext in '' $ac_executable_extensions; do
5613 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5614 ac_cv_prog_ac_ct_RANLIB="ranlib"
5615 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5616 break 2
5617 fi
5618 done
5619 done
5620 IFS=$as_save_IFS
5621
5622 fi
5623 fi
5624 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5625 if test -n "$ac_ct_RANLIB"; then
5626 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5627 $as_echo "$ac_ct_RANLIB" >&6; }
5628 else
5629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5630 $as_echo "no" >&6; }
5631 fi
5632
5633 if test "x$ac_ct_RANLIB" = x; then
5634 RANLIB=":"
5635 else
5636 case $cross_compiling:$ac_tool_warned in
5637 yes:)
5638 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5639 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5640 ac_tool_warned=yes ;;
5641 esac
5642 RANLIB=$ac_ct_RANLIB
5643 fi
5644 else
5645 RANLIB="$ac_cv_prog_RANLIB"
5646 fi
5647
5648 test -z "$RANLIB" && RANLIB=:
5649
5650
5651
5652
5653
5654
5655 # Determine commands to create old-style static archives.
5656 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5657 old_postinstall_cmds='chmod 644 $oldlib'
5658 old_postuninstall_cmds=
5659
5660 if test -n "$RANLIB"; then
5661 case $host_os in
5662 openbsd*)
5663 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
5664 ;;
5665 *)
5666 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
5667 ;;
5668 esac
5669 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5670 fi
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705 # If no C compiler was specified, use CC.
5706 LTCC=${LTCC-"$CC"}
5707
5708 # If no C compiler flags were specified, use CFLAGS.
5709 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
5710
5711 # Allow CC to be a program name with arguments.
5712 compiler=$CC
5713
5714
5715 # Check for command to grab the raw symbol name followed by C symbol from nm.
5716 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
5717 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
5718 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
5719 $as_echo_n "(cached) " >&6
5720 else
5721
5722 # These are sane defaults that work on at least a few old systems.
5723 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
5724
5725 # Character class describing NM global symbol codes.
5726 symcode='[BCDEGRST]'
5727
5728 # Regexp to match symbols that can be accessed directly from C.
5729 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
5730
5731 # Define system-specific variables.
5732 case $host_os in
5733 aix*)
5734 symcode='[BCDT]'
5735 ;;
5736 cygwin* | mingw* | pw32* | cegcc*)
5737 symcode='[ABCDGISTW]'
5738 ;;
5739 hpux*)
5740 if test "$host_cpu" = ia64; then
5741 symcode='[ABCDEGRST]'
5742 fi
5743 ;;
5744 irix* | nonstopux*)
5745 symcode='[BCDEGRST]'
5746 ;;
5747 osf*)
5748 symcode='[BCDEGQRST]'
5749 ;;
5750 solaris*)
5751 symcode='[BDRT]'
5752 ;;
5753 sco3.2v5*)
5754 symcode='[DT]'
5755 ;;
5756 sysv4.2uw2*)
5757 symcode='[DT]'
5758 ;;
5759 sysv5* | sco5v6* | unixware* | OpenUNIX*)
5760 symcode='[ABDT]'
5761 ;;
5762 sysv4)
5763 symcode='[DFNSTU]'
5764 ;;
5765 esac
5766
5767 # If we're using GNU nm, then use its standard symbol codes.
5768 case `$NM -V 2>&1` in
5769 *GNU* | *'with BFD'*)
5770 symcode='[ABCDGIRSTW]' ;;
5771 esac
5772
5773 # Transform an extracted symbol line into a proper C declaration.
5774 # Some systems (esp. on ia64) link data and code symbols differently,
5775 # so use this general approach.
5776 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5777
5778 # Transform an extracted symbol line into symbol name and symbol address
5779 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5780 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
5781
5782 # Handle CRLF in mingw tool chain
5783 opt_cr=
5784 case $build_os in
5785 mingw*)
5786 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5787 ;;
5788 esac
5789
5790 # Try without a prefix underscore, then with it.
5791 for ac_symprfx in "" "_"; do
5792
5793 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5794 symxfrm="\\1 $ac_symprfx\\2 \\2"
5795
5796 # Write the raw and C identifiers.
5797 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5798 # Fake it for dumpbin and say T for any non-static function
5799 # and D for any global variable.
5800 # Also find C++ and __fastcall symbols from MSVC++,
5801 # which start with @ or ?.
5802 lt_cv_sys_global_symbol_pipe="$AWK '"\
5803 " {last_section=section; section=\$ 3};"\
5804 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5805 " \$ 0!~/External *\|/{next};"\
5806 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5807 " {if(hide[section]) next};"\
5808 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5809 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5810 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
5811 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5812 " ' prfx=^$ac_symprfx"
5813 else
5814 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5815 fi
5816
5817 # Check to see that the pipe works correctly.
5818 pipe_works=no
5819
5820 rm -f conftest*
5821 cat > conftest.$ac_ext <<_LT_EOF
5822 #ifdef __cplusplus
5823 extern "C" {
5824 #endif
5825 char nm_test_var;
5826 void nm_test_func(void);
5827 void nm_test_func(void){}
5828 #ifdef __cplusplus
5829 }
5830 #endif
5831 int main(){nm_test_var='a';nm_test_func();return(0);}
5832 _LT_EOF
5833
5834 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5835 (eval $ac_compile) 2>&5
5836 ac_status=$?
5837 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5838 test $ac_status = 0; }; then
5839 # Now try to grab the symbols.
5840 nlist=conftest.nm
5841 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
5842 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
5843 ac_status=$?
5844 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5845 test $ac_status = 0; } && test -s "$nlist"; then
5846 # Try sorting and uniquifying the output.
5847 if sort "$nlist" | uniq > "$nlist"T; then
5848 mv -f "$nlist"T "$nlist"
5849 else
5850 rm -f "$nlist"T
5851 fi
5852
5853 # Make sure that we snagged all the symbols we need.
5854 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5855 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5856 cat <<_LT_EOF > conftest.$ac_ext
5857 #ifdef __cplusplus
5858 extern "C" {
5859 #endif
5860
5861 _LT_EOF
5862 # Now generate the symbol file.
5863 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5864
5865 cat <<_LT_EOF >> conftest.$ac_ext
5866
5867 /* The mapping between symbol names and symbols. */
5868 const struct {
5869 const char *name;
5870 void *address;
5871 }
5872 lt__PROGRAM__LTX_preloaded_symbols[] =
5873 {
5874 { "@PROGRAM@", (void *) 0 },
5875 _LT_EOF
5876 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5877 cat <<\_LT_EOF >> conftest.$ac_ext
5878 {0, (void *) 0}
5879 };
5880
5881 /* This works around a problem in FreeBSD linker */
5882 #ifdef FREEBSD_WORKAROUND
5883 static const void *lt_preloaded_setup() {
5884 return lt__PROGRAM__LTX_preloaded_symbols;
5885 }
5886 #endif
5887
5888 #ifdef __cplusplus
5889 }
5890 #endif
5891 _LT_EOF
5892 # Now try linking the two files.
5893 mv conftest.$ac_objext conftstm.$ac_objext
5894 lt_save_LIBS="$LIBS"
5895 lt_save_CFLAGS="$CFLAGS"
5896 LIBS="conftstm.$ac_objext"
5897 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
5898 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
5899 (eval $ac_link) 2>&5
5900 ac_status=$?
5901 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5902 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
5903 pipe_works=yes
5904 fi
5905 LIBS="$lt_save_LIBS"
5906 CFLAGS="$lt_save_CFLAGS"
5907 else
5908 echo "cannot find nm_test_func in $nlist" >&5
5909 fi
5910 else
5911 echo "cannot find nm_test_var in $nlist" >&5
5912 fi
5913 else
5914 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
5915 fi
5916 else
5917 echo "$progname: failed program was:" >&5
5918 cat conftest.$ac_ext >&5
5919 fi
5920 rm -rf conftest* conftst*
5921
5922 # Do not use the global_symbol_pipe unless it works.
5923 if test "$pipe_works" = yes; then
5924 break
5925 else
5926 lt_cv_sys_global_symbol_pipe=
5927 fi
5928 done
5929
5930 fi
5931
5932 if test -z "$lt_cv_sys_global_symbol_pipe"; then
5933 lt_cv_sys_global_symbol_to_cdecl=
5934 fi
5935 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5936 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
5937 $as_echo "failed" >&6; }
5938 else
5939 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
5940 $as_echo "ok" >&6; }
5941 fi
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965 # Check whether --enable-libtool-lock was given.
5966 if test "${enable_libtool_lock+set}" = set; then :
5967 enableval=$enable_libtool_lock;
5968 fi
5969
5970 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5971
5972 # Some flags need to be propagated to the compiler or linker for good
5973 # libtool support.
5974 case $host in
5975 ia64-*-hpux*)
5976 # Find out which ABI we are using.
5977 echo 'int i;' > conftest.$ac_ext
5978 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5979 (eval $ac_compile) 2>&5
5980 ac_status=$?
5981 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5982 test $ac_status = 0; }; then
5983 case `/usr/bin/file conftest.$ac_objext` in
5984 *ELF-32*)
5985 HPUX_IA64_MODE="32"
5986 ;;
5987 *ELF-64*)
5988 HPUX_IA64_MODE="64"
5989 ;;
5990 esac
5991 fi
5992 rm -rf conftest*
5993 ;;
5994 *-*-irix6*)
5995 # Find out which ABI we are using.
5996 echo '#line 5997 "configure"' > conftest.$ac_ext
5997 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5998 (eval $ac_compile) 2>&5
5999 ac_status=$?
6000 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6001 test $ac_status = 0; }; then
6002 if test "$lt_cv_prog_gnu_ld" = yes; then
6003 case `/usr/bin/file conftest.$ac_objext` in
6004 *32-bit*)
6005 LD="${LD-ld} -melf32bsmip"
6006 ;;
6007 *N32*)
6008 LD="${LD-ld} -melf32bmipn32"
6009 ;;
6010 *64-bit*)
6011 LD="${LD-ld} -melf64bmip"
6012 ;;
6013 esac
6014 else
6015 case `/usr/bin/file conftest.$ac_objext` in
6016 *32-bit*)
6017 LD="${LD-ld} -32"
6018 ;;
6019 *N32*)
6020 LD="${LD-ld} -n32"
6021 ;;
6022 *64-bit*)
6023 LD="${LD-ld} -64"
6024 ;;
6025 esac
6026 fi
6027 fi
6028 rm -rf conftest*
6029 ;;
6030
6031 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6032 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6033 # Find out which ABI we are using.
6034 echo 'int i;' > conftest.$ac_ext
6035 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6036 (eval $ac_compile) 2>&5
6037 ac_status=$?
6038 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6039 test $ac_status = 0; }; then
6040 case `/usr/bin/file conftest.o` in
6041 *32-bit*)
6042 case $host in
6043 x86_64-*kfreebsd*-gnu)
6044 LD="${LD-ld} -m elf_i386_fbsd"
6045 ;;
6046 x86_64-*linux*)
6047 LD="${LD-ld} -m elf_i386"
6048 ;;
6049 ppc64-*linux*|powerpc64-*linux*)
6050 LD="${LD-ld} -m elf32ppclinux"
6051 ;;
6052 s390x-*linux*)
6053 LD="${LD-ld} -m elf_s390"
6054 ;;
6055 sparc64-*linux*)
6056 LD="${LD-ld} -m elf32_sparc"
6057 ;;
6058 esac
6059 ;;
6060 *64-bit*)
6061 case $host in
6062 x86_64-*kfreebsd*-gnu)
6063 LD="${LD-ld} -m elf_x86_64_fbsd"
6064 ;;
6065 x86_64-*linux*)
6066 LD="${LD-ld} -m elf_x86_64"
6067 ;;
6068 ppc*-*linux*|powerpc*-*linux*)
6069 LD="${LD-ld} -m elf64ppc"
6070 ;;
6071 s390*-*linux*|s390*-*tpf*)
6072 LD="${LD-ld} -m elf64_s390"
6073 ;;
6074 sparc*-*linux*)
6075 LD="${LD-ld} -m elf64_sparc"
6076 ;;
6077 esac
6078 ;;
6079 esac
6080 fi
6081 rm -rf conftest*
6082 ;;
6083
6084 *-*-sco3.2v5*)
6085 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6086 SAVE_CFLAGS="$CFLAGS"
6087 CFLAGS="$CFLAGS -belf"
6088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6089 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6090 if test "${lt_cv_cc_needs_belf+set}" = set; then :
6091 $as_echo_n "(cached) " >&6
6092 else
6093 ac_ext=c
6094 ac_cpp='$CPP $CPPFLAGS'
6095 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6096 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6097 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6098
6099 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6100 /* end confdefs.h. */
6101
6102 int
6103 main ()
6104 {
6105
6106 ;
6107 return 0;
6108 }
6109 _ACEOF
6110 if ac_fn_c_try_link "$LINENO"; then :
6111 lt_cv_cc_needs_belf=yes
6112 else
6113 lt_cv_cc_needs_belf=no
6114 fi
6115 rm -f core conftest.err conftest.$ac_objext \
6116 conftest$ac_exeext conftest.$ac_ext
6117 ac_ext=c
6118 ac_cpp='$CPP $CPPFLAGS'
6119 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6120 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6121 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6122
6123 fi
6124 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6125 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6126 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6127 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6128 CFLAGS="$SAVE_CFLAGS"
6129 fi
6130 ;;
6131 sparc*-*solaris*)
6132 # Find out which ABI we are using.
6133 echo 'int i;' > conftest.$ac_ext
6134 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6135 (eval $ac_compile) 2>&5
6136 ac_status=$?
6137 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6138 test $ac_status = 0; }; then
6139 case `/usr/bin/file conftest.o` in
6140 *64-bit*)
6141 case $lt_cv_prog_gnu_ld in
6142 yes*) LD="${LD-ld} -m elf64_sparc" ;;
6143 *)
6144 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6145 LD="${LD-ld} -64"
6146 fi
6147 ;;
6148 esac
6149 ;;
6150 esac
6151 fi
6152 rm -rf conftest*
6153 ;;
6154 esac
6155
6156 need_locks="$enable_libtool_lock"
6157
6158
6159 case $host_os in
6160 rhapsody* | darwin*)
6161 if test -n "$ac_tool_prefix"; then
6162 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6163 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6164 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6165 $as_echo_n "checking for $ac_word... " >&6; }
6166 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
6167 $as_echo_n "(cached) " >&6
6168 else
6169 if test -n "$DSYMUTIL"; then
6170 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6171 else
6172 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6173 for as_dir in $PATH
6174 do
6175 IFS=$as_save_IFS
6176 test -z "$as_dir" && as_dir=.
6177 for ac_exec_ext in '' $ac_executable_extensions; do
6178 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6179 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6180 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6181 break 2
6182 fi
6183 done
6184 done
6185 IFS=$as_save_IFS
6186
6187 fi
6188 fi
6189 DSYMUTIL=$ac_cv_prog_DSYMUTIL
6190 if test -n "$DSYMUTIL"; then
6191 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6192 $as_echo "$DSYMUTIL" >&6; }
6193 else
6194 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6195 $as_echo "no" >&6; }
6196 fi
6197
6198
6199 fi
6200 if test -z "$ac_cv_prog_DSYMUTIL"; then
6201 ac_ct_DSYMUTIL=$DSYMUTIL
6202 # Extract the first word of "dsymutil", so it can be a program name with args.
6203 set dummy dsymutil; ac_word=$2
6204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6205 $as_echo_n "checking for $ac_word... " >&6; }
6206 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
6207 $as_echo_n "(cached) " >&6
6208 else
6209 if test -n "$ac_ct_DSYMUTIL"; then
6210 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6211 else
6212 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6213 for as_dir in $PATH
6214 do
6215 IFS=$as_save_IFS
6216 test -z "$as_dir" && as_dir=.
6217 for ac_exec_ext in '' $ac_executable_extensions; do
6218 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6219 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6220 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6221 break 2
6222 fi
6223 done
6224 done
6225 IFS=$as_save_IFS
6226
6227 fi
6228 fi
6229 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6230 if test -n "$ac_ct_DSYMUTIL"; then
6231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6232 $as_echo "$ac_ct_DSYMUTIL" >&6; }
6233 else
6234 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6235 $as_echo "no" >&6; }
6236 fi
6237
6238 if test "x$ac_ct_DSYMUTIL" = x; then
6239 DSYMUTIL=":"
6240 else
6241 case $cross_compiling:$ac_tool_warned in
6242 yes:)
6243 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6244 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6245 ac_tool_warned=yes ;;
6246 esac
6247 DSYMUTIL=$ac_ct_DSYMUTIL
6248 fi
6249 else
6250 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6251 fi
6252
6253 if test -n "$ac_tool_prefix"; then
6254 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6255 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6257 $as_echo_n "checking for $ac_word... " >&6; }
6258 if test "${ac_cv_prog_NMEDIT+set}" = set; then :
6259 $as_echo_n "(cached) " >&6
6260 else
6261 if test -n "$NMEDIT"; then
6262 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6263 else
6264 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6265 for as_dir in $PATH
6266 do
6267 IFS=$as_save_IFS
6268 test -z "$as_dir" && as_dir=.
6269 for ac_exec_ext in '' $ac_executable_extensions; do
6270 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6271 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
6272 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6273 break 2
6274 fi
6275 done
6276 done
6277 IFS=$as_save_IFS
6278
6279 fi
6280 fi
6281 NMEDIT=$ac_cv_prog_NMEDIT
6282 if test -n "$NMEDIT"; then
6283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
6284 $as_echo "$NMEDIT" >&6; }
6285 else
6286 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6287 $as_echo "no" >&6; }
6288 fi
6289
6290
6291 fi
6292 if test -z "$ac_cv_prog_NMEDIT"; then
6293 ac_ct_NMEDIT=$NMEDIT
6294 # Extract the first word of "nmedit", so it can be a program name with args.
6295 set dummy nmedit; ac_word=$2
6296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6297 $as_echo_n "checking for $ac_word... " >&6; }
6298 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
6299 $as_echo_n "(cached) " >&6
6300 else
6301 if test -n "$ac_ct_NMEDIT"; then
6302 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
6303 else
6304 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6305 for as_dir in $PATH
6306 do
6307 IFS=$as_save_IFS
6308 test -z "$as_dir" && as_dir=.
6309 for ac_exec_ext in '' $ac_executable_extensions; do
6310 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6311 ac_cv_prog_ac_ct_NMEDIT="nmedit"
6312 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6313 break 2
6314 fi
6315 done
6316 done
6317 IFS=$as_save_IFS
6318
6319 fi
6320 fi
6321 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
6322 if test -n "$ac_ct_NMEDIT"; then
6323 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
6324 $as_echo "$ac_ct_NMEDIT" >&6; }
6325 else
6326 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6327 $as_echo "no" >&6; }
6328 fi
6329
6330 if test "x$ac_ct_NMEDIT" = x; then
6331 NMEDIT=":"
6332 else
6333 case $cross_compiling:$ac_tool_warned in
6334 yes:)
6335 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6336 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6337 ac_tool_warned=yes ;;
6338 esac
6339 NMEDIT=$ac_ct_NMEDIT
6340 fi
6341 else
6342 NMEDIT="$ac_cv_prog_NMEDIT"
6343 fi
6344
6345 if test -n "$ac_tool_prefix"; then
6346 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
6347 set dummy ${ac_tool_prefix}lipo; ac_word=$2
6348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6349 $as_echo_n "checking for $ac_word... " >&6; }
6350 if test "${ac_cv_prog_LIPO+set}" = set; then :
6351 $as_echo_n "(cached) " >&6
6352 else
6353 if test -n "$LIPO"; then
6354 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
6355 else
6356 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6357 for as_dir in $PATH
6358 do
6359 IFS=$as_save_IFS
6360 test -z "$as_dir" && as_dir=.
6361 for ac_exec_ext in '' $ac_executable_extensions; do
6362 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6363 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
6364 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6365 break 2
6366 fi
6367 done
6368 done
6369 IFS=$as_save_IFS
6370
6371 fi
6372 fi
6373 LIPO=$ac_cv_prog_LIPO
6374 if test -n "$LIPO"; then
6375 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
6376 $as_echo "$LIPO" >&6; }
6377 else
6378 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6379 $as_echo "no" >&6; }
6380 fi
6381
6382
6383 fi
6384 if test -z "$ac_cv_prog_LIPO"; then
6385 ac_ct_LIPO=$LIPO
6386 # Extract the first word of "lipo", so it can be a program name with args.
6387 set dummy lipo; ac_word=$2
6388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6389 $as_echo_n "checking for $ac_word... " >&6; }
6390 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
6391 $as_echo_n "(cached) " >&6
6392 else
6393 if test -n "$ac_ct_LIPO"; then
6394 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
6395 else
6396 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6397 for as_dir in $PATH
6398 do
6399 IFS=$as_save_IFS
6400 test -z "$as_dir" && as_dir=.
6401 for ac_exec_ext in '' $ac_executable_extensions; do
6402 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6403 ac_cv_prog_ac_ct_LIPO="lipo"
6404 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6405 break 2
6406 fi
6407 done
6408 done
6409 IFS=$as_save_IFS
6410
6411 fi
6412 fi
6413 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
6414 if test -n "$ac_ct_LIPO"; then
6415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
6416 $as_echo "$ac_ct_LIPO" >&6; }
6417 else
6418 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6419 $as_echo "no" >&6; }
6420 fi
6421
6422 if test "x$ac_ct_LIPO" = x; then
6423 LIPO=":"
6424 else
6425 case $cross_compiling:$ac_tool_warned in
6426 yes:)
6427 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6428 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6429 ac_tool_warned=yes ;;
6430 esac
6431 LIPO=$ac_ct_LIPO
6432 fi
6433 else
6434 LIPO="$ac_cv_prog_LIPO"
6435 fi
6436
6437 if test -n "$ac_tool_prefix"; then
6438 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
6439 set dummy ${ac_tool_prefix}otool; ac_word=$2
6440 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6441 $as_echo_n "checking for $ac_word... " >&6; }
6442 if test "${ac_cv_prog_OTOOL+set}" = set; then :
6443 $as_echo_n "(cached) " >&6
6444 else
6445 if test -n "$OTOOL"; then
6446 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
6447 else
6448 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6449 for as_dir in $PATH
6450 do
6451 IFS=$as_save_IFS
6452 test -z "$as_dir" && as_dir=.
6453 for ac_exec_ext in '' $ac_executable_extensions; do
6454 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6455 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
6456 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6457 break 2
6458 fi
6459 done
6460 done
6461 IFS=$as_save_IFS
6462
6463 fi
6464 fi
6465 OTOOL=$ac_cv_prog_OTOOL
6466 if test -n "$OTOOL"; then
6467 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
6468 $as_echo "$OTOOL" >&6; }
6469 else
6470 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6471 $as_echo "no" >&6; }
6472 fi
6473
6474
6475 fi
6476 if test -z "$ac_cv_prog_OTOOL"; then
6477 ac_ct_OTOOL=$OTOOL
6478 # Extract the first word of "otool", so it can be a program name with args.
6479 set dummy otool; ac_word=$2
6480 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6481 $as_echo_n "checking for $ac_word... " >&6; }
6482 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
6483 $as_echo_n "(cached) " >&6
6484 else
6485 if test -n "$ac_ct_OTOOL"; then
6486 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
6487 else
6488 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6489 for as_dir in $PATH
6490 do
6491 IFS=$as_save_IFS
6492 test -z "$as_dir" && as_dir=.
6493 for ac_exec_ext in '' $ac_executable_extensions; do
6494 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6495 ac_cv_prog_ac_ct_OTOOL="otool"
6496 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6497 break 2
6498 fi
6499 done
6500 done
6501 IFS=$as_save_IFS
6502
6503 fi
6504 fi
6505 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
6506 if test -n "$ac_ct_OTOOL"; then
6507 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
6508 $as_echo "$ac_ct_OTOOL" >&6; }
6509 else
6510 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6511 $as_echo "no" >&6; }
6512 fi
6513
6514 if test "x$ac_ct_OTOOL" = x; then
6515 OTOOL=":"
6516 else
6517 case $cross_compiling:$ac_tool_warned in
6518 yes:)
6519 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6520 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6521 ac_tool_warned=yes ;;
6522 esac
6523 OTOOL=$ac_ct_OTOOL
6524 fi
6525 else
6526 OTOOL="$ac_cv_prog_OTOOL"
6527 fi
6528
6529 if test -n "$ac_tool_prefix"; then
6530 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
6531 set dummy ${ac_tool_prefix}otool64; ac_word=$2
6532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6533 $as_echo_n "checking for $ac_word... " >&6; }
6534 if test "${ac_cv_prog_OTOOL64+set}" = set; then :
6535 $as_echo_n "(cached) " >&6
6536 else
6537 if test -n "$OTOOL64"; then
6538 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
6539 else
6540 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6541 for as_dir in $PATH
6542 do
6543 IFS=$as_save_IFS
6544 test -z "$as_dir" && as_dir=.
6545 for ac_exec_ext in '' $ac_executable_extensions; do
6546 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6547 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
6548 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6549 break 2
6550 fi
6551 done
6552 done
6553 IFS=$as_save_IFS
6554
6555 fi
6556 fi
6557 OTOOL64=$ac_cv_prog_OTOOL64
6558 if test -n "$OTOOL64"; then
6559 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
6560 $as_echo "$OTOOL64" >&6; }
6561 else
6562 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6563 $as_echo "no" >&6; }
6564 fi
6565
6566
6567 fi
6568 if test -z "$ac_cv_prog_OTOOL64"; then
6569 ac_ct_OTOOL64=$OTOOL64
6570 # Extract the first word of "otool64", so it can be a program name with args.
6571 set dummy otool64; ac_word=$2
6572 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6573 $as_echo_n "checking for $ac_word... " >&6; }
6574 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
6575 $as_echo_n "(cached) " >&6
6576 else
6577 if test -n "$ac_ct_OTOOL64"; then
6578 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
6579 else
6580 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6581 for as_dir in $PATH
6582 do
6583 IFS=$as_save_IFS
6584 test -z "$as_dir" && as_dir=.
6585 for ac_exec_ext in '' $ac_executable_extensions; do
6586 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6587 ac_cv_prog_ac_ct_OTOOL64="otool64"
6588 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6589 break 2
6590 fi
6591 done
6592 done
6593 IFS=$as_save_IFS
6594
6595 fi
6596 fi
6597 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
6598 if test -n "$ac_ct_OTOOL64"; then
6599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
6600 $as_echo "$ac_ct_OTOOL64" >&6; }
6601 else
6602 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6603 $as_echo "no" >&6; }
6604 fi
6605
6606 if test "x$ac_ct_OTOOL64" = x; then
6607 OTOOL64=":"
6608 else
6609 case $cross_compiling:$ac_tool_warned in
6610 yes:)
6611 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6612 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6613 ac_tool_warned=yes ;;
6614 esac
6615 OTOOL64=$ac_ct_OTOOL64
6616 fi
6617 else
6618 OTOOL64="$ac_cv_prog_OTOOL64"
6619 fi
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
6648 $as_echo_n "checking for -single_module linker flag... " >&6; }
6649 if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
6650 $as_echo_n "(cached) " >&6
6651 else
6652 lt_cv_apple_cc_single_mod=no
6653 if test -z "${LT_MULTI_MODULE}"; then
6654 # By default we will add the -single_module flag. You can override
6655 # by either setting the environment variable LT_MULTI_MODULE
6656 # non-empty at configure time, or by adding -multi_module to the
6657 # link flags.
6658 rm -rf libconftest.dylib*
6659 echo "int foo(void){return 1;}" > conftest.c
6660 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6661 -dynamiclib -Wl,-single_module conftest.c" >&5
6662 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6663 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
6664 _lt_result=$?
6665 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
6666 lt_cv_apple_cc_single_mod=yes
6667 else
6668 cat conftest.err >&5
6669 fi
6670 rm -rf libconftest.dylib*
6671 rm -f conftest.*
6672 fi
6673 fi
6674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
6675 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
6676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
6677 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
6678 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
6679 $as_echo_n "(cached) " >&6
6680 else
6681 lt_cv_ld_exported_symbols_list=no
6682 save_LDFLAGS=$LDFLAGS
6683 echo "_main" > conftest.sym
6684 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
6685 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6686 /* end confdefs.h. */
6687
6688 int
6689 main ()
6690 {
6691
6692 ;
6693 return 0;
6694 }
6695 _ACEOF
6696 if ac_fn_c_try_link "$LINENO"; then :
6697 lt_cv_ld_exported_symbols_list=yes
6698 else
6699 lt_cv_ld_exported_symbols_list=no
6700 fi
6701 rm -f core conftest.err conftest.$ac_objext \
6702 conftest$ac_exeext conftest.$ac_ext
6703 LDFLAGS="$save_LDFLAGS"
6704
6705 fi
6706 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
6707 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
6708 case $host_os in
6709 rhapsody* | darwin1.[012])
6710 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
6711 darwin1.*)
6712 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6713 darwin*) # darwin 5.x on
6714 # if running on 10.5 or later, the deployment target defaults
6715 # to the OS version, if on x86, and 10.4, the deployment
6716 # target defaults to 10.4. Don't you love it?
6717 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
6718 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
6719 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6720 10.[012]*)
6721 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6722 10.*)
6723 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6724 esac
6725 ;;
6726 esac
6727 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
6728 _lt_dar_single_mod='$single_module'
6729 fi
6730 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6731 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
6732 else
6733 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
6734 fi
6735 if test "$DSYMUTIL" != ":"; then
6736 _lt_dsymutil='~$DSYMUTIL $lib || :'
6737 else
6738 _lt_dsymutil=
6739 fi
6740 ;;
6741 esac
6742
6743 ac_ext=c
6744 ac_cpp='$CPP $CPPFLAGS'
6745 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6746 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6747 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6749 $as_echo_n "checking how to run the C preprocessor... " >&6; }
6750 # On Suns, sometimes $CPP names a directory.
6751 if test -n "$CPP" && test -d "$CPP"; then
6752 CPP=
6753 fi
6754 if test -z "$CPP"; then
6755 if test "${ac_cv_prog_CPP+set}" = set; then :
6756 $as_echo_n "(cached) " >&6
6757 else
6758 # Double quotes because CPP needs to be expanded
6759 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6760 do
6761 ac_preproc_ok=false
6762 for ac_c_preproc_warn_flag in '' yes
6763 do
6764 # Use a header file that comes with gcc, so configuring glibc
6765 # with a fresh cross-compiler works.
6766 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6767 # <limits.h> exists even on freestanding compilers.
6768 # On the NeXT, cc -E runs the code through the compiler's parser,
6769 # not just through cpp. "Syntax error" is here to catch this case.
6770 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6771 /* end confdefs.h. */
6772 #ifdef __STDC__
6773 # include <limits.h>
6774 #else
6775 # include <assert.h>
6776 #endif
6777 Syntax error
6778 _ACEOF
6779 if ac_fn_c_try_cpp "$LINENO"; then :
6780
6781 else
6782 # Broken: fails on valid input.
6783 continue
6784 fi
6785 rm -f conftest.err conftest.i conftest.$ac_ext
6786
6787 # OK, works on sane cases. Now check whether nonexistent headers
6788 # can be detected and how.
6789 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6790 /* end confdefs.h. */
6791 #include <ac_nonexistent.h>
6792 _ACEOF
6793 if ac_fn_c_try_cpp "$LINENO"; then :
6794 # Broken: success on invalid input.
6795 continue
6796 else
6797 # Passes both tests.
6798 ac_preproc_ok=:
6799 break
6800 fi
6801 rm -f conftest.err conftest.i conftest.$ac_ext
6802
6803 done
6804 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6805 rm -f conftest.i conftest.err conftest.$ac_ext
6806 if $ac_preproc_ok; then :
6807 break
6808 fi
6809
6810 done
6811 ac_cv_prog_CPP=$CPP
6812
6813 fi
6814 CPP=$ac_cv_prog_CPP
6815 else
6816 ac_cv_prog_CPP=$CPP
6817 fi
6818 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6819 $as_echo "$CPP" >&6; }
6820 ac_preproc_ok=false
6821 for ac_c_preproc_warn_flag in '' yes
6822 do
6823 # Use a header file that comes with gcc, so configuring glibc
6824 # with a fresh cross-compiler works.
6825 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6826 # <limits.h> exists even on freestanding compilers.
6827 # On the NeXT, cc -E runs the code through the compiler's parser,
6828 # not just through cpp. "Syntax error" is here to catch this case.
6829 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6830 /* end confdefs.h. */
6831 #ifdef __STDC__
6832 # include <limits.h>
6833 #else
6834 # include <assert.h>
6835 #endif
6836 Syntax error
6837 _ACEOF
6838 if ac_fn_c_try_cpp "$LINENO"; then :
6839
6840 else
6841 # Broken: fails on valid input.
6842 continue
6843 fi
6844 rm -f conftest.err conftest.i conftest.$ac_ext
6845
6846 # OK, works on sane cases. Now check whether nonexistent headers
6847 # can be detected and how.
6848 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6849 /* end confdefs.h. */
6850 #include <ac_nonexistent.h>
6851 _ACEOF
6852 if ac_fn_c_try_cpp "$LINENO"; then :
6853 # Broken: success on invalid input.
6854 continue
6855 else
6856 # Passes both tests.
6857 ac_preproc_ok=:
6858 break
6859 fi
6860 rm -f conftest.err conftest.i conftest.$ac_ext
6861
6862 done
6863 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6864 rm -f conftest.i conftest.err conftest.$ac_ext
6865 if $ac_preproc_ok; then :
6866
6867 else
6868 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6869 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6870 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
6871 See \`config.log' for more details" "$LINENO" 5 ; }
6872 fi
6873
6874 ac_ext=c
6875 ac_cpp='$CPP $CPPFLAGS'
6876 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6877 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6878 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6879
6880
6881 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
6882 $as_echo_n "checking for ANSI C header files... " >&6; }
6883 if test "${ac_cv_header_stdc+set}" = set; then :
6884 $as_echo_n "(cached) " >&6
6885 else
6886 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6887 /* end confdefs.h. */
6888 #include <stdlib.h>
6889 #include <stdarg.h>
6890 #include <string.h>
6891 #include <float.h>
6892
6893 int
6894 main ()
6895 {
6896
6897 ;
6898 return 0;
6899 }
6900 _ACEOF
6901 if ac_fn_c_try_compile "$LINENO"; then :
6902 ac_cv_header_stdc=yes
6903 else
6904 ac_cv_header_stdc=no
6905 fi
6906 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6907
6908 if test $ac_cv_header_stdc = yes; then
6909 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6910 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6911 /* end confdefs.h. */
6912 #include <string.h>
6913
6914 _ACEOF
6915 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6916 $EGREP "memchr" >/dev/null 2>&1; then :
6917
6918 else
6919 ac_cv_header_stdc=no
6920 fi
6921 rm -f conftest*
6922
6923 fi
6924
6925 if test $ac_cv_header_stdc = yes; then
6926 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6927 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6928 /* end confdefs.h. */
6929 #include <stdlib.h>
6930
6931 _ACEOF
6932 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6933 $EGREP "free" >/dev/null 2>&1; then :
6934
6935 else
6936 ac_cv_header_stdc=no
6937 fi
6938 rm -f conftest*
6939
6940 fi
6941
6942 if test $ac_cv_header_stdc = yes; then
6943 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6944 if test "$cross_compiling" = yes; then :
6945 :
6946 else
6947 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6948 /* end confdefs.h. */
6949 #include <ctype.h>
6950 #include <stdlib.h>
6951 #if ((' ' & 0x0FF) == 0x020)
6952 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6953 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6954 #else
6955 # define ISLOWER(c) \
6956 (('a' <= (c) && (c) <= 'i') \
6957 || ('j' <= (c) && (c) <= 'r') \
6958 || ('s' <= (c) && (c) <= 'z'))
6959 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
6960 #endif
6961
6962 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6963 int
6964 main ()
6965 {
6966 int i;
6967 for (i = 0; i < 256; i++)
6968 if (XOR (islower (i), ISLOWER (i))
6969 || toupper (i) != TOUPPER (i))
6970 return 2;
6971 return 0;
6972 }
6973 _ACEOF
6974 if ac_fn_c_try_run "$LINENO"; then :
6975
6976 else
6977 ac_cv_header_stdc=no
6978 fi
6979 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6980 conftest.$ac_objext conftest.beam conftest.$ac_ext
6981 fi
6982
6983 fi
6984 fi
6985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
6986 $as_echo "$ac_cv_header_stdc" >&6; }
6987 if test $ac_cv_header_stdc = yes; then
6988
6989 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
6990
6991 fi
6992
6993 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
6994 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
6995 inttypes.h stdint.h unistd.h
6996 do :
6997 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
6998 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
6999 "
7000 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7001 cat >>confdefs.h <<_ACEOF
7002 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7003 _ACEOF
7004
7005 fi
7006
7007 done
7008
7009
7010 for ac_header in dlfcn.h
7011 do :
7012 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7013 "
7014 if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
7015 cat >>confdefs.h <<_ACEOF
7016 #define HAVE_DLFCN_H 1
7017 _ACEOF
7018
7019 fi
7020
7021 done
7022
7023
7024
7025 # Set options
7026
7027
7028
7029 enable_dlopen=no
7030
7031
7032 enable_win32_dll=no
7033
7034
7035
7036 # Check whether --enable-static was given.
7037 if test "${enable_static+set}" = set; then :
7038 enableval=$enable_static; p=${PACKAGE-default}
7039 case $enableval in
7040 yes) enable_static=yes ;;
7041 no) enable_static=no ;;
7042 *)
7043 enable_static=no
7044 # Look at the argument we got. We use all the common list separators.
7045 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7046 for pkg in $enableval; do
7047 IFS="$lt_save_ifs"
7048 if test "X$pkg" = "X$p"; then
7049 enable_static=yes
7050 fi
7051 done
7052 IFS="$lt_save_ifs"
7053 ;;
7054 esac
7055 else
7056 enable_static=yes
7057 fi
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068 # Check whether --with-pic was given.
7069 if test "${with_pic+set}" = set; then :
7070 withval=$with_pic; pic_mode="$withval"
7071 else
7072 pic_mode=default
7073 fi
7074
7075
7076 test -z "$pic_mode" && pic_mode=default
7077
7078
7079
7080
7081
7082
7083
7084 # Check whether --enable-fast-install was given.
7085 if test "${enable_fast_install+set}" = set; then :
7086 enableval=$enable_fast_install; p=${PACKAGE-default}
7087 case $enableval in
7088 yes) enable_fast_install=yes ;;
7089 no) enable_fast_install=no ;;
7090 *)
7091 enable_fast_install=no
7092 # Look at the argument we got. We use all the common list separators.
7093 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7094 for pkg in $enableval; do
7095 IFS="$lt_save_ifs"
7096 if test "X$pkg" = "X$p"; then
7097 enable_fast_install=yes
7098 fi
7099 done
7100 IFS="$lt_save_ifs"
7101 ;;
7102 esac
7103 else
7104 enable_fast_install=yes
7105 fi
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117 # This can be used to rebuild libtool when needed
7118 LIBTOOL_DEPS="$ltmain"
7119
7120 # Always use our own libtool.
7121 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147 test -z "$LN_S" && LN_S="ln -s"
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162 if test -n "${ZSH_VERSION+set}" ; then
7163 setopt NO_GLOB_SUBST
7164 fi
7165
7166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
7167 $as_echo_n "checking for objdir... " >&6; }
7168 if test "${lt_cv_objdir+set}" = set; then :
7169 $as_echo_n "(cached) " >&6
7170 else
7171 rm -f .libs 2>/dev/null
7172 mkdir .libs 2>/dev/null
7173 if test -d .libs; then
7174 lt_cv_objdir=.libs
7175 else
7176 # MS-DOS does not allow filenames that begin with a dot.
7177 lt_cv_objdir=_libs
7178 fi
7179 rmdir .libs 2>/dev/null
7180 fi
7181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
7182 $as_echo "$lt_cv_objdir" >&6; }
7183 objdir=$lt_cv_objdir
7184
7185
7186
7187
7188
7189 cat >>confdefs.h <<_ACEOF
7190 #define LT_OBJDIR "$lt_cv_objdir/"
7191 _ACEOF
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209 case $host_os in
7210 aix3*)
7211 # AIX sometimes has problems with the GCC collect2 program. For some
7212 # reason, if we set the COLLECT_NAMES environment variable, the problems
7213 # vanish in a puff of smoke.
7214 if test "X${COLLECT_NAMES+set}" != Xset; then
7215 COLLECT_NAMES=
7216 export COLLECT_NAMES
7217 fi
7218 ;;
7219 esac
7220
7221 # Sed substitution that helps us do robust quoting. It backslashifies
7222 # metacharacters that are still active within double-quoted strings.
7223 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
7224
7225 # Same as above, but do not quote variable references.
7226 double_quote_subst='s/\(["`\\]\)/\\\1/g'
7227
7228 # Sed substitution to delay expansion of an escaped shell variable in a
7229 # double_quote_subst'ed string.
7230 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
7231
7232 # Sed substitution to delay expansion of an escaped single quote.
7233 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
7234
7235 # Sed substitution to avoid accidental globbing in evaled expressions
7236 no_glob_subst='s/\*/\\\*/g'
7237
7238 # Global variables:
7239 ofile=libtool
7240 can_build_shared=yes
7241
7242 # All known linkers require a `.a' archive for static linking (except MSVC,
7243 # which needs '.lib').
7244 libext=a
7245
7246 with_gnu_ld="$lt_cv_prog_gnu_ld"
7247
7248 old_CC="$CC"
7249 old_CFLAGS="$CFLAGS"
7250
7251 # Set sane defaults for various variables
7252 test -z "$CC" && CC=cc
7253 test -z "$LTCC" && LTCC=$CC
7254 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
7255 test -z "$LD" && LD=ld
7256 test -z "$ac_objext" && ac_objext=o
7257
7258 for cc_temp in $compiler""; do
7259 case $cc_temp in
7260 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
7261 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
7262 \-*) ;;
7263 *) break;;
7264 esac
7265 done
7266 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
7267
7268
7269 # Only perform the check for file, if the check method requires it
7270 test -z "$MAGIC_CMD" && MAGIC_CMD=file
7271 case $deplibs_check_method in
7272 file_magic*)
7273 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
7274 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
7275 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
7276 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7277 $as_echo_n "(cached) " >&6
7278 else
7279 case $MAGIC_CMD in
7280 [\\/*] | ?:[\\/]*)
7281 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7282 ;;
7283 *)
7284 lt_save_MAGIC_CMD="$MAGIC_CMD"
7285 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7286 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7287 for ac_dir in $ac_dummy; do
7288 IFS="$lt_save_ifs"
7289 test -z "$ac_dir" && ac_dir=.
7290 if test -f $ac_dir/${ac_tool_prefix}file; then
7291 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
7292 if test -n "$file_magic_test_file"; then
7293 case $deplibs_check_method in
7294 "file_magic "*)
7295 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7296 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7297 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7298 $EGREP "$file_magic_regex" > /dev/null; then
7299 :
7300 else
7301 cat <<_LT_EOF 1>&2
7302
7303 *** Warning: the command libtool uses to detect shared libraries,
7304 *** $file_magic_cmd, produces output that libtool cannot recognize.
7305 *** The result is that libtool may fail to recognize shared libraries
7306 *** as such. This will affect the creation of libtool libraries that
7307 *** depend on shared libraries, but programs linked with such libtool
7308 *** libraries will work regardless of this problem. Nevertheless, you
7309 *** may want to report the problem to your system manager and/or to
7310 *** bug-libtool@gnu.org
7311
7312 _LT_EOF
7313 fi ;;
7314 esac
7315 fi
7316 break
7317 fi
7318 done
7319 IFS="$lt_save_ifs"
7320 MAGIC_CMD="$lt_save_MAGIC_CMD"
7321 ;;
7322 esac
7323 fi
7324
7325 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7326 if test -n "$MAGIC_CMD"; then
7327 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7328 $as_echo "$MAGIC_CMD" >&6; }
7329 else
7330 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7331 $as_echo "no" >&6; }
7332 fi
7333
7334
7335
7336
7337
7338 if test -z "$lt_cv_path_MAGIC_CMD"; then
7339 if test -n "$ac_tool_prefix"; then
7340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
7341 $as_echo_n "checking for file... " >&6; }
7342 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7343 $as_echo_n "(cached) " >&6
7344 else
7345 case $MAGIC_CMD in
7346 [\\/*] | ?:[\\/]*)
7347 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7348 ;;
7349 *)
7350 lt_save_MAGIC_CMD="$MAGIC_CMD"
7351 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7352 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7353 for ac_dir in $ac_dummy; do
7354 IFS="$lt_save_ifs"
7355 test -z "$ac_dir" && ac_dir=.
7356 if test -f $ac_dir/file; then
7357 lt_cv_path_MAGIC_CMD="$ac_dir/file"
7358 if test -n "$file_magic_test_file"; then
7359 case $deplibs_check_method in
7360 "file_magic "*)
7361 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7362 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7363 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7364 $EGREP "$file_magic_regex" > /dev/null; then
7365 :
7366 else
7367 cat <<_LT_EOF 1>&2
7368
7369 *** Warning: the command libtool uses to detect shared libraries,
7370 *** $file_magic_cmd, produces output that libtool cannot recognize.
7371 *** The result is that libtool may fail to recognize shared libraries
7372 *** as such. This will affect the creation of libtool libraries that
7373 *** depend on shared libraries, but programs linked with such libtool
7374 *** libraries will work regardless of this problem. Nevertheless, you
7375 *** may want to report the problem to your system manager and/or to
7376 *** bug-libtool@gnu.org
7377
7378 _LT_EOF
7379 fi ;;
7380 esac
7381 fi
7382 break
7383 fi
7384 done
7385 IFS="$lt_save_ifs"
7386 MAGIC_CMD="$lt_save_MAGIC_CMD"
7387 ;;
7388 esac
7389 fi
7390
7391 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7392 if test -n "$MAGIC_CMD"; then
7393 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7394 $as_echo "$MAGIC_CMD" >&6; }
7395 else
7396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7397 $as_echo "no" >&6; }
7398 fi
7399
7400
7401 else
7402 MAGIC_CMD=:
7403 fi
7404 fi
7405
7406 fi
7407 ;;
7408 esac
7409
7410 # Use C for the default configuration in the libtool script
7411
7412 lt_save_CC="$CC"
7413 ac_ext=c
7414 ac_cpp='$CPP $CPPFLAGS'
7415 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7416 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7417 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7418
7419
7420 # Source file extension for C test sources.
7421 ac_ext=c
7422
7423 # Object file extension for compiled C test sources.
7424 objext=o
7425 objext=$objext
7426
7427 # Code to be used in simple compile tests
7428 lt_simple_compile_test_code="int some_variable = 0;"
7429
7430 # Code to be used in simple link tests
7431 lt_simple_link_test_code='int main(){return(0);}'
7432
7433
7434
7435
7436
7437
7438
7439 # If no C compiler was specified, use CC.
7440 LTCC=${LTCC-"$CC"}
7441
7442 # If no C compiler flags were specified, use CFLAGS.
7443 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
7444
7445 # Allow CC to be a program name with arguments.
7446 compiler=$CC
7447
7448 # Save the default compiler, since it gets overwritten when the other
7449 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7450 compiler_DEFAULT=$CC
7451
7452 # save warnings/boilerplate of simple test code
7453 ac_outfile=conftest.$ac_objext
7454 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
7455 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7456 _lt_compiler_boilerplate=`cat conftest.err`
7457 $RM conftest*
7458
7459 ac_outfile=conftest.$ac_objext
7460 echo "$lt_simple_link_test_code" >conftest.$ac_ext
7461 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7462 _lt_linker_boilerplate=`cat conftest.err`
7463 $RM -r conftest*
7464
7465
7466 ## CAVEAT EMPTOR:
7467 ## There is no encapsulation within the following macros, do not change
7468 ## the running order or otherwise move them around unless you know exactly
7469 ## what you are doing...
7470 if test -n "$compiler"; then
7471
7472 lt_prog_compiler_no_builtin_flag=
7473
7474 if test "$GCC" = yes; then
7475 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
7476
7477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
7478 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
7479 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
7480 $as_echo_n "(cached) " >&6
7481 else
7482 lt_cv_prog_compiler_rtti_exceptions=no
7483 ac_outfile=conftest.$ac_objext
7484 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7485 lt_compiler_flag="-fno-rtti -fno-exceptions"
7486 # Insert the option either (1) after the last *FLAGS variable, or
7487 # (2) before a word containing "conftest.", or (3) at the end.
7488 # Note that $ac_compile itself does not contain backslashes and begins
7489 # with a dollar sign (not a hyphen), so the echo should work correctly.
7490 # The option is referenced via a variable to avoid confusing sed.
7491 lt_compile=`echo "$ac_compile" | $SED \
7492 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7493 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7494 -e 's:$: $lt_compiler_flag:'`
7495 (eval echo "\"\$as_me:7496: $lt_compile\"" >&5)
7496 (eval "$lt_compile" 2>conftest.err)
7497 ac_status=$?
7498 cat conftest.err >&5
7499 echo "$as_me:7500: \$? = $ac_status" >&5
7500 if (exit $ac_status) && test -s "$ac_outfile"; then
7501 # The compiler can only warn and ignore the option if not recognized
7502 # So say no if there are warnings other than the usual output.
7503 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7504 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7505 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7506 lt_cv_prog_compiler_rtti_exceptions=yes
7507 fi
7508 fi
7509 $RM conftest*
7510
7511 fi
7512 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
7513 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
7514
7515 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
7516 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
7517 else
7518 :
7519 fi
7520
7521 fi
7522
7523
7524
7525
7526
7527
7528 lt_prog_compiler_wl=
7529 lt_prog_compiler_pic=
7530 lt_prog_compiler_static=
7531
7532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
7533 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
7534
7535 if test "$GCC" = yes; then
7536 lt_prog_compiler_wl='-Wl,'
7537 lt_prog_compiler_static='-static'
7538
7539 case $host_os in
7540 aix*)
7541 # All AIX code is PIC.
7542 if test "$host_cpu" = ia64; then
7543 # AIX 5 now supports IA64 processor
7544 lt_prog_compiler_static='-Bstatic'
7545 fi
7546 ;;
7547
7548 amigaos*)
7549 case $host_cpu in
7550 powerpc)
7551 # see comment about AmigaOS4 .so support
7552 lt_prog_compiler_pic='-fPIC'
7553 ;;
7554 m68k)
7555 # FIXME: we need at least 68020 code to build shared libraries, but
7556 # adding the `-m68020' flag to GCC prevents building anything better,
7557 # like `-m68040'.
7558 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
7559 ;;
7560 esac
7561 ;;
7562
7563 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7564 # PIC is the default for these OSes.
7565 ;;
7566
7567 mingw* | cygwin* | pw32* | os2* | cegcc*)
7568 # This hack is so that the source file can tell whether it is being
7569 # built for inclusion in a dll (and should export symbols for example).
7570 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7571 # (--disable-auto-import) libraries
7572 lt_prog_compiler_pic='-DDLL_EXPORT'
7573 ;;
7574
7575 darwin* | rhapsody*)
7576 # PIC is the default on this platform
7577 # Common symbols not allowed in MH_DYLIB files
7578 lt_prog_compiler_pic='-fno-common'
7579 ;;
7580
7581 hpux*)
7582 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7583 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7584 # sets the default TLS model and affects inlining.
7585 case $host_cpu in
7586 hppa*64*)
7587 # +Z the default
7588 ;;
7589 *)
7590 lt_prog_compiler_pic='-fPIC'
7591 ;;
7592 esac
7593 ;;
7594
7595 interix[3-9]*)
7596 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7597 # Instead, we relocate shared libraries at runtime.
7598 ;;
7599
7600 msdosdjgpp*)
7601 # Just because we use GCC doesn't mean we suddenly get shared libraries
7602 # on systems that don't support them.
7603 lt_prog_compiler_can_build_shared=no
7604 enable_shared=no
7605 ;;
7606
7607 *nto* | *qnx*)
7608 # QNX uses GNU C++, but need to define -shared option too, otherwise
7609 # it will coredump.
7610 lt_prog_compiler_pic='-fPIC -shared'
7611 ;;
7612
7613 sysv4*MP*)
7614 if test -d /usr/nec; then
7615 lt_prog_compiler_pic=-Kconform_pic
7616 fi
7617 ;;
7618
7619 *)
7620 lt_prog_compiler_pic='-fPIC'
7621 ;;
7622 esac
7623 else
7624 # PORTME Check for flag to pass linker flags through the system compiler.
7625 case $host_os in
7626 aix*)
7627 lt_prog_compiler_wl='-Wl,'
7628 if test "$host_cpu" = ia64; then
7629 # AIX 5 now supports IA64 processor
7630 lt_prog_compiler_static='-Bstatic'
7631 else
7632 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
7633 fi
7634 ;;
7635
7636 mingw* | cygwin* | pw32* | os2* | cegcc*)
7637 # This hack is so that the source file can tell whether it is being
7638 # built for inclusion in a dll (and should export symbols for example).
7639 lt_prog_compiler_pic='-DDLL_EXPORT'
7640 ;;
7641
7642 hpux9* | hpux10* | hpux11*)
7643 lt_prog_compiler_wl='-Wl,'
7644 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7645 # not for PA HP-UX.
7646 case $host_cpu in
7647 hppa*64*|ia64*)
7648 # +Z the default
7649 ;;
7650 *)
7651 lt_prog_compiler_pic='+Z'
7652 ;;
7653 esac
7654 # Is there a better lt_prog_compiler_static that works with the bundled CC?
7655 lt_prog_compiler_static='${wl}-a ${wl}archive'
7656 ;;
7657
7658 irix5* | irix6* | nonstopux*)
7659 lt_prog_compiler_wl='-Wl,'
7660 # PIC (with -KPIC) is the default.
7661 lt_prog_compiler_static='-non_shared'
7662 ;;
7663
7664 linux* | k*bsd*-gnu | kopensolaris*-gnu)
7665 case $cc_basename in
7666 # old Intel for x86_64 which still supported -KPIC.
7667 ecc*)
7668 lt_prog_compiler_wl='-Wl,'
7669 lt_prog_compiler_pic='-KPIC'
7670 lt_prog_compiler_static='-static'
7671 ;;
7672 # icc used to be incompatible with GCC.
7673 # ICC 10 doesn't accept -KPIC any more.
7674 icc* | ifort*)
7675 lt_prog_compiler_wl='-Wl,'
7676 lt_prog_compiler_pic='-fPIC'
7677 lt_prog_compiler_static='-static'
7678 ;;
7679 # Lahey Fortran 8.1.
7680 lf95*)
7681 lt_prog_compiler_wl='-Wl,'
7682 lt_prog_compiler_pic='--shared'
7683 lt_prog_compiler_static='--static'
7684 ;;
7685 pgcc* | pgf77* | pgf90* | pgf95*)
7686 # Portland Group compilers (*not* the Pentium gcc compiler,
7687 # which looks to be a dead project)
7688 lt_prog_compiler_wl='-Wl,'
7689 lt_prog_compiler_pic='-fpic'
7690 lt_prog_compiler_static='-Bstatic'
7691 ;;
7692 ccc*)
7693 lt_prog_compiler_wl='-Wl,'
7694 # All Alpha code is PIC.
7695 lt_prog_compiler_static='-non_shared'
7696 ;;
7697 xl*)
7698 # IBM XL C 8.0/Fortran 10.1 on PPC
7699 lt_prog_compiler_wl='-Wl,'
7700 lt_prog_compiler_pic='-qpic'
7701 lt_prog_compiler_static='-qstaticlink'
7702 ;;
7703 *)
7704 case `$CC -V 2>&1 | sed 5q` in
7705 *Sun\ C*)
7706 # Sun C 5.9
7707 lt_prog_compiler_pic='-KPIC'
7708 lt_prog_compiler_static='-Bstatic'
7709 lt_prog_compiler_wl='-Wl,'
7710 ;;
7711 *Sun\ F*)
7712 # Sun Fortran 8.3 passes all unrecognized flags to the linker
7713 lt_prog_compiler_pic='-KPIC'
7714 lt_prog_compiler_static='-Bstatic'
7715 lt_prog_compiler_wl=''
7716 ;;
7717 esac
7718 ;;
7719 esac
7720 ;;
7721
7722 newsos6)
7723 lt_prog_compiler_pic='-KPIC'
7724 lt_prog_compiler_static='-Bstatic'
7725 ;;
7726
7727 *nto* | *qnx*)
7728 # QNX uses GNU C++, but need to define -shared option too, otherwise
7729 # it will coredump.
7730 lt_prog_compiler_pic='-fPIC -shared'
7731 ;;
7732
7733 osf3* | osf4* | osf5*)
7734 lt_prog_compiler_wl='-Wl,'
7735 # All OSF/1 code is PIC.
7736 lt_prog_compiler_static='-non_shared'
7737 ;;
7738
7739 rdos*)
7740 lt_prog_compiler_static='-non_shared'
7741 ;;
7742
7743 solaris*)
7744 lt_prog_compiler_pic='-KPIC'
7745 lt_prog_compiler_static='-Bstatic'
7746 case $cc_basename in
7747 f77* | f90* | f95*)
7748 lt_prog_compiler_wl='-Qoption ld ';;
7749 *)
7750 lt_prog_compiler_wl='-Wl,';;
7751 esac
7752 ;;
7753
7754 sunos4*)
7755 lt_prog_compiler_wl='-Qoption ld '
7756 lt_prog_compiler_pic='-PIC'
7757 lt_prog_compiler_static='-Bstatic'
7758 ;;
7759
7760 sysv4 | sysv4.2uw2* | sysv4.3*)
7761 lt_prog_compiler_wl='-Wl,'
7762 lt_prog_compiler_pic='-KPIC'
7763 lt_prog_compiler_static='-Bstatic'
7764 ;;
7765
7766 sysv4*MP*)
7767 if test -d /usr/nec ;then
7768 lt_prog_compiler_pic='-Kconform_pic'
7769 lt_prog_compiler_static='-Bstatic'
7770 fi
7771 ;;
7772
7773 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7774 lt_prog_compiler_wl='-Wl,'
7775 lt_prog_compiler_pic='-KPIC'
7776 lt_prog_compiler_static='-Bstatic'
7777 ;;
7778
7779 unicos*)
7780 lt_prog_compiler_wl='-Wl,'
7781 lt_prog_compiler_can_build_shared=no
7782 ;;
7783
7784 uts4*)
7785 lt_prog_compiler_pic='-pic'
7786 lt_prog_compiler_static='-Bstatic'
7787 ;;
7788
7789 *)
7790 lt_prog_compiler_can_build_shared=no
7791 ;;
7792 esac
7793 fi
7794
7795 case $host_os in
7796 # For platforms which do not support PIC, -DPIC is meaningless:
7797 *djgpp*)
7798 lt_prog_compiler_pic=
7799 ;;
7800 *)
7801 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
7802 ;;
7803 esac
7804 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
7805 $as_echo "$lt_prog_compiler_pic" >&6; }
7806
7807
7808
7809
7810
7811
7812 #
7813 # Check to make sure the PIC flag actually works.
7814 #
7815 if test -n "$lt_prog_compiler_pic"; then
7816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
7817 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
7818 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
7819 $as_echo_n "(cached) " >&6
7820 else
7821 lt_cv_prog_compiler_pic_works=no
7822 ac_outfile=conftest.$ac_objext
7823 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7824 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
7825 # Insert the option either (1) after the last *FLAGS variable, or
7826 # (2) before a word containing "conftest.", or (3) at the end.
7827 # Note that $ac_compile itself does not contain backslashes and begins
7828 # with a dollar sign (not a hyphen), so the echo should work correctly.
7829 # The option is referenced via a variable to avoid confusing sed.
7830 lt_compile=`echo "$ac_compile" | $SED \
7831 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7832 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7833 -e 's:$: $lt_compiler_flag:'`
7834 (eval echo "\"\$as_me:7835: $lt_compile\"" >&5)
7835 (eval "$lt_compile" 2>conftest.err)
7836 ac_status=$?
7837 cat conftest.err >&5
7838 echo "$as_me:7839: \$? = $ac_status" >&5
7839 if (exit $ac_status) && test -s "$ac_outfile"; then
7840 # The compiler can only warn and ignore the option if not recognized
7841 # So say no if there are warnings other than the usual output.
7842 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7843 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7844 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7845 lt_cv_prog_compiler_pic_works=yes
7846 fi
7847 fi
7848 $RM conftest*
7849
7850 fi
7851 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
7852 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
7853
7854 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
7855 case $lt_prog_compiler_pic in
7856 "" | " "*) ;;
7857 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
7858 esac
7859 else
7860 lt_prog_compiler_pic=
7861 lt_prog_compiler_can_build_shared=no
7862 fi
7863
7864 fi
7865
7866
7867
7868
7869
7870
7871 #
7872 # Check to make sure the static flag actually works.
7873 #
7874 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
7875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
7876 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
7877 if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
7878 $as_echo_n "(cached) " >&6
7879 else
7880 lt_cv_prog_compiler_static_works=no
7881 save_LDFLAGS="$LDFLAGS"
7882 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
7883 echo "$lt_simple_link_test_code" > conftest.$ac_ext
7884 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
7885 # The linker can only warn and ignore the option if not recognized
7886 # So say no if there are warnings
7887 if test -s conftest.err; then
7888 # Append any errors to the config.log.
7889 cat conftest.err 1>&5
7890 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
7891 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7892 if diff conftest.exp conftest.er2 >/dev/null; then
7893 lt_cv_prog_compiler_static_works=yes
7894 fi
7895 else
7896 lt_cv_prog_compiler_static_works=yes
7897 fi
7898 fi
7899 $RM -r conftest*
7900 LDFLAGS="$save_LDFLAGS"
7901
7902 fi
7903 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
7904 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
7905
7906 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
7907 :
7908 else
7909 lt_prog_compiler_static=
7910 fi
7911
7912
7913
7914
7915
7916
7917
7918 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
7919 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7920 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
7921 $as_echo_n "(cached) " >&6
7922 else
7923 lt_cv_prog_compiler_c_o=no
7924 $RM -r conftest 2>/dev/null
7925 mkdir conftest
7926 cd conftest
7927 mkdir out
7928 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7929
7930 lt_compiler_flag="-o out/conftest2.$ac_objext"
7931 # Insert the option either (1) after the last *FLAGS variable, or
7932 # (2) before a word containing "conftest.", or (3) at the end.
7933 # Note that $ac_compile itself does not contain backslashes and begins
7934 # with a dollar sign (not a hyphen), so the echo should work correctly.
7935 lt_compile=`echo "$ac_compile" | $SED \
7936 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7937 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7938 -e 's:$: $lt_compiler_flag:'`
7939 (eval echo "\"\$as_me:7940: $lt_compile\"" >&5)
7940 (eval "$lt_compile" 2>out/conftest.err)
7941 ac_status=$?
7942 cat out/conftest.err >&5
7943 echo "$as_me:7944: \$? = $ac_status" >&5
7944 if (exit $ac_status) && test -s out/conftest2.$ac_objext
7945 then
7946 # The compiler can only warn and ignore the option if not recognized
7947 # So say no if there are warnings
7948 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
7949 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
7950 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
7951 lt_cv_prog_compiler_c_o=yes
7952 fi
7953 fi
7954 chmod u+w . 2>&5
7955 $RM conftest*
7956 # SGI C++ compiler will create directory out/ii_files/ for
7957 # template instantiation
7958 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
7959 $RM out/* && rmdir out
7960 cd ..
7961 $RM -r conftest
7962 $RM conftest*
7963
7964 fi
7965 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
7966 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
7967
7968
7969
7970
7971
7972
7973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
7974 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7975 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
7976 $as_echo_n "(cached) " >&6
7977 else
7978 lt_cv_prog_compiler_c_o=no
7979 $RM -r conftest 2>/dev/null
7980 mkdir conftest
7981 cd conftest
7982 mkdir out
7983 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7984
7985 lt_compiler_flag="-o out/conftest2.$ac_objext"
7986 # Insert the option either (1) after the last *FLAGS variable, or
7987 # (2) before a word containing "conftest.", or (3) at the end.
7988 # Note that $ac_compile itself does not contain backslashes and begins
7989 # with a dollar sign (not a hyphen), so the echo should work correctly.
7990 lt_compile=`echo "$ac_compile" | $SED \
7991 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7992 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7993 -e 's:$: $lt_compiler_flag:'`
7994 (eval echo "\"\$as_me:7995: $lt_compile\"" >&5)
7995 (eval "$lt_compile" 2>out/conftest.err)
7996 ac_status=$?
7997 cat out/conftest.err >&5
7998 echo "$as_me:7999: \$? = $ac_status" >&5
7999 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8000 then
8001 # The compiler can only warn and ignore the option if not recognized
8002 # So say no if there are warnings
8003 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
8004 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8005 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8006 lt_cv_prog_compiler_c_o=yes
8007 fi
8008 fi
8009 chmod u+w . 2>&5
8010 $RM conftest*
8011 # SGI C++ compiler will create directory out/ii_files/ for
8012 # template instantiation
8013 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8014 $RM out/* && rmdir out
8015 cd ..
8016 $RM -r conftest
8017 $RM conftest*
8018
8019 fi
8020 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8021 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8022
8023
8024
8025
8026 hard_links="nottested"
8027 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
8028 # do not overwrite the value of need_locks provided by the user
8029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8030 $as_echo_n "checking if we can lock with hard links... " >&6; }
8031 hard_links=yes
8032 $RM conftest*
8033 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8034 touch conftest.a
8035 ln conftest.a conftest.b 2>&5 || hard_links=no
8036 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8037 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8038 $as_echo "$hard_links" >&6; }
8039 if test "$hard_links" = no; then
8040 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8041 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
8042 need_locks=warn
8043 fi
8044 else
8045 need_locks=no
8046 fi
8047
8048
8049
8050
8051
8052
8053 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8054 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8055
8056 runpath_var=
8057 allow_undefined_flag=
8058 always_export_symbols=no
8059 archive_cmds=
8060 archive_expsym_cmds=
8061 compiler_needs_object=no
8062 enable_shared_with_static_runtimes=no
8063 export_dynamic_flag_spec=
8064 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8065 hardcode_automatic=no
8066 hardcode_direct=no
8067 hardcode_direct_absolute=no
8068 hardcode_libdir_flag_spec=
8069 hardcode_libdir_flag_spec_ld=
8070 hardcode_libdir_separator=
8071 hardcode_minus_L=no
8072 hardcode_shlibpath_var=unsupported
8073 inherit_rpath=no
8074 link_all_deplibs=unknown
8075 module_cmds=
8076 module_expsym_cmds=
8077 old_archive_from_new_cmds=
8078 old_archive_from_expsyms_cmds=
8079 thread_safe_flag_spec=
8080 whole_archive_flag_spec=
8081 # include_expsyms should be a list of space-separated symbols to be *always*
8082 # included in the symbol list
8083 include_expsyms=
8084 # exclude_expsyms can be an extended regexp of symbols to exclude
8085 # it will be wrapped by ` (' and `)$', so one must not match beginning or
8086 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8087 # as well as any symbol that contains `d'.
8088 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
8089 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8090 # platforms (ab)use it in PIC code, but their linkers get confused if
8091 # the symbol is explicitly referenced. Since portable code cannot
8092 # rely on this symbol name, it's probably fine to never include it in
8093 # preloaded symbol tables.
8094 # Exclude shared library initialization/finalization symbols.
8095 extract_expsyms_cmds=
8096
8097 case $host_os in
8098 cygwin* | mingw* | pw32* | cegcc*)
8099 # FIXME: the MSVC++ port hasn't been tested in a loooong time
8100 # When not using gcc, we currently assume that we are using
8101 # Microsoft Visual C++.
8102 if test "$GCC" != yes; then
8103 with_gnu_ld=no
8104 fi
8105 ;;
8106 interix*)
8107 # we just hope/assume this is gcc and not c89 (= MSVC++)
8108 with_gnu_ld=yes
8109 ;;
8110 openbsd*)
8111 with_gnu_ld=no
8112 ;;
8113 linux* | k*bsd*-gnu)
8114 link_all_deplibs=no
8115 ;;
8116 esac
8117
8118 ld_shlibs=yes
8119 if test "$with_gnu_ld" = yes; then
8120 # If archive_cmds runs LD, not CC, wlarc should be empty
8121 wlarc='${wl}'
8122
8123 # Set some defaults for GNU ld with shared library support. These
8124 # are reset later if shared libraries are not supported. Putting them
8125 # here allows them to be overridden if necessary.
8126 runpath_var=LD_RUN_PATH
8127 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8128 export_dynamic_flag_spec='${wl}--export-dynamic'
8129 # ancient GNU ld didn't support --whole-archive et. al.
8130 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8131 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8132 else
8133 whole_archive_flag_spec=
8134 fi
8135 supports_anon_versioning=no
8136 case `$LD -v 2>&1` in
8137 *GNU\ gold*) supports_anon_versioning=yes ;;
8138 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
8139 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8140 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8141 *\ 2.11.*) ;; # other 2.11 versions
8142 *) supports_anon_versioning=yes ;;
8143 esac
8144
8145 # See if GNU ld supports shared libraries.
8146 case $host_os in
8147 aix[3-9]*)
8148 # On AIX/PPC, the GNU linker is very broken
8149 if test "$host_cpu" != ia64; then
8150 ld_shlibs=no
8151 cat <<_LT_EOF 1>&2
8152
8153 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
8154 *** to be unable to reliably create shared libraries on AIX.
8155 *** Therefore, libtool is disabling shared libraries support. If you
8156 *** really care for shared libraries, you may want to modify your PATH
8157 *** so that a non-GNU linker is found, and then restart.
8158
8159 _LT_EOF
8160 fi
8161 ;;
8162
8163 amigaos*)
8164 case $host_cpu in
8165 powerpc)
8166 # see comment about AmigaOS4 .so support
8167 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8168 archive_expsym_cmds=''
8169 ;;
8170 m68k)
8171 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8172 hardcode_libdir_flag_spec='-L$libdir'
8173 hardcode_minus_L=yes
8174 ;;
8175 esac
8176 ;;
8177
8178 beos*)
8179 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8180 allow_undefined_flag=unsupported
8181 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8182 # support --undefined. This deserves some investigation. FIXME
8183 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8184 else
8185 ld_shlibs=no
8186 fi
8187 ;;
8188
8189 cygwin* | mingw* | pw32* | cegcc*)
8190 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
8191 # as there is no search path for DLLs.
8192 hardcode_libdir_flag_spec='-L$libdir'
8193 allow_undefined_flag=unsupported
8194 always_export_symbols=no
8195 enable_shared_with_static_runtimes=yes
8196 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8197
8198 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8199 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8200 # If the export-symbols file already is a .def file (1st line
8201 # is EXPORTS), use it as is; otherwise, prepend...
8202 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8203 cp $export_symbols $output_objdir/$soname.def;
8204 else
8205 echo EXPORTS > $output_objdir/$soname.def;
8206 cat $export_symbols >> $output_objdir/$soname.def;
8207 fi~
8208 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8209 else
8210 ld_shlibs=no
8211 fi
8212 ;;
8213
8214 interix[3-9]*)
8215 hardcode_direct=no
8216 hardcode_shlibpath_var=no
8217 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8218 export_dynamic_flag_spec='${wl}-E'
8219 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8220 # Instead, shared libraries are loaded at an image base (0x10000000 by
8221 # default) and relocated if they conflict, which is a slow very memory
8222 # consuming and fragmenting process. To avoid this, we pick a random,
8223 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8224 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
8225 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8226 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8227 ;;
8228
8229 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8230 tmp_diet=no
8231 if test "$host_os" = linux-dietlibc; then
8232 case $cc_basename in
8233 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
8234 esac
8235 fi
8236 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8237 && test "$tmp_diet" = no
8238 then
8239 tmp_addflag=
8240 tmp_sharedflag='-shared'
8241 case $cc_basename,$host_cpu in
8242 pgcc*) # Portland Group C compiler
8243 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8244 tmp_addflag=' $pic_flag'
8245 ;;
8246 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
8247 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8248 tmp_addflag=' $pic_flag -Mnomain' ;;
8249 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
8250 tmp_addflag=' -i_dynamic' ;;
8251 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
8252 tmp_addflag=' -i_dynamic -nofor_main' ;;
8253 ifc* | ifort*) # Intel Fortran compiler
8254 tmp_addflag=' -nofor_main' ;;
8255 lf95*) # Lahey Fortran 8.1
8256 whole_archive_flag_spec=
8257 tmp_sharedflag='--shared' ;;
8258 xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8259 tmp_sharedflag='-qmkshrobj'
8260 tmp_addflag= ;;
8261 esac
8262 case `$CC -V 2>&1 | sed 5q` in
8263 *Sun\ C*) # Sun C 5.9
8264 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8265 compiler_needs_object=yes
8266 tmp_sharedflag='-G' ;;
8267 *Sun\ F*) # Sun Fortran 8.3
8268 tmp_sharedflag='-G' ;;
8269 esac
8270 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8271
8272 if test "x$supports_anon_versioning" = xyes; then
8273 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8274 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8275 echo "local: *; };" >> $output_objdir/$libname.ver~
8276 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8277 fi
8278
8279 case $cc_basename in
8280 xlf*)
8281 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8282 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
8283 hardcode_libdir_flag_spec=
8284 hardcode_libdir_flag_spec_ld='-rpath $libdir'
8285 archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
8286 if test "x$supports_anon_versioning" = xyes; then
8287 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8288 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8289 echo "local: *; };" >> $output_objdir/$libname.ver~
8290 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8291 fi
8292 ;;
8293 esac
8294 else
8295 ld_shlibs=no
8296 fi
8297 ;;
8298
8299 netbsd* | netbsdelf*-gnu)
8300 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8301 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8302 wlarc=
8303 else
8304 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8305 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8306 fi
8307 ;;
8308
8309 solaris*)
8310 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8311 ld_shlibs=no
8312 cat <<_LT_EOF 1>&2
8313
8314 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
8315 *** create shared libraries on Solaris systems. Therefore, libtool
8316 *** is disabling shared libraries support. We urge you to upgrade GNU
8317 *** binutils to release 2.9.1 or newer. Another option is to modify
8318 *** your PATH or compiler configuration so that the native linker is
8319 *** used, and then restart.
8320
8321 _LT_EOF
8322 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8323 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8324 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8325 else
8326 ld_shlibs=no
8327 fi
8328 ;;
8329
8330 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8331 case `$LD -v 2>&1` in
8332 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
8333 ld_shlibs=no
8334 cat <<_LT_EOF 1>&2
8335
8336 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
8337 *** reliably create shared libraries on SCO systems. Therefore, libtool
8338 *** is disabling shared libraries support. We urge you to upgrade GNU
8339 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
8340 *** your PATH or compiler configuration so that the native linker is
8341 *** used, and then restart.
8342
8343 _LT_EOF
8344 ;;
8345 *)
8346 # For security reasons, it is highly recommended that you always
8347 # use absolute paths for naming shared libraries, and exclude the
8348 # DT_RUNPATH tag from executables and libraries. But doing so
8349 # requires that you compile everything twice, which is a pain.
8350 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8351 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8352 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8353 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8354 else
8355 ld_shlibs=no
8356 fi
8357 ;;
8358 esac
8359 ;;
8360
8361 sunos4*)
8362 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8363 wlarc=
8364 hardcode_direct=yes
8365 hardcode_shlibpath_var=no
8366 ;;
8367
8368 *)
8369 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8370 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8371 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8372 else
8373 ld_shlibs=no
8374 fi
8375 ;;
8376 esac
8377
8378 if test "$ld_shlibs" = no; then
8379 runpath_var=
8380 hardcode_libdir_flag_spec=
8381 export_dynamic_flag_spec=
8382 whole_archive_flag_spec=
8383 fi
8384 else
8385 # PORTME fill in a description of your system's linker (not GNU ld)
8386 case $host_os in
8387 aix3*)
8388 allow_undefined_flag=unsupported
8389 always_export_symbols=yes
8390 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8391 # Note: this linker hardcodes the directories in LIBPATH if there
8392 # are no directories specified by -L.
8393 hardcode_minus_L=yes
8394 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
8395 # Neither direct hardcoding nor static linking is supported with a
8396 # broken collect2.
8397 hardcode_direct=unsupported
8398 fi
8399 ;;
8400
8401 aix[4-9]*)
8402 if test "$host_cpu" = ia64; then
8403 # On IA64, the linker does run time linking by default, so we don't
8404 # have to do anything special.
8405 aix_use_runtimelinking=no
8406 exp_sym_flag='-Bexport'
8407 no_entry_flag=""
8408 else
8409 # If we're using GNU nm, then we don't want the "-C" option.
8410 # -C means demangle to AIX nm, but means don't demangle with GNU nm
8411 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8412 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8413 else
8414 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8415 fi
8416 aix_use_runtimelinking=no
8417
8418 # Test if we are trying to use run time linking or normal
8419 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8420 # need to do runtime linking.
8421 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
8422 for ld_flag in $LDFLAGS; do
8423 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
8424 aix_use_runtimelinking=yes
8425 break
8426 fi
8427 done
8428 ;;
8429 esac
8430
8431 exp_sym_flag='-bexport'
8432 no_entry_flag='-bnoentry'
8433 fi
8434
8435 # When large executables or shared objects are built, AIX ld can
8436 # have problems creating the table of contents. If linking a library
8437 # or program results in "error TOC overflow" add -mminimal-toc to
8438 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
8439 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8440
8441 archive_cmds=''
8442 hardcode_direct=yes
8443 hardcode_direct_absolute=yes
8444 hardcode_libdir_separator=':'
8445 link_all_deplibs=yes
8446 file_list_spec='${wl}-f,'
8447
8448 if test "$GCC" = yes; then
8449 case $host_os in aix4.[012]|aix4.[012].*)
8450 # We only want to do this on AIX 4.2 and lower, the check
8451 # below for broken collect2 doesn't work under 4.3+
8452 collect2name=`${CC} -print-prog-name=collect2`
8453 if test -f "$collect2name" &&
8454 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8455 then
8456 # We have reworked collect2
8457 :
8458 else
8459 # We have old collect2
8460 hardcode_direct=unsupported
8461 # It fails to find uninstalled libraries when the uninstalled
8462 # path is not listed in the libpath. Setting hardcode_minus_L
8463 # to unsupported forces relinking
8464 hardcode_minus_L=yes
8465 hardcode_libdir_flag_spec='-L$libdir'
8466 hardcode_libdir_separator=
8467 fi
8468 ;;
8469 esac
8470 shared_flag='-shared'
8471 if test "$aix_use_runtimelinking" = yes; then
8472 shared_flag="$shared_flag "'${wl}-G'
8473 fi
8474 link_all_deplibs=no
8475 else
8476 # not using gcc
8477 if test "$host_cpu" = ia64; then
8478 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8479 # chokes on -Wl,-G. The following line is correct:
8480 shared_flag='-G'
8481 else
8482 if test "$aix_use_runtimelinking" = yes; then
8483 shared_flag='${wl}-G'
8484 else
8485 shared_flag='${wl}-bM:SRE'
8486 fi
8487 fi
8488 fi
8489
8490 export_dynamic_flag_spec='${wl}-bexpall'
8491 # It seems that -bexpall does not export symbols beginning with
8492 # underscore (_), so it is better to generate a list of symbols to export.
8493 always_export_symbols=yes
8494 if test "$aix_use_runtimelinking" = yes; then
8495 # Warning - without using the other runtime loading flags (-brtl),
8496 # -berok will link without error, but may produce a broken library.
8497 allow_undefined_flag='-berok'
8498 # Determine the default libpath from the value encoded in an
8499 # empty executable.
8500 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8501 /* end confdefs.h. */
8502
8503 int
8504 main ()
8505 {
8506
8507 ;
8508 return 0;
8509 }
8510 _ACEOF
8511 if ac_fn_c_try_link "$LINENO"; then :
8512
8513 lt_aix_libpath_sed='
8514 /Import File Strings/,/^$/ {
8515 /^0/ {
8516 s/^0 *\(.*\)$/\1/
8517 p
8518 }
8519 }'
8520 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8521 # Check for a 64-bit object if we didn't find anything.
8522 if test -z "$aix_libpath"; then
8523 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8524 fi
8525 fi
8526 rm -f core conftest.err conftest.$ac_objext \
8527 conftest$ac_exeext conftest.$ac_ext
8528 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8529
8530 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8531 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8532 else
8533 if test "$host_cpu" = ia64; then
8534 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
8535 allow_undefined_flag="-z nodefs"
8536 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
8537 else
8538 # Determine the default libpath from the value encoded in an
8539 # empty executable.
8540 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8541 /* end confdefs.h. */
8542
8543 int
8544 main ()
8545 {
8546
8547 ;
8548 return 0;
8549 }
8550 _ACEOF
8551 if ac_fn_c_try_link "$LINENO"; then :
8552
8553 lt_aix_libpath_sed='
8554 /Import File Strings/,/^$/ {
8555 /^0/ {
8556 s/^0 *\(.*\)$/\1/
8557 p
8558 }
8559 }'
8560 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8561 # Check for a 64-bit object if we didn't find anything.
8562 if test -z "$aix_libpath"; then
8563 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8564 fi
8565 fi
8566 rm -f core conftest.err conftest.$ac_objext \
8567 conftest$ac_exeext conftest.$ac_ext
8568 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8569
8570 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8571 # Warning - without using the other run time loading flags,
8572 # -berok will link without error, but may produce a broken library.
8573 no_undefined_flag=' ${wl}-bernotok'
8574 allow_undefined_flag=' ${wl}-berok'
8575 # Exported symbols can be pulled into shared objects from archives
8576 whole_archive_flag_spec='$convenience'
8577 archive_cmds_need_lc=yes
8578 # This is similar to how AIX traditionally builds its shared libraries.
8579 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8580 fi
8581 fi
8582 ;;
8583
8584 amigaos*)
8585 case $host_cpu in
8586 powerpc)
8587 # see comment about AmigaOS4 .so support
8588 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8589 archive_expsym_cmds=''
8590 ;;
8591 m68k)
8592 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8593 hardcode_libdir_flag_spec='-L$libdir'
8594 hardcode_minus_L=yes
8595 ;;
8596 esac
8597 ;;
8598
8599 bsdi[45]*)
8600 export_dynamic_flag_spec=-rdynamic
8601 ;;
8602
8603 cygwin* | mingw* | pw32* | cegcc*)
8604 # When not using gcc, we currently assume that we are using
8605 # Microsoft Visual C++.
8606 # hardcode_libdir_flag_spec is actually meaningless, as there is
8607 # no search path for DLLs.
8608 hardcode_libdir_flag_spec=' '
8609 allow_undefined_flag=unsupported
8610 # Tell ltmain to make .lib files, not .a files.
8611 libext=lib
8612 # Tell ltmain to make .dll files, not .so files.
8613 shrext_cmds=".dll"
8614 # FIXME: Setting linknames here is a bad hack.
8615 archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
8616 # The linker will automatically build a .lib file if we build a DLL.
8617 old_archive_from_new_cmds='true'
8618 # FIXME: Should let the user specify the lib program.
8619 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8620 fix_srcfile_path='`cygpath -w "$srcfile"`'
8621 enable_shared_with_static_runtimes=yes
8622 ;;
8623
8624 darwin* | rhapsody*)
8625
8626
8627 archive_cmds_need_lc=no
8628 hardcode_direct=no
8629 hardcode_automatic=yes
8630 hardcode_shlibpath_var=unsupported
8631 whole_archive_flag_spec=''
8632 link_all_deplibs=yes
8633 allow_undefined_flag="$_lt_dar_allow_undefined"
8634 case $cc_basename in
8635 ifort*) _lt_dar_can_shared=yes ;;
8636 *) _lt_dar_can_shared=$GCC ;;
8637 esac
8638 if test "$_lt_dar_can_shared" = "yes"; then
8639 output_verbose_link_cmd=echo
8640 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
8641 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
8642 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
8643 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
8644
8645 else
8646 ld_shlibs=no
8647 fi
8648
8649 ;;
8650
8651 dgux*)
8652 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8653 hardcode_libdir_flag_spec='-L$libdir'
8654 hardcode_shlibpath_var=no
8655 ;;
8656
8657 freebsd1*)
8658 ld_shlibs=no
8659 ;;
8660
8661 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8662 # support. Future versions do this automatically, but an explicit c++rt0.o
8663 # does not break anything, and helps significantly (at the cost of a little
8664 # extra space).
8665 freebsd2.2*)
8666 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8667 hardcode_libdir_flag_spec='-R$libdir'
8668 hardcode_direct=yes
8669 hardcode_shlibpath_var=no
8670 ;;
8671
8672 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8673 freebsd2*)
8674 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8675 hardcode_direct=yes
8676 hardcode_minus_L=yes
8677 hardcode_shlibpath_var=no
8678 ;;
8679
8680 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8681 freebsd* | dragonfly*)
8682 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8683 hardcode_libdir_flag_spec='-R$libdir'
8684 hardcode_direct=yes
8685 hardcode_shlibpath_var=no
8686 ;;
8687
8688 hpux9*)
8689 if test "$GCC" = yes; then
8690 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8691 else
8692 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8693 fi
8694 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8695 hardcode_libdir_separator=:
8696 hardcode_direct=yes
8697
8698 # hardcode_minus_L: Not really in the search PATH,
8699 # but as the default location of the library.
8700 hardcode_minus_L=yes
8701 export_dynamic_flag_spec='${wl}-E'
8702 ;;
8703
8704 hpux10*)
8705 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8706 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8707 else
8708 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8709 fi
8710 if test "$with_gnu_ld" = no; then
8711 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8712 hardcode_libdir_flag_spec_ld='+b $libdir'
8713 hardcode_libdir_separator=:
8714 hardcode_direct=yes
8715 hardcode_direct_absolute=yes
8716 export_dynamic_flag_spec='${wl}-E'
8717 # hardcode_minus_L: Not really in the search PATH,
8718 # but as the default location of the library.
8719 hardcode_minus_L=yes
8720 fi
8721 ;;
8722
8723 hpux11*)
8724 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8725 case $host_cpu in
8726 hppa*64*)
8727 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8728 ;;
8729 ia64*)
8730 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8731 ;;
8732 *)
8733 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8734 ;;
8735 esac
8736 else
8737 case $host_cpu in
8738 hppa*64*)
8739 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8740 ;;
8741 ia64*)
8742 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8743 ;;
8744 *)
8745 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8746 ;;
8747 esac
8748 fi
8749 if test "$with_gnu_ld" = no; then
8750 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8751 hardcode_libdir_separator=:
8752
8753 case $host_cpu in
8754 hppa*64*|ia64*)
8755 hardcode_direct=no
8756 hardcode_shlibpath_var=no
8757 ;;
8758 *)
8759 hardcode_direct=yes
8760 hardcode_direct_absolute=yes
8761 export_dynamic_flag_spec='${wl}-E'
8762
8763 # hardcode_minus_L: Not really in the search PATH,
8764 # but as the default location of the library.
8765 hardcode_minus_L=yes
8766 ;;
8767 esac
8768 fi
8769 ;;
8770
8771 irix5* | irix6* | nonstopux*)
8772 if test "$GCC" = yes; then
8773 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8774 # Try to use the -exported_symbol ld option, if it does not
8775 # work, assume that -exports_file does not work either and
8776 # implicitly export all symbols.
8777 save_LDFLAGS="$LDFLAGS"
8778 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
8779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8780 /* end confdefs.h. */
8781 int foo(void) {}
8782 _ACEOF
8783 if ac_fn_c_try_link "$LINENO"; then :
8784 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
8785
8786 fi
8787 rm -f core conftest.err conftest.$ac_objext \
8788 conftest$ac_exeext conftest.$ac_ext
8789 LDFLAGS="$save_LDFLAGS"
8790 else
8791 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8792 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
8793 fi
8794 archive_cmds_need_lc='no'
8795 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8796 hardcode_libdir_separator=:
8797 inherit_rpath=yes
8798 link_all_deplibs=yes
8799 ;;
8800
8801 netbsd* | netbsdelf*-gnu)
8802 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8803 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
8804 else
8805 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
8806 fi
8807 hardcode_libdir_flag_spec='-R$libdir'
8808 hardcode_direct=yes
8809 hardcode_shlibpath_var=no
8810 ;;
8811
8812 newsos6)
8813 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8814 hardcode_direct=yes
8815 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8816 hardcode_libdir_separator=:
8817 hardcode_shlibpath_var=no
8818 ;;
8819
8820 *nto* | *qnx*)
8821 ;;
8822
8823 openbsd*)
8824 if test -f /usr/libexec/ld.so; then
8825 hardcode_direct=yes
8826 hardcode_shlibpath_var=no
8827 hardcode_direct_absolute=yes
8828 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8829 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8830 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8831 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8832 export_dynamic_flag_spec='${wl}-E'
8833 else
8834 case $host_os in
8835 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8836 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8837 hardcode_libdir_flag_spec='-R$libdir'
8838 ;;
8839 *)
8840 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8841 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8842 ;;
8843 esac
8844 fi
8845 else
8846 ld_shlibs=no
8847 fi
8848 ;;
8849
8850 os2*)
8851 hardcode_libdir_flag_spec='-L$libdir'
8852 hardcode_minus_L=yes
8853 allow_undefined_flag=unsupported
8854 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8855 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8856 ;;
8857
8858 osf3*)
8859 if test "$GCC" = yes; then
8860 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8861 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8862 else
8863 allow_undefined_flag=' -expect_unresolved \*'
8864 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8865 fi
8866 archive_cmds_need_lc='no'
8867 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8868 hardcode_libdir_separator=:
8869 ;;
8870
8871 osf4* | osf5*) # as osf3* with the addition of -msym flag
8872 if test "$GCC" = yes; then
8873 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8874 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8875 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8876 else
8877 allow_undefined_flag=' -expect_unresolved \*'
8878 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8879 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
8880 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
8881
8882 # Both c and cxx compiler support -rpath directly
8883 hardcode_libdir_flag_spec='-rpath $libdir'
8884 fi
8885 archive_cmds_need_lc='no'
8886 hardcode_libdir_separator=:
8887 ;;
8888
8889 solaris*)
8890 no_undefined_flag=' -z defs'
8891 if test "$GCC" = yes; then
8892 wlarc='${wl}'
8893 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8894 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8895 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8896 else
8897 case `$CC -V 2>&1` in
8898 *"Compilers 5.0"*)
8899 wlarc=''
8900 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8901 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8902 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
8903 ;;
8904 *)
8905 wlarc='${wl}'
8906 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
8907 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8908 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8909 ;;
8910 esac
8911 fi
8912 hardcode_libdir_flag_spec='-R$libdir'
8913 hardcode_shlibpath_var=no
8914 case $host_os in
8915 solaris2.[0-5] | solaris2.[0-5].*) ;;
8916 *)
8917 # The compiler driver will combine and reorder linker options,
8918 # but understands `-z linker_flag'. GCC discards it without `$wl',
8919 # but is careful enough not to reorder.
8920 # Supported since Solaris 2.6 (maybe 2.5.1?)
8921 if test "$GCC" = yes; then
8922 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8923 else
8924 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
8925 fi
8926 ;;
8927 esac
8928 link_all_deplibs=yes
8929 ;;
8930
8931 sunos4*)
8932 if test "x$host_vendor" = xsequent; then
8933 # Use $CC to link under sequent, because it throws in some extra .o
8934 # files that make .init and .fini sections work.
8935 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8936 else
8937 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8938 fi
8939 hardcode_libdir_flag_spec='-L$libdir'
8940 hardcode_direct=yes
8941 hardcode_minus_L=yes
8942 hardcode_shlibpath_var=no
8943 ;;
8944
8945 sysv4)
8946 case $host_vendor in
8947 sni)
8948 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8949 hardcode_direct=yes # is this really true???
8950 ;;
8951 siemens)
8952 ## LD is ld it makes a PLAMLIB
8953 ## CC just makes a GrossModule.
8954 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8955 reload_cmds='$CC -r -o $output$reload_objs'
8956 hardcode_direct=no
8957 ;;
8958 motorola)
8959 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8960 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
8961 ;;
8962 esac
8963 runpath_var='LD_RUN_PATH'
8964 hardcode_shlibpath_var=no
8965 ;;
8966
8967 sysv4.3*)
8968 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8969 hardcode_shlibpath_var=no
8970 export_dynamic_flag_spec='-Bexport'
8971 ;;
8972
8973 sysv4*MP*)
8974 if test -d /usr/nec; then
8975 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8976 hardcode_shlibpath_var=no
8977 runpath_var=LD_RUN_PATH
8978 hardcode_runpath_var=yes
8979 ld_shlibs=yes
8980 fi
8981 ;;
8982
8983 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
8984 no_undefined_flag='${wl}-z,text'
8985 archive_cmds_need_lc=no
8986 hardcode_shlibpath_var=no
8987 runpath_var='LD_RUN_PATH'
8988
8989 if test "$GCC" = yes; then
8990 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8991 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8992 else
8993 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8994 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8995 fi
8996 ;;
8997
8998 sysv5* | sco3.2v5* | sco5v6*)
8999 # Note: We can NOT use -z defs as we might desire, because we do not
9000 # link with -lc, and that would cause any symbols used from libc to
9001 # always be unresolved, which means just about no library would
9002 # ever link correctly. If we're not using GNU ld we use -z text
9003 # though, which does catch some bad symbols but isn't as heavy-handed
9004 # as -z defs.
9005 no_undefined_flag='${wl}-z,text'
9006 allow_undefined_flag='${wl}-z,nodefs'
9007 archive_cmds_need_lc=no
9008 hardcode_shlibpath_var=no
9009 hardcode_libdir_flag_spec='${wl}-R,$libdir'
9010 hardcode_libdir_separator=':'
9011 link_all_deplibs=yes
9012 export_dynamic_flag_spec='${wl}-Bexport'
9013 runpath_var='LD_RUN_PATH'
9014
9015 if test "$GCC" = yes; then
9016 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9017 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9018 else
9019 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9020 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9021 fi
9022 ;;
9023
9024 uts4*)
9025 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9026 hardcode_libdir_flag_spec='-L$libdir'
9027 hardcode_shlibpath_var=no
9028 ;;
9029
9030 *)
9031 ld_shlibs=no
9032 ;;
9033 esac
9034
9035 if test x$host_vendor = xsni; then
9036 case $host in
9037 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9038 export_dynamic_flag_spec='${wl}-Blargedynsym'
9039 ;;
9040 esac
9041 fi
9042 fi
9043
9044 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
9045 $as_echo "$ld_shlibs" >&6; }
9046 test "$ld_shlibs" = no && can_build_shared=no
9047
9048 with_gnu_ld=$with_gnu_ld
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064 #
9065 # Do we need to explicitly link libc?
9066 #
9067 case "x$archive_cmds_need_lc" in
9068 x|xyes)
9069 # Assume -lc should be added
9070 archive_cmds_need_lc=yes
9071
9072 if test "$enable_shared" = yes && test "$GCC" = yes; then
9073 case $archive_cmds in
9074 *'~'*)
9075 # FIXME: we may have to deal with multi-command sequences.
9076 ;;
9077 '$CC '*)
9078 # Test whether the compiler implicitly links with -lc since on some
9079 # systems, -lgcc has to come before -lc. If gcc already passes -lc
9080 # to ld, don't add -lc before -lgcc.
9081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
9082 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
9083 $RM conftest*
9084 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9085
9086 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
9087 (eval $ac_compile) 2>&5
9088 ac_status=$?
9089 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9090 test $ac_status = 0; } 2>conftest.err; then
9091 soname=conftest
9092 lib=conftest
9093 libobjs=conftest.$ac_objext
9094 deplibs=
9095 wl=$lt_prog_compiler_wl
9096 pic_flag=$lt_prog_compiler_pic
9097 compiler_flags=-v
9098 linker_flags=-v
9099 verstring=
9100 output_objdir=.
9101 libname=conftest
9102 lt_save_allow_undefined_flag=$allow_undefined_flag
9103 allow_undefined_flag=
9104 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
9105 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
9106 ac_status=$?
9107 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9108 test $ac_status = 0; }
9109 then
9110 archive_cmds_need_lc=no
9111 else
9112 archive_cmds_need_lc=yes
9113 fi
9114 allow_undefined_flag=$lt_save_allow_undefined_flag
9115 else
9116 cat conftest.err 1>&5
9117 fi
9118 $RM conftest*
9119 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
9120 $as_echo "$archive_cmds_need_lc" >&6; }
9121 ;;
9122 esac
9123 fi
9124 ;;
9125 esac
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
9284 $as_echo_n "checking dynamic linker characteristics... " >&6; }
9285
9286 if test "$GCC" = yes; then
9287 case $host_os in
9288 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
9289 *) lt_awk_arg="/^libraries:/" ;;
9290 esac
9291 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9292 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
9293 # if the path contains ";" then we assume it to be the separator
9294 # otherwise default to the standard path separator (i.e. ":") - it is
9295 # assumed that no part of a normal pathname contains ";" but that should
9296 # okay in the real world where ";" in dirpaths is itself problematic.
9297 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
9298 else
9299 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9300 fi
9301 # Ok, now we have the path, separated by spaces, we can step through it
9302 # and add multilib dir if necessary.
9303 lt_tmp_lt_search_path_spec=
9304 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
9305 for lt_sys_path in $lt_search_path_spec; do
9306 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
9307 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
9308 else
9309 test -d "$lt_sys_path" && \
9310 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
9311 fi
9312 done
9313 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
9314 BEGIN {RS=" "; FS="/|\n";} {
9315 lt_foo="";
9316 lt_count=0;
9317 for (lt_i = NF; lt_i > 0; lt_i--) {
9318 if ($lt_i != "" && $lt_i != ".") {
9319 if ($lt_i == "..") {
9320 lt_count++;
9321 } else {
9322 if (lt_count == 0) {
9323 lt_foo="/" $lt_i lt_foo;
9324 } else {
9325 lt_count--;
9326 }
9327 }
9328 }
9329 }
9330 if (lt_foo != "") { lt_freq[lt_foo]++; }
9331 if (lt_freq[lt_foo] == 1) { print lt_foo; }
9332 }'`
9333 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
9334 else
9335 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
9336 fi
9337 library_names_spec=
9338 libname_spec='lib$name'
9339 soname_spec=
9340 shrext_cmds=".so"
9341 postinstall_cmds=
9342 postuninstall_cmds=
9343 finish_cmds=
9344 finish_eval=
9345 shlibpath_var=
9346 shlibpath_overrides_runpath=unknown
9347 version_type=none
9348 dynamic_linker="$host_os ld.so"
9349 sys_lib_dlsearch_path_spec="/lib /usr/lib"
9350 need_lib_prefix=unknown
9351 hardcode_into_libs=no
9352
9353 # when you set need_version to no, make sure it does not cause -set_version
9354 # flags to be left without arguments
9355 need_version=unknown
9356
9357 case $host_os in
9358 aix3*)
9359 version_type=linux
9360 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
9361 shlibpath_var=LIBPATH
9362
9363 # AIX 3 has no versioning support, so we append a major version to the name.
9364 soname_spec='${libname}${release}${shared_ext}$major'
9365 ;;
9366
9367 aix[4-9]*)
9368 version_type=linux
9369 need_lib_prefix=no
9370 need_version=no
9371 hardcode_into_libs=yes
9372 if test "$host_cpu" = ia64; then
9373 # AIX 5 supports IA64
9374 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
9375 shlibpath_var=LD_LIBRARY_PATH
9376 else
9377 # With GCC up to 2.95.x, collect2 would create an import file
9378 # for dependence libraries. The import file would start with
9379 # the line `#! .'. This would cause the generated library to
9380 # depend on `.', always an invalid library. This was fixed in
9381 # development snapshots of GCC prior to 3.0.
9382 case $host_os in
9383 aix4 | aix4.[01] | aix4.[01].*)
9384 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
9385 echo ' yes '
9386 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
9387 :
9388 else
9389 can_build_shared=no
9390 fi
9391 ;;
9392 esac
9393 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
9394 # soname into executable. Probably we can add versioning support to
9395 # collect2, so additional links can be useful in future.
9396 if test "$aix_use_runtimelinking" = yes; then
9397 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
9398 # instead of lib<name>.a to let people know that these are not
9399 # typical AIX shared libraries.
9400 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9401 else
9402 # We preserve .a as extension for shared libraries through AIX4.2
9403 # and later when we are not doing run time linking.
9404 library_names_spec='${libname}${release}.a $libname.a'
9405 soname_spec='${libname}${release}${shared_ext}$major'
9406 fi
9407 shlibpath_var=LIBPATH
9408 fi
9409 ;;
9410
9411 amigaos*)
9412 case $host_cpu in
9413 powerpc)
9414 # Since July 2007 AmigaOS4 officially supports .so libraries.
9415 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
9416 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9417 ;;
9418 m68k)
9419 library_names_spec='$libname.ixlibrary $libname.a'
9420 # Create ${libname}_ixlibrary.a entries in /sys/libs.
9421 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
9422 ;;
9423 esac
9424 ;;
9425
9426 beos*)
9427 library_names_spec='${libname}${shared_ext}'
9428 dynamic_linker="$host_os ld.so"
9429 shlibpath_var=LIBRARY_PATH
9430 ;;
9431
9432 bsdi[45]*)
9433 version_type=linux
9434 need_version=no
9435 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9436 soname_spec='${libname}${release}${shared_ext}$major'
9437 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
9438 shlibpath_var=LD_LIBRARY_PATH
9439 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
9440 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
9441 # the default ld.so.conf also contains /usr/contrib/lib and
9442 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
9443 # libtool to hard-code these into programs
9444 ;;
9445
9446 cygwin* | mingw* | pw32* | cegcc*)
9447 version_type=windows
9448 shrext_cmds=".dll"
9449 need_version=no
9450 need_lib_prefix=no
9451
9452 case $GCC,$host_os in
9453 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
9454 library_names_spec='$libname.dll.a'
9455 # DLL is installed to $(libdir)/../bin by postinstall_cmds
9456 postinstall_cmds='base_file=`basename \${file}`~
9457 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
9458 dldir=$destdir/`dirname \$dlpath`~
9459 test -d \$dldir || mkdir -p \$dldir~
9460 $install_prog $dir/$dlname \$dldir/$dlname~
9461 chmod a+x \$dldir/$dlname~
9462 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
9463 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
9464 fi'
9465 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
9466 dlpath=$dir/\$dldll~
9467 $RM \$dlpath'
9468 shlibpath_overrides_runpath=yes
9469
9470 case $host_os in
9471 cygwin*)
9472 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
9473 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9474 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
9475 ;;
9476 mingw* | cegcc*)
9477 # MinGW DLLs use traditional 'lib' prefix
9478 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9479 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9480 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
9481 # It is most probably a Windows format PATH printed by
9482 # mingw gcc, but we are running on Cygwin. Gcc prints its search
9483 # path with ; separators, and with drive letters. We can handle the
9484 # drive letters (cygwin fileutils understands them), so leave them,
9485 # especially as we might pass files found there to a mingw objdump,
9486 # which wouldn't understand a cygwinified path. Ahh.
9487 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
9488 else
9489 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9490 fi
9491 ;;
9492 pw32*)
9493 # pw32 DLLs use 'pw' prefix rather than 'lib'
9494 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9495 ;;
9496 esac
9497 ;;
9498
9499 *)
9500 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
9501 ;;
9502 esac
9503 dynamic_linker='Win32 ld.exe'
9504 # FIXME: first we should search . and the directory the executable is in
9505 shlibpath_var=PATH
9506 ;;
9507
9508 darwin* | rhapsody*)
9509 dynamic_linker="$host_os dyld"
9510 version_type=darwin
9511 need_lib_prefix=no
9512 need_version=no
9513 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
9514 soname_spec='${libname}${release}${major}$shared_ext'
9515 shlibpath_overrides_runpath=yes
9516 shlibpath_var=DYLD_LIBRARY_PATH
9517 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
9518
9519 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
9520 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
9521 ;;
9522
9523 dgux*)
9524 version_type=linux
9525 need_lib_prefix=no
9526 need_version=no
9527 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
9528 soname_spec='${libname}${release}${shared_ext}$major'
9529 shlibpath_var=LD_LIBRARY_PATH
9530 ;;
9531
9532 freebsd1*)
9533 dynamic_linker=no
9534 ;;
9535
9536 freebsd* | dragonfly*)
9537 # DragonFly does not have aout. When/if they implement a new
9538 # versioning mechanism, adjust this.
9539 if test -x /usr/bin/objformat; then
9540 objformat=`/usr/bin/objformat`
9541 else
9542 case $host_os in
9543 freebsd[123]*) objformat=aout ;;
9544 *) objformat=elf ;;
9545 esac
9546 fi
9547 version_type=freebsd-$objformat
9548 case $version_type in
9549 freebsd-elf*)
9550 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9551 need_version=no
9552 need_lib_prefix=no
9553 ;;
9554 freebsd-*)
9555 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
9556 need_version=yes
9557 ;;
9558 esac
9559 shlibpath_var=LD_LIBRARY_PATH
9560 case $host_os in
9561 freebsd2*)
9562 shlibpath_overrides_runpath=yes
9563 ;;
9564 freebsd3.[01]* | freebsdelf3.[01]*)
9565 shlibpath_overrides_runpath=yes
9566 hardcode_into_libs=yes
9567 ;;
9568 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
9569 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
9570 shlibpath_overrides_runpath=no
9571 hardcode_into_libs=yes
9572 ;;
9573 *) # from 4.6 on, and DragonFly
9574 shlibpath_overrides_runpath=yes
9575 hardcode_into_libs=yes
9576 ;;
9577 esac
9578 ;;
9579
9580 gnu*)
9581 version_type=linux
9582 need_lib_prefix=no
9583 need_version=no
9584 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
9585 soname_spec='${libname}${release}${shared_ext}$major'
9586 shlibpath_var=LD_LIBRARY_PATH
9587 hardcode_into_libs=yes
9588 ;;
9589
9590 hpux9* | hpux10* | hpux11*)
9591 # Give a soname corresponding to the major version so that dld.sl refuses to
9592 # link against other versions.
9593 version_type=sunos
9594 need_lib_prefix=no
9595 need_version=no
9596 case $host_cpu in
9597 ia64*)
9598 shrext_cmds='.so'
9599 hardcode_into_libs=yes
9600 dynamic_linker="$host_os dld.so"
9601 shlibpath_var=LD_LIBRARY_PATH
9602 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9603 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9604 soname_spec='${libname}${release}${shared_ext}$major'
9605 if test "X$HPUX_IA64_MODE" = X32; then
9606 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
9607 else
9608 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
9609 fi
9610 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9611 ;;
9612 hppa*64*)
9613 shrext_cmds='.sl'
9614 hardcode_into_libs=yes
9615 dynamic_linker="$host_os dld.sl"
9616 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
9617 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9618 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9619 soname_spec='${libname}${release}${shared_ext}$major'
9620 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
9621 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9622 ;;
9623 *)
9624 shrext_cmds='.sl'
9625 dynamic_linker="$host_os dld.sl"
9626 shlibpath_var=SHLIB_PATH
9627 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
9628 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9629 soname_spec='${libname}${release}${shared_ext}$major'
9630 ;;
9631 esac
9632 # HP-UX runs *really* slowly unless shared libraries are mode 555.
9633 postinstall_cmds='chmod 555 $lib'
9634 ;;
9635
9636 interix[3-9]*)
9637 version_type=linux
9638 need_lib_prefix=no
9639 need_version=no
9640 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9641 soname_spec='${libname}${release}${shared_ext}$major'
9642 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
9643 shlibpath_var=LD_LIBRARY_PATH
9644 shlibpath_overrides_runpath=no
9645 hardcode_into_libs=yes
9646 ;;
9647
9648 irix5* | irix6* | nonstopux*)
9649 case $host_os in
9650 nonstopux*) version_type=nonstopux ;;
9651 *)
9652 if test "$lt_cv_prog_gnu_ld" = yes; then
9653 version_type=linux
9654 else
9655 version_type=irix
9656 fi ;;
9657 esac
9658 need_lib_prefix=no
9659 need_version=no
9660 soname_spec='${libname}${release}${shared_ext}$major'
9661 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
9662 case $host_os in
9663 irix5* | nonstopux*)
9664 libsuff= shlibsuff=
9665 ;;
9666 *)
9667 case $LD in # libtool.m4 will add one of these switches to LD
9668 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
9669 libsuff= shlibsuff= libmagic=32-bit;;
9670 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
9671 libsuff=32 shlibsuff=N32 libmagic=N32;;
9672 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
9673 libsuff=64 shlibsuff=64 libmagic=64-bit;;
9674 *) libsuff= shlibsuff= libmagic=never-match;;
9675 esac
9676 ;;
9677 esac
9678 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
9679 shlibpath_overrides_runpath=no
9680 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
9681 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
9682 hardcode_into_libs=yes
9683 ;;
9684
9685 # No shared lib support for Linux oldld, aout, or coff.
9686 linux*oldld* | linux*aout* | linux*coff*)
9687 dynamic_linker=no
9688 ;;
9689
9690 # This must be Linux ELF.
9691 linux* | k*bsd*-gnu | kopensolaris*-gnu)
9692 version_type=linux
9693 need_lib_prefix=no
9694 need_version=no
9695 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9696 soname_spec='${libname}${release}${shared_ext}$major'
9697 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
9698 shlibpath_var=LD_LIBRARY_PATH
9699 shlibpath_overrides_runpath=no
9700 # Some binutils ld are patched to set DT_RUNPATH
9701 save_LDFLAGS=$LDFLAGS
9702 save_libdir=$libdir
9703 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
9704 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
9705 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9706 /* end confdefs.h. */
9707
9708 int
9709 main ()
9710 {
9711
9712 ;
9713 return 0;
9714 }
9715 _ACEOF
9716 if ac_fn_c_try_link "$LINENO"; then :
9717 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
9718 shlibpath_overrides_runpath=yes
9719 fi
9720 fi
9721 rm -f core conftest.err conftest.$ac_objext \
9722 conftest$ac_exeext conftest.$ac_ext
9723 LDFLAGS=$save_LDFLAGS
9724 libdir=$save_libdir
9725
9726 # This implies no fast_install, which is unacceptable.
9727 # Some rework will be needed to allow for fast_install
9728 # before this can be enabled.
9729 hardcode_into_libs=yes
9730
9731 # Append ld.so.conf contents to the search path
9732 if test -f /etc/ld.so.conf; then
9733 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9734 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
9735 fi
9736
9737 # We used to test for /lib/ld.so.1 and disable shared libraries on
9738 # powerpc, because MkLinux only supported shared libraries with the
9739 # GNU dynamic linker. Since this was broken with cross compilers,
9740 # most powerpc-linux boxes support dynamic linking these days and
9741 # people can always --disable-shared, the test was removed, and we
9742 # assume the GNU/Linux dynamic linker is in use.
9743 dynamic_linker='GNU/Linux ld.so'
9744 ;;
9745
9746 netbsdelf*-gnu)
9747 version_type=linux
9748 need_lib_prefix=no
9749 need_version=no
9750 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9751 soname_spec='${libname}${release}${shared_ext}$major'
9752 shlibpath_var=LD_LIBRARY_PATH
9753 shlibpath_overrides_runpath=no
9754 hardcode_into_libs=yes
9755 dynamic_linker='NetBSD ld.elf_so'
9756 ;;
9757
9758 netbsd*)
9759 version_type=sunos
9760 need_lib_prefix=no
9761 need_version=no
9762 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9763 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9764 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9765 dynamic_linker='NetBSD (a.out) ld.so'
9766 else
9767 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9768 soname_spec='${libname}${release}${shared_ext}$major'
9769 dynamic_linker='NetBSD ld.elf_so'
9770 fi
9771 shlibpath_var=LD_LIBRARY_PATH
9772 shlibpath_overrides_runpath=yes
9773 hardcode_into_libs=yes
9774 ;;
9775
9776 newsos6)
9777 version_type=linux
9778 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9779 shlibpath_var=LD_LIBRARY_PATH
9780 shlibpath_overrides_runpath=yes
9781 ;;
9782
9783 *nto* | *qnx*)
9784 version_type=qnx
9785 need_lib_prefix=no
9786 need_version=no
9787 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9788 soname_spec='${libname}${release}${shared_ext}$major'
9789 shlibpath_var=LD_LIBRARY_PATH
9790 shlibpath_overrides_runpath=no
9791 hardcode_into_libs=yes
9792 dynamic_linker='ldqnx.so'
9793 ;;
9794
9795 openbsd*)
9796 version_type=sunos
9797 sys_lib_dlsearch_path_spec="/usr/lib"
9798 need_lib_prefix=no
9799 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
9800 case $host_os in
9801 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
9802 *) need_version=no ;;
9803 esac
9804 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9805 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9806 shlibpath_var=LD_LIBRARY_PATH
9807 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9808 case $host_os in
9809 openbsd2.[89] | openbsd2.[89].*)
9810 shlibpath_overrides_runpath=no
9811 ;;
9812 *)
9813 shlibpath_overrides_runpath=yes
9814 ;;
9815 esac
9816 else
9817 shlibpath_overrides_runpath=yes
9818 fi
9819 ;;
9820
9821 os2*)
9822 libname_spec='$name'
9823 shrext_cmds=".dll"
9824 need_lib_prefix=no
9825 library_names_spec='$libname${shared_ext} $libname.a'
9826 dynamic_linker='OS/2 ld.exe'
9827 shlibpath_var=LIBPATH
9828 ;;
9829
9830 osf3* | osf4* | osf5*)
9831 version_type=osf
9832 need_lib_prefix=no
9833 need_version=no
9834 soname_spec='${libname}${release}${shared_ext}$major'
9835 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9836 shlibpath_var=LD_LIBRARY_PATH
9837 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
9838 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9839 ;;
9840
9841 rdos*)
9842 dynamic_linker=no
9843 ;;
9844
9845 solaris*)
9846 version_type=linux
9847 need_lib_prefix=no
9848 need_version=no
9849 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9850 soname_spec='${libname}${release}${shared_ext}$major'
9851 shlibpath_var=LD_LIBRARY_PATH
9852 shlibpath_overrides_runpath=yes
9853 hardcode_into_libs=yes
9854 # ldd complains unless libraries are executable
9855 postinstall_cmds='chmod +x $lib'
9856 ;;
9857
9858 sunos4*)
9859 version_type=sunos
9860 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9861 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
9862 shlibpath_var=LD_LIBRARY_PATH
9863 shlibpath_overrides_runpath=yes
9864 if test "$with_gnu_ld" = yes; then
9865 need_lib_prefix=no
9866 fi
9867 need_version=yes
9868 ;;
9869
9870 sysv4 | sysv4.3*)
9871 version_type=linux
9872 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9873 soname_spec='${libname}${release}${shared_ext}$major'
9874 shlibpath_var=LD_LIBRARY_PATH
9875 case $host_vendor in
9876 sni)
9877 shlibpath_overrides_runpath=no
9878 need_lib_prefix=no
9879 runpath_var=LD_RUN_PATH
9880 ;;
9881 siemens)
9882 need_lib_prefix=no
9883 ;;
9884 motorola)
9885 need_lib_prefix=no
9886 need_version=no
9887 shlibpath_overrides_runpath=no
9888 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
9889 ;;
9890 esac
9891 ;;
9892
9893 sysv4*MP*)
9894 if test -d /usr/nec ;then
9895 version_type=linux
9896 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
9897 soname_spec='$libname${shared_ext}.$major'
9898 shlibpath_var=LD_LIBRARY_PATH
9899 fi
9900 ;;
9901
9902 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
9903 version_type=freebsd-elf
9904 need_lib_prefix=no
9905 need_version=no
9906 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9907 soname_spec='${libname}${release}${shared_ext}$major'
9908 shlibpath_var=LD_LIBRARY_PATH
9909 shlibpath_overrides_runpath=yes
9910 hardcode_into_libs=yes
9911 if test "$with_gnu_ld" = yes; then
9912 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
9913 else
9914 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
9915 case $host_os in
9916 sco3.2v5*)
9917 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
9918 ;;
9919 esac
9920 fi
9921 sys_lib_dlsearch_path_spec='/usr/lib'
9922 ;;
9923
9924 tpf*)
9925 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
9926 version_type=linux
9927 need_lib_prefix=no
9928 need_version=no
9929 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9930 shlibpath_var=LD_LIBRARY_PATH
9931 shlibpath_overrides_runpath=no
9932 hardcode_into_libs=yes
9933 ;;
9934
9935 uts4*)
9936 version_type=linux
9937 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9938 soname_spec='${libname}${release}${shared_ext}$major'
9939 shlibpath_var=LD_LIBRARY_PATH
9940 ;;
9941
9942 *)
9943 dynamic_linker=no
9944 ;;
9945 esac
9946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
9947 $as_echo "$dynamic_linker" >&6; }
9948 test "$dynamic_linker" = no && can_build_shared=no
9949
9950 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
9951 if test "$GCC" = yes; then
9952 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
9953 fi
9954
9955 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
9956 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
9957 fi
9958 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
9959 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
9960 fi
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
10049 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
10050 hardcode_action=
10051 if test -n "$hardcode_libdir_flag_spec" ||
10052 test -n "$runpath_var" ||
10053 test "X$hardcode_automatic" = "Xyes" ; then
10054
10055 # We can hardcode non-existent directories.
10056 if test "$hardcode_direct" != no &&
10057 # If the only mechanism to avoid hardcoding is shlibpath_var, we
10058 # have to relink, otherwise we might link with an installed library
10059 # when we should be linking with a yet-to-be-installed one
10060 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
10061 test "$hardcode_minus_L" != no; then
10062 # Linking always hardcodes the temporary library directory.
10063 hardcode_action=relink
10064 else
10065 # We can link without hardcoding, and we can hardcode nonexisting dirs.
10066 hardcode_action=immediate
10067 fi
10068 else
10069 # We cannot hardcode anything, or else we can only hardcode existing
10070 # directories.
10071 hardcode_action=unsupported
10072 fi
10073 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
10074 $as_echo "$hardcode_action" >&6; }
10075
10076 if test "$hardcode_action" = relink ||
10077 test "$inherit_rpath" = yes; then
10078 # Fast installation is not supported
10079 enable_fast_install=no
10080 elif test "$shlibpath_overrides_runpath" = yes ||
10081 test "$enable_shared" = no; then
10082 # Fast installation is not necessary
10083 enable_fast_install=needless
10084 fi
10085
10086
10087
10088
10089
10090
10091 if test "x$enable_dlopen" != xyes; then
10092 enable_dlopen=unknown
10093 enable_dlopen_self=unknown
10094 enable_dlopen_self_static=unknown
10095 else
10096 lt_cv_dlopen=no
10097 lt_cv_dlopen_libs=
10098
10099 case $host_os in
10100 beos*)
10101 lt_cv_dlopen="load_add_on"
10102 lt_cv_dlopen_libs=
10103 lt_cv_dlopen_self=yes
10104 ;;
10105
10106 mingw* | pw32* | cegcc*)
10107 lt_cv_dlopen="LoadLibrary"
10108 lt_cv_dlopen_libs=
10109 ;;
10110
10111 cygwin*)
10112 lt_cv_dlopen="dlopen"
10113 lt_cv_dlopen_libs=
10114 ;;
10115
10116 darwin*)
10117 # if libdl is installed we need to link against it
10118 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10119 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10120 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10121 $as_echo_n "(cached) " >&6
10122 else
10123 ac_check_lib_save_LIBS=$LIBS
10124 LIBS="-ldl $LIBS"
10125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10126 /* end confdefs.h. */
10127
10128 /* Override any GCC internal prototype to avoid an error.
10129 Use char because int might match the return type of a GCC
10130 builtin and then its argument prototype would still apply. */
10131 #ifdef __cplusplus
10132 extern "C"
10133 #endif
10134 char dlopen ();
10135 int
10136 main ()
10137 {
10138 return dlopen ();
10139 ;
10140 return 0;
10141 }
10142 _ACEOF
10143 if ac_fn_c_try_link "$LINENO"; then :
10144 ac_cv_lib_dl_dlopen=yes
10145 else
10146 ac_cv_lib_dl_dlopen=no
10147 fi
10148 rm -f core conftest.err conftest.$ac_objext \
10149 conftest$ac_exeext conftest.$ac_ext
10150 LIBS=$ac_check_lib_save_LIBS
10151 fi
10152 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10153 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10154 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10155 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10156 else
10157
10158 lt_cv_dlopen="dyld"
10159 lt_cv_dlopen_libs=
10160 lt_cv_dlopen_self=yes
10161
10162 fi
10163
10164 ;;
10165
10166 *)
10167 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10168 if test "x$ac_cv_func_shl_load" = x""yes; then :
10169 lt_cv_dlopen="shl_load"
10170 else
10171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
10172 $as_echo_n "checking for shl_load in -ldld... " >&6; }
10173 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10174 $as_echo_n "(cached) " >&6
10175 else
10176 ac_check_lib_save_LIBS=$LIBS
10177 LIBS="-ldld $LIBS"
10178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10179 /* end confdefs.h. */
10180
10181 /* Override any GCC internal prototype to avoid an error.
10182 Use char because int might match the return type of a GCC
10183 builtin and then its argument prototype would still apply. */
10184 #ifdef __cplusplus
10185 extern "C"
10186 #endif
10187 char shl_load ();
10188 int
10189 main ()
10190 {
10191 return shl_load ();
10192 ;
10193 return 0;
10194 }
10195 _ACEOF
10196 if ac_fn_c_try_link "$LINENO"; then :
10197 ac_cv_lib_dld_shl_load=yes
10198 else
10199 ac_cv_lib_dld_shl_load=no
10200 fi
10201 rm -f core conftest.err conftest.$ac_objext \
10202 conftest$ac_exeext conftest.$ac_ext
10203 LIBS=$ac_check_lib_save_LIBS
10204 fi
10205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
10206 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10207 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10208 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
10209 else
10210 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
10211 if test "x$ac_cv_func_dlopen" = x""yes; then :
10212 lt_cv_dlopen="dlopen"
10213 else
10214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10215 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10216 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10217 $as_echo_n "(cached) " >&6
10218 else
10219 ac_check_lib_save_LIBS=$LIBS
10220 LIBS="-ldl $LIBS"
10221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10222 /* end confdefs.h. */
10223
10224 /* Override any GCC internal prototype to avoid an error.
10225 Use char because int might match the return type of a GCC
10226 builtin and then its argument prototype would still apply. */
10227 #ifdef __cplusplus
10228 extern "C"
10229 #endif
10230 char dlopen ();
10231 int
10232 main ()
10233 {
10234 return dlopen ();
10235 ;
10236 return 0;
10237 }
10238 _ACEOF
10239 if ac_fn_c_try_link "$LINENO"; then :
10240 ac_cv_lib_dl_dlopen=yes
10241 else
10242 ac_cv_lib_dl_dlopen=no
10243 fi
10244 rm -f core conftest.err conftest.$ac_objext \
10245 conftest$ac_exeext conftest.$ac_ext
10246 LIBS=$ac_check_lib_save_LIBS
10247 fi
10248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10249 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10250 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10251 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10252 else
10253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
10254 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
10255 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
10256 $as_echo_n "(cached) " >&6
10257 else
10258 ac_check_lib_save_LIBS=$LIBS
10259 LIBS="-lsvld $LIBS"
10260 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10261 /* end confdefs.h. */
10262
10263 /* Override any GCC internal prototype to avoid an error.
10264 Use char because int might match the return type of a GCC
10265 builtin and then its argument prototype would still apply. */
10266 #ifdef __cplusplus
10267 extern "C"
10268 #endif
10269 char dlopen ();
10270 int
10271 main ()
10272 {
10273 return dlopen ();
10274 ;
10275 return 0;
10276 }
10277 _ACEOF
10278 if ac_fn_c_try_link "$LINENO"; then :
10279 ac_cv_lib_svld_dlopen=yes
10280 else
10281 ac_cv_lib_svld_dlopen=no
10282 fi
10283 rm -f core conftest.err conftest.$ac_objext \
10284 conftest$ac_exeext conftest.$ac_ext
10285 LIBS=$ac_check_lib_save_LIBS
10286 fi
10287 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
10288 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10289 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
10290 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
10291 else
10292 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
10293 $as_echo_n "checking for dld_link in -ldld... " >&6; }
10294 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
10295 $as_echo_n "(cached) " >&6
10296 else
10297 ac_check_lib_save_LIBS=$LIBS
10298 LIBS="-ldld $LIBS"
10299 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10300 /* end confdefs.h. */
10301
10302 /* Override any GCC internal prototype to avoid an error.
10303 Use char because int might match the return type of a GCC
10304 builtin and then its argument prototype would still apply. */
10305 #ifdef __cplusplus
10306 extern "C"
10307 #endif
10308 char dld_link ();
10309 int
10310 main ()
10311 {
10312 return dld_link ();
10313 ;
10314 return 0;
10315 }
10316 _ACEOF
10317 if ac_fn_c_try_link "$LINENO"; then :
10318 ac_cv_lib_dld_dld_link=yes
10319 else
10320 ac_cv_lib_dld_dld_link=no
10321 fi
10322 rm -f core conftest.err conftest.$ac_objext \
10323 conftest$ac_exeext conftest.$ac_ext
10324 LIBS=$ac_check_lib_save_LIBS
10325 fi
10326 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
10327 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10328 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
10329 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
10330 fi
10331
10332
10333 fi
10334
10335
10336 fi
10337
10338
10339 fi
10340
10341
10342 fi
10343
10344
10345 fi
10346
10347 ;;
10348 esac
10349
10350 if test "x$lt_cv_dlopen" != xno; then
10351 enable_dlopen=yes
10352 else
10353 enable_dlopen=no
10354 fi
10355
10356 case $lt_cv_dlopen in
10357 dlopen)
10358 save_CPPFLAGS="$CPPFLAGS"
10359 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
10360
10361 save_LDFLAGS="$LDFLAGS"
10362 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
10363
10364 save_LIBS="$LIBS"
10365 LIBS="$lt_cv_dlopen_libs $LIBS"
10366
10367 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
10368 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
10369 if test "${lt_cv_dlopen_self+set}" = set; then :
10370 $as_echo_n "(cached) " >&6
10371 else
10372 if test "$cross_compiling" = yes; then :
10373 lt_cv_dlopen_self=cross
10374 else
10375 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10376 lt_status=$lt_dlunknown
10377 cat > conftest.$ac_ext <<_LT_EOF
10378 #line 10379 "configure"
10379 #include "confdefs.h"
10380
10381 #if HAVE_DLFCN_H
10382 #include <dlfcn.h>
10383 #endif
10384
10385 #include <stdio.h>
10386
10387 #ifdef RTLD_GLOBAL
10388 # define LT_DLGLOBAL RTLD_GLOBAL
10389 #else
10390 # ifdef DL_GLOBAL
10391 # define LT_DLGLOBAL DL_GLOBAL
10392 # else
10393 # define LT_DLGLOBAL 0
10394 # endif
10395 #endif
10396
10397 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10398 find out it does not work in some platform. */
10399 #ifndef LT_DLLAZY_OR_NOW
10400 # ifdef RTLD_LAZY
10401 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10402 # else
10403 # ifdef DL_LAZY
10404 # define LT_DLLAZY_OR_NOW DL_LAZY
10405 # else
10406 # ifdef RTLD_NOW
10407 # define LT_DLLAZY_OR_NOW RTLD_NOW
10408 # else
10409 # ifdef DL_NOW
10410 # define LT_DLLAZY_OR_NOW DL_NOW
10411 # else
10412 # define LT_DLLAZY_OR_NOW 0
10413 # endif
10414 # endif
10415 # endif
10416 # endif
10417 #endif
10418
10419 void fnord() { int i=42;}
10420 int main ()
10421 {
10422 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10423 int status = $lt_dlunknown;
10424
10425 if (self)
10426 {
10427 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10428 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10429 /* dlclose (self); */
10430 }
10431 else
10432 puts (dlerror ());
10433
10434 return status;
10435 }
10436 _LT_EOF
10437 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10438 (eval $ac_link) 2>&5
10439 ac_status=$?
10440 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10441 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10442 (./conftest; exit; ) >&5 2>/dev/null
10443 lt_status=$?
10444 case x$lt_status in
10445 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
10446 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
10447 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
10448 esac
10449 else :
10450 # compilation failed
10451 lt_cv_dlopen_self=no
10452 fi
10453 fi
10454 rm -fr conftest*
10455
10456
10457 fi
10458 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
10459 $as_echo "$lt_cv_dlopen_self" >&6; }
10460
10461 if test "x$lt_cv_dlopen_self" = xyes; then
10462 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
10463 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
10464 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
10465 if test "${lt_cv_dlopen_self_static+set}" = set; then :
10466 $as_echo_n "(cached) " >&6
10467 else
10468 if test "$cross_compiling" = yes; then :
10469 lt_cv_dlopen_self_static=cross
10470 else
10471 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10472 lt_status=$lt_dlunknown
10473 cat > conftest.$ac_ext <<_LT_EOF
10474 #line 10475 "configure"
10475 #include "confdefs.h"
10476
10477 #if HAVE_DLFCN_H
10478 #include <dlfcn.h>
10479 #endif
10480
10481 #include <stdio.h>
10482
10483 #ifdef RTLD_GLOBAL
10484 # define LT_DLGLOBAL RTLD_GLOBAL
10485 #else
10486 # ifdef DL_GLOBAL
10487 # define LT_DLGLOBAL DL_GLOBAL
10488 # else
10489 # define LT_DLGLOBAL 0
10490 # endif
10491 #endif
10492
10493 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10494 find out it does not work in some platform. */
10495 #ifndef LT_DLLAZY_OR_NOW
10496 # ifdef RTLD_LAZY
10497 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10498 # else
10499 # ifdef DL_LAZY
10500 # define LT_DLLAZY_OR_NOW DL_LAZY
10501 # else
10502 # ifdef RTLD_NOW
10503 # define LT_DLLAZY_OR_NOW RTLD_NOW
10504 # else
10505 # ifdef DL_NOW
10506 # define LT_DLLAZY_OR_NOW DL_NOW
10507 # else
10508 # define LT_DLLAZY_OR_NOW 0
10509 # endif
10510 # endif
10511 # endif
10512 # endif
10513 #endif
10514
10515 void fnord() { int i=42;}
10516 int main ()
10517 {
10518 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10519 int status = $lt_dlunknown;
10520
10521 if (self)
10522 {
10523 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10524 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10525 /* dlclose (self); */
10526 }
10527 else
10528 puts (dlerror ());
10529
10530 return status;
10531 }
10532 _LT_EOF
10533 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10534 (eval $ac_link) 2>&5
10535 ac_status=$?
10536 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10537 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10538 (./conftest; exit; ) >&5 2>/dev/null
10539 lt_status=$?
10540 case x$lt_status in
10541 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
10542 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
10543 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
10544 esac
10545 else :
10546 # compilation failed
10547 lt_cv_dlopen_self_static=no
10548 fi
10549 fi
10550 rm -fr conftest*
10551
10552
10553 fi
10554 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
10555 $as_echo "$lt_cv_dlopen_self_static" >&6; }
10556 fi
10557
10558 CPPFLAGS="$save_CPPFLAGS"
10559 LDFLAGS="$save_LDFLAGS"
10560 LIBS="$save_LIBS"
10561 ;;
10562 esac
10563
10564 case $lt_cv_dlopen_self in
10565 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
10566 *) enable_dlopen_self=unknown ;;
10567 esac
10568
10569 case $lt_cv_dlopen_self_static in
10570 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
10571 *) enable_dlopen_self_static=unknown ;;
10572 esac
10573 fi
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591 striplib=
10592 old_striplib=
10593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
10594 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
10595 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
10596 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
10597 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
10598 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10599 $as_echo "yes" >&6; }
10600 else
10601 # FIXME - insert some real tests, host_os isn't really good enough
10602 case $host_os in
10603 darwin*)
10604 if test -n "$STRIP" ; then
10605 striplib="$STRIP -x"
10606 old_striplib="$STRIP -S"
10607 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10608 $as_echo "yes" >&6; }
10609 else
10610 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10611 $as_echo "no" >&6; }
10612 fi
10613 ;;
10614 *)
10615 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10616 $as_echo "no" >&6; }
10617 ;;
10618 esac
10619 fi
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632 # Report which library types will actually be built
10633 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
10634 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
10635 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
10636 $as_echo "$can_build_shared" >&6; }
10637
10638 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
10639 $as_echo_n "checking whether to build shared libraries... " >&6; }
10640 test "$can_build_shared" = "no" && enable_shared=no
10641
10642 # On AIX, shared libraries and static libraries use the same namespace, and
10643 # are all built from PIC.
10644 case $host_os in
10645 aix3*)
10646 test "$enable_shared" = yes && enable_static=no
10647 if test -n "$RANLIB"; then
10648 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10649 postinstall_cmds='$RANLIB $lib'
10650 fi
10651 ;;
10652
10653 aix[4-9]*)
10654 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
10655 test "$enable_shared" = yes && enable_static=no
10656 fi
10657 ;;
10658 esac
10659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
10660 $as_echo "$enable_shared" >&6; }
10661
10662 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
10663 $as_echo_n "checking whether to build static libraries... " >&6; }
10664 # Make sure either enable_shared or enable_static is yes.
10665 test "$enable_shared" = yes || enable_static=yes
10666 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
10667 $as_echo "$enable_static" >&6; }
10668
10669
10670
10671
10672 fi
10673 ac_ext=c
10674 ac_cpp='$CPP $CPPFLAGS'
10675 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10676 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10677 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10678
10679 CC="$lt_save_CC"
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693 ac_config_commands="$ac_config_commands libtool"
10694
10695
10696
10697
10698 # Only expand once:
10699
10700
10701
10702
10703 { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wall" >&5
10704 $as_echo_n "checking to see if compiler understands -Wall... " >&6; }
10705
10706 save_CFLAGS="$CFLAGS"
10707 CFLAGS="$CFLAGS -Wall"
10708
10709 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10710 /* end confdefs.h. */
10711
10712 int
10713 main ()
10714 {
10715
10716 ;
10717 return 0;
10718 }
10719 _ACEOF
10720 if ac_fn_c_try_compile "$LINENO"; then :
10721 flag_ok=yes
10722 else
10723 flag_ok=no
10724 fi
10725 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10726 CFLAGS="$save_CFLAGS"
10727
10728 if test "X$flag_ok" = Xyes ; then
10729
10730 ERROR_CFLAGS="-Wall"
10731 if test "x$WERROR" = "xyes"; then
10732
10733 { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5
10734 $as_echo_n "checking to see if compiler understands -Werror... " >&6; }
10735
10736 save_CFLAGS="$CFLAGS"
10737 CFLAGS="$CFLAGS -Werror"
10738
10739 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10740 /* end confdefs.h. */
10741
10742 int
10743 main ()
10744 {
10745
10746 ;
10747 return 0;
10748 }
10749 _ACEOF
10750 if ac_fn_c_try_compile "$LINENO"; then :
10751 flag_ok=yes
10752 else
10753 flag_ok=no
10754 fi
10755 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10756 CFLAGS="$save_CFLAGS"
10757
10758 if test "X$flag_ok" = Xyes ; then
10759 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
10760 true
10761 else
10762 ERROR_CFLAGS="$ERROR_CFLAGS"
10763 true
10764 fi
10765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
10766 $as_echo "$flag_ok" >&6; }
10767
10768 fi
10769
10770 true
10771 else
10772
10773 true
10774 fi
10775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
10776 $as_echo "$flag_ok" >&6; }
10777
10778
10779
10780
10781 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
10782 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
10783 # Check whether --enable-maintainer-mode was given.
10784 if test "${enable_maintainer_mode+set}" = set; then :
10785 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
10786 else
10787 USE_MAINTAINER_MODE=no
10788 fi
10789
10790 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
10791 $as_echo "$USE_MAINTAINER_MODE" >&6; }
10792 if test $USE_MAINTAINER_MODE = yes; then
10793 MAINTAINER_MODE_TRUE=
10794 MAINTAINER_MODE_FALSE='#'
10795 else
10796 MAINTAINER_MODE_TRUE='#'
10797 MAINTAINER_MODE_FALSE=
10798 fi
10799
10800 MAINT=$MAINTAINER_MODE_TRUE
10801
10802
10803
10804 # Check whether --enable-debug was given.
10805 if test "${enable_debug+set}" = set; then :
10806 enableval=$enable_debug;
10807 else
10808 enable_debug=yes
10809 fi
10810
10811
10812 if test x$enable_debug = xyes; then
10813
10814 $as_echo "#define ENABLE_DEBUG 1" >>confdefs.h
10815
10816 fi
10817
10818 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
10819 $as_echo_n "checking for ANSI C header files... " >&6; }
10820 if test "${ac_cv_header_stdc+set}" = set; then :
10821 $as_echo_n "(cached) " >&6
10822 else
10823 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10824 /* end confdefs.h. */
10825 #include <stdlib.h>
10826 #include <stdarg.h>
10827 #include <string.h>
10828 #include <float.h>
10829
10830 int
10831 main ()
10832 {
10833
10834 ;
10835 return 0;
10836 }
10837 _ACEOF
10838 if ac_fn_c_try_compile "$LINENO"; then :
10839 ac_cv_header_stdc=yes
10840 else
10841 ac_cv_header_stdc=no
10842 fi
10843 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10844
10845 if test $ac_cv_header_stdc = yes; then
10846 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10847 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10848 /* end confdefs.h. */
10849 #include <string.h>
10850
10851 _ACEOF
10852 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10853 $EGREP "memchr" >/dev/null 2>&1; then :
10854
10855 else
10856 ac_cv_header_stdc=no
10857 fi
10858 rm -f conftest*
10859
10860 fi
10861
10862 if test $ac_cv_header_stdc = yes; then
10863 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10864 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10865 /* end confdefs.h. */
10866 #include <stdlib.h>
10867
10868 _ACEOF
10869 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10870 $EGREP "free" >/dev/null 2>&1; then :
10871
10872 else
10873 ac_cv_header_stdc=no
10874 fi
10875 rm -f conftest*
10876
10877 fi
10878
10879 if test $ac_cv_header_stdc = yes; then
10880 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10881 if test "$cross_compiling" = yes; then :
10882 :
10883 else
10884 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10885 /* end confdefs.h. */
10886 #include <ctype.h>
10887 #include <stdlib.h>
10888 #if ((' ' & 0x0FF) == 0x020)
10889 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10890 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10891 #else
10892 # define ISLOWER(c) \
10893 (('a' <= (c) && (c) <= 'i') \
10894 || ('j' <= (c) && (c) <= 'r') \
10895 || ('s' <= (c) && (c) <= 'z'))
10896 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10897 #endif
10898
10899 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10900 int
10901 main ()
10902 {
10903 int i;
10904 for (i = 0; i < 256; i++)
10905 if (XOR (islower (i), ISLOWER (i))
10906 || toupper (i) != TOUPPER (i))
10907 return 2;
10908 return 0;
10909 }
10910 _ACEOF
10911 if ac_fn_c_try_run "$LINENO"; then :
10912
10913 else
10914 ac_cv_header_stdc=no
10915 fi
10916 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10917 conftest.$ac_objext conftest.beam conftest.$ac_ext
10918 fi
10919
10920 fi
10921 fi
10922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
10923 $as_echo "$ac_cv_header_stdc" >&6; }
10924 if test $ac_cv_header_stdc = yes; then
10925
10926 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
10927
10928 fi
10929
10930 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
10931 $as_echo_n "checking for inline... " >&6; }
10932 if test "${ac_cv_c_inline+set}" = set; then :
10933 $as_echo_n "(cached) " >&6
10934 else
10935 ac_cv_c_inline=no
10936 for ac_kw in inline __inline__ __inline; do
10937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10938 /* end confdefs.h. */
10939 #ifndef __cplusplus
10940 typedef int foo_t;
10941 static $ac_kw foo_t static_foo () {return 0; }
10942 $ac_kw foo_t foo () {return 0; }
10943 #endif
10944
10945 _ACEOF
10946 if ac_fn_c_try_compile "$LINENO"; then :
10947 ac_cv_c_inline=$ac_kw
10948 fi
10949 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10950 test "$ac_cv_c_inline" != no && break
10951 done
10952
10953 fi
10954 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
10955 $as_echo "$ac_cv_c_inline" >&6; }
10956
10957 case $ac_cv_c_inline in
10958 inline | yes) ;;
10959 *)
10960 case $ac_cv_c_inline in
10961 no) ac_val=;;
10962 *) ac_val=$ac_cv_c_inline;;
10963 esac
10964 cat >>confdefs.h <<_ACEOF
10965 #ifndef __cplusplus
10966 #define inline $ac_val
10967 #endif
10968 _ACEOF
10969 ;;
10970 esac
10971
10972
10973
10974
10975 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
10976
10977
10978
10979
10980
10981
10982
10983
10984 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
10985 if test -n "$ac_tool_prefix"; then
10986 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
10987 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
10988 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10989 $as_echo_n "checking for $ac_word... " >&6; }
10990 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
10991 $as_echo_n "(cached) " >&6
10992 else
10993 case $PKG_CONFIG in
10994 [\\/]* | ?:[\\/]*)
10995 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
10996 ;;
10997 *)
10998 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10999 for as_dir in $PATH
11000 do
11001 IFS=$as_save_IFS
11002 test -z "$as_dir" && as_dir=.
11003 for ac_exec_ext in '' $ac_executable_extensions; do
11004 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11005 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
11006 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11007 break 2
11008 fi
11009 done
11010 done
11011 IFS=$as_save_IFS
11012
11013 ;;
11014 esac
11015 fi
11016 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
11017 if test -n "$PKG_CONFIG"; then
11018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
11019 $as_echo "$PKG_CONFIG" >&6; }
11020 else
11021 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11022 $as_echo "no" >&6; }
11023 fi
11024
11025
11026 fi
11027 if test -z "$ac_cv_path_PKG_CONFIG"; then
11028 ac_pt_PKG_CONFIG=$PKG_CONFIG
11029 # Extract the first word of "pkg-config", so it can be a program name with args.
11030 set dummy pkg-config; ac_word=$2
11031 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11032 $as_echo_n "checking for $ac_word... " >&6; }
11033 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
11034 $as_echo_n "(cached) " >&6
11035 else
11036 case $ac_pt_PKG_CONFIG in
11037 [\\/]* | ?:[\\/]*)
11038 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
11039 ;;
11040 *)
11041 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11042 for as_dir in $PATH
11043 do
11044 IFS=$as_save_IFS
11045 test -z "$as_dir" && as_dir=.
11046 for ac_exec_ext in '' $ac_executable_extensions; do
11047 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11048 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
11049 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11050 break 2
11051 fi
11052 done
11053 done
11054 IFS=$as_save_IFS
11055
11056 ;;
11057 esac
11058 fi
11059 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
11060 if test -n "$ac_pt_PKG_CONFIG"; then
11061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
11062 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
11063 else
11064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11065 $as_echo "no" >&6; }
11066 fi
11067
11068 if test "x$ac_pt_PKG_CONFIG" = x; then
11069 PKG_CONFIG=""
11070 else
11071 case $cross_compiling:$ac_tool_warned in
11072 yes:)
11073 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
11074 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
11075 ac_tool_warned=yes ;;
11076 esac
11077 PKG_CONFIG=$ac_pt_PKG_CONFIG
11078 fi
11079 else
11080 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
11081 fi
11082
11083 fi
11084 if test -n "$PKG_CONFIG"; then
11085 _pkg_min_version=0.9.0
11086 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
11087 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
11088 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
11089 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11090 $as_echo "yes" >&6; }
11091 else
11092 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11093 $as_echo "no" >&6; }
11094 PKG_CONFIG=""
11095 fi
11096 fi
11097
11098 pkg_failed=no
11099 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
11100 $as_echo_n "checking for GLIB... " >&6; }
11101
11102 if test -n "$GLIB_CFLAGS"; then
11103 pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
11104 elif test -n "$PKG_CONFIG"; then
11105 if test -n "$PKG_CONFIG" && \
11106 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0 >= 2.4 glib-2.0\""; } >&5
11107 ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= 2.4 glib-2.0") 2>&5
11108 ac_status=$?
11109 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11110 test $ac_status = 0; }; then
11111 pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0 >= 2.4 glib-2.0" 2>/dev/null`
11112 else
11113 pkg_failed=yes
11114 fi
11115 else
11116 pkg_failed=untried
11117 fi
11118 if test -n "$GLIB_LIBS"; then
11119 pkg_cv_GLIB_LIBS="$GLIB_LIBS"
11120 elif test -n "$PKG_CONFIG"; then
11121 if test -n "$PKG_CONFIG" && \
11122 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0 >= 2.4 glib-2.0\""; } >&5
11123 ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= 2.4 glib-2.0") 2>&5
11124 ac_status=$?
11125 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11126 test $ac_status = 0; }; then
11127 pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gobject-2.0 >= 2.4 glib-2.0" 2>/dev/null`
11128 else
11129 pkg_failed=yes
11130 fi
11131 else
11132 pkg_failed=untried
11133 fi
11134
11135
11136
11137 if test $pkg_failed = yes; then
11138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11139 $as_echo "no" >&6; }
11140
11141 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11142 _pkg_short_errors_supported=yes
11143 else
11144 _pkg_short_errors_supported=no
11145 fi
11146 if test $_pkg_short_errors_supported = yes; then
11147 GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gobject-2.0 >= 2.4 glib-2.0" 2>&1`
11148 else
11149 GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "gobject-2.0 >= 2.4 glib-2.0" 2>&1`
11150 fi
11151 # Put the nasty error message in config.log where it belongs
11152 echo "$GLIB_PKG_ERRORS" >&5
11153
11154 as_fn_error $? "Package requirements (gobject-2.0 >= 2.4 glib-2.0) were not met:
11155
11156 $GLIB_PKG_ERRORS
11157
11158 Consider adjusting the PKG_CONFIG_PATH environment variable if you
11159 installed software in a non-standard prefix.
11160
11161 Alternatively, you may set the environment variables GLIB_CFLAGS
11162 and GLIB_LIBS to avoid the need to call pkg-config.
11163 See the pkg-config man page for more details." "$LINENO" 5
11164 elif test $pkg_failed = untried; then
11165 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11166 $as_echo "no" >&6; }
11167 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11168 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11169 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11170 is in your PATH or set the PKG_CONFIG environment variable to the full
11171 path to pkg-config.
11172
11173 Alternatively, you may set the environment variables GLIB_CFLAGS
11174 and GLIB_LIBS to avoid the need to call pkg-config.
11175 See the pkg-config man page for more details.
11176
11177 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11178 See \`config.log' for more details" "$LINENO" 5 ; }
11179 else
11180 GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
11181 GLIB_LIBS=$pkg_cv_GLIB_LIBS
11182 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11183 $as_echo "yes" >&6; }
11184
11185 fi
11186
11187 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
11188
11189
11190
11191 pkg_failed=no
11192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5
11193 $as_echo_n "checking for CHECK... " >&6; }
11194
11195 if test -n "$CHECK_CFLAGS"; then
11196 pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS"
11197 elif test -n "$PKG_CONFIG"; then
11198 if test -n "$PKG_CONFIG" && \
11199 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.4\""; } >&5
11200 ($PKG_CONFIG --exists --print-errors "check >= 0.9.4") 2>&5
11201 ac_status=$?
11202 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11203 test $ac_status = 0; }; then
11204 pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.9.4" 2>/dev/null`
11205 else
11206 pkg_failed=yes
11207 fi
11208 else
11209 pkg_failed=untried
11210 fi
11211 if test -n "$CHECK_LIBS"; then
11212 pkg_cv_CHECK_LIBS="$CHECK_LIBS"
11213 elif test -n "$PKG_CONFIG"; then
11214 if test -n "$PKG_CONFIG" && \
11215 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.4\""; } >&5
11216 ($PKG_CONFIG --exists --print-errors "check >= 0.9.4") 2>&5
11217 ac_status=$?
11218 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11219 test $ac_status = 0; }; then
11220 pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.9.4" 2>/dev/null`
11221 else
11222 pkg_failed=yes
11223 fi
11224 else
11225 pkg_failed=untried
11226 fi
11227
11228
11229
11230 if test $pkg_failed = yes; then
11231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11232 $as_echo "no" >&6; }
11233
11234 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11235 _pkg_short_errors_supported=yes
11236 else
11237 _pkg_short_errors_supported=no
11238 fi
11239 if test $_pkg_short_errors_supported = yes; then
11240 CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "check >= 0.9.4" 2>&1`
11241 else
11242 CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors "check >= 0.9.4" 2>&1`
11243 fi
11244 # Put the nasty error message in config.log where it belongs
11245 echo "$CHECK_PKG_ERRORS" >&5
11246
11247 as_fn_error $? "Package requirements (check >= 0.9.4) were not met:
11248
11249 $CHECK_PKG_ERRORS
11250
11251 Consider adjusting the PKG_CONFIG_PATH environment variable if you
11252 installed software in a non-standard prefix.
11253
11254 Alternatively, you may set the environment variables CHECK_CFLAGS
11255 and CHECK_LIBS to avoid the need to call pkg-config.
11256 See the pkg-config man page for more details." "$LINENO" 5
11257 elif test $pkg_failed = untried; then
11258 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11259 $as_echo "no" >&6; }
11260 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11261 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11262 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11263 is in your PATH or set the PKG_CONFIG environment variable to the full
11264 path to pkg-config.
11265
11266 Alternatively, you may set the environment variables CHECK_CFLAGS
11267 and CHECK_LIBS to avoid the need to call pkg-config.
11268 See the pkg-config man page for more details.
11269
11270 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11271 See \`config.log' for more details" "$LINENO" 5 ; }
11272 else
11273 CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS
11274 CHECK_LIBS=$pkg_cv_CHECK_LIBS
11275 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11276 $as_echo "yes" >&6; }
11277
11278 fi
11279
11280
11281 pkg_failed=no
11282 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5
11283 $as_echo_n "checking for DBUS... " >&6; }
11284
11285 if test -n "$DBUS_CFLAGS"; then
11286 pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS"
11287 elif test -n "$PKG_CONFIG"; then
11288 if test -n "$PKG_CONFIG" && \
11289 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.60, dbus-glib-1 >= 0.88\""; } >&5
11290 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.60, dbus-glib-1 >= 0.88") 2>&5
11291 ac_status=$?
11292 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11293 test $ac_status = 0; }; then
11294 pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 0.60, dbus-glib-1 >= 0.88" 2>/dev/null`
11295 else
11296 pkg_failed=yes
11297 fi
11298 else
11299 pkg_failed=untried
11300 fi
11301 if test -n "$DBUS_LIBS"; then
11302 pkg_cv_DBUS_LIBS="$DBUS_LIBS"
11303 elif test -n "$PKG_CONFIG"; then
11304 if test -n "$PKG_CONFIG" && \
11305 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.60, dbus-glib-1 >= 0.88\""; } >&5
11306 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.60, dbus-glib-1 >= 0.88") 2>&5
11307 ac_status=$?
11308 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11309 test $ac_status = 0; }; then
11310 pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 0.60, dbus-glib-1 >= 0.88" 2>/dev/null`
11311 else
11312 pkg_failed=yes
11313 fi
11314 else
11315 pkg_failed=untried
11316 fi
11317
11318
11319
11320 if test $pkg_failed = yes; then
11321 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11322 $as_echo "no" >&6; }
11323
11324 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11325 _pkg_short_errors_supported=yes
11326 else
11327 _pkg_short_errors_supported=no
11328 fi
11329 if test $_pkg_short_errors_supported = yes; then
11330 DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 0.60, dbus-glib-1 >= 0.88" 2>&1`
11331 else
11332 DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 0.60, dbus-glib-1 >= 0.88" 2>&1`
11333 fi
11334 # Put the nasty error message in config.log where it belongs
11335 echo "$DBUS_PKG_ERRORS" >&5
11336
11337 as_fn_error $? "Package requirements (dbus-1 >= 0.60, dbus-glib-1 >= 0.88) were not met:
11338
11339 $DBUS_PKG_ERRORS
11340
11341 Consider adjusting the PKG_CONFIG_PATH environment variable if you
11342 installed software in a non-standard prefix.
11343
11344 Alternatively, you may set the environment variables DBUS_CFLAGS
11345 and DBUS_LIBS to avoid the need to call pkg-config.
11346 See the pkg-config man page for more details." "$LINENO" 5
11347 elif test $pkg_failed = untried; then
11348 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11349 $as_echo "no" >&6; }
11350 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11351 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11352 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11353 is in your PATH or set the PKG_CONFIG environment variable to the full
11354 path to pkg-config.
11355
11356 Alternatively, you may set the environment variables DBUS_CFLAGS
11357 and DBUS_LIBS to avoid the need to call pkg-config.
11358 See the pkg-config man page for more details.
11359
11360 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11361 See \`config.log' for more details" "$LINENO" 5 ; }
11362 else
11363 DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS
11364 DBUS_LIBS=$pkg_cv_DBUS_LIBS
11365 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11366 $as_echo "yes" >&6; }
11367
11368 fi
11369
11370
11371 pkg_failed=no
11372 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5
11373 $as_echo_n "checking for UUID... " >&6; }
11374
11375 if test -n "$UUID_CFLAGS"; then
11376 pkg_cv_UUID_CFLAGS="$UUID_CFLAGS"
11377 elif test -n "$PKG_CONFIG"; then
11378 if test -n "$PKG_CONFIG" && \
11379 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5
11380 ($PKG_CONFIG --exists --print-errors "uuid") 2>&5
11381 ac_status=$?
11382 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11383 test $ac_status = 0; }; then
11384 pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null`
11385 else
11386 pkg_failed=yes
11387 fi
11388 else
11389 pkg_failed=untried
11390 fi
11391 if test -n "$UUID_LIBS"; then
11392 pkg_cv_UUID_LIBS="$UUID_LIBS"
11393 elif test -n "$PKG_CONFIG"; then
11394 if test -n "$PKG_CONFIG" && \
11395 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5
11396 ($PKG_CONFIG --exists --print-errors "uuid") 2>&5
11397 ac_status=$?
11398 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11399 test $ac_status = 0; }; then
11400 pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null`
11401 else
11402 pkg_failed=yes
11403 fi
11404 else
11405 pkg_failed=untried
11406 fi
11407
11408
11409
11410 if test $pkg_failed = yes; then
11411 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11412 $as_echo "no" >&6; }
11413
11414 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11415 _pkg_short_errors_supported=yes
11416 else
11417 _pkg_short_errors_supported=no
11418 fi
11419 if test $_pkg_short_errors_supported = yes; then
11420 UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "uuid" 2>&1`
11421 else
11422 UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors "uuid" 2>&1`
11423 fi
11424 # Put the nasty error message in config.log where it belongs
11425 echo "$UUID_PKG_ERRORS" >&5
11426
11427 as_fn_error $? "Package requirements (uuid) were not met:
11428
11429 $UUID_PKG_ERRORS
11430
11431 Consider adjusting the PKG_CONFIG_PATH environment variable if you
11432 installed software in a non-standard prefix.
11433
11434 Alternatively, you may set the environment variables UUID_CFLAGS
11435 and UUID_LIBS to avoid the need to call pkg-config.
11436 See the pkg-config man page for more details." "$LINENO" 5
11437 elif test $pkg_failed = untried; then
11438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11439 $as_echo "no" >&6; }
11440 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11441 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11442 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11443 is in your PATH or set the PKG_CONFIG environment variable to the full
11444 path to pkg-config.
11445
11446 Alternatively, you may set the environment variables UUID_CFLAGS
11447 and UUID_LIBS to avoid the need to call pkg-config.
11448 See the pkg-config man page for more details.
11449
11450 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11451 See \`config.log' for more details" "$LINENO" 5 ; }
11452 else
11453 UUID_CFLAGS=$pkg_cv_UUID_CFLAGS
11454 UUID_LIBS=$pkg_cv_UUID_LIBS
11455 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11456 $as_echo "yes" >&6; }
11457
11458 fi
11459
11460
11461 EXP_VAR=DATADIR
11462 FROM_VAR=${datadir}
11463
11464 prefix_save=$prefix
11465 exec_prefix_save=$exec_prefix
11466
11467 if test "x$prefix" = "xNONE"; then
11468 prefix=$ac_default_prefix
11469 fi
11470 if test "x$exec_prefix" = "xNONE"; then
11471 exec_prefix=$prefix
11472 fi
11473
11474 full_var="$FROM_VAR"
11475 while true; do
11476 new_full_var="`eval echo $full_var`"
11477 if test "x$new_full_var"="x$full_var"; then break; fi
11478 full_var=$new_full_var
11479 done
11480
11481 full_var=$new_full_var
11482 DATADIR="$full_var"
11483
11484
11485 prefix=$prefix_save
11486 exec_prefix=$exec_prefix_save
11487
11488 DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
11489
11490
11491 cat >>confdefs.h <<_ACEOF
11492 #define DBUS_SERVICES_DIR "$DBUS_SERVICES_DIR"
11493 _ACEOF
11494
11495
11496
11497 pkg_failed=no
11498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TP" >&5
11499 $as_echo_n "checking for TP... " >&6; }
11500
11501 if test -n "$TP_CFLAGS"; then
11502 pkg_cv_TP_CFLAGS="$TP_CFLAGS"
11503 elif test -n "$PKG_CONFIG"; then
11504 if test -n "$PKG_CONFIG" && \
11505 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.11.11\""; } >&5
11506 ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.11.11") 2>&5
11507 ac_status=$?
11508 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11509 test $ac_status = 0; }; then
11510 pkg_cv_TP_CFLAGS=`$PKG_CONFIG --cflags "telepathy-glib >= 0.11.11" 2>/dev/null`
11511 else
11512 pkg_failed=yes
11513 fi
11514 else
11515 pkg_failed=untried
11516 fi
11517 if test -n "$TP_LIBS"; then
11518 pkg_cv_TP_LIBS="$TP_LIBS"
11519 elif test -n "$PKG_CONFIG"; then
11520 if test -n "$PKG_CONFIG" && \
11521 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.11.11\""; } >&5
11522 ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.11.11") 2>&5
11523 ac_status=$?
11524 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11525 test $ac_status = 0; }; then
11526 pkg_cv_TP_LIBS=`$PKG_CONFIG --libs "telepathy-glib >= 0.11.11" 2>/dev/null`
11527 else
11528 pkg_failed=yes
11529 fi
11530 else
11531 pkg_failed=untried
11532 fi
11533
11534
11535
11536 if test $pkg_failed = yes; then
11537 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11538 $as_echo "no" >&6; }
11539
11540 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11541 _pkg_short_errors_supported=yes
11542 else
11543 _pkg_short_errors_supported=no
11544 fi
11545 if test $_pkg_short_errors_supported = yes; then
11546 TP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "telepathy-glib >= 0.11.11" 2>&1`
11547 else
11548 TP_PKG_ERRORS=`$PKG_CONFIG --print-errors "telepathy-glib >= 0.11.11" 2>&1`
11549 fi
11550 # Put the nasty error message in config.log where it belongs
11551 echo "$TP_PKG_ERRORS" >&5
11552
11553 as_fn_error $? "Package requirements (telepathy-glib >= 0.11.11) were not met:
11554
11555 $TP_PKG_ERRORS
11556
11557 Consider adjusting the PKG_CONFIG_PATH environment variable if you
11558 installed software in a non-standard prefix.
11559
11560 Alternatively, you may set the environment variables TP_CFLAGS
11561 and TP_LIBS to avoid the need to call pkg-config.
11562 See the pkg-config man page for more details." "$LINENO" 5
11563 elif test $pkg_failed = untried; then
11564 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11565 $as_echo "no" >&6; }
11566 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11567 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11568 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
11569 is in your PATH or set the PKG_CONFIG environment variable to the full
11570 path to pkg-config.
11571
11572 Alternatively, you may set the environment variables TP_CFLAGS
11573 and TP_LIBS to avoid the need to call pkg-config.
11574 See the pkg-config man page for more details.
11575
11576 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
11577 See \`config.log' for more details" "$LINENO" 5 ; }
11578 else
11579 TP_CFLAGS=$pkg_cv_TP_CFLAGS
11580 TP_LIBS=$pkg_cv_TP_LIBS
11581 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11582 $as_echo "yes" >&6; }
11583
11584 fi
11585
11586 for ac_prog in $XSLTPROC xsltproc
11587 do
11588 # Extract the first word of "$ac_prog", so it can be a program name with args.
11589 set dummy $ac_prog; ac_word=$2
11590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11591 $as_echo_n "checking for $ac_word... " >&6; }
11592 if test "${ac_cv_prog_XSLTPROC+set}" = set; then :
11593 $as_echo_n "(cached) " >&6
11594 else
11595 if test -n "$XSLTPROC"; then
11596 ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
11597 else
11598 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11599 for as_dir in $PATH
11600 do
11601 IFS=$as_save_IFS
11602 test -z "$as_dir" && as_dir=.
11603 for ac_exec_ext in '' $ac_executable_extensions; do
11604 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11605 ac_cv_prog_XSLTPROC="$ac_prog"
11606 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11607 break 2
11608 fi
11609 done
11610 done
11611 IFS=$as_save_IFS
11612
11613 fi
11614 fi
11615 XSLTPROC=$ac_cv_prog_XSLTPROC
11616 if test -n "$XSLTPROC"; then
11617 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
11618 $as_echo "$XSLTPROC" >&6; }
11619 else
11620 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11621 $as_echo "no" >&6; }
11622 fi
11623
11624
11625 test -n "$XSLTPROC" && break
11626 done
11627
11628 for ac_prog in $DBUS_BINDING_TOOL dbus-binding-tool
11629 do
11630 # Extract the first word of "$ac_prog", so it can be a program name with args.
11631 set dummy $ac_prog; ac_word=$2
11632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11633 $as_echo_n "checking for $ac_word... " >&6; }
11634 if test "${ac_cv_prog_DBUS_BINDING_TOOL+set}" = set; then :
11635 $as_echo_n "(cached) " >&6
11636 else
11637 if test -n "$DBUS_BINDING_TOOL"; then
11638 ac_cv_prog_DBUS_BINDING_TOOL="$DBUS_BINDING_TOOL" # Let the user override the test.
11639 else
11640 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11641 for as_dir in $PATH
11642 do
11643 IFS=$as_save_IFS
11644 test -z "$as_dir" && as_dir=.
11645 for ac_exec_ext in '' $ac_executable_extensions; do
11646 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11647 ac_cv_prog_DBUS_BINDING_TOOL="$ac_prog"
11648 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11649 break 2
11650 fi
11651 done
11652 done
11653 IFS=$as_save_IFS
11654
11655 fi
11656 fi
11657 DBUS_BINDING_TOOL=$ac_cv_prog_DBUS_BINDING_TOOL
11658 if test -n "$DBUS_BINDING_TOOL"; then
11659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_BINDING_TOOL" >&5
11660 $as_echo "$DBUS_BINDING_TOOL" >&6; }
11661 else
11662 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11663 $as_echo "no" >&6; }
11664 fi
11665
11666
11667 test -n "$DBUS_BINDING_TOOL" && break
11668 done
11669
11670 for ac_prog in $PYTHON python2.5 python2.4 python2.3 python
11671 do
11672 # Extract the first word of "$ac_prog", so it can be a program name with args.
11673 set dummy $ac_prog; ac_word=$2
11674 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11675 $as_echo_n "checking for $ac_word... " >&6; }
11676 if test "${ac_cv_prog_PYTHON+set}" = set; then :
11677 $as_echo_n "(cached) " >&6
11678 else
11679 if test -n "$PYTHON"; then
11680 ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
11681 else
11682 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11683 for as_dir in $PATH
11684 do
11685 IFS=$as_save_IFS
11686 test -z "$as_dir" && as_dir=.
11687 for ac_exec_ext in '' $ac_executable_extensions; do
11688 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11689 ac_cv_prog_PYTHON="$ac_prog"
11690 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11691 break 2
11692 fi
11693 done
11694 done
11695 IFS=$as_save_IFS
11696
11697 fi
11698 fi
11699 PYTHON=$ac_cv_prog_PYTHON
11700 if test -n "$PYTHON"; then
11701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
11702 $as_echo "$PYTHON" >&6; }
11703 else
11704 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11705 $as_echo "no" >&6; }
11706 fi
11707
11708
11709 test -n "$PYTHON" && break
11710 done
11711
11712
11713 if test -n "$XSLTPROC" && test -n "$PYTHON" && test -n "$DBUS_BINDING_TOOL"; then
11714 HAVE_TP_EXTENSIONS_TRUE=
11715 HAVE_TP_EXTENSIONS_FALSE='#'
11716 else
11717 HAVE_TP_EXTENSIONS_TRUE='#'
11718 HAVE_TP_EXTENSIONS_FALSE=
11719 fi
11720
11721
11722 if ! test -z "$XSLTPROC""$PYTHON""$DBUS_BINDING_TOOL"; then
11723
11724 $as_echo "#define HAVE_TP_EXTENSIONS 1" >>confdefs.h
11725
11726 fi
11727
11728 ac_fn_c_check_func "$LINENO" "getresuid" "ac_cv_func_getresuid"
11729 if test "x$ac_cv_func_getresuid" = x""yes; then :
11730
11731 fi
11732
11733
11734 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_trylock" >&5
11735 $as_echo_n "checking for library containing pthread_mutex_trylock... " >&6; }
11736 if test "${ac_cv_search_pthread_mutex_trylock+set}" = set; then :
11737 $as_echo_n "(cached) " >&6
11738 else
11739 ac_func_search_save_LIBS=$LIBS
11740 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11741 /* end confdefs.h. */
11742
11743 /* Override any GCC internal prototype to avoid an error.
11744 Use char because int might match the return type of a GCC
11745 builtin and then its argument prototype would still apply. */
11746 #ifdef __cplusplus
11747 extern "C"
11748 #endif
11749 char pthread_mutex_trylock ();
11750 int
11751 main ()
11752 {
11753 return pthread_mutex_trylock ();
11754 ;
11755 return 0;
11756 }
11757 _ACEOF
11758 for ac_lib in '' pthread; do
11759 if test -z "$ac_lib"; then
11760 ac_res="none required"
11761 else
11762 ac_res=-l$ac_lib
11763 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
11764 fi
11765 if ac_fn_c_try_link "$LINENO"; then :
11766 ac_cv_search_pthread_mutex_trylock=$ac_res
11767 fi
11768 rm -f core conftest.err conftest.$ac_objext \
11769 conftest$ac_exeext
11770 if test "${ac_cv_search_pthread_mutex_trylock+set}" = set; then :
11771 break
11772 fi
11773 done
11774 if test "${ac_cv_search_pthread_mutex_trylock+set}" = set; then :
11775
11776 else
11777 ac_cv_search_pthread_mutex_trylock=no
11778 fi
11779 rm conftest.$ac_ext
11780 LIBS=$ac_func_search_save_LIBS
11781 fi
11782 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_trylock" >&5
11783 $as_echo "$ac_cv_search_pthread_mutex_trylock" >&6; }
11784 ac_res=$ac_cv_search_pthread_mutex_trylock
11785 if test "$ac_res" != no; then :
11786 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11787
11788 else
11789 as_fn_error $? "POSIX threads not available" "$LINENO" 5
11790 fi
11791
11792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mln_lock_data in -lmlocknice" >&5
11793 $as_echo_n "checking for mln_lock_data in -lmlocknice... " >&6; }
11794 if test "${ac_cv_lib_mlocknice_mln_lock_data+set}" = set; then :
11795 $as_echo_n "(cached) " >&6
11796 else
11797 ac_check_lib_save_LIBS=$LIBS
11798 LIBS="-lmlocknice $LIBS"
11799 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11800 /* end confdefs.h. */
11801
11802 /* Override any GCC internal prototype to avoid an error.
11803 Use char because int might match the return type of a GCC
11804 builtin and then its argument prototype would still apply. */
11805 #ifdef __cplusplus
11806 extern "C"
11807 #endif
11808 char mln_lock_data ();
11809 int
11810 main ()
11811 {
11812 return mln_lock_data ();
11813 ;
11814 return 0;
11815 }
11816 _ACEOF
11817 if ac_fn_c_try_link "$LINENO"; then :
11818 ac_cv_lib_mlocknice_mln_lock_data=yes
11819 else
11820 ac_cv_lib_mlocknice_mln_lock_data=no
11821 fi
11822 rm -f core conftest.err conftest.$ac_objext \
11823 conftest$ac_exeext conftest.$ac_ext
11824 LIBS=$ac_check_lib_save_LIBS
11825 fi
11826 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mlocknice_mln_lock_data" >&5
11827 $as_echo "$ac_cv_lib_mlocknice_mln_lock_data" >&6; }
11828 if test "x$ac_cv_lib_mlocknice_mln_lock_data" = x""yes; then :
11829 cat >>confdefs.h <<_ACEOF
11830 #define HAVE_LIBMLOCKNICE 1
11831 _ACEOF
11832
11833 LIBS="-lmlocknice $LIBS"
11834
11835 else
11836 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Library mlocknice not found" >&5
11837 $as_echo "$as_me: WARNING: Library mlocknice not found" >&2;}
11838 fi
11839
11840
11841 testdir='${libdir}/tests/telepathy-ring-tests'
11842
11843 includemodemdir='${includedir}/modem-glib'
11844
11845 includesmsdir='${includedir}/sms-glib'
11846
11847
11848 ac_config_files="$ac_config_files Makefile"
11849
11850 ac_config_files="$ac_config_files modem/Makefile modem/tests/Makefile src/Makefile tests/Makefile docs/Makefile scripts/Makefile sms-glib/Makefile tools/Makefile ring-extensions/Makefile"
11851
11852 cat >confcache <<\_ACEOF
11853 # This file is a shell script that caches the results of configure
11854 # tests run on this system so they can be shared between configure
11855 # scripts and configure runs, see configure's option --config-cache.
11856 # It is not useful on other systems. If it contains results you don't
11857 # want to keep, you may remove or edit it.
11858 #
11859 # config.status only pays attention to the cache file if you give it
11860 # the --recheck option to rerun configure.
11861 #
11862 # `ac_cv_env_foo' variables (set or unset) will be overridden when
11863 # loading this file, other *unset* `ac_cv_foo' will be assigned the
11864 # following values.
11865
11866 _ACEOF
11867
11868 # The following way of writing the cache mishandles newlines in values,
11869 # but we know of no workaround that is simple, portable, and efficient.
11870 # So, we kill variables containing newlines.
11871 # Ultrix sh set writes to stderr and can't be redirected directly,
11872 # and sets the high bit in the cache file unless we assign to the vars.
11873 (
11874 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
11875 eval ac_val=\$$ac_var
11876 case $ac_val in #(
11877 *${as_nl}*)
11878 case $ac_var in #(
11879 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
11880 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
11881 esac
11882 case $ac_var in #(
11883 _ | IFS | as_nl) ;; #(
11884 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
11885 *) { eval $ac_var=; unset $ac_var;} ;;
11886 esac ;;
11887 esac
11888 done
11889
11890 (set) 2>&1 |
11891 case $as_nl`(ac_space=' '; set) 2>&1` in #(
11892 *${as_nl}ac_space=\ *)
11893 # `set' does not quote correctly, so add quotes: double-quote
11894 # substitution turns \\\\ into \\, and sed turns \\ into \.
11895 sed -n \
11896 "s/'/'\\\\''/g;
11897 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
11898 ;; #(
11899 *)
11900 # `set' quotes correctly as required by POSIX, so do not add quotes.
11901 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
11902 ;;
11903 esac |
11904 sort
11905 ) |
11906 sed '
11907 /^ac_cv_env_/b end
11908 t clear
11909 :clear
11910 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
11911 t end
11912 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11913 :end' >>confcache
11914 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
11915 if test -w "$cache_file"; then
11916 test "x$cache_file" != "x/dev/null" &&
11917 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
11918 $as_echo "$as_me: updating cache $cache_file" >&6;}
11919 cat confcache >$cache_file
11920 else
11921 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
11922 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
11923 fi
11924 fi
11925 rm -f confcache
11926
11927 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11928 # Let make expand exec_prefix.
11929 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11930
11931 DEFS=-DHAVE_CONFIG_H
11932
11933 ac_libobjs=
11934 ac_ltlibobjs=
11935 U=
11936 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
11937 # 1. Remove the extension, and $U if already installed.
11938 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
11939 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
11940 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
11941 # will be set to the directory where LIBOBJS objects are built.
11942 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
11943 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
11944 done
11945 LIBOBJS=$ac_libobjs
11946
11947 LTLIBOBJS=$ac_ltlibobjs
11948
11949
11950 if test -n "$EXEEXT"; then
11951 am__EXEEXT_TRUE=
11952 am__EXEEXT_FALSE='#'
11953 else
11954 am__EXEEXT_TRUE='#'
11955 am__EXEEXT_FALSE=
11956 fi
11957
11958 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
11959 as_fn_error $? "conditional \"AMDEP\" was never defined.
11960 Usually this means the macro was only invoked conditionally." "$LINENO" 5
11961 fi
11962 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
11963 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
11964 Usually this means the macro was only invoked conditionally." "$LINENO" 5
11965 fi
11966 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
11967 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
11968 Usually this means the macro was only invoked conditionally." "$LINENO" 5
11969 fi
11970 if test -z "${HAVE_TP_EXTENSIONS_TRUE}" && test -z "${HAVE_TP_EXTENSIONS_FALSE}"; then
11971 as_fn_error $? "conditional \"HAVE_TP_EXTENSIONS\" was never defined.
11972 Usually this means the macro was only invoked conditionally." "$LINENO" 5
11973 fi
11974
11975 : ${CONFIG_STATUS=./config.status}
11976 ac_write_fail=0
11977 ac_clean_files_save=$ac_clean_files
11978 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
11979 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
11980 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
11981 as_write_fail=0
11982 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
11983 #! $SHELL
11984 # Generated by $as_me.
11985 # Run this file to recreate the current configuration.
11986 # Compiler output produced by configure, useful for debugging
11987 # configure, is in config.log if it exists.
11988
11989 debug=false
11990 ac_cs_recheck=false
11991 ac_cs_silent=false
11992
11993 SHELL=\${CONFIG_SHELL-$SHELL}
11994 export SHELL
11995 _ASEOF
11996 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
11997 ## -------------------- ##
11998 ## M4sh Initialization. ##
11999 ## -------------------- ##
12000
12001 # Be more Bourne compatible
12002 DUALCASE=1; export DUALCASE # for MKS sh
12003 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
12004 emulate sh
12005 NULLCMD=:
12006 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
12007 # is contrary to our usage. Disable this feature.
12008 alias -g '${1+"$@"}'='"$@"'
12009 setopt NO_GLOB_SUBST
12010 else
12011 case `(set -o) 2>/dev/null` in #(
12012 *posix*) :
12013 set -o posix ;; #(
12014 *) :
12015 ;;
12016 esac
12017 fi
12018
12019
12020 as_nl='
12021 '
12022 export as_nl
12023 # Printing a long string crashes Solaris 7 /usr/bin/printf.
12024 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12025 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
12026 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
12027 # Prefer a ksh shell builtin over an external printf program on Solaris,
12028 # but without wasting forks for bash or zsh.
12029 if test -z "$BASH_VERSION$ZSH_VERSION" \
12030 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
12031 as_echo='print -r --'
12032 as_echo_n='print -rn --'
12033 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
12034 as_echo='printf %s\n'
12035 as_echo_n='printf %s'
12036 else
12037 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
12038 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
12039 as_echo_n='/usr/ucb/echo -n'
12040 else
12041 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
12042 as_echo_n_body='eval
12043 arg=$1;
12044 case $arg in #(
12045 *"$as_nl"*)
12046 expr "X$arg" : "X\\(.*\\)$as_nl";
12047 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
12048 esac;
12049 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
12050 '
12051 export as_echo_n_body
12052 as_echo_n='sh -c $as_echo_n_body as_echo'
12053 fi
12054 export as_echo_body
12055 as_echo='sh -c $as_echo_body as_echo'
12056 fi
12057
12058 # The user is always right.
12059 if test "${PATH_SEPARATOR+set}" != set; then
12060 PATH_SEPARATOR=:
12061 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
12062 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
12063 PATH_SEPARATOR=';'
12064 }
12065 fi
12066
12067
12068 # IFS
12069 # We need space, tab and new line, in precisely that order. Quoting is
12070 # there to prevent editors from complaining about space-tab.
12071 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
12072 # splitting by setting IFS to empty value.)
12073 IFS=" "" $as_nl"
12074
12075 # Find who we are. Look in the path if we contain no directory separator.
12076 case $0 in #((
12077 *[\\/]* ) as_myself=$0 ;;
12078 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12079 for as_dir in $PATH
12080 do
12081 IFS=$as_save_IFS
12082 test -z "$as_dir" && as_dir=.
12083 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
12084 done
12085 IFS=$as_save_IFS
12086
12087 ;;
12088 esac
12089 # We did not find ourselves, most probably we were run as `sh COMMAND'
12090 # in which case we are not to be found in the path.
12091 if test "x$as_myself" = x; then
12092 as_myself=$0
12093 fi
12094 if test ! -f "$as_myself"; then
12095 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
12096 exit 1
12097 fi
12098
12099 # Unset variables that we do not need and which cause bugs (e.g. in
12100 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
12101 # suppresses any "Segmentation fault" message there. '((' could
12102 # trigger a bug in pdksh 5.2.14.
12103 for as_var in BASH_ENV ENV MAIL MAILPATH
12104 do eval test x\${$as_var+set} = xset \
12105 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
12106 done
12107 PS1='$ '
12108 PS2='> '
12109 PS4='+ '
12110
12111 # NLS nuisances.
12112 LC_ALL=C
12113 export LC_ALL
12114 LANGUAGE=C
12115 export LANGUAGE
12116
12117 # CDPATH.
12118 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
12119
12120
12121 # as_fn_error STATUS ERROR [LINENO LOG_FD]
12122 # ----------------------------------------
12123 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
12124 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
12125 # script with STATUS, using 1 if that was 0.
12126 as_fn_error ()
12127 {
12128 as_status=$1; test $as_status -eq 0 && as_status=1
12129 if test "$4"; then
12130 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
12131 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
12132 fi
12133 $as_echo "$as_me: error: $2" >&2
12134 as_fn_exit $as_status
12135 } # as_fn_error
12136
12137
12138 # as_fn_set_status STATUS
12139 # -----------------------
12140 # Set $? to STATUS, without forking.
12141 as_fn_set_status ()
12142 {
12143 return $1
12144 } # as_fn_set_status
12145
12146 # as_fn_exit STATUS
12147 # -----------------
12148 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
12149 as_fn_exit ()
12150 {
12151 set +e
12152 as_fn_set_status $1
12153 exit $1
12154 } # as_fn_exit
12155
12156 # as_fn_unset VAR
12157 # ---------------
12158 # Portably unset VAR.
12159 as_fn_unset ()
12160 {
12161 { eval $1=; unset $1;}
12162 }
12163 as_unset=as_fn_unset
12164 # as_fn_append VAR VALUE
12165 # ----------------------
12166 # Append the text in VALUE to the end of the definition contained in VAR. Take
12167 # advantage of any shell optimizations that allow amortized linear growth over
12168 # repeated appends, instead of the typical quadratic growth present in naive
12169 # implementations.
12170 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
12171 eval 'as_fn_append ()
12172 {
12173 eval $1+=\$2
12174 }'
12175 else
12176 as_fn_append ()
12177 {
12178 eval $1=\$$1\$2
12179 }
12180 fi # as_fn_append
12181
12182 # as_fn_arith ARG...
12183 # ------------------
12184 # Perform arithmetic evaluation on the ARGs, and store the result in the
12185 # global $as_val. Take advantage of shells that can avoid forks. The arguments
12186 # must be portable across $(()) and expr.
12187 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
12188 eval 'as_fn_arith ()
12189 {
12190 as_val=$(( $* ))
12191 }'
12192 else
12193 as_fn_arith ()
12194 {
12195 as_val=`expr "$@" || test $? -eq 1`
12196 }
12197 fi # as_fn_arith
12198
12199
12200 if expr a : '\(a\)' >/dev/null 2>&1 &&
12201 test "X`expr 00001 : '.*\(...\)'`" = X001; then
12202 as_expr=expr
12203 else
12204 as_expr=false
12205 fi
12206
12207 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
12208 as_basename=basename
12209 else
12210 as_basename=false
12211 fi
12212
12213 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
12214 as_dirname=dirname
12215 else
12216 as_dirname=false
12217 fi
12218
12219 as_me=`$as_basename -- "$0" ||
12220 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
12221 X"$0" : 'X\(//\)$' \| \
12222 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
12223 $as_echo X/"$0" |
12224 sed '/^.*\/\([^/][^/]*\)\/*$/{
12225 s//\1/
12226 q
12227 }
12228 /^X\/\(\/\/\)$/{
12229 s//\1/
12230 q
12231 }
12232 /^X\/\(\/\).*/{
12233 s//\1/
12234 q
12235 }
12236 s/.*/./; q'`
12237
12238 # Avoid depending upon Character Ranges.
12239 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12240 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
12241 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
12242 as_cr_digits='0123456789'
12243 as_cr_alnum=$as_cr_Letters$as_cr_digits
12244
12245 ECHO_C= ECHO_N= ECHO_T=
12246 case `echo -n x` in #(((((
12247 -n*)
12248 case `echo 'xy\c'` in
12249 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
12250 xy) ECHO_C='\c';;
12251 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
12252 ECHO_T=' ';;
12253 esac;;
12254 *)
12255 ECHO_N='-n';;
12256 esac
12257
12258 rm -f conf$$ conf$$.exe conf$$.file
12259 if test -d conf$$.dir; then
12260 rm -f conf$$.dir/conf$$.file
12261 else
12262 rm -f conf$$.dir
12263 mkdir conf$$.dir 2>/dev/null
12264 fi
12265 if (echo >conf$$.file) 2>/dev/null; then
12266 if ln -s conf$$.file conf$$ 2>/dev/null; then
12267 as_ln_s='ln -s'
12268 # ... but there are two gotchas:
12269 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
12270 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
12271 # In both cases, we have to default to `cp -p'.
12272 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
12273 as_ln_s='cp -p'
12274 elif ln conf$$.file conf$$ 2>/dev/null; then
12275 as_ln_s=ln
12276 else
12277 as_ln_s='cp -p'
12278 fi
12279 else
12280 as_ln_s='cp -p'
12281 fi
12282 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
12283 rmdir conf$$.dir 2>/dev/null
12284
12285
12286 # as_fn_mkdir_p
12287 # -------------
12288 # Create "$as_dir" as a directory, including parents if necessary.
12289 as_fn_mkdir_p ()
12290 {
12291
12292 case $as_dir in #(
12293 -*) as_dir=./$as_dir;;
12294 esac
12295 test -d "$as_dir" || eval $as_mkdir_p || {
12296 as_dirs=
12297 while :; do
12298 case $as_dir in #(
12299 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
12300 *) as_qdir=$as_dir;;
12301 esac
12302 as_dirs="'$as_qdir' $as_dirs"
12303 as_dir=`$as_dirname -- "$as_dir" ||
12304 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12305 X"$as_dir" : 'X\(//\)[^/]' \| \
12306 X"$as_dir" : 'X\(//\)$' \| \
12307 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
12308 $as_echo X"$as_dir" |
12309 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12310 s//\1/
12311 q
12312 }
12313 /^X\(\/\/\)[^/].*/{
12314 s//\1/
12315 q
12316 }
12317 /^X\(\/\/\)$/{
12318 s//\1/
12319 q
12320 }
12321 /^X\(\/\).*/{
12322 s//\1/
12323 q
12324 }
12325 s/.*/./; q'`
12326 test -d "$as_dir" && break
12327 done
12328 test -z "$as_dirs" || eval "mkdir $as_dirs"
12329 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
12330
12331
12332 } # as_fn_mkdir_p
12333 if mkdir -p . 2>/dev/null; then
12334 as_mkdir_p='mkdir -p "$as_dir"'
12335 else
12336 test -d ./-p && rmdir ./-p
12337 as_mkdir_p=false
12338 fi
12339
12340 if test -x / >/dev/null 2>&1; then
12341 as_test_x='test -x'
12342 else
12343 if ls -dL / >/dev/null 2>&1; then
12344 as_ls_L_option=L
12345 else
12346 as_ls_L_option=
12347 fi
12348 as_test_x='
12349 eval sh -c '\''
12350 if test -d "$1"; then
12351 test -d "$1/.";
12352 else
12353 case $1 in #(
12354 -*)set "./$1";;
12355 esac;
12356 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
12357 ???[sx]*):;;*)false;;esac;fi
12358 '\'' sh
12359 '
12360 fi
12361 as_executable_p=$as_test_x
12362
12363 # Sed expression to map a string onto a valid CPP name.
12364 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
12365
12366 # Sed expression to map a string onto a valid variable name.
12367 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
12368
12369
12370 exec 6>&1
12371 ## ----------------------------------- ##
12372 ## Main body of $CONFIG_STATUS script. ##
12373 ## ----------------------------------- ##
12374 _ASEOF
12375 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
12376
12377 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12378 # Save the log message, to keep $0 and so on meaningful, and to
12379 # report actual input values of CONFIG_FILES etc. instead of their
12380 # values after options handling.
12381 ac_log="
12382 This file was extended by telepathy-ring $as_me 2.1.0, which was
12383 generated by GNU Autoconf 2.67. Invocation command line was
12384
12385 CONFIG_FILES = $CONFIG_FILES
12386 CONFIG_HEADERS = $CONFIG_HEADERS
12387 CONFIG_LINKS = $CONFIG_LINKS
12388 CONFIG_COMMANDS = $CONFIG_COMMANDS
12389 $ $0 $@
12390
12391 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12392 "
12393
12394 _ACEOF
12395
12396 case $ac_config_files in *"
12397 "*) set x $ac_config_files; shift; ac_config_files=$*;;
12398 esac
12399
12400 case $ac_config_headers in *"
12401 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
12402 esac
12403
12404
12405 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12406 # Files that config.status was made for.
12407 config_files="$ac_config_files"
12408 config_headers="$ac_config_headers"
12409 config_commands="$ac_config_commands"
12410
12411 _ACEOF
12412
12413 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12414 ac_cs_usage="\
12415 \`$as_me' instantiates files and other configuration actions
12416 from templates according to the current configuration. Unless the files
12417 and actions are specified as TAGs, all are instantiated by default.
12418
12419 Usage: $0 [OPTION]... [TAG]...
12420
12421 -h, --help print this help, then exit
12422 -V, --version print version number and configuration settings, then exit
12423 --config print configuration, then exit
12424 -q, --quiet, --silent
12425 do not print progress messages
12426 -d, --debug don't remove temporary files
12427 --recheck update $as_me by reconfiguring in the same conditions
12428 --file=FILE[:TEMPLATE]
12429 instantiate the configuration file FILE
12430 --header=FILE[:TEMPLATE]
12431 instantiate the configuration header FILE
12432
12433 Configuration files:
12434 $config_files
12435
12436 Configuration headers:
12437 $config_headers
12438
12439 Configuration commands:
12440 $config_commands
12441
12442 Report bugs to the package provider."
12443
12444 _ACEOF
12445 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12446 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
12447 ac_cs_version="\\
12448 telepathy-ring config.status 2.1.0
12449 configured by $0, generated by GNU Autoconf 2.67,
12450 with options \\"\$ac_cs_config\\"
12451
12452 Copyright (C) 2010 Free Software Foundation, Inc.
12453 This config.status script is free software; the Free Software Foundation
12454 gives unlimited permission to copy, distribute and modify it."
12455
12456 ac_pwd='$ac_pwd'
12457 srcdir='$srcdir'
12458 INSTALL='$INSTALL'
12459 MKDIR_P='$MKDIR_P'
12460 AWK='$AWK'
12461 test -n "\$AWK" || AWK=awk
12462 _ACEOF
12463
12464 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12465 # The default lists apply if the user does not specify any file.
12466 ac_need_defaults=:
12467 while test $# != 0
12468 do
12469 case $1 in
12470 --*=?*)
12471 ac_option=`expr "X$1" : 'X\([^=]*\)='`
12472 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
12473 ac_shift=:
12474 ;;
12475 --*=)
12476 ac_option=`expr "X$1" : 'X\([^=]*\)='`
12477 ac_optarg=
12478 ac_shift=:
12479 ;;
12480 *)
12481 ac_option=$1
12482 ac_optarg=$2
12483 ac_shift=shift
12484 ;;
12485 esac
12486
12487 case $ac_option in
12488 # Handling of the options.
12489 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12490 ac_cs_recheck=: ;;
12491 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
12492 $as_echo "$ac_cs_version"; exit ;;
12493 --config | --confi | --conf | --con | --co | --c )
12494 $as_echo "$ac_cs_config"; exit ;;
12495 --debug | --debu | --deb | --de | --d | -d )
12496 debug=: ;;
12497 --file | --fil | --fi | --f )
12498 $ac_shift
12499 case $ac_optarg in
12500 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
12501 '') as_fn_error $? "missing file argument" ;;
12502 esac
12503 as_fn_append CONFIG_FILES " '$ac_optarg'"
12504 ac_need_defaults=false;;
12505 --header | --heade | --head | --hea )
12506 $ac_shift
12507 case $ac_optarg in
12508 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
12509 esac
12510 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
12511 ac_need_defaults=false;;
12512 --he | --h)
12513 # Conflict between --help and --header
12514 as_fn_error $? "ambiguous option: \`$1'
12515 Try \`$0 --help' for more information.";;
12516 --help | --hel | -h )
12517 $as_echo "$ac_cs_usage"; exit ;;
12518 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
12519 | -silent | --silent | --silen | --sile | --sil | --si | --s)
12520 ac_cs_silent=: ;;
12521
12522 # This is an error.
12523 -*) as_fn_error $? "unrecognized option: \`$1'
12524 Try \`$0 --help' for more information." ;;
12525
12526 *) as_fn_append ac_config_targets " $1"
12527 ac_need_defaults=false ;;
12528
12529 esac
12530 shift
12531 done
12532
12533 ac_configure_extra_args=
12534
12535 if $ac_cs_silent; then
12536 exec 6>/dev/null
12537 ac_configure_extra_args="$ac_configure_extra_args --silent"
12538 fi
12539
12540 _ACEOF
12541 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12542 if \$ac_cs_recheck; then
12543 set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
12544 shift
12545 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
12546 CONFIG_SHELL='$SHELL'
12547 export CONFIG_SHELL
12548 exec "\$@"
12549 fi
12550
12551 _ACEOF
12552 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12553 exec 5>>config.log
12554 {
12555 echo
12556 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
12557 ## Running $as_me. ##
12558 _ASBOX
12559 $as_echo "$ac_log"
12560 } >&5
12561
12562 _ACEOF
12563 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12564 #
12565 # INIT-COMMANDS
12566 #
12567 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
12568
12569
12570 # The HP-UX ksh and POSIX shell print the target directory to stdout
12571 # if CDPATH is set.
12572 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
12573
12574 sed_quote_subst='$sed_quote_subst'
12575 double_quote_subst='$double_quote_subst'
12576 delay_variable_subst='$delay_variable_subst'
12577 enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
12578 macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
12579 macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
12580 enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
12581 pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
12582 enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
12583 host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
12584 host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
12585 host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
12586 build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
12587 build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
12588 build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
12589 SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
12590 Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
12591 GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
12592 EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
12593 FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
12594 LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
12595 NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
12596 LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
12597 max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
12598 ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
12599 exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
12600 lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
12601 lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
12602 lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
12603 reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
12604 reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12605 OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
12606 deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
12607 file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
12608 AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
12609 AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
12610 STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
12611 RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
12612 old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12613 old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12614 old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12615 CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
12616 CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
12617 compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
12618 GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
12619 lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
12620 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
12621 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
12622 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
12623 objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
12624 SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
12625 ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
12626 MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
12627 lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
12628 lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
12629 lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
12630 lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
12631 lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
12632 need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
12633 DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
12634 NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
12635 LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
12636 OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
12637 OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
12638 libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
12639 shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12640 extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12641 archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
12642 enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
12643 export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
12644 whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
12645 compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
12646 old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12647 old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12648 archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12649 archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12650 module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12651 module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12652 with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
12653 allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
12654 no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
12655 hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
12656 hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
12657 hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
12658 hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
12659 hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
12660 hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
12661 hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
12662 hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
12663 inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
12664 link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
12665 fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
12666 always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
12667 export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12668 exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
12669 include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
12670 prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12671 file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
12672 variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
12673 need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
12674 need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
12675 version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
12676 runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
12677 shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
12678 shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
12679 libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
12680 library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
12681 soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
12682 postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12683 postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12684 finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
12685 finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
12686 hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
12687 sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
12688 sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
12689 hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
12690 enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
12691 enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
12692 enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
12693 old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
12694 striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
12695
12696 LTCC='$LTCC'
12697 LTCFLAGS='$LTCFLAGS'
12698 compiler='$compiler_DEFAULT'
12699
12700 # Quote evaled strings.
12701 for var in SED \
12702 GREP \
12703 EGREP \
12704 FGREP \
12705 LD \
12706 NM \
12707 LN_S \
12708 lt_SP2NL \
12709 lt_NL2SP \
12710 reload_flag \
12711 OBJDUMP \
12712 deplibs_check_method \
12713 file_magic_cmd \
12714 AR \
12715 AR_FLAGS \
12716 STRIP \
12717 RANLIB \
12718 CC \
12719 CFLAGS \
12720 compiler \
12721 lt_cv_sys_global_symbol_pipe \
12722 lt_cv_sys_global_symbol_to_cdecl \
12723 lt_cv_sys_global_symbol_to_c_name_address \
12724 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
12725 SHELL \
12726 ECHO \
12727 lt_prog_compiler_no_builtin_flag \
12728 lt_prog_compiler_wl \
12729 lt_prog_compiler_pic \
12730 lt_prog_compiler_static \
12731 lt_cv_prog_compiler_c_o \
12732 need_locks \
12733 DSYMUTIL \
12734 NMEDIT \
12735 LIPO \
12736 OTOOL \
12737 OTOOL64 \
12738 shrext_cmds \
12739 export_dynamic_flag_spec \
12740 whole_archive_flag_spec \
12741 compiler_needs_object \
12742 with_gnu_ld \
12743 allow_undefined_flag \
12744 no_undefined_flag \
12745 hardcode_libdir_flag_spec \
12746 hardcode_libdir_flag_spec_ld \
12747 hardcode_libdir_separator \
12748 fix_srcfile_path \
12749 exclude_expsyms \
12750 include_expsyms \
12751 file_list_spec \
12752 variables_saved_for_relink \
12753 libname_spec \
12754 library_names_spec \
12755 soname_spec \
12756 finish_eval \
12757 old_striplib \
12758 striplib; do
12759 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
12760 *[\\\\\\\`\\"\\\$]*)
12761 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
12762 ;;
12763 *)
12764 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
12765 ;;
12766 esac
12767 done
12768
12769 # Double-quote double-evaled strings.
12770 for var in reload_cmds \
12771 old_postinstall_cmds \
12772 old_postuninstall_cmds \
12773 old_archive_cmds \
12774 extract_expsyms_cmds \
12775 old_archive_from_new_cmds \
12776 old_archive_from_expsyms_cmds \
12777 archive_cmds \
12778 archive_expsym_cmds \
12779 module_cmds \
12780 module_expsym_cmds \
12781 export_symbols_cmds \
12782 prelink_cmds \
12783 postinstall_cmds \
12784 postuninstall_cmds \
12785 finish_cmds \
12786 sys_lib_search_path_spec \
12787 sys_lib_dlsearch_path_spec; do
12788 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
12789 *[\\\\\\\`\\"\\\$]*)
12790 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
12791 ;;
12792 *)
12793 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
12794 ;;
12795 esac
12796 done
12797
12798 # Fix-up fallback echo if it was mangled by the above quoting rules.
12799 case \$lt_ECHO in
12800 *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
12801 ;;
12802 esac
12803
12804 ac_aux_dir='$ac_aux_dir'
12805 xsi_shell='$xsi_shell'
12806 lt_shell_append='$lt_shell_append'
12807
12808 # See if we are running on zsh, and set the options which allow our
12809 # commands through without removal of \ escapes INIT.
12810 if test -n "\${ZSH_VERSION+set}" ; then
12811 setopt NO_GLOB_SUBST
12812 fi
12813
12814
12815 PACKAGE='$PACKAGE'
12816 VERSION='$VERSION'
12817 TIMESTAMP='$TIMESTAMP'
12818 RM='$RM'
12819 ofile='$ofile'
12820
12821
12822
12823
12824 _ACEOF
12825
12826 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12827
12828 # Handling of arguments.
12829 for ac_config_target in $ac_config_targets
12830 do
12831 case $ac_config_target in
12832 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
12833 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
12834 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
12835 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12836 "modem/Makefile") CONFIG_FILES="$CONFIG_FILES modem/Makefile" ;;
12837 "modem/tests/Makefile") CONFIG_FILES="$CONFIG_FILES modem/tests/Makefile" ;;
12838 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
12839 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
12840 "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
12841 "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
12842 "sms-glib/Makefile") CONFIG_FILES="$CONFIG_FILES sms-glib/Makefile" ;;
12843 "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
12844 "ring-extensions/Makefile") CONFIG_FILES="$CONFIG_FILES ring-extensions/Makefile" ;;
12845
12846 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
12847 esac
12848 done
12849
12850
12851 # If the user did not use the arguments to specify the items to instantiate,
12852 # then the envvar interface is used. Set only those that are not.
12853 # We use the long form for the default assignment because of an extremely
12854 # bizarre bug on SunOS 4.1.3.
12855 if $ac_need_defaults; then
12856 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12857 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12858 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12859 fi
12860
12861 # Have a temporary directory for convenience. Make it in the build tree
12862 # simply because there is no reason against having it here, and in addition,
12863 # creating and moving files from /tmp can sometimes cause problems.
12864 # Hook for its removal unless debugging.
12865 # Note that there is a small window in which the directory will not be cleaned:
12866 # after its creation but before its name has been assigned to `$tmp'.
12867 $debug ||
12868 {
12869 tmp=
12870 trap 'exit_status=$?
12871 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
12872 ' 0
12873 trap 'as_fn_exit 1' 1 2 13 15
12874 }
12875 # Create a (secure) tmp directory for tmp files.
12876
12877 {
12878 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
12879 test -n "$tmp" && test -d "$tmp"
12880 } ||
12881 {
12882 tmp=./conf$$-$RANDOM
12883 (umask 077 && mkdir "$tmp")
12884 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
12885
12886 # Set up the scripts for CONFIG_FILES section.
12887 # No need to generate them if there are no CONFIG_FILES.
12888 # This happens for instance with `./config.status config.h'.
12889 if test -n "$CONFIG_FILES"; then
12890
12891
12892 ac_cr=`echo X | tr X '\015'`
12893 # On cygwin, bash can eat \r inside `` if the user requested igncr.
12894 # But we know of no other shell where ac_cr would be empty at this
12895 # point, so we can use a bashism as a fallback.
12896 if test "x$ac_cr" = x; then
12897 eval ac_cr=\$\'\\r\'
12898 fi
12899 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
12900 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
12901 ac_cs_awk_cr='\\r'
12902 else
12903 ac_cs_awk_cr=$ac_cr
12904 fi
12905
12906 echo 'BEGIN {' >"$tmp/subs1.awk" &&
12907 _ACEOF
12908
12909
12910 {
12911 echo "cat >conf$$subs.awk <<_ACEOF" &&
12912 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
12913 echo "_ACEOF"
12914 } >conf$$subs.sh ||
12915 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
12916 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
12917 ac_delim='%!_!# '
12918 for ac_last_try in false false false false false :; do
12919 . ./conf$$subs.sh ||
12920 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
12921
12922 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
12923 if test $ac_delim_n = $ac_delim_num; then
12924 break
12925 elif $ac_last_try; then
12926 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
12927 else
12928 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
12929 fi
12930 done
12931 rm -f conf$$subs.sh
12932
12933 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12934 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
12935 _ACEOF
12936 sed -n '
12937 h
12938 s/^/S["/; s/!.*/"]=/
12939 p
12940 g
12941 s/^[^!]*!//
12942 :repl
12943 t repl
12944 s/'"$ac_delim"'$//
12945 t delim
12946 :nl
12947 h
12948 s/\(.\{148\}\)..*/\1/
12949 t more1
12950 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
12951 p
12952 n
12953 b repl
12954 :more1
12955 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
12956 p
12957 g
12958 s/.\{148\}//
12959 t nl
12960 :delim
12961 h
12962 s/\(.\{148\}\)..*/\1/
12963 t more2
12964 s/["\\]/\\&/g; s/^/"/; s/$/"/
12965 p
12966 b
12967 :more2
12968 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
12969 p
12970 g
12971 s/.\{148\}//
12972 t delim
12973 ' <conf$$subs.awk | sed '
12974 /^[^""]/{
12975 N
12976 s/\n//
12977 }
12978 ' >>$CONFIG_STATUS || ac_write_fail=1
12979 rm -f conf$$subs.awk
12980 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12981 _ACAWK
12982 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
12983 for (key in S) S_is_set[key] = 1
12984 FS = ""
12985
12986 }
12987 {
12988 line = $ 0
12989 nfields = split(line, field, "@")
12990 substed = 0
12991 len = length(field[1])
12992 for (i = 2; i < nfields; i++) {
12993 key = field[i]
12994 keylen = length(key)
12995 if (S_is_set[key]) {
12996 value = S[key]
12997 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
12998 len += length(value) + length(field[++i])
12999 substed = 1
13000 } else
13001 len += 1 + keylen
13002 }
13003
13004 print line
13005 }
13006
13007 _ACAWK
13008 _ACEOF
13009 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13010 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
13011 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
13012 else
13013 cat
13014 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
13015 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
13016 _ACEOF
13017
13018 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
13019 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
13020 # trailing colons and then remove the whole line if VPATH becomes empty
13021 # (actually we leave an empty line to preserve line numbers).
13022 if test "x$srcdir" = x.; then
13023 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
13024 h
13025 s///
13026 s/^/:/
13027 s/[ ]*$/:/
13028 s/:\$(srcdir):/:/g
13029 s/:\${srcdir}:/:/g
13030 s/:@srcdir@:/:/g
13031 s/^:*//
13032 s/:*$//
13033 x
13034 s/\(=[ ]*\).*/\1/
13035 G
13036 s/\n//
13037 s/^[^=]*=[ ]*$//
13038 }'
13039 fi
13040
13041 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13042 fi # test -n "$CONFIG_FILES"
13043
13044 # Set up the scripts for CONFIG_HEADERS section.
13045 # No need to generate them if there are no CONFIG_HEADERS.
13046 # This happens for instance with `./config.status Makefile'.
13047 if test -n "$CONFIG_HEADERS"; then
13048 cat >"$tmp/defines.awk" <<\_ACAWK ||
13049 BEGIN {
13050 _ACEOF
13051
13052 # Transform confdefs.h into an awk script `defines.awk', embedded as
13053 # here-document in config.status, that substitutes the proper values into
13054 # config.h.in to produce config.h.
13055
13056 # Create a delimiter string that does not exist in confdefs.h, to ease
13057 # handling of long lines.
13058 ac_delim='%!_!# '
13059 for ac_last_try in false false :; do
13060 ac_t=`sed -n "/$ac_delim/p" confdefs.h`
13061 if test -z "$ac_t"; then
13062 break
13063 elif $ac_last_try; then
13064 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
13065 else
13066 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
13067 fi
13068 done
13069
13070 # For the awk script, D is an array of macro values keyed by name,
13071 # likewise P contains macro parameters if any. Preserve backslash
13072 # newline sequences.
13073
13074 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
13075 sed -n '
13076 s/.\{148\}/&'"$ac_delim"'/g
13077 t rset
13078 :rset
13079 s/^[ ]*#[ ]*define[ ][ ]*/ /
13080 t def
13081 d
13082 :def
13083 s/\\$//
13084 t bsnl
13085 s/["\\]/\\&/g
13086 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
13087 D["\1"]=" \3"/p
13088 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
13089 d
13090 :bsnl
13091 s/["\\]/\\&/g
13092 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
13093 D["\1"]=" \3\\\\\\n"\\/p
13094 t cont
13095 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
13096 t cont
13097 d
13098 :cont
13099 n
13100 s/.\{148\}/&'"$ac_delim"'/g
13101 t clear
13102 :clear
13103 s/\\$//
13104 t bsnlc
13105 s/["\\]/\\&/g; s/^/"/; s/$/"/p
13106 d
13107 :bsnlc
13108 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
13109 b cont
13110 ' <confdefs.h | sed '
13111 s/'"$ac_delim"'/"\\\
13112 "/g' >>$CONFIG_STATUS || ac_write_fail=1
13113
13114 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13115 for (key in D) D_is_set[key] = 1
13116 FS = ""
13117 }
13118 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
13119 line = \$ 0
13120 split(line, arg, " ")
13121 if (arg[1] == "#") {
13122 defundef = arg[2]
13123 mac1 = arg[3]
13124 } else {
13125 defundef = substr(arg[1], 2)
13126 mac1 = arg[2]
13127 }
13128 split(mac1, mac2, "(") #)
13129 macro = mac2[1]
13130 prefix = substr(line, 1, index(line, defundef) - 1)
13131 if (D_is_set[macro]) {
13132 # Preserve the white space surrounding the "#".
13133 print prefix "define", macro P[macro] D[macro]
13134 next
13135 } else {
13136 # Replace #undef with comments. This is necessary, for example,
13137 # in the case of _POSIX_SOURCE, which is predefined and required
13138 # on some systems where configure will not decide to define it.
13139 if (defundef == "undef") {
13140 print "/*", prefix defundef, macro, "*/"
13141 next
13142 }
13143 }
13144 }
13145 { print }
13146 _ACAWK
13147 _ACEOF
13148 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13149 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
13150 fi # test -n "$CONFIG_HEADERS"
13151
13152
13153 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
13154 shift
13155 for ac_tag
13156 do
13157 case $ac_tag in
13158 :[FHLC]) ac_mode=$ac_tag; continue;;
13159 esac
13160 case $ac_mode$ac_tag in
13161 :[FHL]*:*);;
13162 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
13163 :[FH]-) ac_tag=-:-;;
13164 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
13165 esac
13166 ac_save_IFS=$IFS
13167 IFS=:
13168 set x $ac_tag
13169 IFS=$ac_save_IFS
13170 shift
13171 ac_file=$1
13172 shift
13173
13174 case $ac_mode in
13175 :L) ac_source=$1;;
13176 :[FH])
13177 ac_file_inputs=
13178 for ac_f
13179 do
13180 case $ac_f in
13181 -) ac_f="$tmp/stdin";;
13182 *) # Look for the file first in the build tree, then in the source tree
13183 # (if the path is not absolute). The absolute path cannot be DOS-style,
13184 # because $ac_f cannot contain `:'.
13185 test -f "$ac_f" ||
13186 case $ac_f in
13187 [\\/$]*) false;;
13188 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
13189 esac ||
13190 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
13191 esac
13192 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
13193 as_fn_append ac_file_inputs " '$ac_f'"
13194 done
13195
13196 # Let's still pretend it is `configure' which instantiates (i.e., don't
13197 # use $as_me), people would be surprised to read:
13198 # /* config.h. Generated by config.status. */
13199 configure_input='Generated from '`
13200 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
13201 `' by configure.'
13202 if test x"$ac_file" != x-; then
13203 configure_input="$ac_file. $configure_input"
13204 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
13205 $as_echo "$as_me: creating $ac_file" >&6;}
13206 fi
13207 # Neutralize special characters interpreted by sed in replacement strings.
13208 case $configure_input in #(
13209 *\&* | *\|* | *\\* )
13210 ac_sed_conf_input=`$as_echo "$configure_input" |
13211 sed 's/[\\\\&|]/\\\\&/g'`;; #(
13212 *) ac_sed_conf_input=$configure_input;;
13213 esac
13214
13215 case $ac_tag in
13216 *:-:* | *:-) cat >"$tmp/stdin" \
13217 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
13218 esac
13219 ;;
13220 esac
13221
13222 ac_dir=`$as_dirname -- "$ac_file" ||
13223 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13224 X"$ac_file" : 'X\(//\)[^/]' \| \
13225 X"$ac_file" : 'X\(//\)$' \| \
13226 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
13227 $as_echo X"$ac_file" |
13228 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13229 s//\1/
13230 q
13231 }
13232 /^X\(\/\/\)[^/].*/{
13233 s//\1/
13234 q
13235 }
13236 /^X\(\/\/\)$/{
13237 s//\1/
13238 q
13239 }
13240 /^X\(\/\).*/{
13241 s//\1/
13242 q
13243 }
13244 s/.*/./; q'`
13245 as_dir="$ac_dir"; as_fn_mkdir_p
13246 ac_builddir=.
13247
13248 case "$ac_dir" in
13249 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
13250 *)
13251 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
13252 # A ".." for each directory in $ac_dir_suffix.
13253 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
13254 case $ac_top_builddir_sub in
13255 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
13256 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
13257 esac ;;
13258 esac
13259 ac_abs_top_builddir=$ac_pwd
13260 ac_abs_builddir=$ac_pwd$ac_dir_suffix
13261 # for backward compatibility:
13262 ac_top_builddir=$ac_top_build_prefix
13263
13264 case $srcdir in
13265 .) # We are building in place.
13266 ac_srcdir=.
13267 ac_top_srcdir=$ac_top_builddir_sub
13268 ac_abs_top_srcdir=$ac_pwd ;;
13269 [\\/]* | ?:[\\/]* ) # Absolute name.
13270 ac_srcdir=$srcdir$ac_dir_suffix;
13271 ac_top_srcdir=$srcdir
13272 ac_abs_top_srcdir=$srcdir ;;
13273 *) # Relative name.
13274 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
13275 ac_top_srcdir=$ac_top_build_prefix$srcdir
13276 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
13277 esac
13278 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
13279
13280
13281 case $ac_mode in
13282 :F)
13283 #
13284 # CONFIG_FILE
13285 #
13286
13287 case $INSTALL in
13288 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
13289 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
13290 esac
13291 ac_MKDIR_P=$MKDIR_P
13292 case $MKDIR_P in
13293 [\\/$]* | ?:[\\/]* ) ;;
13294 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
13295 esac
13296 _ACEOF
13297
13298 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13299 # If the template does not know about datarootdir, expand it.
13300 # FIXME: This hack should be removed a few years after 2.60.
13301 ac_datarootdir_hack=; ac_datarootdir_seen=
13302 ac_sed_dataroot='
13303 /datarootdir/ {
13304 p
13305 q
13306 }
13307 /@datadir@/p
13308 /@docdir@/p
13309 /@infodir@/p
13310 /@localedir@/p
13311 /@mandir@/p'
13312 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
13313 *datarootdir*) ac_datarootdir_seen=yes;;
13314 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
13315 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
13316 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
13317 _ACEOF
13318 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13319 ac_datarootdir_hack='
13320 s&@datadir@&$datadir&g
13321 s&@docdir@&$docdir&g
13322 s&@infodir@&$infodir&g
13323 s&@localedir@&$localedir&g
13324 s&@mandir@&$mandir&g
13325 s&\\\${datarootdir}&$datarootdir&g' ;;
13326 esac
13327 _ACEOF
13328
13329 # Neutralize VPATH when `$srcdir' = `.'.
13330 # Shell code in configure.ac might set extrasub.
13331 # FIXME: do we really want to maintain this feature?
13332 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13333 ac_sed_extra="$ac_vpsub
13334 $extrasub
13335 _ACEOF
13336 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13337 :t
13338 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
13339 s|@configure_input@|$ac_sed_conf_input|;t t
13340 s&@top_builddir@&$ac_top_builddir_sub&;t t
13341 s&@top_build_prefix@&$ac_top_build_prefix&;t t
13342 s&@srcdir@&$ac_srcdir&;t t
13343 s&@abs_srcdir@&$ac_abs_srcdir&;t t
13344 s&@top_srcdir@&$ac_top_srcdir&;t t
13345 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
13346 s&@builddir@&$ac_builddir&;t t
13347 s&@abs_builddir@&$ac_abs_builddir&;t t
13348 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
13349 s&@INSTALL@&$ac_INSTALL&;t t
13350 s&@MKDIR_P@&$ac_MKDIR_P&;t t
13351 $ac_datarootdir_hack
13352 "
13353 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
13354 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13355
13356 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
13357 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
13358 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
13359 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
13360 which seems to be undefined. Please make sure it is defined" >&5
13361 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
13362 which seems to be undefined. Please make sure it is defined" >&2;}
13363
13364 rm -f "$tmp/stdin"
13365 case $ac_file in
13366 -) cat "$tmp/out" && rm -f "$tmp/out";;
13367 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
13368 esac \
13369 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13370 ;;
13371 :H)
13372 #
13373 # CONFIG_HEADER
13374 #
13375 if test x"$ac_file" != x-; then
13376 {
13377 $as_echo "/* $configure_input */" \
13378 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
13379 } >"$tmp/config.h" \
13380 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13381 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
13382 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
13383 $as_echo "$as_me: $ac_file is unchanged" >&6;}
13384 else
13385 rm -f "$ac_file"
13386 mv "$tmp/config.h" "$ac_file" \
13387 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13388 fi
13389 else
13390 $as_echo "/* $configure_input */" \
13391 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
13392 || as_fn_error $? "could not create -" "$LINENO" 5
13393 fi
13394 # Compute "$ac_file"'s index in $config_headers.
13395 _am_arg="$ac_file"
13396 _am_stamp_count=1
13397 for _am_header in $config_headers :; do
13398 case $_am_header in
13399 $_am_arg | $_am_arg:* )
13400 break ;;
13401 * )
13402 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
13403 esac
13404 done
13405 echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
13406 $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13407 X"$_am_arg" : 'X\(//\)[^/]' \| \
13408 X"$_am_arg" : 'X\(//\)$' \| \
13409 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
13410 $as_echo X"$_am_arg" |
13411 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13412 s//\1/
13413 q
13414 }
13415 /^X\(\/\/\)[^/].*/{
13416 s//\1/
13417 q
13418 }
13419 /^X\(\/\/\)$/{
13420 s//\1/
13421 q
13422 }
13423 /^X\(\/\).*/{
13424 s//\1/
13425 q
13426 }
13427 s/.*/./; q'`/stamp-h$_am_stamp_count
13428 ;;
13429
13430 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
13431 $as_echo "$as_me: executing $ac_file commands" >&6;}
13432 ;;
13433 esac
13434
13435
13436 case $ac_file$ac_mode in
13437 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
13438 # Autoconf 2.62 quotes --file arguments for eval, but not when files
13439 # are listed without --file. Let's play safe and only enable the eval
13440 # if we detect the quoting.
13441 case $CONFIG_FILES in
13442 *\'*) eval set x "$CONFIG_FILES" ;;
13443 *) set x $CONFIG_FILES ;;
13444 esac
13445 shift
13446 for mf
13447 do
13448 # Strip MF so we end up with the name of the file.
13449 mf=`echo "$mf" | sed -e 's/:.*$//'`
13450 # Check whether this is an Automake generated Makefile or not.
13451 # We used to match only the files named `Makefile.in', but
13452 # some people rename them; so instead we look at the file content.
13453 # Grep'ing the first line is not enough: some people post-process
13454 # each Makefile.in and add a new line on top of each file to say so.
13455 # Grep'ing the whole file is not good either: AIX grep has a line
13456 # limit of 2048, but all sed's we know have understand at least 4000.
13457 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
13458 dirpart=`$as_dirname -- "$mf" ||
13459 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13460 X"$mf" : 'X\(//\)[^/]' \| \
13461 X"$mf" : 'X\(//\)$' \| \
13462 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
13463 $as_echo X"$mf" |
13464 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13465 s//\1/
13466 q
13467 }
13468 /^X\(\/\/\)[^/].*/{
13469 s//\1/
13470 q
13471 }
13472 /^X\(\/\/\)$/{
13473 s//\1/
13474 q
13475 }
13476 /^X\(\/\).*/{
13477 s//\1/
13478 q
13479 }
13480 s/.*/./; q'`
13481 else
13482 continue
13483 fi
13484 # Extract the definition of DEPDIR, am__include, and am__quote
13485 # from the Makefile without running `make'.
13486 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
13487 test -z "$DEPDIR" && continue
13488 am__include=`sed -n 's/^am__include = //p' < "$mf"`
13489 test -z "am__include" && continue
13490 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
13491 # When using ansi2knr, U may be empty or an underscore; expand it
13492 U=`sed -n 's/^U = //p' < "$mf"`
13493 # Find all dependency output files, they are included files with
13494 # $(DEPDIR) in their names. We invoke sed twice because it is the
13495 # simplest approach to changing $(DEPDIR) to its actual value in the
13496 # expansion.
13497 for file in `sed -n "
13498 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
13499 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
13500 # Make sure the directory exists.
13501 test -f "$dirpart/$file" && continue
13502 fdir=`$as_dirname -- "$file" ||
13503 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13504 X"$file" : 'X\(//\)[^/]' \| \
13505 X"$file" : 'X\(//\)$' \| \
13506 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
13507 $as_echo X"$file" |
13508 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13509 s//\1/
13510 q
13511 }
13512 /^X\(\/\/\)[^/].*/{
13513 s//\1/
13514 q
13515 }
13516 /^X\(\/\/\)$/{
13517 s//\1/
13518 q
13519 }
13520 /^X\(\/\).*/{
13521 s//\1/
13522 q
13523 }
13524 s/.*/./; q'`
13525 as_dir=$dirpart/$fdir; as_fn_mkdir_p
13526 # echo "creating $dirpart/$file"
13527 echo '# dummy' > "$dirpart/$file"
13528 done
13529 done
13530 }
13531 ;;
13532 "libtool":C)
13533
13534 # See if we are running on zsh, and set the options which allow our
13535 # commands through without removal of \ escapes.
13536 if test -n "${ZSH_VERSION+set}" ; then
13537 setopt NO_GLOB_SUBST
13538 fi
13539
13540 cfgfile="${ofile}T"
13541 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
13542 $RM "$cfgfile"
13543
13544 cat <<_LT_EOF >> "$cfgfile"
13545 #! $SHELL
13546
13547 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
13548 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
13549 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13550 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
13551 #
13552 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
13553 # 2006, 2007, 2008 Free Software Foundation, Inc.
13554 # Written by Gordon Matzigkeit, 1996
13555 #
13556 # This file is part of GNU Libtool.
13557 #
13558 # GNU Libtool is free software; you can redistribute it and/or
13559 # modify it under the terms of the GNU General Public License as
13560 # published by the Free Software Foundation; either version 2 of
13561 # the License, or (at your option) any later version.
13562 #
13563 # As a special exception to the GNU General Public License,
13564 # if you distribute this file as part of a program or library that
13565 # is built using GNU Libtool, you may include this file under the
13566 # same distribution terms that you use for the rest of that program.
13567 #
13568 # GNU Libtool is distributed in the hope that it will be useful,
13569 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13570 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13571 # GNU General Public License for more details.
13572 #
13573 # You should have received a copy of the GNU General Public License
13574 # along with GNU Libtool; see the file COPYING. If not, a copy
13575 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
13576 # obtained by writing to the Free Software Foundation, Inc.,
13577 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13578
13579
13580 # The names of the tagged configurations supported by this script.
13581 available_tags=""
13582
13583 # ### BEGIN LIBTOOL CONFIG
13584
13585 # Whether or not to build shared libraries.
13586 build_libtool_libs=$enable_shared
13587
13588 # Which release of libtool.m4 was used?
13589 macro_version=$macro_version
13590 macro_revision=$macro_revision
13591
13592 # Whether or not to build static libraries.
13593 build_old_libs=$enable_static
13594
13595 # What type of objects to build.
13596 pic_mode=$pic_mode
13597
13598 # Whether or not to optimize for fast installation.
13599 fast_install=$enable_fast_install
13600
13601 # The host system.
13602 host_alias=$host_alias
13603 host=$host
13604 host_os=$host_os
13605
13606 # The build system.
13607 build_alias=$build_alias
13608 build=$build
13609 build_os=$build_os
13610
13611 # A sed program that does not truncate output.
13612 SED=$lt_SED
13613
13614 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
13615 Xsed="\$SED -e 1s/^X//"
13616
13617 # A grep program that handles long lines.
13618 GREP=$lt_GREP
13619
13620 # An ERE matcher.
13621 EGREP=$lt_EGREP
13622
13623 # A literal string matcher.
13624 FGREP=$lt_FGREP
13625
13626 # A BSD- or MS-compatible name lister.
13627 NM=$lt_NM
13628
13629 # Whether we need soft or hard links.
13630 LN_S=$lt_LN_S
13631
13632 # What is the maximum length of a command?
13633 max_cmd_len=$max_cmd_len
13634
13635 # Object file suffix (normally "o").
13636 objext=$ac_objext
13637
13638 # Executable file suffix (normally "").
13639 exeext=$exeext
13640
13641 # whether the shell understands "unset".
13642 lt_unset=$lt_unset
13643
13644 # turn spaces into newlines.
13645 SP2NL=$lt_lt_SP2NL
13646
13647 # turn newlines into spaces.
13648 NL2SP=$lt_lt_NL2SP
13649
13650 # How to create reloadable object files.
13651 reload_flag=$lt_reload_flag
13652 reload_cmds=$lt_reload_cmds
13653
13654 # An object symbol dumper.
13655 OBJDUMP=$lt_OBJDUMP
13656
13657 # Method to check whether dependent libraries are shared objects.
13658 deplibs_check_method=$lt_deplibs_check_method
13659
13660 # Command to use when deplibs_check_method == "file_magic".
13661 file_magic_cmd=$lt_file_magic_cmd
13662
13663 # The archiver.
13664 AR=$lt_AR
13665 AR_FLAGS=$lt_AR_FLAGS
13666
13667 # A symbol stripping program.
13668 STRIP=$lt_STRIP
13669
13670 # Commands used to install an old-style archive.
13671 RANLIB=$lt_RANLIB
13672 old_postinstall_cmds=$lt_old_postinstall_cmds
13673 old_postuninstall_cmds=$lt_old_postuninstall_cmds
13674
13675 # A C compiler.
13676 LTCC=$lt_CC
13677
13678 # LTCC compiler flags.
13679 LTCFLAGS=$lt_CFLAGS
13680
13681 # Take the output of nm and produce a listing of raw symbols and C names.
13682 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
13683
13684 # Transform the output of nm in a proper C declaration.
13685 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
13686
13687 # Transform the output of nm in a C name address pair.
13688 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
13689
13690 # Transform the output of nm in a C name address pair when lib prefix is needed.
13691 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
13692
13693 # The name of the directory that contains temporary libtool files.
13694 objdir=$objdir
13695
13696 # Shell to use when invoking shell scripts.
13697 SHELL=$lt_SHELL
13698
13699 # An echo program that does not interpret backslashes.
13700 ECHO=$lt_ECHO
13701
13702 # Used to examine libraries when file_magic_cmd begins with "file".
13703 MAGIC_CMD=$MAGIC_CMD
13704
13705 # Must we lock files when doing compilation?
13706 need_locks=$lt_need_locks
13707
13708 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
13709 DSYMUTIL=$lt_DSYMUTIL
13710
13711 # Tool to change global to local symbols on Mac OS X.
13712 NMEDIT=$lt_NMEDIT
13713
13714 # Tool to manipulate fat objects and archives on Mac OS X.
13715 LIPO=$lt_LIPO
13716
13717 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
13718 OTOOL=$lt_OTOOL
13719
13720 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
13721 OTOOL64=$lt_OTOOL64
13722
13723 # Old archive suffix (normally "a").
13724 libext=$libext
13725
13726 # Shared library suffix (normally ".so").
13727 shrext_cmds=$lt_shrext_cmds
13728
13729 # The commands to extract the exported symbol list from a shared archive.
13730 extract_expsyms_cmds=$lt_extract_expsyms_cmds
13731
13732 # Variables whose values should be saved in libtool wrapper scripts and
13733 # restored at link time.
13734 variables_saved_for_relink=$lt_variables_saved_for_relink
13735
13736 # Do we need the "lib" prefix for modules?
13737 need_lib_prefix=$need_lib_prefix
13738
13739 # Do we need a version for libraries?
13740 need_version=$need_version
13741
13742 # Library versioning type.
13743 version_type=$version_type
13744
13745 # Shared library runtime path variable.
13746 runpath_var=$runpath_var
13747
13748 # Shared library path variable.
13749 shlibpath_var=$shlibpath_var
13750
13751 # Is shlibpath searched before the hard-coded library search path?
13752 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
13753
13754 # Format of library name prefix.
13755 libname_spec=$lt_libname_spec
13756
13757 # List of archive names. First name is the real one, the rest are links.
13758 # The last name is the one that the linker finds with -lNAME
13759 library_names_spec=$lt_library_names_spec
13760
13761 # The coded name of the library, if different from the real name.
13762 soname_spec=$lt_soname_spec
13763
13764 # Command to use after installation of a shared archive.
13765 postinstall_cmds=$lt_postinstall_cmds
13766
13767 # Command to use after uninstallation of a shared archive.
13768 postuninstall_cmds=$lt_postuninstall_cmds
13769
13770 # Commands used to finish a libtool library installation in a directory.
13771 finish_cmds=$lt_finish_cmds
13772
13773 # As "finish_cmds", except a single script fragment to be evaled but
13774 # not shown.
13775 finish_eval=$lt_finish_eval
13776
13777 # Whether we should hardcode library paths into libraries.
13778 hardcode_into_libs=$hardcode_into_libs
13779
13780 # Compile-time system search path for libraries.
13781 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
13782
13783 # Run-time system search path for libraries.
13784 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
13785
13786 # Whether dlopen is supported.
13787 dlopen_support=$enable_dlopen
13788
13789 # Whether dlopen of programs is supported.
13790 dlopen_self=$enable_dlopen_self
13791
13792 # Whether dlopen of statically linked programs is supported.
13793 dlopen_self_static=$enable_dlopen_self_static
13794
13795 # Commands to strip libraries.
13796 old_striplib=$lt_old_striplib
13797 striplib=$lt_striplib
13798
13799
13800 # The linker used to build libraries.
13801 LD=$lt_LD
13802
13803 # Commands used to build an old-style archive.
13804 old_archive_cmds=$lt_old_archive_cmds
13805
13806 # A language specific compiler.
13807 CC=$lt_compiler
13808
13809 # Is the compiler the GNU compiler?
13810 with_gcc=$GCC
13811
13812 # Compiler flag to turn off builtin functions.
13813 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
13814
13815 # How to pass a linker flag through the compiler.
13816 wl=$lt_lt_prog_compiler_wl
13817
13818 # Additional compiler flags for building library objects.
13819 pic_flag=$lt_lt_prog_compiler_pic
13820
13821 # Compiler flag to prevent dynamic linking.
13822 link_static_flag=$lt_lt_prog_compiler_static
13823
13824 # Does compiler simultaneously support -c and -o options?
13825 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
13826
13827 # Whether or not to add -lc for building shared libraries.
13828 build_libtool_need_lc=$archive_cmds_need_lc
13829
13830 # Whether or not to disallow shared libs when runtime libs are static.
13831 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
13832
13833 # Compiler flag to allow reflexive dlopens.
13834 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
13835
13836 # Compiler flag to generate shared objects directly from archives.
13837 whole_archive_flag_spec=$lt_whole_archive_flag_spec
13838
13839 # Whether the compiler copes with passing no objects directly.
13840 compiler_needs_object=$lt_compiler_needs_object
13841
13842 # Create an old-style archive from a shared archive.
13843 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
13844
13845 # Create a temporary old-style archive to link instead of a shared archive.
13846 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
13847
13848 # Commands used to build a shared archive.
13849 archive_cmds=$lt_archive_cmds
13850 archive_expsym_cmds=$lt_archive_expsym_cmds
13851
13852 # Commands used to build a loadable module if different from building
13853 # a shared archive.
13854 module_cmds=$lt_module_cmds
13855 module_expsym_cmds=$lt_module_expsym_cmds
13856
13857 # Whether we are building with GNU ld or not.
13858 with_gnu_ld=$lt_with_gnu_ld
13859
13860 # Flag that allows shared libraries with undefined symbols to be built.
13861 allow_undefined_flag=$lt_allow_undefined_flag
13862
13863 # Flag that enforces no undefined symbols.
13864 no_undefined_flag=$lt_no_undefined_flag
13865
13866 # Flag to hardcode \$libdir into a binary during linking.
13867 # This must work even if \$libdir does not exist
13868 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
13869
13870 # If ld is used when linking, flag to hardcode \$libdir into a binary
13871 # during linking. This must work even if \$libdir does not exist.
13872 hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
13873
13874 # Whether we need a single "-rpath" flag with a separated argument.
13875 hardcode_libdir_separator=$lt_hardcode_libdir_separator
13876
13877 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
13878 # DIR into the resulting binary.
13879 hardcode_direct=$hardcode_direct
13880
13881 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
13882 # DIR into the resulting binary and the resulting library dependency is
13883 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
13884 # library is relocated.
13885 hardcode_direct_absolute=$hardcode_direct_absolute
13886
13887 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
13888 # into the resulting binary.
13889 hardcode_minus_L=$hardcode_minus_L
13890
13891 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
13892 # into the resulting binary.
13893 hardcode_shlibpath_var=$hardcode_shlibpath_var
13894
13895 # Set to "yes" if building a shared library automatically hardcodes DIR
13896 # into the library and all subsequent libraries and executables linked
13897 # against it.
13898 hardcode_automatic=$hardcode_automatic
13899
13900 # Set to yes if linker adds runtime paths of dependent libraries
13901 # to runtime path list.
13902 inherit_rpath=$inherit_rpath
13903
13904 # Whether libtool must link a program against all its dependency libraries.
13905 link_all_deplibs=$link_all_deplibs
13906
13907 # Fix the shell variable \$srcfile for the compiler.
13908 fix_srcfile_path=$lt_fix_srcfile_path
13909
13910 # Set to "yes" if exported symbols are required.
13911 always_export_symbols=$always_export_symbols
13912
13913 # The commands to list exported symbols.
13914 export_symbols_cmds=$lt_export_symbols_cmds
13915
13916 # Symbols that should not be listed in the preloaded symbols.
13917 exclude_expsyms=$lt_exclude_expsyms
13918
13919 # Symbols that must always be exported.
13920 include_expsyms=$lt_include_expsyms
13921
13922 # Commands necessary for linking programs (against libraries) with templates.
13923 prelink_cmds=$lt_prelink_cmds
13924
13925 # Specify filename containing input files.
13926 file_list_spec=$lt_file_list_spec
13927
13928 # How to hardcode a shared library path into an executable.
13929 hardcode_action=$hardcode_action
13930
13931 # ### END LIBTOOL CONFIG
13932
13933 _LT_EOF
13934
13935 case $host_os in
13936 aix3*)
13937 cat <<\_LT_EOF >> "$cfgfile"
13938 # AIX sometimes has problems with the GCC collect2 program. For some
13939 # reason, if we set the COLLECT_NAMES environment variable, the problems
13940 # vanish in a puff of smoke.
13941 if test "X${COLLECT_NAMES+set}" != Xset; then
13942 COLLECT_NAMES=
13943 export COLLECT_NAMES
13944 fi
13945 _LT_EOF
13946 ;;
13947 esac
13948
13949
13950 ltmain="$ac_aux_dir/ltmain.sh"
13951
13952
13953 # We use sed instead of cat because bash on DJGPP gets confused if
13954 # if finds mixed CR/LF and LF-only lines. Since sed operates in
13955 # text mode, it properly converts lines to CR/LF. This bash problem
13956 # is reportedly fixed, but why not run on old versions too?
13957 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
13958 || (rm -f "$cfgfile"; exit 1)
13959
13960 case $xsi_shell in
13961 yes)
13962 cat << \_LT_EOF >> "$cfgfile"
13963
13964 # func_dirname file append nondir_replacement
13965 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
13966 # otherwise set result to NONDIR_REPLACEMENT.
13967 func_dirname ()
13968 {
13969 case ${1} in
13970 */*) func_dirname_result="${1%/*}${2}" ;;
13971 * ) func_dirname_result="${3}" ;;
13972 esac
13973 }
13974
13975 # func_basename file
13976 func_basename ()
13977 {
13978 func_basename_result="${1##*/}"
13979 }
13980
13981 # func_dirname_and_basename file append nondir_replacement
13982 # perform func_basename and func_dirname in a single function
13983 # call:
13984 # dirname: Compute the dirname of FILE. If nonempty,
13985 # add APPEND to the result, otherwise set result
13986 # to NONDIR_REPLACEMENT.
13987 # value returned in "$func_dirname_result"
13988 # basename: Compute filename of FILE.
13989 # value retuned in "$func_basename_result"
13990 # Implementation must be kept synchronized with func_dirname
13991 # and func_basename. For efficiency, we do not delegate to
13992 # those functions but instead duplicate the functionality here.
13993 func_dirname_and_basename ()
13994 {
13995 case ${1} in
13996 */*) func_dirname_result="${1%/*}${2}" ;;
13997 * ) func_dirname_result="${3}" ;;
13998 esac
13999 func_basename_result="${1##*/}"
14000 }
14001
14002 # func_stripname prefix suffix name
14003 # strip PREFIX and SUFFIX off of NAME.
14004 # PREFIX and SUFFIX must not contain globbing or regex special
14005 # characters, hashes, percent signs, but SUFFIX may contain a leading
14006 # dot (in which case that matches only a dot).
14007 func_stripname ()
14008 {
14009 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
14010 # positional parameters, so assign one to ordinary parameter first.
14011 func_stripname_result=${3}
14012 func_stripname_result=${func_stripname_result#"${1}"}
14013 func_stripname_result=${func_stripname_result%"${2}"}
14014 }
14015
14016 # func_opt_split
14017 func_opt_split ()
14018 {
14019 func_opt_split_opt=${1%%=*}
14020 func_opt_split_arg=${1#*=}
14021 }
14022
14023 # func_lo2o object
14024 func_lo2o ()
14025 {
14026 case ${1} in
14027 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
14028 *) func_lo2o_result=${1} ;;
14029 esac
14030 }
14031
14032 # func_xform libobj-or-source
14033 func_xform ()
14034 {
14035 func_xform_result=${1%.*}.lo
14036 }
14037
14038 # func_arith arithmetic-term...
14039 func_arith ()
14040 {
14041 func_arith_result=$(( $* ))
14042 }
14043
14044 # func_len string
14045 # STRING may not start with a hyphen.
14046 func_len ()
14047 {
14048 func_len_result=${#1}
14049 }
14050
14051 _LT_EOF
14052 ;;
14053 *) # Bourne compatible functions.
14054 cat << \_LT_EOF >> "$cfgfile"
14055
14056 # func_dirname file append nondir_replacement
14057 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
14058 # otherwise set result to NONDIR_REPLACEMENT.
14059 func_dirname ()
14060 {
14061 # Extract subdirectory from the argument.
14062 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
14063 if test "X$func_dirname_result" = "X${1}"; then
14064 func_dirname_result="${3}"
14065 else
14066 func_dirname_result="$func_dirname_result${2}"
14067 fi
14068 }
14069
14070 # func_basename file
14071 func_basename ()
14072 {
14073 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
14074 }
14075
14076
14077 # func_stripname prefix suffix name
14078 # strip PREFIX and SUFFIX off of NAME.
14079 # PREFIX and SUFFIX must not contain globbing or regex special
14080 # characters, hashes, percent signs, but SUFFIX may contain a leading
14081 # dot (in which case that matches only a dot).
14082 # func_strip_suffix prefix name
14083 func_stripname ()
14084 {
14085 case ${2} in
14086 .*) func_stripname_result=`$ECHO "X${3}" \
14087 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
14088 *) func_stripname_result=`$ECHO "X${3}" \
14089 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
14090 esac
14091 }
14092
14093 # sed scripts:
14094 my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
14095 my_sed_long_arg='1s/^-[^=]*=//'
14096
14097 # func_opt_split
14098 func_opt_split ()
14099 {
14100 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
14101 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
14102 }
14103
14104 # func_lo2o object
14105 func_lo2o ()
14106 {
14107 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
14108 }
14109
14110 # func_xform libobj-or-source
14111 func_xform ()
14112 {
14113 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
14114 }
14115
14116 # func_arith arithmetic-term...
14117 func_arith ()
14118 {
14119 func_arith_result=`expr "$@"`
14120 }
14121
14122 # func_len string
14123 # STRING may not start with a hyphen.
14124 func_len ()
14125 {
14126 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
14127 }
14128
14129 _LT_EOF
14130 esac
14131
14132 case $lt_shell_append in
14133 yes)
14134 cat << \_LT_EOF >> "$cfgfile"
14135
14136 # func_append var value
14137 # Append VALUE to the end of shell variable VAR.
14138 func_append ()
14139 {
14140 eval "$1+=\$2"
14141 }
14142 _LT_EOF
14143 ;;
14144 *)
14145 cat << \_LT_EOF >> "$cfgfile"
14146
14147 # func_append var value
14148 # Append VALUE to the end of shell variable VAR.
14149 func_append ()
14150 {
14151 eval "$1=\$$1\$2"
14152 }
14153
14154 _LT_EOF
14155 ;;
14156 esac
14157
14158
14159 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
14160 || (rm -f "$cfgfile"; exit 1)
14161
14162 mv -f "$cfgfile" "$ofile" ||
14163 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
14164 chmod +x "$ofile"
14165
14166 ;;
14167
14168 esac
14169 done # for ac_tag
14170
14171
14172 as_fn_exit 0
14173 _ACEOF
14174 ac_clean_files=$ac_clean_files_save
14175
14176 test $ac_write_fail = 0 ||
14177 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
14178
14179
14180 # configure is writing to config.log, and then calls config.status.
14181 # config.status does its own redirection, appending to config.log.
14182 # Unfortunately, on DOS this fails, as config.log is still kept open
14183 # by configure, so config.status won't be able to write to it; its
14184 # output is simply discarded. So we exec the FD to /dev/null,
14185 # effectively closing config.log, so it can be properly (re)opened and
14186 # appended to by config.status. When coming back to configure, we
14187 # need to make the FD available again.
14188 if test "$no_create" != yes; then
14189 ac_cs_success=:
14190 ac_config_status_args=
14191 test "$silent" = yes &&
14192 ac_config_status_args="$ac_config_status_args --quiet"
14193 exec 5>/dev/null
14194 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
14195 exec 5>>config.log
14196 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14197 # would make configure fail if this is the last instruction.
14198 $ac_cs_success || as_fn_exit 1
14199 fi
14200 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
14201 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
14202 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
14203 fi
14204
0 AC_INIT([telepathy-ring], [2.1.0])
0 AC_INIT([telepathy-ring], [2.2.1])
11 AC_PREREQ([2.59])
22 AM_INIT_AUTOMAKE([foreign 1.9])
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
1010 AC_PROG_CC_STDC
1111
1212 dnl Not yet
13 AC_DISABLE_SHARED
1413 AM_PROG_LIBTOOL
1514
1615 dnl decide on error flags
3029
3130 if test x$enable_debug = xyes; then
3231 AC_DEFINE([ENABLE_DEBUG], [1], [Enable debug code])
32 fi
33
34 AC_ARG_ENABLE(mc-account-plugin,
35 AS_HELP_STRING([--enable-mc-account-plugin=@<:@no/yes/auto@:>@],
36 [build MC account plugin]), , enable_mc_account_plugin=auto)
37
38 if test "x$enable_mc_account_plugin" != "xno"; then
39 PKG_CHECK_MODULES(MCP,
40 [
41 mission-control-plugins
42 ], have_mcp="yes", have_mcp="no")
43
44 AC_MSG_CHECKING([Mission Control plugins dir])
45 MISSION_CONTROL_PLUGINS_DIR=${libdir}/mission-control-plugins.`pkg-config --variable=MCP_ABI_VERSION mission-control-plugins`
46
47 AC_MSG_RESULT([$MISSION_CONTROL_PLUGINS_DIR])
48 AC_SUBST(MISSION_CONTROL_PLUGINS_DIR)
49 else
50 have_mcp=no
51 fi
52
53 if test "x$enable_mc_account_plugin" = "xyes" -a "x$have_mcp" != "xyes"; then
54 AC_MSG_ERROR([Could not find mission-control plugin dependencies:
55
56 $MCP_PKG_ERRORS])
3357 fi
3458
3559 AC_HEADER_STDC
5781 AC_DEFINE_UNQUOTED([DBUS_SERVICES_DIR], "$DBUS_SERVICES_DIR", [DBus services directory])
5882
5983 dnl Check for telepathy-glib
60 PKG_CHECK_MODULES(TP, [telepathy-glib >= 0.11.11])
84 PKG_CHECK_MODULES(TP, [telepathy-glib >= 0.11.14])
85
86 if pkg-config 'telepathy-glib >= 0.13.3' ||
87 pkg-config 'telepathy-glib >= 0.12.2'
88 then
89 AC_DEFINE([HAVE_TP_MESSAGE_MIXIN_WITH_DELI], 1,
90 [Do you have working DeliveryReportingSupport])
91 fi
92
93 if pkg-config 'telepathy-glib >= 0.13.10'
94 then
95 AC_DEFINE([HAVE_TP_SMS_CHANNEL], 1,
96 [Do you have SMSChannel on Channel.Interface.SMS])
97 fi
6198
6299 AC_CHECK_PROGS([XSLTPROC], [$XSLTPROC xsltproc])
63100 AC_CHECK_PROGS([DBUS_BINDING_TOOL], [$DBUS_BINDING_TOOL dbus-binding-tool])
76113 AC_CHECK_LIB([mlocknice], [mln_lock_data],,
77114 AC_MSG_WARN([Library mlocknice not found]))
78115
79 AC_SUBST([testdir],'${libdir}/tests/telepathy-ring-tests')
116 AC_SUBST([testdir],'/opt/tests/telepathy-ring')
80117 AC_SUBST([includemodemdir],'${includedir}/modem-glib')
81 AC_SUBST([includesmsdir],'${includedir}/sms-glib')
118
119 dnl check for a version of python that can run the twisted tests
120 AC_MSG_CHECKING([for Python with Twisted])
121 for TEST_PYTHON in python2.5 python2.6 python; do
122 AS_IF([$TEST_PYTHON -c "from sys import version_info; import dbus, dbus.mainloop.glib; raise SystemExit(version_info < (2, 5, 0, 'final', 0))" >/dev/null 2>&1],
123 [
124 AS_IF([$TEST_PYTHON -c "import twisted.internet.reactor" >/dev/null 2>&1],
125 [
126 AM_CONDITIONAL([WANT_TWISTED_TESTS], [true])
127 break
128 ],
129 [TEST_PYTHON=no])
130 ])
131 done
132 AC_MSG_RESULT([$TEST_PYTHON])
133 AC_SUBST(TEST_PYTHON)
134 AM_CONDITIONAL([WANT_TWISTED_TESTS], test xno != x$TEST_PYTHON)
82135
83136 AC_CONFIG_FILES([Makefile])
84 AC_CONFIG_FILES([modem/Makefile modem/tests/Makefile \
85 src/Makefile tests/Makefile docs/Makefile \
86 scripts/Makefile sms-glib/Makefile \
87 tools/Makefile ring-extensions/Makefile])
137 AC_CONFIG_FILES([modem/Makefile \
138 modem/tests/Makefile \
139 src/Makefile tests/Makefile \
140 tests/twisted/Makefile \
141 tests/twisted/tools/Makefile \
142 docs/Makefile \
143 scripts/Makefile \
144 tools/Makefile \
145 ring-extensions/Makefile \
146 mc-plugin/Makefile])
88147 AC_OUTPUT
+0
-630
depcomp less more
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
6 # Software Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
28 case $1 in
29 '')
30 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
31 exit 1;
32 ;;
33 -h | --h*)
34 cat <<\EOF
35 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
36
37 Run PROGRAMS ARGS to compile a file, generating dependencies
38 as side-effects.
39
40 Environment variables:
41 depmode Dependency tracking mode.
42 source Source file read by `PROGRAMS ARGS'.
43 object Object file output by `PROGRAMS ARGS'.
44 DEPDIR directory where to store dependencies.
45 depfile Dependency file to output.
46 tmpdepfile Temporary file to use when outputing dependencies.
47 libtool Whether libtool is used (yes/no).
48
49 Report bugs to <bug-automake@gnu.org>.
50 EOF
51 exit $?
52 ;;
53 -v | --v*)
54 echo "depcomp $scriptversion"
55 exit $?
56 ;;
57 esac
58
59 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
60 echo "depcomp: Variables source, object and depmode must be set" 1>&2
61 exit 1
62 fi
63
64 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
65 depfile=${depfile-`echo "$object" |
66 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
67 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
68
69 rm -f "$tmpdepfile"
70
71 # Some modes work just like other modes, but use different flags. We
72 # parameterize here, but still list the modes in the big case below,
73 # to make depend.m4 easier to write. Note that we *cannot* use a case
74 # here, because this file can only contain one case statement.
75 if test "$depmode" = hp; then
76 # HP compiler uses -M and no extra arg.
77 gccflag=-M
78 depmode=gcc
79 fi
80
81 if test "$depmode" = dashXmstdout; then
82 # This is just like dashmstdout with a different argument.
83 dashmflag=-xM
84 depmode=dashmstdout
85 fi
86
87 cygpath_u="cygpath -u -f -"
88 if test "$depmode" = msvcmsys; then
89 # This is just like msvisualcpp but w/o cygpath translation.
90 # Just convert the backslash-escaped backslashes to single forward
91 # slashes to satisfy depend.m4
92 cygpath_u="sed s,\\\\\\\\,/,g"
93 depmode=msvisualcpp
94 fi
95
96 case "$depmode" in
97 gcc3)
98 ## gcc 3 implements dependency tracking that does exactly what
99 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
100 ## it if -MD -MP comes after the -MF stuff. Hmm.
101 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
102 ## the command line argument order; so add the flags where they
103 ## appear in depend2.am. Note that the slowdown incurred here
104 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
105 for arg
106 do
107 case $arg in
108 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
109 *) set fnord "$@" "$arg" ;;
110 esac
111 shift # fnord
112 shift # $arg
113 done
114 "$@"
115 stat=$?
116 if test $stat -eq 0; then :
117 else
118 rm -f "$tmpdepfile"
119 exit $stat
120 fi
121 mv "$tmpdepfile" "$depfile"
122 ;;
123
124 gcc)
125 ## There are various ways to get dependency output from gcc. Here's
126 ## why we pick this rather obscure method:
127 ## - Don't want to use -MD because we'd like the dependencies to end
128 ## up in a subdir. Having to rename by hand is ugly.
129 ## (We might end up doing this anyway to support other compilers.)
130 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
131 ## -MM, not -M (despite what the docs say).
132 ## - Using -M directly means running the compiler twice (even worse
133 ## than renaming).
134 if test -z "$gccflag"; then
135 gccflag=-MD,
136 fi
137 "$@" -Wp,"$gccflag$tmpdepfile"
138 stat=$?
139 if test $stat -eq 0; then :
140 else
141 rm -f "$tmpdepfile"
142 exit $stat
143 fi
144 rm -f "$depfile"
145 echo "$object : \\" > "$depfile"
146 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
147 ## The second -e expression handles DOS-style file names with drive letters.
148 sed -e 's/^[^:]*: / /' \
149 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
150 ## This next piece of magic avoids the `deleted header file' problem.
151 ## The problem is that when a header file which appears in a .P file
152 ## is deleted, the dependency causes make to die (because there is
153 ## typically no way to rebuild the header). We avoid this by adding
154 ## dummy dependencies for each header file. Too bad gcc doesn't do
155 ## this for us directly.
156 tr ' ' '
157 ' < "$tmpdepfile" |
158 ## Some versions of gcc put a space before the `:'. On the theory
159 ## that the space means something, we add a space to the output as
160 ## well.
161 ## Some versions of the HPUX 10.20 sed can't process this invocation
162 ## correctly. Breaking it into two sed invocations is a workaround.
163 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
164 rm -f "$tmpdepfile"
165 ;;
166
167 hp)
168 # This case exists only to let depend.m4 do its work. It works by
169 # looking at the text of this script. This case will never be run,
170 # since it is checked for above.
171 exit 1
172 ;;
173
174 sgi)
175 if test "$libtool" = yes; then
176 "$@" "-Wp,-MDupdate,$tmpdepfile"
177 else
178 "$@" -MDupdate "$tmpdepfile"
179 fi
180 stat=$?
181 if test $stat -eq 0; then :
182 else
183 rm -f "$tmpdepfile"
184 exit $stat
185 fi
186 rm -f "$depfile"
187
188 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
189 echo "$object : \\" > "$depfile"
190
191 # Clip off the initial element (the dependent). Don't try to be
192 # clever and replace this with sed code, as IRIX sed won't handle
193 # lines with more than a fixed number of characters (4096 in
194 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
195 # the IRIX cc adds comments like `#:fec' to the end of the
196 # dependency line.
197 tr ' ' '
198 ' < "$tmpdepfile" \
199 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
200 tr '
201 ' ' ' >> "$depfile"
202 echo >> "$depfile"
203
204 # The second pass generates a dummy entry for each header file.
205 tr ' ' '
206 ' < "$tmpdepfile" \
207 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
208 >> "$depfile"
209 else
210 # The sourcefile does not contain any dependencies, so just
211 # store a dummy comment line, to avoid errors with the Makefile
212 # "include basename.Plo" scheme.
213 echo "#dummy" > "$depfile"
214 fi
215 rm -f "$tmpdepfile"
216 ;;
217
218 aix)
219 # The C for AIX Compiler uses -M and outputs the dependencies
220 # in a .u file. In older versions, this file always lives in the
221 # current directory. Also, the AIX compiler puts `$object:' at the
222 # start of each line; $object doesn't have directory information.
223 # Version 6 uses the directory in both cases.
224 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
225 test "x$dir" = "x$object" && dir=
226 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
227 if test "$libtool" = yes; then
228 tmpdepfile1=$dir$base.u
229 tmpdepfile2=$base.u
230 tmpdepfile3=$dir.libs/$base.u
231 "$@" -Wc,-M
232 else
233 tmpdepfile1=$dir$base.u
234 tmpdepfile2=$dir$base.u
235 tmpdepfile3=$dir$base.u
236 "$@" -M
237 fi
238 stat=$?
239
240 if test $stat -eq 0; then :
241 else
242 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
243 exit $stat
244 fi
245
246 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
247 do
248 test -f "$tmpdepfile" && break
249 done
250 if test -f "$tmpdepfile"; then
251 # Each line is of the form `foo.o: dependent.h'.
252 # Do two passes, one to just change these to
253 # `$object: dependent.h' and one to simply `dependent.h:'.
254 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
255 # That's a tab and a space in the [].
256 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
257 else
258 # The sourcefile does not contain any dependencies, so just
259 # store a dummy comment line, to avoid errors with the Makefile
260 # "include basename.Plo" scheme.
261 echo "#dummy" > "$depfile"
262 fi
263 rm -f "$tmpdepfile"
264 ;;
265
266 icc)
267 # Intel's C compiler understands `-MD -MF file'. However on
268 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
269 # ICC 7.0 will fill foo.d with something like
270 # foo.o: sub/foo.c
271 # foo.o: sub/foo.h
272 # which is wrong. We want:
273 # sub/foo.o: sub/foo.c
274 # sub/foo.o: sub/foo.h
275 # sub/foo.c:
276 # sub/foo.h:
277 # ICC 7.1 will output
278 # foo.o: sub/foo.c sub/foo.h
279 # and will wrap long lines using \ :
280 # foo.o: sub/foo.c ... \
281 # sub/foo.h ... \
282 # ...
283
284 "$@" -MD -MF "$tmpdepfile"
285 stat=$?
286 if test $stat -eq 0; then :
287 else
288 rm -f "$tmpdepfile"
289 exit $stat
290 fi
291 rm -f "$depfile"
292 # Each line is of the form `foo.o: dependent.h',
293 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
294 # Do two passes, one to just change these to
295 # `$object: dependent.h' and one to simply `dependent.h:'.
296 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
297 # Some versions of the HPUX 10.20 sed can't process this invocation
298 # correctly. Breaking it into two sed invocations is a workaround.
299 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
300 sed -e 's/$/ :/' >> "$depfile"
301 rm -f "$tmpdepfile"
302 ;;
303
304 hp2)
305 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
306 # compilers, which have integrated preprocessors. The correct option
307 # to use with these is +Maked; it writes dependencies to a file named
308 # 'foo.d', which lands next to the object file, wherever that
309 # happens to be.
310 # Much of this is similar to the tru64 case; see comments there.
311 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
312 test "x$dir" = "x$object" && dir=
313 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
314 if test "$libtool" = yes; then
315 tmpdepfile1=$dir$base.d
316 tmpdepfile2=$dir.libs/$base.d
317 "$@" -Wc,+Maked
318 else
319 tmpdepfile1=$dir$base.d
320 tmpdepfile2=$dir$base.d
321 "$@" +Maked
322 fi
323 stat=$?
324 if test $stat -eq 0; then :
325 else
326 rm -f "$tmpdepfile1" "$tmpdepfile2"
327 exit $stat
328 fi
329
330 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
331 do
332 test -f "$tmpdepfile" && break
333 done
334 if test -f "$tmpdepfile"; then
335 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
336 # Add `dependent.h:' lines.
337 sed -ne '2,${
338 s/^ *//
339 s/ \\*$//
340 s/$/:/
341 p
342 }' "$tmpdepfile" >> "$depfile"
343 else
344 echo "#dummy" > "$depfile"
345 fi
346 rm -f "$tmpdepfile" "$tmpdepfile2"
347 ;;
348
349 tru64)
350 # The Tru64 compiler uses -MD to generate dependencies as a side
351 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
352 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
353 # dependencies in `foo.d' instead, so we check for that too.
354 # Subdirectories are respected.
355 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
356 test "x$dir" = "x$object" && dir=
357 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
358
359 if test "$libtool" = yes; then
360 # With Tru64 cc, shared objects can also be used to make a
361 # static library. This mechanism is used in libtool 1.4 series to
362 # handle both shared and static libraries in a single compilation.
363 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
364 #
365 # With libtool 1.5 this exception was removed, and libtool now
366 # generates 2 separate objects for the 2 libraries. These two
367 # compilations output dependencies in $dir.libs/$base.o.d and
368 # in $dir$base.o.d. We have to check for both files, because
369 # one of the two compilations can be disabled. We should prefer
370 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
371 # automatically cleaned when .libs/ is deleted, while ignoring
372 # the former would cause a distcleancheck panic.
373 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
374 tmpdepfile2=$dir$base.o.d # libtool 1.5
375 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
376 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
377 "$@" -Wc,-MD
378 else
379 tmpdepfile1=$dir$base.o.d
380 tmpdepfile2=$dir$base.d
381 tmpdepfile3=$dir$base.d
382 tmpdepfile4=$dir$base.d
383 "$@" -MD
384 fi
385
386 stat=$?
387 if test $stat -eq 0; then :
388 else
389 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
390 exit $stat
391 fi
392
393 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
394 do
395 test -f "$tmpdepfile" && break
396 done
397 if test -f "$tmpdepfile"; then
398 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
399 # That's a tab and a space in the [].
400 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
401 else
402 echo "#dummy" > "$depfile"
403 fi
404 rm -f "$tmpdepfile"
405 ;;
406
407 #nosideeffect)
408 # This comment above is used by automake to tell side-effect
409 # dependency tracking mechanisms from slower ones.
410
411 dashmstdout)
412 # Important note: in order to support this mode, a compiler *must*
413 # always write the preprocessed file to stdout, regardless of -o.
414 "$@" || exit $?
415
416 # Remove the call to Libtool.
417 if test "$libtool" = yes; then
418 while test "X$1" != 'X--mode=compile'; do
419 shift
420 done
421 shift
422 fi
423
424 # Remove `-o $object'.
425 IFS=" "
426 for arg
427 do
428 case $arg in
429 -o)
430 shift
431 ;;
432 $object)
433 shift
434 ;;
435 *)
436 set fnord "$@" "$arg"
437 shift # fnord
438 shift # $arg
439 ;;
440 esac
441 done
442
443 test -z "$dashmflag" && dashmflag=-M
444 # Require at least two characters before searching for `:'
445 # in the target name. This is to cope with DOS-style filenames:
446 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
447 "$@" $dashmflag |
448 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
449 rm -f "$depfile"
450 cat < "$tmpdepfile" > "$depfile"
451 tr ' ' '
452 ' < "$tmpdepfile" | \
453 ## Some versions of the HPUX 10.20 sed can't process this invocation
454 ## correctly. Breaking it into two sed invocations is a workaround.
455 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
456 rm -f "$tmpdepfile"
457 ;;
458
459 dashXmstdout)
460 # This case only exists to satisfy depend.m4. It is never actually
461 # run, as this mode is specially recognized in the preamble.
462 exit 1
463 ;;
464
465 makedepend)
466 "$@" || exit $?
467 # Remove any Libtool call
468 if test "$libtool" = yes; then
469 while test "X$1" != 'X--mode=compile'; do
470 shift
471 done
472 shift
473 fi
474 # X makedepend
475 shift
476 cleared=no eat=no
477 for arg
478 do
479 case $cleared in
480 no)
481 set ""; shift
482 cleared=yes ;;
483 esac
484 if test $eat = yes; then
485 eat=no
486 continue
487 fi
488 case "$arg" in
489 -D*|-I*)
490 set fnord "$@" "$arg"; shift ;;
491 # Strip any option that makedepend may not understand. Remove
492 # the object too, otherwise makedepend will parse it as a source file.
493 -arch)
494 eat=yes ;;
495 -*|$object)
496 ;;
497 *)
498 set fnord "$@" "$arg"; shift ;;
499 esac
500 done
501 obj_suffix=`echo "$object" | sed 's/^.*\././'`
502 touch "$tmpdepfile"
503 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
504 rm -f "$depfile"
505 cat < "$tmpdepfile" > "$depfile"
506 sed '1,2d' "$tmpdepfile" | tr ' ' '
507 ' | \
508 ## Some versions of the HPUX 10.20 sed can't process this invocation
509 ## correctly. Breaking it into two sed invocations is a workaround.
510 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
511 rm -f "$tmpdepfile" "$tmpdepfile".bak
512 ;;
513
514 cpp)
515 # Important note: in order to support this mode, a compiler *must*
516 # always write the preprocessed file to stdout.
517 "$@" || exit $?
518
519 # Remove the call to Libtool.
520 if test "$libtool" = yes; then
521 while test "X$1" != 'X--mode=compile'; do
522 shift
523 done
524 shift
525 fi
526
527 # Remove `-o $object'.
528 IFS=" "
529 for arg
530 do
531 case $arg in
532 -o)
533 shift
534 ;;
535 $object)
536 shift
537 ;;
538 *)
539 set fnord "$@" "$arg"
540 shift # fnord
541 shift # $arg
542 ;;
543 esac
544 done
545
546 "$@" -E |
547 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
548 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
549 sed '$ s: \\$::' > "$tmpdepfile"
550 rm -f "$depfile"
551 echo "$object : \\" > "$depfile"
552 cat < "$tmpdepfile" >> "$depfile"
553 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
554 rm -f "$tmpdepfile"
555 ;;
556
557 msvisualcpp)
558 # Important note: in order to support this mode, a compiler *must*
559 # always write the preprocessed file to stdout.
560 "$@" || exit $?
561
562 # Remove the call to Libtool.
563 if test "$libtool" = yes; then
564 while test "X$1" != 'X--mode=compile'; do
565 shift
566 done
567 shift
568 fi
569
570 IFS=" "
571 for arg
572 do
573 case "$arg" in
574 -o)
575 shift
576 ;;
577 $object)
578 shift
579 ;;
580 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
581 set fnord "$@"
582 shift
583 shift
584 ;;
585 *)
586 set fnord "$@" "$arg"
587 shift
588 shift
589 ;;
590 esac
591 done
592 "$@" -E 2>/dev/null |
593 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
594 rm -f "$depfile"
595 echo "$object : \\" > "$depfile"
596 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
597 echo " " >> "$depfile"
598 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
599 rm -f "$tmpdepfile"
600 ;;
601
602 msvcmsys)
603 # This case exists only to let depend.m4 do its work. It works by
604 # looking at the text of this script. This case will never be run,
605 # since it is checked for above.
606 exit 1
607 ;;
608
609 none)
610 exec "$@"
611 ;;
612
613 *)
614 echo "Unknown depmode $depmode" 1>&2
615 exit 1
616 ;;
617 esac
618
619 exit 0
620
621 # Local Variables:
622 # mode: shell-script
623 # sh-indentation: 2
624 # eval: (add-hook 'write-file-hooks 'time-stamp)
625 # time-stamp-start: "scriptversion="
626 # time-stamp-format: "%:y-%02m-%02d.%02H"
627 # time-stamp-time-zone: "UTC"
628 # time-stamp-end: "; # UTC"
629 # End:
00 EXTRA_DIST = design.txt DTMF-playback
1
2 # Man page
3 man_MANS = telepathy-ring.8
4 CLEANFILES = $(man_MANS)
5 EXTRA_DIST += telepathy-ring.8.in
6
7 %.8: %.8.in Makefile
8 sed -e 's,[@]libexecdir[@],@libexecdir@,' < $< > $@
+0
-382
docs/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 pkgdatadir = $(datadir)/@PACKAGE@
18 pkgincludedir = $(includedir)/@PACKAGE@
19 pkglibdir = $(libdir)/@PACKAGE@
20 pkglibexecdir = $(libexecdir)/@PACKAGE@
21 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22 install_sh_DATA = $(install_sh) -c -m 644
23 install_sh_PROGRAM = $(install_sh) -c
24 install_sh_SCRIPT = $(install_sh) -c
25 INSTALL_HEADER = $(INSTALL_DATA)
26 transform = $(program_transform_name)
27 NORMAL_INSTALL = :
28 PRE_INSTALL = :
29 POST_INSTALL = :
30 NORMAL_UNINSTALL = :
31 PRE_UNINSTALL = :
32 POST_UNINSTALL = :
33 build_triplet = @build@
34 host_triplet = @host@
35 subdir = docs
36 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
39 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
40 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
41 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
42 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
43 $(ACLOCAL_M4)
44 mkinstalldirs = $(install_sh) -d
45 CONFIG_HEADER = $(top_builddir)/config.h
46 CONFIG_CLEAN_FILES =
47 CONFIG_CLEAN_VPATH_FILES =
48 AM_V_GEN = $(am__v_GEN_$(V))
49 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
50 am__v_GEN_0 = @echo " GEN " $@;
51 AM_V_at = $(am__v_at_$(V))
52 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
53 am__v_at_0 = @
54 SOURCES =
55 DIST_SOURCES =
56 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
57 ACLOCAL = @ACLOCAL@
58 AMTAR = @AMTAR@
59 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
60 AR = @AR@
61 AUTOCONF = @AUTOCONF@
62 AUTOHEADER = @AUTOHEADER@
63 AUTOMAKE = @AUTOMAKE@
64 AWK = @AWK@
65 CC = @CC@
66 CCDEPMODE = @CCDEPMODE@
67 CFLAGS = @CFLAGS@
68 CHECK_CFLAGS = @CHECK_CFLAGS@
69 CHECK_LIBS = @CHECK_LIBS@
70 CPP = @CPP@
71 CPPFLAGS = @CPPFLAGS@
72 CYGPATH_W = @CYGPATH_W@
73 DATADIR = @DATADIR@
74 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
75 DBUS_CFLAGS = @DBUS_CFLAGS@
76 DBUS_LIBS = @DBUS_LIBS@
77 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
78 DEFS = @DEFS@
79 DEPDIR = @DEPDIR@
80 DSYMUTIL = @DSYMUTIL@
81 DUMPBIN = @DUMPBIN@
82 ECHO_C = @ECHO_C@
83 ECHO_N = @ECHO_N@
84 ECHO_T = @ECHO_T@
85 EGREP = @EGREP@
86 ERROR_CFLAGS = @ERROR_CFLAGS@
87 EXEEXT = @EXEEXT@
88 FGREP = @FGREP@
89 GLIB_CFLAGS = @GLIB_CFLAGS@
90 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
91 GLIB_LIBS = @GLIB_LIBS@
92 GREP = @GREP@
93 INSTALL = @INSTALL@
94 INSTALL_DATA = @INSTALL_DATA@
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@
96 INSTALL_SCRIPT = @INSTALL_SCRIPT@
97 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
98 LD = @LD@
99 LDFLAGS = @LDFLAGS@
100 LIBOBJS = @LIBOBJS@
101 LIBS = @LIBS@
102 LIBTOOL = @LIBTOOL@
103 LIPO = @LIPO@
104 LN_S = @LN_S@
105 LTLIBOBJS = @LTLIBOBJS@
106 MAINT = @MAINT@
107 MAKEINFO = @MAKEINFO@
108 MKDIR_P = @MKDIR_P@
109 NM = @NM@
110 NMEDIT = @NMEDIT@
111 OBJDUMP = @OBJDUMP@
112 OBJEXT = @OBJEXT@
113 OTOOL = @OTOOL@
114 OTOOL64 = @OTOOL64@
115 PACKAGE = @PACKAGE@
116 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
117 PACKAGE_NAME = @PACKAGE_NAME@
118 PACKAGE_STRING = @PACKAGE_STRING@
119 PACKAGE_TARNAME = @PACKAGE_TARNAME@
120 PACKAGE_URL = @PACKAGE_URL@
121 PACKAGE_VERSION = @PACKAGE_VERSION@
122 PATH_SEPARATOR = @PATH_SEPARATOR@
123 PKG_CONFIG = @PKG_CONFIG@
124 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
125 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
126 PYTHON = @PYTHON@
127 RANLIB = @RANLIB@
128 SED = @SED@
129 SET_MAKE = @SET_MAKE@
130 SHELL = @SHELL@
131 STRIP = @STRIP@
132 TP_CFLAGS = @TP_CFLAGS@
133 TP_LIBS = @TP_LIBS@
134 UUID_CFLAGS = @UUID_CFLAGS@
135 UUID_LIBS = @UUID_LIBS@
136 VERSION = @VERSION@
137 XSLTPROC = @XSLTPROC@
138 abs_builddir = @abs_builddir@
139 abs_srcdir = @abs_srcdir@
140 abs_top_builddir = @abs_top_builddir@
141 abs_top_srcdir = @abs_top_srcdir@
142 ac_ct_CC = @ac_ct_CC@
143 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
144 am__include = @am__include@
145 am__leading_dot = @am__leading_dot@
146 am__quote = @am__quote@
147 am__tar = @am__tar@
148 am__untar = @am__untar@
149 bindir = @bindir@
150 build = @build@
151 build_alias = @build_alias@
152 build_cpu = @build_cpu@
153 build_os = @build_os@
154 build_vendor = @build_vendor@
155 builddir = @builddir@
156 datadir = @datadir@
157 datarootdir = @datarootdir@
158 docdir = @docdir@
159 dvidir = @dvidir@
160 exec_prefix = @exec_prefix@
161 host = @host@
162 host_alias = @host_alias@
163 host_cpu = @host_cpu@
164 host_os = @host_os@
165 host_vendor = @host_vendor@
166 htmldir = @htmldir@
167 includedir = @includedir@
168 includemodemdir = @includemodemdir@
169 includesmsdir = @includesmsdir@
170 infodir = @infodir@
171 install_sh = @install_sh@
172 libdir = @libdir@
173 libexecdir = @libexecdir@
174 localedir = @localedir@
175 localstatedir = @localstatedir@
176 lt_ECHO = @lt_ECHO@
177 mandir = @mandir@
178 mkdir_p = @mkdir_p@
179 oldincludedir = @oldincludedir@
180 pdfdir = @pdfdir@
181 prefix = @prefix@
182 program_transform_name = @program_transform_name@
183 psdir = @psdir@
184 sbindir = @sbindir@
185 sharedstatedir = @sharedstatedir@
186 srcdir = @srcdir@
187 sysconfdir = @sysconfdir@
188 target_alias = @target_alias@
189 testdir = @testdir@
190 top_build_prefix = @top_build_prefix@
191 top_builddir = @top_builddir@
192 top_srcdir = @top_srcdir@
193 EXTRA_DIST = design.txt DTMF-playback
194 all: all-am
195
196 .SUFFIXES:
197 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
198 @for dep in $?; do \
199 case '$(am__configure_deps)' in \
200 *$$dep*) \
201 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
202 && { if test -f $@; then exit 0; else break; fi; }; \
203 exit 1;; \
204 esac; \
205 done; \
206 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \
207 $(am__cd) $(top_srcdir) && \
208 $(AUTOMAKE) --foreign docs/Makefile
209 .PRECIOUS: Makefile
210 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
211 @case '$?' in \
212 *config.status*) \
213 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
214 *) \
215 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
216 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
217 esac;
218
219 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
220 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
221
222 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
223 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
224 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
225 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
226 $(am__aclocal_m4_deps):
227
228 mostlyclean-libtool:
229 -rm -f *.lo
230
231 clean-libtool:
232 -rm -rf .libs _libs
233 tags: TAGS
234 TAGS:
235
236 ctags: CTAGS
237 CTAGS:
238
239
240 distdir: $(DISTFILES)
241 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
242 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
243 list='$(DISTFILES)'; \
244 dist_files=`for file in $$list; do echo $$file; done | \
245 sed -e "s|^$$srcdirstrip/||;t" \
246 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
247 case $$dist_files in \
248 */*) $(MKDIR_P) `echo "$$dist_files" | \
249 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
250 sort -u` ;; \
251 esac; \
252 for file in $$dist_files; do \
253 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
254 if test -d $$d/$$file; then \
255 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
256 if test -d "$(distdir)/$$file"; then \
257 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
258 fi; \
259 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
260 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
261 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
262 fi; \
263 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
264 else \
265 test -f "$(distdir)/$$file" \
266 || cp -p $$d/$$file "$(distdir)/$$file" \
267 || exit 1; \
268 fi; \
269 done
270 check-am: all-am
271 check: check-am
272 all-am: Makefile
273 installdirs:
274 install: install-am
275 install-exec: install-exec-am
276 install-data: install-data-am
277 uninstall: uninstall-am
278
279 install-am: all-am
280 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
281
282 installcheck: installcheck-am
283 install-strip:
284 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
285 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
286 `test -z '$(STRIP)' || \
287 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
288 mostlyclean-generic:
289
290 clean-generic:
291
292 distclean-generic:
293 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
294 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
295
296 maintainer-clean-generic:
297 @echo "This command is intended for maintainers to use"
298 @echo "it deletes files that may require special tools to rebuild."
299 clean: clean-am
300
301 clean-am: clean-generic clean-libtool mostlyclean-am
302
303 distclean: distclean-am
304 -rm -f Makefile
305 distclean-am: clean-am distclean-generic
306
307 dvi: dvi-am
308
309 dvi-am:
310
311 html: html-am
312
313 html-am:
314
315 info: info-am
316
317 info-am:
318
319 install-data-am:
320
321 install-dvi: install-dvi-am
322
323 install-dvi-am:
324
325 install-exec-am:
326
327 install-html: install-html-am
328
329 install-html-am:
330
331 install-info: install-info-am
332
333 install-info-am:
334
335 install-man:
336
337 install-pdf: install-pdf-am
338
339 install-pdf-am:
340
341 install-ps: install-ps-am
342
343 install-ps-am:
344
345 installcheck-am:
346
347 maintainer-clean: maintainer-clean-am
348 -rm -f Makefile
349 maintainer-clean-am: distclean-am maintainer-clean-generic
350
351 mostlyclean: mostlyclean-am
352
353 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
354
355 pdf: pdf-am
356
357 pdf-am:
358
359 ps: ps-am
360
361 ps-am:
362
363 uninstall-am:
364
365 .MAKE: install-am install-strip
366
367 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
368 distclean distclean-generic distclean-libtool distdir dvi \
369 dvi-am html html-am info info-am install install-am \
370 install-data install-data-am install-dvi install-dvi-am \
371 install-exec install-exec-am install-html install-html-am \
372 install-info install-info-am install-man install-pdf \
373 install-pdf-am install-ps install-ps-am install-strip \
374 installcheck installcheck-am installdirs maintainer-clean \
375 maintainer-clean-generic mostlyclean mostlyclean-generic \
376 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
377
378
379 # Tell versions [3.59,3.63) of GNU make to not export all variables.
380 # Otherwise a system limit (for SysV at least) may be exceeded.
381 .NOEXPORT:
00 title: Design notes for Telepathy-Ring
1 version: 2008-12-11
1 version: 2011-02-04
22
33
44 General
55 -------
66
7 Telepathy-ring is a Telepathy connection manager for GSM and similar circuit
8 switched (CS) mobile telephony. Currently, it implements basic Connection
7 Telepathy-ring is a Telepathy connection manager for GSM and similar Circuit
8 Switched (CS) mobile telephony. Currently, it implements basic Connection
99 Manager functionality with Contacts and Capabilities extensions,
1010 StreamedMedia channels for voice calls, and Text channel for SMS.
1111
2121 -------------------
2222
2323 Interface between the host and the CS TE (terminal equipment, in other
24 words, actual phone or modem) is implemented using the "modem" libraries and
25 D-Bus services provided by Ofono.
24 words, actual phone or modem) is implemented using the "modem" libraries
25 and D-Bus services provided by oFono.
2626
2727 The modem library interface provides uniform interface towards the phone, be
2828 it physically and software-wise implemented in any way.
3232 using telepathy-glib ChannelManager interface.
3333
3434
35 Short Overview of Telepathy Media Handling with CS Calls
36 --------------------------------------------------------
37
38 The Telepathy framework has been originally developed with packet switched
39 calls in mind. With packet switcing (in other words, VoIP) the call
40 signaling and media connections use separate transport streams and they can
41 be handled by separate software elements. For example, when a SIP VoIP call
42 is set up, the phone application can starting up a separate media stream
43 engine. The media stream engine takes care of the actual media transport and
44 processing.
35 Short Overview of Telepathy Media Handling with VoIP Calls
36 ----------------------------------------------------------
37
38 The Telepathy framework has been originally developed with VoIP calls in
39 mind. With VoIP. the call signaling and media connections use separate
40 transport streams and they can be handled by separate software elements.
41 For example, when a SIP VoIP call is set up, the phone application can
42 start up a separate stream engine process. The stream engine takes care
43 of the actual media transport and processing.
4544
4645 The Telepathy.Channel.Type.StreamedMedia interface is used to represent the
47 signaling connection of a PS call within the Telepathy connection manager.
46 signaling connection of a VoIP call within the Telepathy connection manager.
4847 The channel provides additional media handler interfaces in order set up and
49 negotiate the separate media connections for the PS call.
48 negotiate the separate media connections for the VoIP call.
5049
5150 When the call is set up, the new Telepathy.Channel instance is dispatched to
5251 the ChannelHandler responsible for the StreamedMedia channels. It is usually
53 the actual PS call application, taking care of user interface and media
52 the actual call UI application, taking care of user interface and media
5453 aspects. While the Telepathy framework provides a Stream Engine package for
5554 media processing, it does specify that a Telepathy client should use this
5655 particular media stream engine with standard interfaces, however.
6463 interface is then used to negotiate and set up the individual media
6564 stream(s).
6665
67 Usually, the PS call application itself do not use the above-mentioned media
68 signaling interfaces directly. It uses Telepathy.Channel.Type.StreamedMedia
66 The call UI application itself does not necessarily use the above-mentioned
67 media signaling interfaces directly. It can use Channel.Type.StreamedMedia
6968 interface towards the call signaling and the Telepathy.StreamEngine
7069 interface towards the media stream engine. Unfortunately, that latter
7170 interface is not mandatory part of the Telepathy framework.
7574 ----------------------------------------
7675
7776 The TelepathyChannel object can be used represent a circuit switched call
78 connection. The optional interfaces like Interface.DTMF can be used as is
79 with the CS call. However, the media handling is more problematic.
77 connection. The optional interfaces like Channel.Interface.DTMF or
78 Channel.Interface.Hold can be used as is with the CS call. However, the
79 media handling is more problematic.
8080
8181 The media within a circuit-switched call can be handled with different
8282 modes, depending on the processing it requires:
101101 The shared media mode looks pretty much like the VoIP case above: a separate
102102 media stream engine should be started and it negotiates the media transport
103103 connection using the media handler interfaces. However, the existing
104 Media.StreamHandler interface is very PS-centric. Even the very basic
104 Media.StreamHandler interface is very VoIP-centric. Even the very basic
105105 media semantics are quite different when handling a CS call.
106106
107107 There are multiple options for handling the CS calls:
143143 - Telepathy.Channel.Type.StreamedMedia (as is)
144144 - Telepathy.Channel.Interface.Group (accepting or rejecting calls)
145145 - Telepathy.Channel.Interface.DTMF (sending or receiving DTMF tones)
146
147 There is no Telepathy.Channel.Interface.CSMediaSignaling.
146 - Telepathy.Channel.Interface.Hold (placing call on hold or retrieving it)
147
148 There is no Telepathy.Channel.Interface.MediaSignaling.
148149
149150
150151 Outbound calls
151152 --------------
152 - client binds remote remote telephone number to a handle (bob)
153 - client requests a Channel.Type.StreamedMedia with remote handle (bob) using the
154 Telepathy.Connection.RequestChannel() method
153 - client requests a Channel.Type.StreamedMedia with target id (dialed
154 telephone number) using the Connection.Requests.CreateChannel() method
155155 - RingCallChannel object (rc) is created
156156 - RingConnection emits NewChannel with ringchannel
157157 - emit MembersChanged:
158158 - selfhandle is added to current members
159 - handle (bob) is added to the list of remote pending members
159 - handle for dialed number is added to the list of remote pending members
160160 - client requests channel to set up media streams to remote handle with
161161 Telepathy.Channel.Type.StreamedMedia.RequestStreams() method
162162 - RingCallChannel calls modem_call_request_dial() (org.ofono.VoiceCallManager.Dial())
0 ;
1 ; telepathy style for Emacs
2 ;
3 (defconst my-telepathy-c-style
4 '("gnu"
5 (indent-tabs-mode . nil)
6 (c-offsets-alist
7 (brace-list-open . tp-brace-list-open)
8 (arglist-intro . 4)
9 (arglist-cont-nonempty . tp-lineup-arglist-cont)))
10 "C Style for telepathy")
11
12 (defun tp-brace-list-open (langelem)
13 (save-excursion
14 (goto-char (cdr langelem))
15 (if (looking-at "\\(\\btypedef\\b\\s-+\\)?\\benum\\b")
16 0
17 '+)))
18
19 (defun tp-lineup-arglist-cont (langelem)
20 (let (syntax)
21 (save-excursion
22 (goto-char (cdr langelem))
23 (setq syntax (c-guess-basic-syntax)))
24 (if (assq 'topmost-intro-cont syntax)
25 ;; Lineup arglist in function definitions
26 (c-lineup-arglist-intro-after-paren langelem)
27 ;; 'topmost-intro is used in declarations
28 4)))
29
30 (c-add-style "telepathy" my-telepathy-c-style)
0 .TH TELEPATHY-RING "4" "February 2011" "Telepathy" "D-Bus services"
1 \" This man page is based on page written by Simon McVittie for
2 \" telepathy-sofiasip.
3 \" Copyright © 2007-2010 Collabora Ltd. <http://www.collabora.co.uk/>
4 \" Copyright © 2011 Nokia Corporation. <http://www.nokia.com/>
5 \" It may be distributed under the same terms as telepathy-ring itself.
6 .SH NAME
7 telepathy-ring \- Telepathy connection manager for GSM
8 .SH SYNOPSIS
9 \fB@libexecdir@/telepathy\-ring\fR
10 .SH DESCRIPTION
11
12 \fBtelepathy\-ring\fR implements the Telepathy D-Bus specification for
13 the GSM and UMTS, allowing Telepathy clients like
14 .BR empathy (1)
15 to place mobile calls and send or receive SMSs. It uses
16 .BR ofonod (8)
17 for interfacing with modems.
18
19 .PP
20 \fBtelepathy\-ring\fR is a D-Bus service which runs on the session bus,
21 and should usually be started automatically by D-Bus activation.
22 However, it might be useful to start it manually for debugging.
23
24 .SH OPTIONS
25 There are no command-line options.
26
27 .SH ENVIRONMENT
28 .TP
29 \fBRING_DEBUG\fR=\fItype\fR
30 May be set to "all" for full debug output, or various undocumented options
31 (which may change from release to release) to filter the output.
32
33 .TP
34 \fBMODEM_DEBUG\fR=\fItype\fR
35 May be set to "all" for full debug output from oFono interface, or
36 various undocumented options (which may change from release to release)
37 to filter the output.
38
39 .TP
40 \fBRING_PERSIST\fR
41 May be set to any value to avoid telepathy-ring's usual automatic exit
42 when there have been no connections for a few seconds.
43
44 .TP
45 .SH SEE ALSO
46 .IR http://telepathy.freedesktop.org/ ,
47 .BR mission-control-5 (1)
48 .BR empathy (1)
49 .BR ofonod (8)
+0
-520
install-sh less more
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 shift;;
159
160 -T) no_target_directory=true;;
161
162 --version) echo "$0 $scriptversion"; exit $?;;
163
164 --) shift
165 break;;
166
167 -*) echo "$0: invalid option: $1" >&2
168 exit 1;;
169
170 *) break;;
171 esac
172 shift
173 done
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 done
189 fi
190
191 if test $# -eq 0; then
192 if test -z "$dir_arg"; then
193 echo "$0: no input file specified." >&2
194 exit 1
195 fi
196 # It's OK to call `install-sh -d' without argument.
197 # This can happen when creating conditional directories.
198 exit 0
199 fi
200
201 if test -z "$dir_arg"; then
202 trap '(exit $?); exit' 1 2 13 15
203
204 # Set umask so as not to create temps with too-generous modes.
205 # However, 'strip' requires both read and write access to temps.
206 case $mode in
207 # Optimize common cases.
208 *644) cp_umask=133;;
209 *755) cp_umask=22;;
210
211 *[0-7])
212 if test -z "$stripcmd"; then
213 u_plus_rw=
214 else
215 u_plus_rw='% 200'
216 fi
217 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
218 *)
219 if test -z "$stripcmd"; then
220 u_plus_rw=
221 else
222 u_plus_rw=,u+rw
223 fi
224 cp_umask=$mode$u_plus_rw;;
225 esac
226 fi
227
228 for src
229 do
230 # Protect names starting with `-'.
231 case $src in
232 -*) src=./$src;;
233 esac
234
235 if test -n "$dir_arg"; then
236 dst=$src
237 dstdir=$dst
238 test -d "$dstdir"
239 dstdir_status=$?
240 else
241
242 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
243 # might cause directories to be created, which would be especially bad
244 # if $src (and thus $dsttmp) contains '*'.
245 if test ! -f "$src" && test ! -d "$src"; then
246 echo "$0: $src does not exist." >&2
247 exit 1
248 fi
249
250 if test -z "$dst_arg"; then
251 echo "$0: no destination specified." >&2
252 exit 1
253 fi
254
255 dst=$dst_arg
256 # Protect names starting with `-'.
257 case $dst in
258 -*) dst=./$dst;;
259 esac
260
261 # If destination is a directory, append the input filename; won't work
262 # if double slashes aren't ignored.
263 if test -d "$dst"; then
264 if test -n "$no_target_directory"; then
265 echo "$0: $dst_arg: Is a directory" >&2
266 exit 1
267 fi
268 dstdir=$dst
269 dst=$dstdir/`basename "$src"`
270 dstdir_status=0
271 else
272 # Prefer dirname, but fall back on a substitute if dirname fails.
273 dstdir=`
274 (dirname "$dst") 2>/dev/null ||
275 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
276 X"$dst" : 'X\(//\)[^/]' \| \
277 X"$dst" : 'X\(//\)$' \| \
278 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
279 echo X"$dst" |
280 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
281 s//\1/
282 q
283 }
284 /^X\(\/\/\)[^/].*/{
285 s//\1/
286 q
287 }
288 /^X\(\/\/\)$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\).*/{
293 s//\1/
294 q
295 }
296 s/.*/./; q'
297 `
298
299 test -d "$dstdir"
300 dstdir_status=$?
301 fi
302 fi
303
304 obsolete_mkdir_used=false
305
306 if test $dstdir_status != 0; then
307 case $posix_mkdir in
308 '')
309 # Create intermediate dirs using mode 755 as modified by the umask.
310 # This is like FreeBSD 'install' as of 1997-10-28.
311 umask=`umask`
312 case $stripcmd.$umask in
313 # Optimize common cases.
314 *[2367][2367]) mkdir_umask=$umask;;
315 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
316
317 *[0-7])
318 mkdir_umask=`expr $umask + 22 \
319 - $umask % 100 % 40 + $umask % 20 \
320 - $umask % 10 % 4 + $umask % 2
321 `;;
322 *) mkdir_umask=$umask,go-w;;
323 esac
324
325 # With -d, create the new directory with the user-specified mode.
326 # Otherwise, rely on $mkdir_umask.
327 if test -n "$dir_arg"; then
328 mkdir_mode=-m$mode
329 else
330 mkdir_mode=
331 fi
332
333 posix_mkdir=false
334 case $umask in
335 *[123567][0-7][0-7])
336 # POSIX mkdir -p sets u+wx bits regardless of umask, which
337 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
338 ;;
339 *)
340 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
341 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
342
343 if (umask $mkdir_umask &&
344 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 then
346 if test -z "$dir_arg" || {
347 # Check for POSIX incompatibilities with -m.
348 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
349 # other-writeable bit of parent directory when it shouldn't.
350 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
351 ls_ld_tmpdir=`ls -ld "$tmpdir"`
352 case $ls_ld_tmpdir in
353 d????-?r-*) different_mode=700;;
354 d????-?--*) different_mode=755;;
355 *) false;;
356 esac &&
357 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
358 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
359 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
360 }
361 }
362 then posix_mkdir=:
363 fi
364 rmdir "$tmpdir/d" "$tmpdir"
365 else
366 # Remove any dirs left behind by ancient mkdir implementations.
367 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
368 fi
369 trap '' 0;;
370 esac;;
371 esac
372
373 if
374 $posix_mkdir && (
375 umask $mkdir_umask &&
376 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
377 )
378 then :
379 else
380
381 # The umask is ridiculous, or mkdir does not conform to POSIX,
382 # or it failed possibly due to a race condition. Create the
383 # directory the slow way, step by step, checking for races as we go.
384
385 case $dstdir in
386 /*) prefix='/';;
387 -*) prefix='./';;
388 *) prefix='';;
389 esac
390
391 eval "$initialize_posix_glob"
392
393 oIFS=$IFS
394 IFS=/
395 $posix_glob set -f
396 set fnord $dstdir
397 shift
398 $posix_glob set +f
399 IFS=$oIFS
400
401 prefixes=
402
403 for d
404 do
405 test -z "$d" && continue
406
407 prefix=$prefix$d
408 if test -d "$prefix"; then
409 prefixes=
410 else
411 if $posix_mkdir; then
412 (umask=$mkdir_umask &&
413 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
414 # Don't fail if two instances are running concurrently.
415 test -d "$prefix" || exit 1
416 else
417 case $prefix in
418 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
419 *) qprefix=$prefix;;
420 esac
421 prefixes="$prefixes '$qprefix'"
422 fi
423 fi
424 prefix=$prefix/
425 done
426
427 if test -n "$prefixes"; then
428 # Don't fail if two instances are running concurrently.
429 (umask $mkdir_umask &&
430 eval "\$doit_exec \$mkdirprog $prefixes") ||
431 test -d "$dstdir" || exit 1
432 obsolete_mkdir_used=true
433 fi
434 fi
435 fi
436
437 if test -n "$dir_arg"; then
438 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
439 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
440 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
441 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
442 else
443
444 # Make a couple of temp file names in the proper directory.
445 dsttmp=$dstdir/_inst.$$_
446 rmtmp=$dstdir/_rm.$$_
447
448 # Trap to clean up those temp files at exit.
449 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
450
451 # Copy the file name to the temp name.
452 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453
454 # and set any options; do chmod last to preserve setuid bits.
455 #
456 # If any of these fail, we abort the whole thing. If we want to
457 # ignore errors from any of these, just make sure not to ignore
458 # errors from the above "$doit $cpprog $src $dsttmp" command.
459 #
460 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
461 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
462 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
463 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
464
465 # If -C, don't bother to copy if it wouldn't change the file.
466 if $copy_on_change &&
467 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
468 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
469
470 eval "$initialize_posix_glob" &&
471 $posix_glob set -f &&
472 set X $old && old=:$2:$4:$5:$6 &&
473 set X $new && new=:$2:$4:$5:$6 &&
474 $posix_glob set +f &&
475
476 test "$old" = "$new" &&
477 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
478 then
479 rm -f "$dsttmp"
480 else
481 # Rename the file to the real destination.
482 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
483
484 # The rename failed, perhaps because mv can't rename something else
485 # to itself, or perhaps because mv is so ancient that it does not
486 # support -f.
487 {
488 # Now remove or move aside any old file at destination location.
489 # We try this two ways since rm can't unlink itself on some
490 # systems and the destination file might be busy for other
491 # reasons. In this case, the final cleanup might fail but the new
492 # file should still install successfully.
493 {
494 test ! -f "$dst" ||
495 $doit $rmcmd -f "$dst" 2>/dev/null ||
496 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
497 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
498 } ||
499 { echo "$0: cannot unlink or rename $dst" >&2
500 (exit 1); exit 1
501 }
502 } &&
503
504 # Now rename the file to the real destination.
505 $doit $mvcmd "$dsttmp" "$dst"
506 }
507 fi || exit 1
508
509 trap '' 0
510 fi
511 done
512
513 # Local variables:
514 # eval: (add-hook 'write-file-hooks 'time-stamp)
515 # time-stamp-start: "scriptversion="
516 # time-stamp-format: "%:y-%02m-%02d.%02H"
517 # time-stamp-time-zone: "UTC"
518 # time-stamp-end: "; # UTC"
519 # End:
+0
-8413
ltmain.sh less more
0 # Generated from ltmain.m4sh.
1
2 # ltmain.sh (GNU libtool) 2.2.6b
3 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
6 # This is free software; see the source for copying conditions. There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
9 # GNU Libtool is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # As a special exception to the GNU General Public License,
15 # if you distribute this file as part of a program or library that
16 # is built using GNU Libtool, you may include this file under the
17 # same distribution terms that you use for the rest of that program.
18 #
19 # GNU Libtool is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --tag=TAG use configuration variables from tag TAG
42 # -v, --verbose print informational messages (default)
43 # --version print version information
44 # -h, --help print short or long help message
45 #
46 # MODE must be one of the following:
47 #
48 # clean remove files from the build directory
49 # compile compile a source file into a libtool object
50 # execute automatically set library path, then run a program
51 # finish complete the installation of libtool libraries
52 # install install libraries or executables
53 # link create a library or an executable
54 # uninstall remove libraries from an installed directory
55 #
56 # MODE-ARGS vary depending on the MODE.
57 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
58 #
59 # When reporting a bug, please describe a test case to reproduce it and
60 # include the following information:
61 #
62 # host-triplet: $host
63 # shell: $SHELL
64 # compiler: $LTCC
65 # compiler flags: $LTCFLAGS
66 # linker: $LD (gnu? $with_gnu_ld)
67 # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
68 # automake: $automake_version
69 # autoconf: $autoconf_version
70 #
71 # Report bugs to <bug-libtool@gnu.org>.
72
73 PROGRAM=ltmain.sh
74 PACKAGE=libtool
75 VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
76 TIMESTAMP=""
77 package_revision=1.3017
78
79 # Be Bourne compatible
80 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
81 emulate sh
82 NULLCMD=:
83 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
84 # is contrary to our usage. Disable this feature.
85 alias -g '${1+"$@"}'='"$@"'
86 setopt NO_GLOB_SUBST
87 else
88 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
89 fi
90 BIN_SH=xpg4; export BIN_SH # for Tru64
91 DUALCASE=1; export DUALCASE # for MKS sh
92
93 # NLS nuisances: We save the old values to restore during execute mode.
94 # Only set LANG and LC_ALL to C if already set.
95 # These must not be set unconditionally because not all systems understand
96 # e.g. LANG=C (notably SCO).
97 lt_user_locale=
98 lt_safe_locale=
99 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
100 do
101 eval "if test \"\${$lt_var+set}\" = set; then
102 save_$lt_var=\$$lt_var
103 $lt_var=C
104 export $lt_var
105 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
106 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
107 fi"
108 done
109
110 $lt_unset CDPATH
111
112
113
114
115
116 : ${CP="cp -f"}
117 : ${ECHO="echo"}
118 : ${EGREP="/bin/grep -E"}
119 : ${FGREP="/bin/grep -F"}
120 : ${GREP="/bin/grep"}
121 : ${LN_S="ln -s"}
122 : ${MAKE="make"}
123 : ${MKDIR="mkdir"}
124 : ${MV="mv -f"}
125 : ${RM="rm -f"}
126 : ${SED="/bin/sed"}
127 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
128 : ${Xsed="$SED -e 1s/^X//"}
129
130 # Global variables:
131 EXIT_SUCCESS=0
132 EXIT_FAILURE=1
133 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
134 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
135
136 exit_status=$EXIT_SUCCESS
137
138 # Make sure IFS has a sensible default
139 lt_nl='
140 '
141 IFS=" $lt_nl"
142
143 dirname="s,/[^/]*$,,"
144 basename="s,^.*/,,"
145
146 # func_dirname_and_basename file append nondir_replacement
147 # perform func_basename and func_dirname in a single function
148 # call:
149 # dirname: Compute the dirname of FILE. If nonempty,
150 # add APPEND to the result, otherwise set result
151 # to NONDIR_REPLACEMENT.
152 # value returned in "$func_dirname_result"
153 # basename: Compute filename of FILE.
154 # value retuned in "$func_basename_result"
155 # Implementation must be kept synchronized with func_dirname
156 # and func_basename. For efficiency, we do not delegate to
157 # those functions but instead duplicate the functionality here.
158 func_dirname_and_basename ()
159 {
160 # Extract subdirectory from the argument.
161 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
162 if test "X$func_dirname_result" = "X${1}"; then
163 func_dirname_result="${3}"
164 else
165 func_dirname_result="$func_dirname_result${2}"
166 fi
167 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
168 }
169
170 # Generated shell functions inserted here.
171
172 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
173 # is ksh but when the shell is invoked as "sh" and the current value of
174 # the _XPG environment variable is not equal to 1 (one), the special
175 # positional parameter $0, within a function call, is the name of the
176 # function.
177 progpath="$0"
178
179 # The name of this program:
180 # In the unlikely event $progname began with a '-', it would play havoc with
181 # func_echo (imagine progname=-n), so we prepend ./ in that case:
182 func_dirname_and_basename "$progpath"
183 progname=$func_basename_result
184 case $progname in
185 -*) progname=./$progname ;;
186 esac
187
188 # Make sure we have an absolute path for reexecution:
189 case $progpath in
190 [\\/]*|[A-Za-z]:\\*) ;;
191 *[\\/]*)
192 progdir=$func_dirname_result
193 progdir=`cd "$progdir" && pwd`
194 progpath="$progdir/$progname"
195 ;;
196 *)
197 save_IFS="$IFS"
198 IFS=:
199 for progdir in $PATH; do
200 IFS="$save_IFS"
201 test -x "$progdir/$progname" && break
202 done
203 IFS="$save_IFS"
204 test -n "$progdir" || progdir=`pwd`
205 progpath="$progdir/$progname"
206 ;;
207 esac
208
209 # Sed substitution that helps us do robust quoting. It backslashifies
210 # metacharacters that are still active within double-quoted strings.
211 Xsed="${SED}"' -e 1s/^X//'
212 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
213
214 # Same as above, but do not quote variable references.
215 double_quote_subst='s/\(["`\\]\)/\\\1/g'
216
217 # Re-`\' parameter expansions in output of double_quote_subst that were
218 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
219 # in input to double_quote_subst, that '$' was protected from expansion.
220 # Since each input `\' is now two `\'s, look for any number of runs of
221 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
222 bs='\\'
223 bs2='\\\\'
224 bs4='\\\\\\\\'
225 dollar='\$'
226 sed_double_backslash="\
227 s/$bs4/&\\
228 /g
229 s/^$bs2$dollar/$bs&/
230 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
231 s/\n//g"
232
233 # Standard options:
234 opt_dry_run=false
235 opt_help=false
236 opt_quiet=false
237 opt_verbose=false
238 opt_warning=:
239
240 # func_echo arg...
241 # Echo program name prefixed message, along with the current mode
242 # name if it has been set yet.
243 func_echo ()
244 {
245 $ECHO "$progname${mode+: }$mode: $*"
246 }
247
248 # func_verbose arg...
249 # Echo program name prefixed message in verbose mode only.
250 func_verbose ()
251 {
252 $opt_verbose && func_echo ${1+"$@"}
253
254 # A bug in bash halts the script if the last line of a function
255 # fails when set -e is in force, so we need another command to
256 # work around that:
257 :
258 }
259
260 # func_error arg...
261 # Echo program name prefixed message to standard error.
262 func_error ()
263 {
264 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
265 }
266
267 # func_warning arg...
268 # Echo program name prefixed warning message to standard error.
269 func_warning ()
270 {
271 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
272
273 # bash bug again:
274 :
275 }
276
277 # func_fatal_error arg...
278 # Echo program name prefixed message to standard error, and exit.
279 func_fatal_error ()
280 {
281 func_error ${1+"$@"}
282 exit $EXIT_FAILURE
283 }
284
285 # func_fatal_help arg...
286 # Echo program name prefixed message to standard error, followed by
287 # a help hint, and exit.
288 func_fatal_help ()
289 {
290 func_error ${1+"$@"}
291 func_fatal_error "$help"
292 }
293 help="Try \`$progname --help' for more information." ## default
294
295
296 # func_grep expression filename
297 # Check whether EXPRESSION matches any line of FILENAME, without output.
298 func_grep ()
299 {
300 $GREP "$1" "$2" >/dev/null 2>&1
301 }
302
303
304 # func_mkdir_p directory-path
305 # Make sure the entire path to DIRECTORY-PATH is available.
306 func_mkdir_p ()
307 {
308 my_directory_path="$1"
309 my_dir_list=
310
311 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
312
313 # Protect directory names starting with `-'
314 case $my_directory_path in
315 -*) my_directory_path="./$my_directory_path" ;;
316 esac
317
318 # While some portion of DIR does not yet exist...
319 while test ! -d "$my_directory_path"; do
320 # ...make a list in topmost first order. Use a colon delimited
321 # list incase some portion of path contains whitespace.
322 my_dir_list="$my_directory_path:$my_dir_list"
323
324 # If the last portion added has no slash in it, the list is done
325 case $my_directory_path in */*) ;; *) break ;; esac
326
327 # ...otherwise throw away the child directory and loop
328 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
329 done
330 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
331
332 save_mkdir_p_IFS="$IFS"; IFS=':'
333 for my_dir in $my_dir_list; do
334 IFS="$save_mkdir_p_IFS"
335 # mkdir can fail with a `File exist' error if two processes
336 # try to create one of the directories concurrently. Don't
337 # stop in that case!
338 $MKDIR "$my_dir" 2>/dev/null || :
339 done
340 IFS="$save_mkdir_p_IFS"
341
342 # Bail out if we (or some other process) failed to create a directory.
343 test -d "$my_directory_path" || \
344 func_fatal_error "Failed to create \`$1'"
345 fi
346 }
347
348
349 # func_mktempdir [string]
350 # Make a temporary directory that won't clash with other running
351 # libtool processes, and avoids race conditions if possible. If
352 # given, STRING is the basename for that directory.
353 func_mktempdir ()
354 {
355 my_template="${TMPDIR-/tmp}/${1-$progname}"
356
357 if test "$opt_dry_run" = ":"; then
358 # Return a directory name, but don't create it in dry-run mode
359 my_tmpdir="${my_template}-$$"
360 else
361
362 # If mktemp works, use that first and foremost
363 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
364
365 if test ! -d "$my_tmpdir"; then
366 # Failing that, at least try and use $RANDOM to avoid a race
367 my_tmpdir="${my_template}-${RANDOM-0}$$"
368
369 save_mktempdir_umask=`umask`
370 umask 0077
371 $MKDIR "$my_tmpdir"
372 umask $save_mktempdir_umask
373 fi
374
375 # If we're not in dry-run mode, bomb out on failure
376 test -d "$my_tmpdir" || \
377 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
378 fi
379
380 $ECHO "X$my_tmpdir" | $Xsed
381 }
382
383
384 # func_quote_for_eval arg
385 # Aesthetically quote ARG to be evaled later.
386 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
387 # is double-quoted, suitable for a subsequent eval, whereas
388 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
389 # which are still active within double quotes backslashified.
390 func_quote_for_eval ()
391 {
392 case $1 in
393 *[\\\`\"\$]*)
394 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
395 *)
396 func_quote_for_eval_unquoted_result="$1" ;;
397 esac
398
399 case $func_quote_for_eval_unquoted_result in
400 # Double-quote args containing shell metacharacters to delay
401 # word splitting, command substitution and and variable
402 # expansion for a subsequent eval.
403 # Many Bourne shells cannot handle close brackets correctly
404 # in scan sets, so we specify it separately.
405 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
406 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
407 ;;
408 *)
409 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
410 esac
411 }
412
413
414 # func_quote_for_expand arg
415 # Aesthetically quote ARG to be evaled later; same as above,
416 # but do not quote variable references.
417 func_quote_for_expand ()
418 {
419 case $1 in
420 *[\\\`\"]*)
421 my_arg=`$ECHO "X$1" | $Xsed \
422 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
423 *)
424 my_arg="$1" ;;
425 esac
426
427 case $my_arg in
428 # Double-quote args containing shell metacharacters to delay
429 # word splitting and command substitution for a subsequent eval.
430 # Many Bourne shells cannot handle close brackets correctly
431 # in scan sets, so we specify it separately.
432 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
433 my_arg="\"$my_arg\""
434 ;;
435 esac
436
437 func_quote_for_expand_result="$my_arg"
438 }
439
440
441 # func_show_eval cmd [fail_exp]
442 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
443 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
444 # is given, then evaluate it.
445 func_show_eval ()
446 {
447 my_cmd="$1"
448 my_fail_exp="${2-:}"
449
450 ${opt_silent-false} || {
451 func_quote_for_expand "$my_cmd"
452 eval "func_echo $func_quote_for_expand_result"
453 }
454
455 if ${opt_dry_run-false}; then :; else
456 eval "$my_cmd"
457 my_status=$?
458 if test "$my_status" -eq 0; then :; else
459 eval "(exit $my_status); $my_fail_exp"
460 fi
461 fi
462 }
463
464
465 # func_show_eval_locale cmd [fail_exp]
466 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
467 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
468 # is given, then evaluate it. Use the saved locale for evaluation.
469 func_show_eval_locale ()
470 {
471 my_cmd="$1"
472 my_fail_exp="${2-:}"
473
474 ${opt_silent-false} || {
475 func_quote_for_expand "$my_cmd"
476 eval "func_echo $func_quote_for_expand_result"
477 }
478
479 if ${opt_dry_run-false}; then :; else
480 eval "$lt_user_locale
481 $my_cmd"
482 my_status=$?
483 eval "$lt_safe_locale"
484 if test "$my_status" -eq 0; then :; else
485 eval "(exit $my_status); $my_fail_exp"
486 fi
487 fi
488 }
489
490
491
492
493
494 # func_version
495 # Echo version message to standard output and exit.
496 func_version ()
497 {
498 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
499 s/^# //
500 s/^# *$//
501 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
502 p
503 }' < "$progpath"
504 exit $?
505 }
506
507 # func_usage
508 # Echo short help message to standard output and exit.
509 func_usage ()
510 {
511 $SED -n '/^# Usage:/,/# -h/ {
512 s/^# //
513 s/^# *$//
514 s/\$progname/'$progname'/
515 p
516 }' < "$progpath"
517 $ECHO
518 $ECHO "run \`$progname --help | more' for full usage"
519 exit $?
520 }
521
522 # func_help
523 # Echo long help message to standard output and exit.
524 func_help ()
525 {
526 $SED -n '/^# Usage:/,/# Report bugs to/ {
527 s/^# //
528 s/^# *$//
529 s*\$progname*'$progname'*
530 s*\$host*'"$host"'*
531 s*\$SHELL*'"$SHELL"'*
532 s*\$LTCC*'"$LTCC"'*
533 s*\$LTCFLAGS*'"$LTCFLAGS"'*
534 s*\$LD*'"$LD"'*
535 s/\$with_gnu_ld/'"$with_gnu_ld"'/
536 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
537 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
538 p
539 }' < "$progpath"
540 exit $?
541 }
542
543 # func_missing_arg argname
544 # Echo program name prefixed message to standard error and set global
545 # exit_cmd.
546 func_missing_arg ()
547 {
548 func_error "missing argument for $1"
549 exit_cmd=exit
550 }
551
552 exit_cmd=:
553
554
555
556
557
558 # Check that we have a working $ECHO.
559 if test "X$1" = X--no-reexec; then
560 # Discard the --no-reexec flag, and continue.
561 shift
562 elif test "X$1" = X--fallback-echo; then
563 # Avoid inline document here, it may be left over
564 :
565 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
566 # Yippee, $ECHO works!
567 :
568 else
569 # Restart under the correct shell, and then maybe $ECHO will work.
570 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
571 fi
572
573 if test "X$1" = X--fallback-echo; then
574 # used as fallback echo
575 shift
576 cat <<EOF
577 $*
578 EOF
579 exit $EXIT_SUCCESS
580 fi
581
582 magic="%%%MAGIC variable%%%"
583 magic_exe="%%%MAGIC EXE variable%%%"
584
585 # Global variables.
586 # $mode is unset
587 nonopt=
588 execute_dlfiles=
589 preserve_args=
590 lo2o="s/\\.lo\$/.${objext}/"
591 o2lo="s/\\.${objext}\$/.lo/"
592 extracted_archives=
593 extracted_serial=0
594
595 opt_dry_run=false
596 opt_duplicate_deps=false
597 opt_silent=false
598 opt_debug=:
599
600 # If this variable is set in any of the actions, the command in it
601 # will be execed at the end. This prevents here-documents from being
602 # left over by shells.
603 exec_cmd=
604
605 # func_fatal_configuration arg...
606 # Echo program name prefixed message to standard error, followed by
607 # a configuration failure hint, and exit.
608 func_fatal_configuration ()
609 {
610 func_error ${1+"$@"}
611 func_error "See the $PACKAGE documentation for more information."
612 func_fatal_error "Fatal configuration error."
613 }
614
615
616 # func_config
617 # Display the configuration for all the tags in this script.
618 func_config ()
619 {
620 re_begincf='^# ### BEGIN LIBTOOL'
621 re_endcf='^# ### END LIBTOOL'
622
623 # Default configuration.
624 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
625
626 # Now print the configurations for the tags.
627 for tagname in $taglist; do
628 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
629 done
630
631 exit $?
632 }
633
634 # func_features
635 # Display the features supported by this script.
636 func_features ()
637 {
638 $ECHO "host: $host"
639 if test "$build_libtool_libs" = yes; then
640 $ECHO "enable shared libraries"
641 else
642 $ECHO "disable shared libraries"
643 fi
644 if test "$build_old_libs" = yes; then
645 $ECHO "enable static libraries"
646 else
647 $ECHO "disable static libraries"
648 fi
649
650 exit $?
651 }
652
653 # func_enable_tag tagname
654 # Verify that TAGNAME is valid, and either flag an error and exit, or
655 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
656 # variable here.
657 func_enable_tag ()
658 {
659 # Global variable:
660 tagname="$1"
661
662 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
663 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
664 sed_extractcf="/$re_begincf/,/$re_endcf/p"
665
666 # Validate tagname.
667 case $tagname in
668 *[!-_A-Za-z0-9,/]*)
669 func_fatal_error "invalid tag name: $tagname"
670 ;;
671 esac
672
673 # Don't test for the "default" C tag, as we know it's
674 # there but not specially marked.
675 case $tagname in
676 CC) ;;
677 *)
678 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
679 taglist="$taglist $tagname"
680
681 # Evaluate the configuration. Be careful to quote the path
682 # and the sed script, to avoid splitting on whitespace, but
683 # also don't use non-portable quotes within backquotes within
684 # quotes we have to do it in 2 steps:
685 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
686 eval "$extractedcf"
687 else
688 func_error "ignoring unknown tag $tagname"
689 fi
690 ;;
691 esac
692 }
693
694 # Parse options once, thoroughly. This comes as soon as possible in
695 # the script to make things like `libtool --version' happen quickly.
696 {
697
698 # Shorthand for --mode=foo, only valid as the first argument
699 case $1 in
700 clean|clea|cle|cl)
701 shift; set dummy --mode clean ${1+"$@"}; shift
702 ;;
703 compile|compil|compi|comp|com|co|c)
704 shift; set dummy --mode compile ${1+"$@"}; shift
705 ;;
706 execute|execut|execu|exec|exe|ex|e)
707 shift; set dummy --mode execute ${1+"$@"}; shift
708 ;;
709 finish|finis|fini|fin|fi|f)
710 shift; set dummy --mode finish ${1+"$@"}; shift
711 ;;
712 install|instal|insta|inst|ins|in|i)
713 shift; set dummy --mode install ${1+"$@"}; shift
714 ;;
715 link|lin|li|l)
716 shift; set dummy --mode link ${1+"$@"}; shift
717 ;;
718 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
719 shift; set dummy --mode uninstall ${1+"$@"}; shift
720 ;;
721 esac
722
723 # Parse non-mode specific arguments:
724 while test "$#" -gt 0; do
725 opt="$1"
726 shift
727
728 case $opt in
729 --config) func_config ;;
730
731 --debug) preserve_args="$preserve_args $opt"
732 func_echo "enabling shell trace mode"
733 opt_debug='set -x'
734 $opt_debug
735 ;;
736
737 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
738 execute_dlfiles="$execute_dlfiles $1"
739 shift
740 ;;
741
742 --dry-run | -n) opt_dry_run=: ;;
743 --features) func_features ;;
744 --finish) mode="finish" ;;
745
746 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
747 case $1 in
748 # Valid mode arguments:
749 clean) ;;
750 compile) ;;
751 execute) ;;
752 finish) ;;
753 install) ;;
754 link) ;;
755 relink) ;;
756 uninstall) ;;
757
758 # Catch anything else as an error
759 *) func_error "invalid argument for $opt"
760 exit_cmd=exit
761 break
762 ;;
763 esac
764
765 mode="$1"
766 shift
767 ;;
768
769 --preserve-dup-deps)
770 opt_duplicate_deps=: ;;
771
772 --quiet|--silent) preserve_args="$preserve_args $opt"
773 opt_silent=:
774 ;;
775
776 --verbose| -v) preserve_args="$preserve_args $opt"
777 opt_silent=false
778 ;;
779
780 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
781 preserve_args="$preserve_args $opt $1"
782 func_enable_tag "$1" # tagname is set here
783 shift
784 ;;
785
786 # Separate optargs to long options:
787 -dlopen=*|--mode=*|--tag=*)
788 func_opt_split "$opt"
789 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
790 shift
791 ;;
792
793 -\?|-h) func_usage ;;
794 --help) opt_help=: ;;
795 --version) func_version ;;
796
797 -*) func_fatal_help "unrecognized option \`$opt'" ;;
798
799 *) nonopt="$opt"
800 break
801 ;;
802 esac
803 done
804
805
806 case $host in
807 *cygwin* | *mingw* | *pw32* | *cegcc*)
808 # don't eliminate duplications in $postdeps and $predeps
809 opt_duplicate_compiler_generated_deps=:
810 ;;
811 *)
812 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
813 ;;
814 esac
815
816 # Having warned about all mis-specified options, bail out if
817 # anything was wrong.
818 $exit_cmd $EXIT_FAILURE
819 }
820
821 # func_check_version_match
822 # Ensure that we are using m4 macros, and libtool script from the same
823 # release of libtool.
824 func_check_version_match ()
825 {
826 if test "$package_revision" != "$macro_revision"; then
827 if test "$VERSION" != "$macro_version"; then
828 if test -z "$macro_version"; then
829 cat >&2 <<_LT_EOF
830 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
831 $progname: definition of this LT_INIT comes from an older release.
832 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
833 $progname: and run autoconf again.
834 _LT_EOF
835 else
836 cat >&2 <<_LT_EOF
837 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
838 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
839 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
840 $progname: and run autoconf again.
841 _LT_EOF
842 fi
843 else
844 cat >&2 <<_LT_EOF
845 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
846 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
847 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
848 $progname: of $PACKAGE $VERSION and run autoconf again.
849 _LT_EOF
850 fi
851
852 exit $EXIT_MISMATCH
853 fi
854 }
855
856
857 ## ----------- ##
858 ## Main. ##
859 ## ----------- ##
860
861 $opt_help || {
862 # Sanity checks first:
863 func_check_version_match
864
865 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
866 func_fatal_configuration "not configured to build any kind of library"
867 fi
868
869 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
870
871
872 # Darwin sucks
873 eval std_shrext=\"$shrext_cmds\"
874
875
876 # Only execute mode is allowed to have -dlopen flags.
877 if test -n "$execute_dlfiles" && test "$mode" != execute; then
878 func_error "unrecognized option \`-dlopen'"
879 $ECHO "$help" 1>&2
880 exit $EXIT_FAILURE
881 fi
882
883 # Change the help message to a mode-specific one.
884 generic_help="$help"
885 help="Try \`$progname --help --mode=$mode' for more information."
886 }
887
888
889 # func_lalib_p file
890 # True iff FILE is a libtool `.la' library or `.lo' object file.
891 # This function is only a basic sanity check; it will hardly flush out
892 # determined imposters.
893 func_lalib_p ()
894 {
895 test -f "$1" &&
896 $SED -e 4q "$1" 2>/dev/null \
897 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
898 }
899
900 # func_lalib_unsafe_p file
901 # True iff FILE is a libtool `.la' library or `.lo' object file.
902 # This function implements the same check as func_lalib_p without
903 # resorting to external programs. To this end, it redirects stdin and
904 # closes it afterwards, without saving the original file descriptor.
905 # As a safety measure, use it only where a negative result would be
906 # fatal anyway. Works if `file' does not exist.
907 func_lalib_unsafe_p ()
908 {
909 lalib_p=no
910 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
911 for lalib_p_l in 1 2 3 4
912 do
913 read lalib_p_line
914 case "$lalib_p_line" in
915 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
916 esac
917 done
918 exec 0<&5 5<&-
919 fi
920 test "$lalib_p" = yes
921 }
922
923 # func_ltwrapper_script_p file
924 # True iff FILE is a libtool wrapper script
925 # This function is only a basic sanity check; it will hardly flush out
926 # determined imposters.
927 func_ltwrapper_script_p ()
928 {
929 func_lalib_p "$1"
930 }
931
932 # func_ltwrapper_executable_p file
933 # True iff FILE is a libtool wrapper executable
934 # This function is only a basic sanity check; it will hardly flush out
935 # determined imposters.
936 func_ltwrapper_executable_p ()
937 {
938 func_ltwrapper_exec_suffix=
939 case $1 in
940 *.exe) ;;
941 *) func_ltwrapper_exec_suffix=.exe ;;
942 esac
943 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
944 }
945
946 # func_ltwrapper_scriptname file
947 # Assumes file is an ltwrapper_executable
948 # uses $file to determine the appropriate filename for a
949 # temporary ltwrapper_script.
950 func_ltwrapper_scriptname ()
951 {
952 func_ltwrapper_scriptname_result=""
953 if func_ltwrapper_executable_p "$1"; then
954 func_dirname_and_basename "$1" "" "."
955 func_stripname '' '.exe' "$func_basename_result"
956 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
957 fi
958 }
959
960 # func_ltwrapper_p file
961 # True iff FILE is a libtool wrapper script or wrapper executable
962 # This function is only a basic sanity check; it will hardly flush out
963 # determined imposters.
964 func_ltwrapper_p ()
965 {
966 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
967 }
968
969
970 # func_execute_cmds commands fail_cmd
971 # Execute tilde-delimited COMMANDS.
972 # If FAIL_CMD is given, eval that upon failure.
973 # FAIL_CMD may read-access the current command in variable CMD!
974 func_execute_cmds ()
975 {
976 $opt_debug
977 save_ifs=$IFS; IFS='~'
978 for cmd in $1; do
979 IFS=$save_ifs
980 eval cmd=\"$cmd\"
981 func_show_eval "$cmd" "${2-:}"
982 done
983 IFS=$save_ifs
984 }
985
986
987 # func_source file
988 # Source FILE, adding directory component if necessary.
989 # Note that it is not necessary on cygwin/mingw to append a dot to
990 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
991 # behavior happens only for exec(3), not for open(2)! Also, sourcing
992 # `FILE.' does not work on cygwin managed mounts.
993 func_source ()
994 {
995 $opt_debug
996 case $1 in
997 */* | *\\*) . "$1" ;;
998 *) . "./$1" ;;
999 esac
1000 }
1001
1002
1003 # func_infer_tag arg
1004 # Infer tagged configuration to use if any are available and
1005 # if one wasn't chosen via the "--tag" command line option.
1006 # Only attempt this if the compiler in the base compile
1007 # command doesn't match the default compiler.
1008 # arg is usually of the form 'gcc ...'
1009 func_infer_tag ()
1010 {
1011 $opt_debug
1012 if test -n "$available_tags" && test -z "$tagname"; then
1013 CC_quoted=
1014 for arg in $CC; do
1015 func_quote_for_eval "$arg"
1016 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1017 done
1018 case $@ in
1019 # Blanks in the command may have been stripped by the calling shell,
1020 # but not from the CC environment variable when configure was run.
1021 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1022 # Blanks at the start of $base_compile will cause this to fail
1023 # if we don't check for them as well.
1024 *)
1025 for z in $available_tags; do
1026 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1027 # Evaluate the configuration.
1028 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1029 CC_quoted=
1030 for arg in $CC; do
1031 # Double-quote args containing other shell metacharacters.
1032 func_quote_for_eval "$arg"
1033 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1034 done
1035 case "$@ " in
1036 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1037 # The compiler in the base compile command matches
1038 # the one in the tagged configuration.
1039 # Assume this is the tagged configuration we want.
1040 tagname=$z
1041 break
1042 ;;
1043 esac
1044 fi
1045 done
1046 # If $tagname still isn't set, then no tagged configuration
1047 # was found and let the user know that the "--tag" command
1048 # line option must be used.
1049 if test -z "$tagname"; then
1050 func_echo "unable to infer tagged configuration"
1051 func_fatal_error "specify a tag with \`--tag'"
1052 # else
1053 # func_verbose "using $tagname tagged configuration"
1054 fi
1055 ;;
1056 esac
1057 fi
1058 }
1059
1060
1061
1062 # func_write_libtool_object output_name pic_name nonpic_name
1063 # Create a libtool object file (analogous to a ".la" file),
1064 # but don't create it if we're doing a dry run.
1065 func_write_libtool_object ()
1066 {
1067 write_libobj=${1}
1068 if test "$build_libtool_libs" = yes; then
1069 write_lobj=\'${2}\'
1070 else
1071 write_lobj=none
1072 fi
1073
1074 if test "$build_old_libs" = yes; then
1075 write_oldobj=\'${3}\'
1076 else
1077 write_oldobj=none
1078 fi
1079
1080 $opt_dry_run || {
1081 cat >${write_libobj}T <<EOF
1082 # $write_libobj - a libtool object file
1083 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1084 #
1085 # Please DO NOT delete this file!
1086 # It is necessary for linking the library.
1087
1088 # Name of the PIC object.
1089 pic_object=$write_lobj
1090
1091 # Name of the non-PIC object
1092 non_pic_object=$write_oldobj
1093
1094 EOF
1095 $MV "${write_libobj}T" "${write_libobj}"
1096 }
1097 }
1098
1099 # func_mode_compile arg...
1100 func_mode_compile ()
1101 {
1102 $opt_debug
1103 # Get the compilation command and the source file.
1104 base_compile=
1105 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1106 suppress_opt=yes
1107 suppress_output=
1108 arg_mode=normal
1109 libobj=
1110 later=
1111 pie_flag=
1112
1113 for arg
1114 do
1115 case $arg_mode in
1116 arg )
1117 # do not "continue". Instead, add this to base_compile
1118 lastarg="$arg"
1119 arg_mode=normal
1120 ;;
1121
1122 target )
1123 libobj="$arg"
1124 arg_mode=normal
1125 continue
1126 ;;
1127
1128 normal )
1129 # Accept any command-line options.
1130 case $arg in
1131 -o)
1132 test -n "$libobj" && \
1133 func_fatal_error "you cannot specify \`-o' more than once"
1134 arg_mode=target
1135 continue
1136 ;;
1137
1138 -pie | -fpie | -fPIE)
1139 pie_flag="$pie_flag $arg"
1140 continue
1141 ;;
1142
1143 -shared | -static | -prefer-pic | -prefer-non-pic)
1144 later="$later $arg"
1145 continue
1146 ;;
1147
1148 -no-suppress)
1149 suppress_opt=no
1150 continue
1151 ;;
1152
1153 -Xcompiler)
1154 arg_mode=arg # the next one goes into the "base_compile" arg list
1155 continue # The current "srcfile" will either be retained or
1156 ;; # replaced later. I would guess that would be a bug.
1157
1158 -Wc,*)
1159 func_stripname '-Wc,' '' "$arg"
1160 args=$func_stripname_result
1161 lastarg=
1162 save_ifs="$IFS"; IFS=','
1163 for arg in $args; do
1164 IFS="$save_ifs"
1165 func_quote_for_eval "$arg"
1166 lastarg="$lastarg $func_quote_for_eval_result"
1167 done
1168 IFS="$save_ifs"
1169 func_stripname ' ' '' "$lastarg"
1170 lastarg=$func_stripname_result
1171
1172 # Add the arguments to base_compile.
1173 base_compile="$base_compile $lastarg"
1174 continue
1175 ;;
1176
1177 *)
1178 # Accept the current argument as the source file.
1179 # The previous "srcfile" becomes the current argument.
1180 #
1181 lastarg="$srcfile"
1182 srcfile="$arg"
1183 ;;
1184 esac # case $arg
1185 ;;
1186 esac # case $arg_mode
1187
1188 # Aesthetically quote the previous argument.
1189 func_quote_for_eval "$lastarg"
1190 base_compile="$base_compile $func_quote_for_eval_result"
1191 done # for arg
1192
1193 case $arg_mode in
1194 arg)
1195 func_fatal_error "you must specify an argument for -Xcompile"
1196 ;;
1197 target)
1198 func_fatal_error "you must specify a target with \`-o'"
1199 ;;
1200 *)
1201 # Get the name of the library object.
1202 test -z "$libobj" && {
1203 func_basename "$srcfile"
1204 libobj="$func_basename_result"
1205 }
1206 ;;
1207 esac
1208
1209 # Recognize several different file suffixes.
1210 # If the user specifies -o file.o, it is replaced with file.lo
1211 case $libobj in
1212 *.[cCFSifmso] | \
1213 *.ada | *.adb | *.ads | *.asm | \
1214 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1215 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1216 func_xform "$libobj"
1217 libobj=$func_xform_result
1218 ;;
1219 esac
1220
1221 case $libobj in
1222 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1223 *)
1224 func_fatal_error "cannot determine name of library object from \`$libobj'"
1225 ;;
1226 esac
1227
1228 func_infer_tag $base_compile
1229
1230 for arg in $later; do
1231 case $arg in
1232 -shared)
1233 test "$build_libtool_libs" != yes && \
1234 func_fatal_configuration "can not build a shared library"
1235 build_old_libs=no
1236 continue
1237 ;;
1238
1239 -static)
1240 build_libtool_libs=no
1241 build_old_libs=yes
1242 continue
1243 ;;
1244
1245 -prefer-pic)
1246 pic_mode=yes
1247 continue
1248 ;;
1249
1250 -prefer-non-pic)
1251 pic_mode=no
1252 continue
1253 ;;
1254 esac
1255 done
1256
1257 func_quote_for_eval "$libobj"
1258 test "X$libobj" != "X$func_quote_for_eval_result" \
1259 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1260 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1261 func_dirname_and_basename "$obj" "/" ""
1262 objname="$func_basename_result"
1263 xdir="$func_dirname_result"
1264 lobj=${xdir}$objdir/$objname
1265
1266 test -z "$base_compile" && \
1267 func_fatal_help "you must specify a compilation command"
1268
1269 # Delete any leftover library objects.
1270 if test "$build_old_libs" = yes; then
1271 removelist="$obj $lobj $libobj ${libobj}T"
1272 else
1273 removelist="$lobj $libobj ${libobj}T"
1274 fi
1275
1276 # On Cygwin there's no "real" PIC flag so we must build both object types
1277 case $host_os in
1278 cygwin* | mingw* | pw32* | os2* | cegcc*)
1279 pic_mode=default
1280 ;;
1281 esac
1282 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1283 # non-PIC code in shared libraries is not supported
1284 pic_mode=default
1285 fi
1286
1287 # Calculate the filename of the output object if compiler does
1288 # not support -o with -c
1289 if test "$compiler_c_o" = no; then
1290 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1291 lockfile="$output_obj.lock"
1292 else
1293 output_obj=
1294 need_locks=no
1295 lockfile=
1296 fi
1297
1298 # Lock this critical section if it is needed
1299 # We use this script file to make the link, it avoids creating a new file
1300 if test "$need_locks" = yes; then
1301 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1302 func_echo "Waiting for $lockfile to be removed"
1303 sleep 2
1304 done
1305 elif test "$need_locks" = warn; then
1306 if test -f "$lockfile"; then
1307 $ECHO "\
1308 *** ERROR, $lockfile exists and contains:
1309 `cat $lockfile 2>/dev/null`
1310
1311 This indicates that another process is trying to use the same
1312 temporary object file, and libtool could not work around it because
1313 your compiler does not support \`-c' and \`-o' together. If you
1314 repeat this compilation, it may succeed, by chance, but you had better
1315 avoid parallel builds (make -j) in this platform, or get a better
1316 compiler."
1317
1318 $opt_dry_run || $RM $removelist
1319 exit $EXIT_FAILURE
1320 fi
1321 removelist="$removelist $output_obj"
1322 $ECHO "$srcfile" > "$lockfile"
1323 fi
1324
1325 $opt_dry_run || $RM $removelist
1326 removelist="$removelist $lockfile"
1327 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1328
1329 if test -n "$fix_srcfile_path"; then
1330 eval srcfile=\"$fix_srcfile_path\"
1331 fi
1332 func_quote_for_eval "$srcfile"
1333 qsrcfile=$func_quote_for_eval_result
1334
1335 # Only build a PIC object if we are building libtool libraries.
1336 if test "$build_libtool_libs" = yes; then
1337 # Without this assignment, base_compile gets emptied.
1338 fbsd_hideous_sh_bug=$base_compile
1339
1340 if test "$pic_mode" != no; then
1341 command="$base_compile $qsrcfile $pic_flag"
1342 else
1343 # Don't build PIC code
1344 command="$base_compile $qsrcfile"
1345 fi
1346
1347 func_mkdir_p "$xdir$objdir"
1348
1349 if test -z "$output_obj"; then
1350 # Place PIC objects in $objdir
1351 command="$command -o $lobj"
1352 fi
1353
1354 func_show_eval_locale "$command" \
1355 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1356
1357 if test "$need_locks" = warn &&
1358 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1359 $ECHO "\
1360 *** ERROR, $lockfile contains:
1361 `cat $lockfile 2>/dev/null`
1362
1363 but it should contain:
1364 $srcfile
1365
1366 This indicates that another process is trying to use the same
1367 temporary object file, and libtool could not work around it because
1368 your compiler does not support \`-c' and \`-o' together. If you
1369 repeat this compilation, it may succeed, by chance, but you had better
1370 avoid parallel builds (make -j) in this platform, or get a better
1371 compiler."
1372
1373 $opt_dry_run || $RM $removelist
1374 exit $EXIT_FAILURE
1375 fi
1376
1377 # Just move the object if needed, then go on to compile the next one
1378 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1379 func_show_eval '$MV "$output_obj" "$lobj"' \
1380 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1381 fi
1382
1383 # Allow error messages only from the first compilation.
1384 if test "$suppress_opt" = yes; then
1385 suppress_output=' >/dev/null 2>&1'
1386 fi
1387 fi
1388
1389 # Only build a position-dependent object if we build old libraries.
1390 if test "$build_old_libs" = yes; then
1391 if test "$pic_mode" != yes; then
1392 # Don't build PIC code
1393 command="$base_compile $qsrcfile$pie_flag"
1394 else
1395 command="$base_compile $qsrcfile $pic_flag"
1396 fi
1397 if test "$compiler_c_o" = yes; then
1398 command="$command -o $obj"
1399 fi
1400
1401 # Suppress compiler output if we already did a PIC compilation.
1402 command="$command$suppress_output"
1403 func_show_eval_locale "$command" \
1404 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1405
1406 if test "$need_locks" = warn &&
1407 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1408 $ECHO "\
1409 *** ERROR, $lockfile contains:
1410 `cat $lockfile 2>/dev/null`
1411
1412 but it should contain:
1413 $srcfile
1414
1415 This indicates that another process is trying to use the same
1416 temporary object file, and libtool could not work around it because
1417 your compiler does not support \`-c' and \`-o' together. If you
1418 repeat this compilation, it may succeed, by chance, but you had better
1419 avoid parallel builds (make -j) in this platform, or get a better
1420 compiler."
1421
1422 $opt_dry_run || $RM $removelist
1423 exit $EXIT_FAILURE
1424 fi
1425
1426 # Just move the object if needed
1427 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1428 func_show_eval '$MV "$output_obj" "$obj"' \
1429 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1430 fi
1431 fi
1432
1433 $opt_dry_run || {
1434 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1435
1436 # Unlock the critical section if it was locked
1437 if test "$need_locks" != no; then
1438 removelist=$lockfile
1439 $RM "$lockfile"
1440 fi
1441 }
1442
1443 exit $EXIT_SUCCESS
1444 }
1445
1446 $opt_help || {
1447 test "$mode" = compile && func_mode_compile ${1+"$@"}
1448 }
1449
1450 func_mode_help ()
1451 {
1452 # We need to display help for each of the modes.
1453 case $mode in
1454 "")
1455 # Generic help is extracted from the usage comments
1456 # at the start of this file.
1457 func_help
1458 ;;
1459
1460 clean)
1461 $ECHO \
1462 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1463
1464 Remove files from the build directory.
1465
1466 RM is the name of the program to use to delete files associated with each FILE
1467 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1468 to RM.
1469
1470 If FILE is a libtool library, object or program, all the files associated
1471 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1472 ;;
1473
1474 compile)
1475 $ECHO \
1476 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1477
1478 Compile a source file into a libtool library object.
1479
1480 This mode accepts the following additional options:
1481
1482 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1483 -no-suppress do not suppress compiler output for multiple passes
1484 -prefer-pic try to building PIC objects only
1485 -prefer-non-pic try to building non-PIC objects only
1486 -shared do not build a \`.o' file suitable for static linking
1487 -static only build a \`.o' file suitable for static linking
1488
1489 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1490 from the given SOURCEFILE.
1491
1492 The output file name is determined by removing the directory component from
1493 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1494 library object suffix, \`.lo'."
1495 ;;
1496
1497 execute)
1498 $ECHO \
1499 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1500
1501 Automatically set library path, then run a program.
1502
1503 This mode accepts the following additional options:
1504
1505 -dlopen FILE add the directory containing FILE to the library path
1506
1507 This mode sets the library path environment variable according to \`-dlopen'
1508 flags.
1509
1510 If any of the ARGS are libtool executable wrappers, then they are translated
1511 into their corresponding uninstalled binary, and any of their required library
1512 directories are added to the library path.
1513
1514 Then, COMMAND is executed, with ARGS as arguments."
1515 ;;
1516
1517 finish)
1518 $ECHO \
1519 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1520
1521 Complete the installation of libtool libraries.
1522
1523 Each LIBDIR is a directory that contains libtool libraries.
1524
1525 The commands that this mode executes may require superuser privileges. Use
1526 the \`--dry-run' option if you just want to see what would be executed."
1527 ;;
1528
1529 install)
1530 $ECHO \
1531 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1532
1533 Install executables or libraries.
1534
1535 INSTALL-COMMAND is the installation command. The first component should be
1536 either the \`install' or \`cp' program.
1537
1538 The following components of INSTALL-COMMAND are treated specially:
1539
1540 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1541
1542 The rest of the components are interpreted as arguments to that command (only
1543 BSD-compatible install options are recognized)."
1544 ;;
1545
1546 link)
1547 $ECHO \
1548 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1549
1550 Link object files or libraries together to form another library, or to
1551 create an executable program.
1552
1553 LINK-COMMAND is a command using the C compiler that you would use to create
1554 a program from several object files.
1555
1556 The following components of LINK-COMMAND are treated specially:
1557
1558 -all-static do not do any dynamic linking at all
1559 -avoid-version do not add a version suffix if possible
1560 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1561 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1562 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1563 -export-symbols SYMFILE
1564 try to export only the symbols listed in SYMFILE
1565 -export-symbols-regex REGEX
1566 try to export only the symbols matching REGEX
1567 -LLIBDIR search LIBDIR for required installed libraries
1568 -lNAME OUTPUT-FILE requires the installed library libNAME
1569 -module build a library that can dlopened
1570 -no-fast-install disable the fast-install mode
1571 -no-install link a not-installable executable
1572 -no-undefined declare that a library does not refer to external symbols
1573 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1574 -objectlist FILE Use a list of object files found in FILE to specify objects
1575 -precious-files-regex REGEX
1576 don't remove output files matching REGEX
1577 -release RELEASE specify package release information
1578 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1579 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1580 -shared only do dynamic linking of libtool libraries
1581 -shrext SUFFIX override the standard shared library file extension
1582 -static do not do any dynamic linking of uninstalled libtool libraries
1583 -static-libtool-libs
1584 do not do any dynamic linking of libtool libraries
1585 -version-info CURRENT[:REVISION[:AGE]]
1586 specify library version info [each variable defaults to 0]
1587 -weak LIBNAME declare that the target provides the LIBNAME interface
1588
1589 All other options (arguments beginning with \`-') are ignored.
1590
1591 Every other argument is treated as a filename. Files ending in \`.la' are
1592 treated as uninstalled libtool libraries, other files are standard or library
1593 object files.
1594
1595 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1596 only library objects (\`.lo' files) may be specified, and \`-rpath' is
1597 required, except when creating a convenience library.
1598
1599 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1600 using \`ar' and \`ranlib', or on Windows using \`lib'.
1601
1602 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1603 is created, otherwise an executable program is created."
1604 ;;
1605
1606 uninstall)
1607 $ECHO \
1608 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1609
1610 Remove libraries from an installation directory.
1611
1612 RM is the name of the program to use to delete files associated with each FILE
1613 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1614 to RM.
1615
1616 If FILE is a libtool library, all the files associated with it are deleted.
1617 Otherwise, only FILE itself is deleted using RM."
1618 ;;
1619
1620 *)
1621 func_fatal_help "invalid operation mode \`$mode'"
1622 ;;
1623 esac
1624
1625 $ECHO
1626 $ECHO "Try \`$progname --help' for more information about other modes."
1627
1628 exit $?
1629 }
1630
1631 # Now that we've collected a possible --mode arg, show help if necessary
1632 $opt_help && func_mode_help
1633
1634
1635 # func_mode_execute arg...
1636 func_mode_execute ()
1637 {
1638 $opt_debug
1639 # The first argument is the command name.
1640 cmd="$nonopt"
1641 test -z "$cmd" && \
1642 func_fatal_help "you must specify a COMMAND"
1643
1644 # Handle -dlopen flags immediately.
1645 for file in $execute_dlfiles; do
1646 test -f "$file" \
1647 || func_fatal_help "\`$file' is not a file"
1648
1649 dir=
1650 case $file in
1651 *.la)
1652 # Check to see that this really is a libtool archive.
1653 func_lalib_unsafe_p "$file" \
1654 || func_fatal_help "\`$lib' is not a valid libtool archive"
1655
1656 # Read the libtool library.
1657 dlname=
1658 library_names=
1659 func_source "$file"
1660
1661 # Skip this library if it cannot be dlopened.
1662 if test -z "$dlname"; then
1663 # Warn if it was a shared library.
1664 test -n "$library_names" && \
1665 func_warning "\`$file' was not linked with \`-export-dynamic'"
1666 continue
1667 fi
1668
1669 func_dirname "$file" "" "."
1670 dir="$func_dirname_result"
1671
1672 if test -f "$dir/$objdir/$dlname"; then
1673 dir="$dir/$objdir"
1674 else
1675 if test ! -f "$dir/$dlname"; then
1676 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1677 fi
1678 fi
1679 ;;
1680
1681 *.lo)
1682 # Just add the directory containing the .lo file.
1683 func_dirname "$file" "" "."
1684 dir="$func_dirname_result"
1685 ;;
1686
1687 *)
1688 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
1689 continue
1690 ;;
1691 esac
1692
1693 # Get the absolute pathname.
1694 absdir=`cd "$dir" && pwd`
1695 test -n "$absdir" && dir="$absdir"
1696
1697 # Now add the directory to shlibpath_var.
1698 if eval "test -z \"\$$shlibpath_var\""; then
1699 eval "$shlibpath_var=\"\$dir\""
1700 else
1701 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1702 fi
1703 done
1704
1705 # This variable tells wrapper scripts just to set shlibpath_var
1706 # rather than running their programs.
1707 libtool_execute_magic="$magic"
1708
1709 # Check if any of the arguments is a wrapper script.
1710 args=
1711 for file
1712 do
1713 case $file in
1714 -*) ;;
1715 *)
1716 # Do a test to see if this is really a libtool program.
1717 if func_ltwrapper_script_p "$file"; then
1718 func_source "$file"
1719 # Transform arg to wrapped name.
1720 file="$progdir/$program"
1721 elif func_ltwrapper_executable_p "$file"; then
1722 func_ltwrapper_scriptname "$file"
1723 func_source "$func_ltwrapper_scriptname_result"
1724 # Transform arg to wrapped name.
1725 file="$progdir/$program"
1726 fi
1727 ;;
1728 esac
1729 # Quote arguments (to preserve shell metacharacters).
1730 func_quote_for_eval "$file"
1731 args="$args $func_quote_for_eval_result"
1732 done
1733
1734 if test "X$opt_dry_run" = Xfalse; then
1735 if test -n "$shlibpath_var"; then
1736 # Export the shlibpath_var.
1737 eval "export $shlibpath_var"
1738 fi
1739
1740 # Restore saved environment variables
1741 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1742 do
1743 eval "if test \"\${save_$lt_var+set}\" = set; then
1744 $lt_var=\$save_$lt_var; export $lt_var
1745 else
1746 $lt_unset $lt_var
1747 fi"
1748 done
1749
1750 # Now prepare to actually exec the command.
1751 exec_cmd="\$cmd$args"
1752 else
1753 # Display what would be done.
1754 if test -n "$shlibpath_var"; then
1755 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1756 $ECHO "export $shlibpath_var"
1757 fi
1758 $ECHO "$cmd$args"
1759 exit $EXIT_SUCCESS
1760 fi
1761 }
1762
1763 test "$mode" = execute && func_mode_execute ${1+"$@"}
1764
1765
1766 # func_mode_finish arg...
1767 func_mode_finish ()
1768 {
1769 $opt_debug
1770 libdirs="$nonopt"
1771 admincmds=
1772
1773 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1774 for dir
1775 do
1776 libdirs="$libdirs $dir"
1777 done
1778
1779 for libdir in $libdirs; do
1780 if test -n "$finish_cmds"; then
1781 # Do each command in the finish commands.
1782 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1783 '"$cmd"'"'
1784 fi
1785 if test -n "$finish_eval"; then
1786 # Do the single finish_eval.
1787 eval cmds=\"$finish_eval\"
1788 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
1789 $cmds"
1790 fi
1791 done
1792 fi
1793
1794 # Exit here if they wanted silent mode.
1795 $opt_silent && exit $EXIT_SUCCESS
1796
1797 $ECHO "X----------------------------------------------------------------------" | $Xsed
1798 $ECHO "Libraries have been installed in:"
1799 for libdir in $libdirs; do
1800 $ECHO " $libdir"
1801 done
1802 $ECHO
1803 $ECHO "If you ever happen to want to link against installed libraries"
1804 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1805 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1806 $ECHO "flag during linking and do at least one of the following:"
1807 if test -n "$shlibpath_var"; then
1808 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1809 $ECHO " during execution"
1810 fi
1811 if test -n "$runpath_var"; then
1812 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1813 $ECHO " during linking"
1814 fi
1815 if test -n "$hardcode_libdir_flag_spec"; then
1816 libdir=LIBDIR
1817 eval flag=\"$hardcode_libdir_flag_spec\"
1818
1819 $ECHO " - use the \`$flag' linker flag"
1820 fi
1821 if test -n "$admincmds"; then
1822 $ECHO " - have your system administrator run these commands:$admincmds"
1823 fi
1824 if test -f /etc/ld.so.conf; then
1825 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1826 fi
1827 $ECHO
1828
1829 $ECHO "See any operating system documentation about shared libraries for"
1830 case $host in
1831 solaris2.[6789]|solaris2.1[0-9])
1832 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1833 $ECHO "pages."
1834 ;;
1835 *)
1836 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1837 ;;
1838 esac
1839 $ECHO "X----------------------------------------------------------------------" | $Xsed
1840 exit $EXIT_SUCCESS
1841 }
1842
1843 test "$mode" = finish && func_mode_finish ${1+"$@"}
1844
1845
1846 # func_mode_install arg...
1847 func_mode_install ()
1848 {
1849 $opt_debug
1850 # There may be an optional sh(1) argument at the beginning of
1851 # install_prog (especially on Windows NT).
1852 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1853 # Allow the use of GNU shtool's install command.
1854 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
1855 # Aesthetically quote it.
1856 func_quote_for_eval "$nonopt"
1857 install_prog="$func_quote_for_eval_result "
1858 arg=$1
1859 shift
1860 else
1861 install_prog=
1862 arg=$nonopt
1863 fi
1864
1865 # The real first argument should be the name of the installation program.
1866 # Aesthetically quote it.
1867 func_quote_for_eval "$arg"
1868 install_prog="$install_prog$func_quote_for_eval_result"
1869
1870 # We need to accept at least all the BSD install flags.
1871 dest=
1872 files=
1873 opts=
1874 prev=
1875 install_type=
1876 isdir=no
1877 stripme=
1878 for arg
1879 do
1880 if test -n "$dest"; then
1881 files="$files $dest"
1882 dest=$arg
1883 continue
1884 fi
1885
1886 case $arg in
1887 -d) isdir=yes ;;
1888 -f)
1889 case " $install_prog " in
1890 *[\\\ /]cp\ *) ;;
1891 *) prev=$arg ;;
1892 esac
1893 ;;
1894 -g | -m | -o)
1895 prev=$arg
1896 ;;
1897 -s)
1898 stripme=" -s"
1899 continue
1900 ;;
1901 -*)
1902 ;;
1903 *)
1904 # If the previous option needed an argument, then skip it.
1905 if test -n "$prev"; then
1906 prev=
1907 else
1908 dest=$arg
1909 continue
1910 fi
1911 ;;
1912 esac
1913
1914 # Aesthetically quote the argument.
1915 func_quote_for_eval "$arg"
1916 install_prog="$install_prog $func_quote_for_eval_result"
1917 done
1918
1919 test -z "$install_prog" && \
1920 func_fatal_help "you must specify an install program"
1921
1922 test -n "$prev" && \
1923 func_fatal_help "the \`$prev' option requires an argument"
1924
1925 if test -z "$files"; then
1926 if test -z "$dest"; then
1927 func_fatal_help "no file or destination specified"
1928 else
1929 func_fatal_help "you must specify a destination"
1930 fi
1931 fi
1932
1933 # Strip any trailing slash from the destination.
1934 func_stripname '' '/' "$dest"
1935 dest=$func_stripname_result
1936
1937 # Check to see that the destination is a directory.
1938 test -d "$dest" && isdir=yes
1939 if test "$isdir" = yes; then
1940 destdir="$dest"
1941 destname=
1942 else
1943 func_dirname_and_basename "$dest" "" "."
1944 destdir="$func_dirname_result"
1945 destname="$func_basename_result"
1946
1947 # Not a directory, so check to see that there is only one file specified.
1948 set dummy $files; shift
1949 test "$#" -gt 1 && \
1950 func_fatal_help "\`$dest' is not a directory"
1951 fi
1952 case $destdir in
1953 [\\/]* | [A-Za-z]:[\\/]*) ;;
1954 *)
1955 for file in $files; do
1956 case $file in
1957 *.lo) ;;
1958 *)
1959 func_fatal_help "\`$destdir' must be an absolute directory name"
1960 ;;
1961 esac
1962 done
1963 ;;
1964 esac
1965
1966 # This variable tells wrapper scripts just to set variables rather
1967 # than running their programs.
1968 libtool_install_magic="$magic"
1969
1970 staticlibs=
1971 future_libdirs=
1972 current_libdirs=
1973 for file in $files; do
1974
1975 # Do each installation.
1976 case $file in
1977 *.$libext)
1978 # Do the static libraries later.
1979 staticlibs="$staticlibs $file"
1980 ;;
1981
1982 *.la)
1983 # Check to see that this really is a libtool archive.
1984 func_lalib_unsafe_p "$file" \
1985 || func_fatal_help "\`$file' is not a valid libtool archive"
1986
1987 library_names=
1988 old_library=
1989 relink_command=
1990 func_source "$file"
1991
1992 # Add the libdir to current_libdirs if it is the destination.
1993 if test "X$destdir" = "X$libdir"; then
1994 case "$current_libdirs " in
1995 *" $libdir "*) ;;
1996 *) current_libdirs="$current_libdirs $libdir" ;;
1997 esac
1998 else
1999 # Note the libdir as a future libdir.
2000 case "$future_libdirs " in
2001 *" $libdir "*) ;;
2002 *) future_libdirs="$future_libdirs $libdir" ;;
2003 esac
2004 fi
2005
2006 func_dirname "$file" "/" ""
2007 dir="$func_dirname_result"
2008 dir="$dir$objdir"
2009
2010 if test -n "$relink_command"; then
2011 # Determine the prefix the user has applied to our future dir.
2012 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2013
2014 # Don't allow the user to place us outside of our expected
2015 # location b/c this prevents finding dependent libraries that
2016 # are installed to the same prefix.
2017 # At present, this check doesn't affect windows .dll's that
2018 # are installed into $libdir/../bin (currently, that works fine)
2019 # but it's something to keep an eye on.
2020 test "$inst_prefix_dir" = "$destdir" && \
2021 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2022
2023 if test -n "$inst_prefix_dir"; then
2024 # Stick the inst_prefix_dir data into the link command.
2025 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2026 else
2027 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2028 fi
2029
2030 func_warning "relinking \`$file'"
2031 func_show_eval "$relink_command" \
2032 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2033 fi
2034
2035 # See the names of the shared library.
2036 set dummy $library_names; shift
2037 if test -n "$1"; then
2038 realname="$1"
2039 shift
2040
2041 srcname="$realname"
2042 test -n "$relink_command" && srcname="$realname"T
2043
2044 # Install the shared library and build the symlinks.
2045 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2046 'exit $?'
2047 tstripme="$stripme"
2048 case $host_os in
2049 cygwin* | mingw* | pw32* | cegcc*)
2050 case $realname in
2051 *.dll.a)
2052 tstripme=""
2053 ;;
2054 esac
2055 ;;
2056 esac
2057 if test -n "$tstripme" && test -n "$striplib"; then
2058 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2059 fi
2060
2061 if test "$#" -gt 0; then
2062 # Delete the old symlinks, and create new ones.
2063 # Try `ln -sf' first, because the `ln' binary might depend on
2064 # the symlink we replace! Solaris /bin/ln does not understand -f,
2065 # so we also need to try rm && ln -s.
2066 for linkname
2067 do
2068 test "$linkname" != "$realname" \
2069 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2070 done
2071 fi
2072
2073 # Do each command in the postinstall commands.
2074 lib="$destdir/$realname"
2075 func_execute_cmds "$postinstall_cmds" 'exit $?'
2076 fi
2077
2078 # Install the pseudo-library for information purposes.
2079 func_basename "$file"
2080 name="$func_basename_result"
2081 instname="$dir/$name"i
2082 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2083
2084 # Maybe install the static library, too.
2085 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2086 ;;
2087
2088 *.lo)
2089 # Install (i.e. copy) a libtool object.
2090
2091 # Figure out destination file name, if it wasn't already specified.
2092 if test -n "$destname"; then
2093 destfile="$destdir/$destname"
2094 else
2095 func_basename "$file"
2096 destfile="$func_basename_result"
2097 destfile="$destdir/$destfile"
2098 fi
2099
2100 # Deduce the name of the destination old-style object file.
2101 case $destfile in
2102 *.lo)
2103 func_lo2o "$destfile"
2104 staticdest=$func_lo2o_result
2105 ;;
2106 *.$objext)
2107 staticdest="$destfile"
2108 destfile=
2109 ;;
2110 *)
2111 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2112 ;;
2113 esac
2114
2115 # Install the libtool object if requested.
2116 test -n "$destfile" && \
2117 func_show_eval "$install_prog $file $destfile" 'exit $?'
2118
2119 # Install the old object if enabled.
2120 if test "$build_old_libs" = yes; then
2121 # Deduce the name of the old-style object file.
2122 func_lo2o "$file"
2123 staticobj=$func_lo2o_result
2124 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2125 fi
2126 exit $EXIT_SUCCESS
2127 ;;
2128
2129 *)
2130 # Figure out destination file name, if it wasn't already specified.
2131 if test -n "$destname"; then
2132 destfile="$destdir/$destname"
2133 else
2134 func_basename "$file"
2135 destfile="$func_basename_result"
2136 destfile="$destdir/$destfile"
2137 fi
2138
2139 # If the file is missing, and there is a .exe on the end, strip it
2140 # because it is most likely a libtool script we actually want to
2141 # install
2142 stripped_ext=""
2143 case $file in
2144 *.exe)
2145 if test ! -f "$file"; then
2146 func_stripname '' '.exe' "$file"
2147 file=$func_stripname_result
2148 stripped_ext=".exe"
2149 fi
2150 ;;
2151 esac
2152
2153 # Do a test to see if this is really a libtool program.
2154 case $host in
2155 *cygwin* | *mingw*)
2156 if func_ltwrapper_executable_p "$file"; then
2157 func_ltwrapper_scriptname "$file"
2158 wrapper=$func_ltwrapper_scriptname_result
2159 else
2160 func_stripname '' '.exe' "$file"
2161 wrapper=$func_stripname_result
2162 fi
2163 ;;
2164 *)
2165 wrapper=$file
2166 ;;
2167 esac
2168 if func_ltwrapper_script_p "$wrapper"; then
2169 notinst_deplibs=
2170 relink_command=
2171
2172 func_source "$wrapper"
2173
2174 # Check the variables that should have been set.
2175 test -z "$generated_by_libtool_version" && \
2176 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2177
2178 finalize=yes
2179 for lib in $notinst_deplibs; do
2180 # Check to see that each library is installed.
2181 libdir=
2182 if test -f "$lib"; then
2183 func_source "$lib"
2184 fi
2185 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2186 if test -n "$libdir" && test ! -f "$libfile"; then
2187 func_warning "\`$lib' has not been installed in \`$libdir'"
2188 finalize=no
2189 fi
2190 done
2191
2192 relink_command=
2193 func_source "$wrapper"
2194
2195 outputname=
2196 if test "$fast_install" = no && test -n "$relink_command"; then
2197 $opt_dry_run || {
2198 if test "$finalize" = yes; then
2199 tmpdir=`func_mktempdir`
2200 func_basename "$file$stripped_ext"
2201 file="$func_basename_result"
2202 outputname="$tmpdir/$file"
2203 # Replace the output file specification.
2204 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2205
2206 $opt_silent || {
2207 func_quote_for_expand "$relink_command"
2208 eval "func_echo $func_quote_for_expand_result"
2209 }
2210 if eval "$relink_command"; then :
2211 else
2212 func_error "error: relink \`$file' with the above command before installing it"
2213 $opt_dry_run || ${RM}r "$tmpdir"
2214 continue
2215 fi
2216 file="$outputname"
2217 else
2218 func_warning "cannot relink \`$file'"
2219 fi
2220 }
2221 else
2222 # Install the binary that we compiled earlier.
2223 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2224 fi
2225 fi
2226
2227 # remove .exe since cygwin /usr/bin/install will append another
2228 # one anyway
2229 case $install_prog,$host in
2230 */usr/bin/install*,*cygwin*)
2231 case $file:$destfile in
2232 *.exe:*.exe)
2233 # this is ok
2234 ;;
2235 *.exe:*)
2236 destfile=$destfile.exe
2237 ;;
2238 *:*.exe)
2239 func_stripname '' '.exe' "$destfile"
2240 destfile=$func_stripname_result
2241 ;;
2242 esac
2243 ;;
2244 esac
2245 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2246 $opt_dry_run || if test -n "$outputname"; then
2247 ${RM}r "$tmpdir"
2248 fi
2249 ;;
2250 esac
2251 done
2252
2253 for file in $staticlibs; do
2254 func_basename "$file"
2255 name="$func_basename_result"
2256
2257 # Set up the ranlib parameters.
2258 oldlib="$destdir/$name"
2259
2260 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2261
2262 if test -n "$stripme" && test -n "$old_striplib"; then
2263 func_show_eval "$old_striplib $oldlib" 'exit $?'
2264 fi
2265
2266 # Do each command in the postinstall commands.
2267 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2268 done
2269
2270 test -n "$future_libdirs" && \
2271 func_warning "remember to run \`$progname --finish$future_libdirs'"
2272
2273 if test -n "$current_libdirs"; then
2274 # Maybe just do a dry run.
2275 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2276 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2277 else
2278 exit $EXIT_SUCCESS
2279 fi
2280 }
2281
2282 test "$mode" = install && func_mode_install ${1+"$@"}
2283
2284
2285 # func_generate_dlsyms outputname originator pic_p
2286 # Extract symbols from dlprefiles and create ${outputname}S.o with
2287 # a dlpreopen symbol table.
2288 func_generate_dlsyms ()
2289 {
2290 $opt_debug
2291 my_outputname="$1"
2292 my_originator="$2"
2293 my_pic_p="${3-no}"
2294 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2295 my_dlsyms=
2296
2297 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2298 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2299 my_dlsyms="${my_outputname}S.c"
2300 else
2301 func_error "not configured to extract global symbols from dlpreopened files"
2302 fi
2303 fi
2304
2305 if test -n "$my_dlsyms"; then
2306 case $my_dlsyms in
2307 "") ;;
2308 *.c)
2309 # Discover the nlist of each of the dlfiles.
2310 nlist="$output_objdir/${my_outputname}.nm"
2311
2312 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2313
2314 # Parse the name list into a source file.
2315 func_verbose "creating $output_objdir/$my_dlsyms"
2316
2317 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2318 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2319 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2320
2321 #ifdef __cplusplus
2322 extern \"C\" {
2323 #endif
2324
2325 /* External symbol declarations for the compiler. */\
2326 "
2327
2328 if test "$dlself" = yes; then
2329 func_verbose "generating symbol list for \`$output'"
2330
2331 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2332
2333 # Add our own program objects to the symbol list.
2334 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2335 for progfile in $progfiles; do
2336 func_verbose "extracting global C symbols from \`$progfile'"
2337 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2338 done
2339
2340 if test -n "$exclude_expsyms"; then
2341 $opt_dry_run || {
2342 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2343 eval '$MV "$nlist"T "$nlist"'
2344 }
2345 fi
2346
2347 if test -n "$export_symbols_regex"; then
2348 $opt_dry_run || {
2349 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2350 eval '$MV "$nlist"T "$nlist"'
2351 }
2352 fi
2353
2354 # Prepare the list of exported symbols
2355 if test -z "$export_symbols"; then
2356 export_symbols="$output_objdir/$outputname.exp"
2357 $opt_dry_run || {
2358 $RM $export_symbols
2359 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2360 case $host in
2361 *cygwin* | *mingw* | *cegcc* )
2362 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2363 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2364 ;;
2365 esac
2366 }
2367 else
2368 $opt_dry_run || {
2369 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2370 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2371 eval '$MV "$nlist"T "$nlist"'
2372 case $host in
2373 *cygwin | *mingw* | *cegcc* )
2374 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2375 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2376 ;;
2377 esac
2378 }
2379 fi
2380 fi
2381
2382 for dlprefile in $dlprefiles; do
2383 func_verbose "extracting global C symbols from \`$dlprefile'"
2384 func_basename "$dlprefile"
2385 name="$func_basename_result"
2386 $opt_dry_run || {
2387 eval '$ECHO ": $name " >> "$nlist"'
2388 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2389 }
2390 done
2391
2392 $opt_dry_run || {
2393 # Make sure we have at least an empty file.
2394 test -f "$nlist" || : > "$nlist"
2395
2396 if test -n "$exclude_expsyms"; then
2397 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2398 $MV "$nlist"T "$nlist"
2399 fi
2400
2401 # Try sorting and uniquifying the output.
2402 if $GREP -v "^: " < "$nlist" |
2403 if sort -k 3 </dev/null >/dev/null 2>&1; then
2404 sort -k 3
2405 else
2406 sort +2
2407 fi |
2408 uniq > "$nlist"S; then
2409 :
2410 else
2411 $GREP -v "^: " < "$nlist" > "$nlist"S
2412 fi
2413
2414 if test -f "$nlist"S; then
2415 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2416 else
2417 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2418 fi
2419
2420 $ECHO >> "$output_objdir/$my_dlsyms" "\
2421
2422 /* The mapping between symbol names and symbols. */
2423 typedef struct {
2424 const char *name;
2425 void *address;
2426 } lt_dlsymlist;
2427 "
2428 case $host in
2429 *cygwin* | *mingw* | *cegcc* )
2430 $ECHO >> "$output_objdir/$my_dlsyms" "\
2431 /* DATA imports from DLLs on WIN32 con't be const, because
2432 runtime relocations are performed -- see ld's documentation
2433 on pseudo-relocs. */"
2434 lt_dlsym_const= ;;
2435 *osf5*)
2436 echo >> "$output_objdir/$my_dlsyms" "\
2437 /* This system does not cope well with relocations in const data */"
2438 lt_dlsym_const= ;;
2439 *)
2440 lt_dlsym_const=const ;;
2441 esac
2442
2443 $ECHO >> "$output_objdir/$my_dlsyms" "\
2444 extern $lt_dlsym_const lt_dlsymlist
2445 lt_${my_prefix}_LTX_preloaded_symbols[];
2446 $lt_dlsym_const lt_dlsymlist
2447 lt_${my_prefix}_LTX_preloaded_symbols[] =
2448 {\
2449 { \"$my_originator\", (void *) 0 },"
2450
2451 case $need_lib_prefix in
2452 no)
2453 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2454 ;;
2455 *)
2456 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2457 ;;
2458 esac
2459 $ECHO >> "$output_objdir/$my_dlsyms" "\
2460 {0, (void *) 0}
2461 };
2462
2463 /* This works around a problem in FreeBSD linker */
2464 #ifdef FREEBSD_WORKAROUND
2465 static const void *lt_preloaded_setup() {
2466 return lt_${my_prefix}_LTX_preloaded_symbols;
2467 }
2468 #endif
2469
2470 #ifdef __cplusplus
2471 }
2472 #endif\
2473 "
2474 } # !$opt_dry_run
2475
2476 pic_flag_for_symtable=
2477 case "$compile_command " in
2478 *" -static "*) ;;
2479 *)
2480 case $host in
2481 # compiling the symbol table file with pic_flag works around
2482 # a FreeBSD bug that causes programs to crash when -lm is
2483 # linked before any other PIC object. But we must not use
2484 # pic_flag when linking with -static. The problem exists in
2485 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2486 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2487 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2488 *-*-hpux*)
2489 pic_flag_for_symtable=" $pic_flag" ;;
2490 *)
2491 if test "X$my_pic_p" != Xno; then
2492 pic_flag_for_symtable=" $pic_flag"
2493 fi
2494 ;;
2495 esac
2496 ;;
2497 esac
2498 symtab_cflags=
2499 for arg in $LTCFLAGS; do
2500 case $arg in
2501 -pie | -fpie | -fPIE) ;;
2502 *) symtab_cflags="$symtab_cflags $arg" ;;
2503 esac
2504 done
2505
2506 # Now compile the dynamic symbol file.
2507 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2508
2509 # Clean up the generated files.
2510 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2511
2512 # Transform the symbol file into the correct name.
2513 symfileobj="$output_objdir/${my_outputname}S.$objext"
2514 case $host in
2515 *cygwin* | *mingw* | *cegcc* )
2516 if test -f "$output_objdir/$my_outputname.def"; then
2517 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2518 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519 else
2520 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2521 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2522 fi
2523 ;;
2524 *)
2525 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2526 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2527 ;;
2528 esac
2529 ;;
2530 *)
2531 func_fatal_error "unknown suffix for \`$my_dlsyms'"
2532 ;;
2533 esac
2534 else
2535 # We keep going just in case the user didn't refer to
2536 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2537 # really was required.
2538
2539 # Nullify the symbol file.
2540 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2541 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2542 fi
2543 }
2544
2545 # func_win32_libid arg
2546 # return the library type of file 'arg'
2547 #
2548 # Need a lot of goo to handle *both* DLLs and import libs
2549 # Has to be a shell function in order to 'eat' the argument
2550 # that is supplied when $file_magic_command is called.
2551 func_win32_libid ()
2552 {
2553 $opt_debug
2554 win32_libid_type="unknown"
2555 win32_fileres=`file -L $1 2>/dev/null`
2556 case $win32_fileres in
2557 *ar\ archive\ import\ library*) # definitely import
2558 win32_libid_type="x86 archive import"
2559 ;;
2560 *ar\ archive*) # could be an import, or static
2561 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2562 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2563 win32_nmres=`eval $NM -f posix -A $1 |
2564 $SED -n -e '
2565 1,100{
2566 / I /{
2567 s,.*,import,
2568 p
2569 q
2570 }
2571 }'`
2572 case $win32_nmres in
2573 import*) win32_libid_type="x86 archive import";;
2574 *) win32_libid_type="x86 archive static";;
2575 esac
2576 fi
2577 ;;
2578 *DLL*)
2579 win32_libid_type="x86 DLL"
2580 ;;
2581 *executable*) # but shell scripts are "executable" too...
2582 case $win32_fileres in
2583 *MS\ Windows\ PE\ Intel*)
2584 win32_libid_type="x86 DLL"
2585 ;;
2586 esac
2587 ;;
2588 esac
2589 $ECHO "$win32_libid_type"
2590 }
2591
2592
2593
2594 # func_extract_an_archive dir oldlib
2595 func_extract_an_archive ()
2596 {
2597 $opt_debug
2598 f_ex_an_ar_dir="$1"; shift
2599 f_ex_an_ar_oldlib="$1"
2600 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2601 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2602 :
2603 else
2604 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2605 fi
2606 }
2607
2608
2609 # func_extract_archives gentop oldlib ...
2610 func_extract_archives ()
2611 {
2612 $opt_debug
2613 my_gentop="$1"; shift
2614 my_oldlibs=${1+"$@"}
2615 my_oldobjs=""
2616 my_xlib=""
2617 my_xabs=""
2618 my_xdir=""
2619
2620 for my_xlib in $my_oldlibs; do
2621 # Extract the objects.
2622 case $my_xlib in
2623 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
2624 *) my_xabs=`pwd`"/$my_xlib" ;;
2625 esac
2626 func_basename "$my_xlib"
2627 my_xlib="$func_basename_result"
2628 my_xlib_u=$my_xlib
2629 while :; do
2630 case " $extracted_archives " in
2631 *" $my_xlib_u "*)
2632 func_arith $extracted_serial + 1
2633 extracted_serial=$func_arith_result
2634 my_xlib_u=lt$extracted_serial-$my_xlib ;;
2635 *) break ;;
2636 esac
2637 done
2638 extracted_archives="$extracted_archives $my_xlib_u"
2639 my_xdir="$my_gentop/$my_xlib_u"
2640
2641 func_mkdir_p "$my_xdir"
2642
2643 case $host in
2644 *-darwin*)
2645 func_verbose "Extracting $my_xabs"
2646 # Do not bother doing anything if just a dry run
2647 $opt_dry_run || {
2648 darwin_orig_dir=`pwd`
2649 cd $my_xdir || exit $?
2650 darwin_archive=$my_xabs
2651 darwin_curdir=`pwd`
2652 darwin_base_archive=`basename "$darwin_archive"`
2653 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2654 if test -n "$darwin_arches"; then
2655 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2656 darwin_arch=
2657 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2658 for darwin_arch in $darwin_arches ; do
2659 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2660 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2661 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2662 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
2663 cd "$darwin_curdir"
2664 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2665 done # $darwin_arches
2666 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2667 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2668 darwin_file=
2669 darwin_files=
2670 for darwin_file in $darwin_filelist; do
2671 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2672 $LIPO -create -output "$darwin_file" $darwin_files
2673 done # $darwin_filelist
2674 $RM -rf unfat-$$
2675 cd "$darwin_orig_dir"
2676 else
2677 cd $darwin_orig_dir
2678 func_extract_an_archive "$my_xdir" "$my_xabs"
2679 fi # $darwin_arches
2680 } # !$opt_dry_run
2681 ;;
2682 *)
2683 func_extract_an_archive "$my_xdir" "$my_xabs"
2684 ;;
2685 esac
2686 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2687 done
2688
2689 func_extract_archives_result="$my_oldobjs"
2690 }
2691
2692
2693
2694 # func_emit_wrapper_part1 [arg=no]
2695 #
2696 # Emit the first part of a libtool wrapper script on stdout.
2697 # For more information, see the description associated with
2698 # func_emit_wrapper(), below.
2699 func_emit_wrapper_part1 ()
2700 {
2701 func_emit_wrapper_part1_arg1=no
2702 if test -n "$1" ; then
2703 func_emit_wrapper_part1_arg1=$1
2704 fi
2705
2706 $ECHO "\
2707 #! $SHELL
2708
2709 # $output - temporary wrapper script for $objdir/$outputname
2710 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2711 #
2712 # The $output program cannot be directly executed until all the libtool
2713 # libraries that it depends on are installed.
2714 #
2715 # This wrapper script should never be moved out of the build directory.
2716 # If it is, it will not operate correctly.
2717
2718 # Sed substitution that helps us do robust quoting. It backslashifies
2719 # metacharacters that are still active within double-quoted strings.
2720 Xsed='${SED} -e 1s/^X//'
2721 sed_quote_subst='$sed_quote_subst'
2722
2723 # Be Bourne compatible
2724 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2725 emulate sh
2726 NULLCMD=:
2727 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2728 # is contrary to our usage. Disable this feature.
2729 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2730 setopt NO_GLOB_SUBST
2731 else
2732 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2733 fi
2734 BIN_SH=xpg4; export BIN_SH # for Tru64
2735 DUALCASE=1; export DUALCASE # for MKS sh
2736
2737 # The HP-UX ksh and POSIX shell print the target directory to stdout
2738 # if CDPATH is set.
2739 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2740
2741 relink_command=\"$relink_command\"
2742
2743 # This environment variable determines our operation mode.
2744 if test \"\$libtool_install_magic\" = \"$magic\"; then
2745 # install mode needs the following variables:
2746 generated_by_libtool_version='$macro_version'
2747 notinst_deplibs='$notinst_deplibs'
2748 else
2749 # When we are sourced in execute mode, \$file and \$ECHO are already set.
2750 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2751 ECHO=\"$qecho\"
2752 file=\"\$0\"
2753 # Make sure echo works.
2754 if test \"X\$1\" = X--no-reexec; then
2755 # Discard the --no-reexec flag, and continue.
2756 shift
2757 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2758 # Yippee, \$ECHO works!
2759 :
2760 else
2761 # Restart under the correct shell, and then maybe \$ECHO will work.
2762 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2763 fi
2764 fi\
2765 "
2766 $ECHO "\
2767
2768 # Find the directory that this script lives in.
2769 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2770 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2771
2772 # Follow symbolic links until we get to the real thisdir.
2773 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2774 while test -n \"\$file\"; do
2775 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2776
2777 # If there was a directory component, then change thisdir.
2778 if test \"x\$destdir\" != \"x\$file\"; then
2779 case \"\$destdir\" in
2780 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2781 *) thisdir=\"\$thisdir/\$destdir\" ;;
2782 esac
2783 fi
2784
2785 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2786 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2787 done
2788 "
2789 }
2790 # end: func_emit_wrapper_part1
2791
2792 # func_emit_wrapper_part2 [arg=no]
2793 #
2794 # Emit the second part of a libtool wrapper script on stdout.
2795 # For more information, see the description associated with
2796 # func_emit_wrapper(), below.
2797 func_emit_wrapper_part2 ()
2798 {
2799 func_emit_wrapper_part2_arg1=no
2800 if test -n "$1" ; then
2801 func_emit_wrapper_part2_arg1=$1
2802 fi
2803
2804 $ECHO "\
2805
2806 # Usually 'no', except on cygwin/mingw when embedded into
2807 # the cwrapper.
2808 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2809 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2810 # special case for '.'
2811 if test \"\$thisdir\" = \".\"; then
2812 thisdir=\`pwd\`
2813 fi
2814 # remove .libs from thisdir
2815 case \"\$thisdir\" in
2816 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2817 $objdir ) thisdir=. ;;
2818 esac
2819 fi
2820
2821 # Try to get the absolute directory name.
2822 absdir=\`cd \"\$thisdir\" && pwd\`
2823 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2824 "
2825
2826 if test "$fast_install" = yes; then
2827 $ECHO "\
2828 program=lt-'$outputname'$exeext
2829 progdir=\"\$thisdir/$objdir\"
2830
2831 if test ! -f \"\$progdir/\$program\" ||
2832 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2833 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2834
2835 file=\"\$\$-\$program\"
2836
2837 if test ! -d \"\$progdir\"; then
2838 $MKDIR \"\$progdir\"
2839 else
2840 $RM \"\$progdir/\$file\"
2841 fi"
2842
2843 $ECHO "\
2844
2845 # relink executable if necessary
2846 if test -n \"\$relink_command\"; then
2847 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2848 else
2849 $ECHO \"\$relink_command_output\" >&2
2850 $RM \"\$progdir/\$file\"
2851 exit 1
2852 fi
2853 fi
2854
2855 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2856 { $RM \"\$progdir/\$program\";
2857 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2858 $RM \"\$progdir/\$file\"
2859 fi"
2860 else
2861 $ECHO "\
2862 program='$outputname'
2863 progdir=\"\$thisdir/$objdir\"
2864 "
2865 fi
2866
2867 $ECHO "\
2868
2869 if test -f \"\$progdir/\$program\"; then"
2870
2871 # Export our shlibpath_var if we have one.
2872 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2873 $ECHO "\
2874 # Add our own library path to $shlibpath_var
2875 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2876
2877 # Some systems cannot cope with colon-terminated $shlibpath_var
2878 # The second colon is a workaround for a bug in BeOS R4 sed
2879 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2880
2881 export $shlibpath_var
2882 "
2883 fi
2884
2885 # fixup the dll searchpath if we need to.
2886 if test -n "$dllsearchpath"; then
2887 $ECHO "\
2888 # Add the dll search path components to the executable PATH
2889 PATH=$dllsearchpath:\$PATH
2890 "
2891 fi
2892
2893 $ECHO "\
2894 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2895 # Run the actual program with our arguments.
2896 "
2897 case $host in
2898 # Backslashes separate directories on plain windows
2899 *-*-mingw | *-*-os2* | *-cegcc*)
2900 $ECHO "\
2901 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2902 "
2903 ;;
2904
2905 *)
2906 $ECHO "\
2907 exec \"\$progdir/\$program\" \${1+\"\$@\"}
2908 "
2909 ;;
2910 esac
2911 $ECHO "\
2912 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2913 exit 1
2914 fi
2915 else
2916 # The program doesn't exist.
2917 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2918 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2919 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2920 exit 1
2921 fi
2922 fi\
2923 "
2924 }
2925 # end: func_emit_wrapper_part2
2926
2927
2928 # func_emit_wrapper [arg=no]
2929 #
2930 # Emit a libtool wrapper script on stdout.
2931 # Don't directly open a file because we may want to
2932 # incorporate the script contents within a cygwin/mingw
2933 # wrapper executable. Must ONLY be called from within
2934 # func_mode_link because it depends on a number of variables
2935 # set therein.
2936 #
2937 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2938 # variable will take. If 'yes', then the emitted script
2939 # will assume that the directory in which it is stored is
2940 # the $objdir directory. This is a cygwin/mingw-specific
2941 # behavior.
2942 func_emit_wrapper ()
2943 {
2944 func_emit_wrapper_arg1=no
2945 if test -n "$1" ; then
2946 func_emit_wrapper_arg1=$1
2947 fi
2948
2949 # split this up so that func_emit_cwrapperexe_src
2950 # can call each part independently.
2951 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2952 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2953 }
2954
2955
2956 # func_to_host_path arg
2957 #
2958 # Convert paths to host format when used with build tools.
2959 # Intended for use with "native" mingw (where libtool itself
2960 # is running under the msys shell), or in the following cross-
2961 # build environments:
2962 # $build $host
2963 # mingw (msys) mingw [e.g. native]
2964 # cygwin mingw
2965 # *nix + wine mingw
2966 # where wine is equipped with the `winepath' executable.
2967 # In the native mingw case, the (msys) shell automatically
2968 # converts paths for any non-msys applications it launches,
2969 # but that facility isn't available from inside the cwrapper.
2970 # Similar accommodations are necessary for $host mingw and
2971 # $build cygwin. Calling this function does no harm for other
2972 # $host/$build combinations not listed above.
2973 #
2974 # ARG is the path (on $build) that should be converted to
2975 # the proper representation for $host. The result is stored
2976 # in $func_to_host_path_result.
2977 func_to_host_path ()
2978 {
2979 func_to_host_path_result="$1"
2980 if test -n "$1" ; then
2981 case $host in
2982 *mingw* )
2983 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2984 case $build in
2985 *mingw* ) # actually, msys
2986 # awkward: cmd appends spaces to result
2987 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
2988 func_to_host_path_tmp1=`( cmd //c echo "$1" |\
2989 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2990 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2991 $SED -e "$lt_sed_naive_backslashify"`
2992 ;;
2993 *cygwin* )
2994 func_to_host_path_tmp1=`cygpath -w "$1"`
2995 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2996 $SED -e "$lt_sed_naive_backslashify"`
2997 ;;
2998 * )
2999 # Unfortunately, winepath does not exit with a non-zero
3000 # error code, so we are forced to check the contents of
3001 # stdout. On the other hand, if the command is not
3002 # found, the shell will set an exit code of 127 and print
3003 # *an error message* to stdout. So we must check for both
3004 # error code of zero AND non-empty stdout, which explains
3005 # the odd construction:
3006 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3007 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3008 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3009 $SED -e "$lt_sed_naive_backslashify"`
3010 else
3011 # Allow warning below.
3012 func_to_host_path_result=""
3013 fi
3014 ;;
3015 esac
3016 if test -z "$func_to_host_path_result" ; then
3017 func_error "Could not determine host path corresponding to"
3018 func_error " '$1'"
3019 func_error "Continuing, but uninstalled executables may not work."
3020 # Fallback:
3021 func_to_host_path_result="$1"
3022 fi
3023 ;;
3024 esac
3025 fi
3026 }
3027 # end: func_to_host_path
3028
3029 # func_to_host_pathlist arg
3030 #
3031 # Convert pathlists to host format when used with build tools.
3032 # See func_to_host_path(), above. This function supports the
3033 # following $build/$host combinations (but does no harm for
3034 # combinations not listed here):
3035 # $build $host
3036 # mingw (msys) mingw [e.g. native]
3037 # cygwin mingw
3038 # *nix + wine mingw
3039 #
3040 # Path separators are also converted from $build format to
3041 # $host format. If ARG begins or ends with a path separator
3042 # character, it is preserved (but converted to $host format)
3043 # on output.
3044 #
3045 # ARG is a pathlist (on $build) that should be converted to
3046 # the proper representation on $host. The result is stored
3047 # in $func_to_host_pathlist_result.
3048 func_to_host_pathlist ()
3049 {
3050 func_to_host_pathlist_result="$1"
3051 if test -n "$1" ; then
3052 case $host in
3053 *mingw* )
3054 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3055 # Remove leading and trailing path separator characters from
3056 # ARG. msys behavior is inconsistent here, cygpath turns them
3057 # into '.;' and ';.', and winepath ignores them completely.
3058 func_to_host_pathlist_tmp2="$1"
3059 # Once set for this call, this variable should not be
3060 # reassigned. It is used in tha fallback case.
3061 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3062 $SED -e 's|^:*||' -e 's|:*$||'`
3063 case $build in
3064 *mingw* ) # Actually, msys.
3065 # Awkward: cmd appends spaces to result.
3066 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3067 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3068 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3069 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3070 $SED -e "$lt_sed_naive_backslashify"`
3071 ;;
3072 *cygwin* )
3073 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3074 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3075 $SED -e "$lt_sed_naive_backslashify"`
3076 ;;
3077 * )
3078 # unfortunately, winepath doesn't convert pathlists
3079 func_to_host_pathlist_result=""
3080 func_to_host_pathlist_oldIFS=$IFS
3081 IFS=:
3082 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3083 IFS=$func_to_host_pathlist_oldIFS
3084 if test -n "$func_to_host_pathlist_f" ; then
3085 func_to_host_path "$func_to_host_pathlist_f"
3086 if test -n "$func_to_host_path_result" ; then
3087 if test -z "$func_to_host_pathlist_result" ; then
3088 func_to_host_pathlist_result="$func_to_host_path_result"
3089 else
3090 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3091 fi
3092 fi
3093 fi
3094 IFS=:
3095 done
3096 IFS=$func_to_host_pathlist_oldIFS
3097 ;;
3098 esac
3099 if test -z "$func_to_host_pathlist_result" ; then
3100 func_error "Could not determine the host path(s) corresponding to"
3101 func_error " '$1'"
3102 func_error "Continuing, but uninstalled executables may not work."
3103 # Fallback. This may break if $1 contains DOS-style drive
3104 # specifications. The fix is not to complicate the expression
3105 # below, but for the user to provide a working wine installation
3106 # with winepath so that path translation in the cross-to-mingw
3107 # case works properly.
3108 lt_replace_pathsep_nix_to_dos="s|:|;|g"
3109 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3110 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3111 fi
3112 # Now, add the leading and trailing path separators back
3113 case "$1" in
3114 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3115 ;;
3116 esac
3117 case "$1" in
3118 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3119 ;;
3120 esac
3121 ;;
3122 esac
3123 fi
3124 }
3125 # end: func_to_host_pathlist
3126
3127 # func_emit_cwrapperexe_src
3128 # emit the source code for a wrapper executable on stdout
3129 # Must ONLY be called from within func_mode_link because
3130 # it depends on a number of variable set therein.
3131 func_emit_cwrapperexe_src ()
3132 {
3133 cat <<EOF
3134
3135 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3136 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3137
3138 The $output program cannot be directly executed until all the libtool
3139 libraries that it depends on are installed.
3140
3141 This wrapper executable should never be moved out of the build directory.
3142 If it is, it will not operate correctly.
3143
3144 Currently, it simply execs the wrapper *script* "$SHELL $output",
3145 but could eventually absorb all of the scripts functionality and
3146 exec $objdir/$outputname directly.
3147 */
3148 EOF
3149 cat <<"EOF"
3150 #include <stdio.h>
3151 #include <stdlib.h>
3152 #ifdef _MSC_VER
3153 # include <direct.h>
3154 # include <process.h>
3155 # include <io.h>
3156 # define setmode _setmode
3157 #else
3158 # include <unistd.h>
3159 # include <stdint.h>
3160 # ifdef __CYGWIN__
3161 # include <io.h>
3162 # define HAVE_SETENV
3163 # ifdef __STRICT_ANSI__
3164 char *realpath (const char *, char *);
3165 int putenv (char *);
3166 int setenv (const char *, const char *, int);
3167 # endif
3168 # endif
3169 #endif
3170 #include <malloc.h>
3171 #include <stdarg.h>
3172 #include <assert.h>
3173 #include <string.h>
3174 #include <ctype.h>
3175 #include <errno.h>
3176 #include <fcntl.h>
3177 #include <sys/stat.h>
3178
3179 #if defined(PATH_MAX)
3180 # define LT_PATHMAX PATH_MAX
3181 #elif defined(MAXPATHLEN)
3182 # define LT_PATHMAX MAXPATHLEN
3183 #else
3184 # define LT_PATHMAX 1024
3185 #endif
3186
3187 #ifndef S_IXOTH
3188 # define S_IXOTH 0
3189 #endif
3190 #ifndef S_IXGRP
3191 # define S_IXGRP 0
3192 #endif
3193
3194 #ifdef _MSC_VER
3195 # define S_IXUSR _S_IEXEC
3196 # define stat _stat
3197 # ifndef _INTPTR_T_DEFINED
3198 # define intptr_t int
3199 # endif
3200 #endif
3201
3202 #ifndef DIR_SEPARATOR
3203 # define DIR_SEPARATOR '/'
3204 # define PATH_SEPARATOR ':'
3205 #endif
3206
3207 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3208 defined (__OS2__)
3209 # define HAVE_DOS_BASED_FILE_SYSTEM
3210 # define FOPEN_WB "wb"
3211 # ifndef DIR_SEPARATOR_2
3212 # define DIR_SEPARATOR_2 '\\'
3213 # endif
3214 # ifndef PATH_SEPARATOR_2
3215 # define PATH_SEPARATOR_2 ';'
3216 # endif
3217 #endif
3218
3219 #ifndef DIR_SEPARATOR_2
3220 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3221 #else /* DIR_SEPARATOR_2 */
3222 # define IS_DIR_SEPARATOR(ch) \
3223 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3224 #endif /* DIR_SEPARATOR_2 */
3225
3226 #ifndef PATH_SEPARATOR_2
3227 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3228 #else /* PATH_SEPARATOR_2 */
3229 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3230 #endif /* PATH_SEPARATOR_2 */
3231
3232 #ifdef __CYGWIN__
3233 # define FOPEN_WB "wb"
3234 #endif
3235
3236 #ifndef FOPEN_WB
3237 # define FOPEN_WB "w"
3238 #endif
3239 #ifndef _O_BINARY
3240 # define _O_BINARY 0
3241 #endif
3242
3243 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3244 #define XFREE(stale) do { \
3245 if (stale) { free ((void *) stale); stale = 0; } \
3246 } while (0)
3247
3248 #undef LTWRAPPER_DEBUGPRINTF
3249 #if defined DEBUGWRAPPER
3250 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3251 static void
3252 ltwrapper_debugprintf (const char *fmt, ...)
3253 {
3254 va_list args;
3255 va_start (args, fmt);
3256 (void) vfprintf (stderr, fmt, args);
3257 va_end (args);
3258 }
3259 #else
3260 # define LTWRAPPER_DEBUGPRINTF(args)
3261 #endif
3262
3263 const char *program_name = NULL;
3264
3265 void *xmalloc (size_t num);
3266 char *xstrdup (const char *string);
3267 const char *base_name (const char *name);
3268 char *find_executable (const char *wrapper);
3269 char *chase_symlinks (const char *pathspec);
3270 int make_executable (const char *path);
3271 int check_executable (const char *path);
3272 char *strendzap (char *str, const char *pat);
3273 void lt_fatal (const char *message, ...);
3274 void lt_setenv (const char *name, const char *value);
3275 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3276 void lt_opt_process_env_set (const char *arg);
3277 void lt_opt_process_env_prepend (const char *arg);
3278 void lt_opt_process_env_append (const char *arg);
3279 int lt_split_name_value (const char *arg, char** name, char** value);
3280 void lt_update_exe_path (const char *name, const char *value);
3281 void lt_update_lib_path (const char *name, const char *value);
3282
3283 static const char *script_text_part1 =
3284 EOF
3285
3286 func_emit_wrapper_part1 yes |
3287 $SED -e 's/\([\\"]\)/\\\1/g' \
3288 -e 's/^/ "/' -e 's/$/\\n"/'
3289 echo ";"
3290 cat <<EOF
3291
3292 static const char *script_text_part2 =
3293 EOF
3294 func_emit_wrapper_part2 yes |
3295 $SED -e 's/\([\\"]\)/\\\1/g' \
3296 -e 's/^/ "/' -e 's/$/\\n"/'
3297 echo ";"
3298
3299 cat <<EOF
3300 const char * MAGIC_EXE = "$magic_exe";
3301 const char * LIB_PATH_VARNAME = "$shlibpath_var";
3302 EOF
3303
3304 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3305 func_to_host_pathlist "$temp_rpath"
3306 cat <<EOF
3307 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3308 EOF
3309 else
3310 cat <<"EOF"
3311 const char * LIB_PATH_VALUE = "";
3312 EOF
3313 fi
3314
3315 if test -n "$dllsearchpath"; then
3316 func_to_host_pathlist "$dllsearchpath:"
3317 cat <<EOF
3318 const char * EXE_PATH_VARNAME = "PATH";
3319 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3320 EOF
3321 else
3322 cat <<"EOF"
3323 const char * EXE_PATH_VARNAME = "";
3324 const char * EXE_PATH_VALUE = "";
3325 EOF
3326 fi
3327
3328 if test "$fast_install" = yes; then
3329 cat <<EOF
3330 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3331 EOF
3332 else
3333 cat <<EOF
3334 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3335 EOF
3336 fi
3337
3338
3339 cat <<"EOF"
3340
3341 #define LTWRAPPER_OPTION_PREFIX "--lt-"
3342 #define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3343
3344 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3345 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3346
3347 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3348
3349 static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3350 static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3351 /* argument is putenv-style "foo=bar", value of foo is set to bar */
3352
3353 static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3354 static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3355 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3356
3357 static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3358 static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3359 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3360
3361 int
3362 main (int argc, char *argv[])
3363 {
3364 char **newargz;
3365 int newargc;
3366 char *tmp_pathspec;
3367 char *actual_cwrapper_path;
3368 char *actual_cwrapper_name;
3369 char *target_name;
3370 char *lt_argv_zero;
3371 intptr_t rval = 127;
3372
3373 int i;
3374
3375 program_name = (char *) xstrdup (base_name (argv[0]));
3376 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3377 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3378
3379 /* very simple arg parsing; don't want to rely on getopt */
3380 for (i = 1; i < argc; i++)
3381 {
3382 if (strcmp (argv[i], dumpscript_opt) == 0)
3383 {
3384 EOF
3385 case "$host" in
3386 *mingw* | *cygwin* )
3387 # make stdout use "unix" line endings
3388 echo " setmode(1,_O_BINARY);"
3389 ;;
3390 esac
3391
3392 cat <<"EOF"
3393 printf ("%s", script_text_part1);
3394 printf ("%s", script_text_part2);
3395 return 0;
3396 }
3397 }
3398
3399 newargz = XMALLOC (char *, argc + 1);
3400 tmp_pathspec = find_executable (argv[0]);
3401 if (tmp_pathspec == NULL)
3402 lt_fatal ("Couldn't find %s", argv[0]);
3403 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3404 tmp_pathspec));
3405
3406 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3407 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3408 actual_cwrapper_path));
3409 XFREE (tmp_pathspec);
3410
3411 actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3412 strendzap (actual_cwrapper_path, actual_cwrapper_name);
3413
3414 /* wrapper name transforms */
3415 strendzap (actual_cwrapper_name, ".exe");
3416 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3417 XFREE (actual_cwrapper_name);
3418 actual_cwrapper_name = tmp_pathspec;
3419 tmp_pathspec = 0;
3420
3421 /* target_name transforms -- use actual target program name; might have lt- prefix */
3422 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3423 strendzap (target_name, ".exe");
3424 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3425 XFREE (target_name);
3426 target_name = tmp_pathspec;
3427 tmp_pathspec = 0;
3428
3429 LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3430 target_name));
3431 EOF
3432
3433 cat <<EOF
3434 newargz[0] =
3435 XMALLOC (char, (strlen (actual_cwrapper_path) +
3436 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3437 strcpy (newargz[0], actual_cwrapper_path);
3438 strcat (newargz[0], "$objdir");
3439 strcat (newargz[0], "/");
3440 EOF
3441
3442 cat <<"EOF"
3443 /* stop here, and copy so we don't have to do this twice */
3444 tmp_pathspec = xstrdup (newargz[0]);
3445
3446 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3447 strcat (newargz[0], actual_cwrapper_name);
3448
3449 /* DO want the lt- prefix here if it exists, so use target_name */
3450 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3451 XFREE (tmp_pathspec);
3452 tmp_pathspec = NULL;
3453 EOF
3454
3455 case $host_os in
3456 mingw*)
3457 cat <<"EOF"
3458 {
3459 char* p;
3460 while ((p = strchr (newargz[0], '\\')) != NULL)
3461 {
3462 *p = '/';
3463 }
3464 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3465 {
3466 *p = '/';
3467 }
3468 }
3469 EOF
3470 ;;
3471 esac
3472
3473 cat <<"EOF"
3474 XFREE (target_name);
3475 XFREE (actual_cwrapper_path);
3476 XFREE (actual_cwrapper_name);
3477
3478 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3479 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3480 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3481 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3482
3483 newargc=0;
3484 for (i = 1; i < argc; i++)
3485 {
3486 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3487 {
3488 if (argv[i][env_set_opt_len] == '=')
3489 {
3490 const char *p = argv[i] + env_set_opt_len + 1;
3491 lt_opt_process_env_set (p);
3492 }
3493 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3494 {
3495 lt_opt_process_env_set (argv[++i]); /* don't copy */
3496 }
3497 else
3498 lt_fatal ("%s missing required argument", env_set_opt);
3499 continue;
3500 }
3501 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3502 {
3503 if (argv[i][env_prepend_opt_len] == '=')
3504 {
3505 const char *p = argv[i] + env_prepend_opt_len + 1;
3506 lt_opt_process_env_prepend (p);
3507 }
3508 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3509 {
3510 lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3511 }
3512 else
3513 lt_fatal ("%s missing required argument", env_prepend_opt);
3514 continue;
3515 }
3516 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3517 {
3518 if (argv[i][env_append_opt_len] == '=')
3519 {
3520 const char *p = argv[i] + env_append_opt_len + 1;
3521 lt_opt_process_env_append (p);
3522 }
3523 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3524 {
3525 lt_opt_process_env_append (argv[++i]); /* don't copy */
3526 }
3527 else
3528 lt_fatal ("%s missing required argument", env_append_opt);
3529 continue;
3530 }
3531 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3532 {
3533 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3534 namespace, but it is not one of the ones we know about and
3535 have already dealt with, above (inluding dump-script), then
3536 report an error. Otherwise, targets might begin to believe
3537 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3538 namespace. The first time any user complains about this, we'll
3539 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3540 or a configure.ac-settable value.
3541 */
3542 lt_fatal ("Unrecognized option in %s namespace: '%s'",
3543 ltwrapper_option_prefix, argv[i]);
3544 }
3545 /* otherwise ... */
3546 newargz[++newargc] = xstrdup (argv[i]);
3547 }
3548 newargz[++newargc] = NULL;
3549
3550 LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3551 for (i = 0; i < newargc; i++)
3552 {
3553 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3554 }
3555
3556 EOF
3557
3558 case $host_os in
3559 mingw*)
3560 cat <<"EOF"
3561 /* execv doesn't actually work on mingw as expected on unix */
3562 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3563 if (rval == -1)
3564 {
3565 /* failed to start process */
3566 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3567 return 127;
3568 }
3569 return rval;
3570 EOF
3571 ;;
3572 *)
3573 cat <<"EOF"
3574 execv (lt_argv_zero, newargz);
3575 return rval; /* =127, but avoids unused variable warning */
3576 EOF
3577 ;;
3578 esac
3579
3580 cat <<"EOF"
3581 }
3582
3583 void *
3584 xmalloc (size_t num)
3585 {
3586 void *p = (void *) malloc (num);
3587 if (!p)
3588 lt_fatal ("Memory exhausted");
3589
3590 return p;
3591 }
3592
3593 char *
3594 xstrdup (const char *string)
3595 {
3596 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3597 string) : NULL;
3598 }
3599
3600 const char *
3601 base_name (const char *name)
3602 {
3603 const char *base;
3604
3605 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3606 /* Skip over the disk name in MSDOS pathnames. */
3607 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3608 name += 2;
3609 #endif
3610
3611 for (base = name; *name; name++)
3612 if (IS_DIR_SEPARATOR (*name))
3613 base = name + 1;
3614 return base;
3615 }
3616
3617 int
3618 check_executable (const char *path)
3619 {
3620 struct stat st;
3621
3622 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3623 path ? (*path ? path : "EMPTY!") : "NULL!"));
3624 if ((!path) || (!*path))
3625 return 0;
3626
3627 if ((stat (path, &st) >= 0)
3628 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3629 return 1;
3630 else
3631 return 0;
3632 }
3633
3634 int
3635 make_executable (const char *path)
3636 {
3637 int rval = 0;
3638 struct stat st;
3639
3640 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3641 path ? (*path ? path : "EMPTY!") : "NULL!"));
3642 if ((!path) || (!*path))
3643 return 0;
3644
3645 if (stat (path, &st) >= 0)
3646 {
3647 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3648 }
3649 return rval;
3650 }
3651
3652 /* Searches for the full path of the wrapper. Returns
3653 newly allocated full path name if found, NULL otherwise
3654 Does not chase symlinks, even on platforms that support them.
3655 */
3656 char *
3657 find_executable (const char *wrapper)
3658 {
3659 int has_slash = 0;
3660 const char *p;
3661 const char *p_next;
3662 /* static buffer for getcwd */
3663 char tmp[LT_PATHMAX + 1];
3664 int tmp_len;
3665 char *concat_name;
3666
3667 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3668 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3669
3670 if ((wrapper == NULL) || (*wrapper == '\0'))
3671 return NULL;
3672
3673 /* Absolute path? */
3674 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3675 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3676 {
3677 concat_name = xstrdup (wrapper);
3678 if (check_executable (concat_name))
3679 return concat_name;
3680 XFREE (concat_name);
3681 }
3682 else
3683 {
3684 #endif
3685 if (IS_DIR_SEPARATOR (wrapper[0]))
3686 {
3687 concat_name = xstrdup (wrapper);
3688 if (check_executable (concat_name))
3689 return concat_name;
3690 XFREE (concat_name);
3691 }
3692 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3693 }
3694 #endif
3695
3696 for (p = wrapper; *p; p++)
3697 if (*p == '/')
3698 {
3699 has_slash = 1;
3700 break;
3701 }
3702 if (!has_slash)
3703 {
3704 /* no slashes; search PATH */
3705 const char *path = getenv ("PATH");
3706 if (path != NULL)
3707 {
3708 for (p = path; *p; p = p_next)
3709 {
3710 const char *q;
3711 size_t p_len;
3712 for (q = p; *q; q++)
3713 if (IS_PATH_SEPARATOR (*q))
3714 break;
3715 p_len = q - p;
3716 p_next = (*q == '\0' ? q : q + 1);
3717 if (p_len == 0)
3718 {
3719 /* empty path: current directory */
3720 if (getcwd (tmp, LT_PATHMAX) == NULL)
3721 lt_fatal ("getcwd failed");
3722 tmp_len = strlen (tmp);
3723 concat_name =
3724 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3725 memcpy (concat_name, tmp, tmp_len);
3726 concat_name[tmp_len] = '/';
3727 strcpy (concat_name + tmp_len + 1, wrapper);
3728 }
3729 else
3730 {
3731 concat_name =
3732 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3733 memcpy (concat_name, p, p_len);
3734 concat_name[p_len] = '/';
3735 strcpy (concat_name + p_len + 1, wrapper);
3736 }
3737 if (check_executable (concat_name))
3738 return concat_name;
3739 XFREE (concat_name);
3740 }
3741 }
3742 /* not found in PATH; assume curdir */
3743 }
3744 /* Relative path | not found in path: prepend cwd */
3745 if (getcwd (tmp, LT_PATHMAX) == NULL)
3746 lt_fatal ("getcwd failed");
3747 tmp_len = strlen (tmp);
3748 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3749 memcpy (concat_name, tmp, tmp_len);
3750 concat_name[tmp_len] = '/';
3751 strcpy (concat_name + tmp_len + 1, wrapper);
3752
3753 if (check_executable (concat_name))
3754 return concat_name;
3755 XFREE (concat_name);
3756 return NULL;
3757 }
3758
3759 char *
3760 chase_symlinks (const char *pathspec)
3761 {
3762 #ifndef S_ISLNK
3763 return xstrdup (pathspec);
3764 #else
3765 char buf[LT_PATHMAX];
3766 struct stat s;
3767 char *tmp_pathspec = xstrdup (pathspec);
3768 char *p;
3769 int has_symlinks = 0;
3770 while (strlen (tmp_pathspec) && !has_symlinks)
3771 {
3772 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3773 tmp_pathspec));
3774 if (lstat (tmp_pathspec, &s) == 0)
3775 {
3776 if (S_ISLNK (s.st_mode) != 0)
3777 {
3778 has_symlinks = 1;
3779 break;
3780 }
3781
3782 /* search backwards for last DIR_SEPARATOR */
3783 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3784 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3785 p--;
3786 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3787 {
3788 /* no more DIR_SEPARATORS left */
3789 break;
3790 }
3791 *p = '\0';
3792 }
3793 else
3794 {
3795 char *errstr = strerror (errno);
3796 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3797 }
3798 }
3799 XFREE (tmp_pathspec);
3800
3801 if (!has_symlinks)
3802 {
3803 return xstrdup (pathspec);
3804 }
3805
3806 tmp_pathspec = realpath (pathspec, buf);
3807 if (tmp_pathspec == 0)
3808 {
3809 lt_fatal ("Could not follow symlinks for %s", pathspec);
3810 }
3811 return xstrdup (tmp_pathspec);
3812 #endif
3813 }
3814
3815 char *
3816 strendzap (char *str, const char *pat)
3817 {
3818 size_t len, patlen;
3819
3820 assert (str != NULL);
3821 assert (pat != NULL);
3822
3823 len = strlen (str);
3824 patlen = strlen (pat);
3825
3826 if (patlen <= len)
3827 {
3828 str += len - patlen;
3829 if (strcmp (str, pat) == 0)
3830 *str = '\0';
3831 }
3832 return str;
3833 }
3834
3835 static void
3836 lt_error_core (int exit_status, const char *mode,
3837 const char *message, va_list ap)
3838 {
3839 fprintf (stderr, "%s: %s: ", program_name, mode);
3840 vfprintf (stderr, message, ap);
3841 fprintf (stderr, ".\n");
3842
3843 if (exit_status >= 0)
3844 exit (exit_status);
3845 }
3846
3847 void
3848 lt_fatal (const char *message, ...)
3849 {
3850 va_list ap;
3851 va_start (ap, message);
3852 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3853 va_end (ap);
3854 }
3855
3856 void
3857 lt_setenv (const char *name, const char *value)
3858 {
3859 LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3860 (name ? name : "<NULL>"),
3861 (value ? value : "<NULL>")));
3862 {
3863 #ifdef HAVE_SETENV
3864 /* always make a copy, for consistency with !HAVE_SETENV */
3865 char *str = xstrdup (value);
3866 setenv (name, str, 1);
3867 #else
3868 int len = strlen (name) + 1 + strlen (value) + 1;
3869 char *str = XMALLOC (char, len);
3870 sprintf (str, "%s=%s", name, value);
3871 if (putenv (str) != EXIT_SUCCESS)
3872 {
3873 XFREE (str);
3874 }
3875 #endif
3876 }
3877 }
3878
3879 char *
3880 lt_extend_str (const char *orig_value, const char *add, int to_end)
3881 {
3882 char *new_value;
3883 if (orig_value && *orig_value)
3884 {
3885 int orig_value_len = strlen (orig_value);
3886 int add_len = strlen (add);
3887 new_value = XMALLOC (char, add_len + orig_value_len + 1);
3888 if (to_end)
3889 {
3890 strcpy (new_value, orig_value);
3891 strcpy (new_value + orig_value_len, add);
3892 }
3893 else
3894 {
3895 strcpy (new_value, add);
3896 strcpy (new_value + add_len, orig_value);
3897 }
3898 }
3899 else
3900 {
3901 new_value = xstrdup (add);
3902 }
3903 return new_value;
3904 }
3905
3906 int
3907 lt_split_name_value (const char *arg, char** name, char** value)
3908 {
3909 const char *p;
3910 int len;
3911 if (!arg || !*arg)
3912 return 1;
3913
3914 p = strchr (arg, (int)'=');
3915
3916 if (!p)
3917 return 1;
3918
3919 *value = xstrdup (++p);
3920
3921 len = strlen (arg) - strlen (*value);
3922 *name = XMALLOC (char, len);
3923 strncpy (*name, arg, len-1);
3924 (*name)[len - 1] = '\0';
3925
3926 return 0;
3927 }
3928
3929 void
3930 lt_opt_process_env_set (const char *arg)
3931 {
3932 char *name = NULL;
3933 char *value = NULL;
3934
3935 if (lt_split_name_value (arg, &name, &value) != 0)
3936 {
3937 XFREE (name);
3938 XFREE (value);
3939 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3940 }
3941
3942 lt_setenv (name, value);
3943 XFREE (name);
3944 XFREE (value);
3945 }
3946
3947 void
3948 lt_opt_process_env_prepend (const char *arg)
3949 {
3950 char *name = NULL;
3951 char *value = NULL;
3952 char *new_value = NULL;
3953
3954 if (lt_split_name_value (arg, &name, &value) != 0)
3955 {
3956 XFREE (name);
3957 XFREE (value);
3958 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3959 }
3960
3961 new_value = lt_extend_str (getenv (name), value, 0);
3962 lt_setenv (name, new_value);
3963 XFREE (new_value);
3964 XFREE (name);
3965 XFREE (value);
3966 }
3967
3968 void
3969 lt_opt_process_env_append (const char *arg)
3970 {
3971 char *name = NULL;
3972 char *value = NULL;
3973 char *new_value = NULL;
3974
3975 if (lt_split_name_value (arg, &name, &value) != 0)
3976 {
3977 XFREE (name);
3978 XFREE (value);
3979 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3980 }
3981
3982 new_value = lt_extend_str (getenv (name), value, 1);
3983 lt_setenv (name, new_value);
3984 XFREE (new_value);
3985 XFREE (name);
3986 XFREE (value);
3987 }
3988
3989 void
3990 lt_update_exe_path (const char *name, const char *value)
3991 {
3992 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3993 (name ? name : "<NULL>"),
3994 (value ? value : "<NULL>")));
3995
3996 if (name && *name && value && *value)
3997 {
3998 char *new_value = lt_extend_str (getenv (name), value, 0);
3999 /* some systems can't cope with a ':'-terminated path #' */
4000 int len = strlen (new_value);
4001 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4002 {
4003 new_value[len-1] = '\0';
4004 }
4005 lt_setenv (name, new_value);
4006 XFREE (new_value);
4007 }
4008 }
4009
4010 void
4011 lt_update_lib_path (const char *name, const char *value)
4012 {
4013 LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4014 (name ? name : "<NULL>"),
4015 (value ? value : "<NULL>")));
4016
4017 if (name && *name && value && *value)
4018 {
4019 char *new_value = lt_extend_str (getenv (name), value, 0);
4020 lt_setenv (name, new_value);
4021 XFREE (new_value);
4022 }
4023 }
4024
4025
4026 EOF
4027 }
4028 # end: func_emit_cwrapperexe_src
4029
4030 # func_mode_link arg...
4031 func_mode_link ()
4032 {
4033 $opt_debug
4034 case $host in
4035 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4036 # It is impossible to link a dll without this setting, and
4037 # we shouldn't force the makefile maintainer to figure out
4038 # which system we are compiling for in order to pass an extra
4039 # flag for every libtool invocation.
4040 # allow_undefined=no
4041
4042 # FIXME: Unfortunately, there are problems with the above when trying
4043 # to make a dll which has undefined symbols, in which case not
4044 # even a static library is built. For now, we need to specify
4045 # -no-undefined on the libtool link line when we can be certain
4046 # that all symbols are satisfied, otherwise we get a static library.
4047 allow_undefined=yes
4048 ;;
4049 *)
4050 allow_undefined=yes
4051 ;;
4052 esac
4053 libtool_args=$nonopt
4054 base_compile="$nonopt $@"
4055 compile_command=$nonopt
4056 finalize_command=$nonopt
4057
4058 compile_rpath=
4059 finalize_rpath=
4060 compile_shlibpath=
4061 finalize_shlibpath=
4062 convenience=
4063 old_convenience=
4064 deplibs=
4065 old_deplibs=
4066 compiler_flags=
4067 linker_flags=
4068 dllsearchpath=
4069 lib_search_path=`pwd`
4070 inst_prefix_dir=
4071 new_inherited_linker_flags=
4072
4073 avoid_version=no
4074 dlfiles=
4075 dlprefiles=
4076 dlself=no
4077 export_dynamic=no
4078 export_symbols=
4079 export_symbols_regex=
4080 generated=
4081 libobjs=
4082 ltlibs=
4083 module=no
4084 no_install=no
4085 objs=
4086 non_pic_objects=
4087 precious_files_regex=
4088 prefer_static_libs=no
4089 preload=no
4090 prev=
4091 prevarg=
4092 release=
4093 rpath=
4094 xrpath=
4095 perm_rpath=
4096 temp_rpath=
4097 thread_safe=no
4098 vinfo=
4099 vinfo_number=no
4100 weak_libs=
4101 single_module="${wl}-single_module"
4102 func_infer_tag $base_compile
4103
4104 # We need to know -static, to get the right output filenames.
4105 for arg
4106 do
4107 case $arg in
4108 -shared)
4109 test "$build_libtool_libs" != yes && \
4110 func_fatal_configuration "can not build a shared library"
4111 build_old_libs=no
4112 break
4113 ;;
4114 -all-static | -static | -static-libtool-libs)
4115 case $arg in
4116 -all-static)
4117 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4118 func_warning "complete static linking is impossible in this configuration"
4119 fi
4120 if test -n "$link_static_flag"; then
4121 dlopen_self=$dlopen_self_static
4122 fi
4123 prefer_static_libs=yes
4124 ;;
4125 -static)
4126 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4127 dlopen_self=$dlopen_self_static
4128 fi
4129 prefer_static_libs=built
4130 ;;
4131 -static-libtool-libs)
4132 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4133 dlopen_self=$dlopen_self_static
4134 fi
4135 prefer_static_libs=yes
4136 ;;
4137 esac
4138 build_libtool_libs=no
4139 build_old_libs=yes
4140 break
4141 ;;
4142 esac
4143 done
4144
4145 # See if our shared archives depend on static archives.
4146 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4147
4148 # Go through the arguments, transforming them on the way.
4149 while test "$#" -gt 0; do
4150 arg="$1"
4151 shift
4152 func_quote_for_eval "$arg"
4153 qarg=$func_quote_for_eval_unquoted_result
4154 func_append libtool_args " $func_quote_for_eval_result"
4155
4156 # If the previous option needs an argument, assign it.
4157 if test -n "$prev"; then
4158 case $prev in
4159 output)
4160 func_append compile_command " @OUTPUT@"
4161 func_append finalize_command " @OUTPUT@"
4162 ;;
4163 esac
4164
4165 case $prev in
4166 dlfiles|dlprefiles)
4167 if test "$preload" = no; then
4168 # Add the symbol object into the linking commands.
4169 func_append compile_command " @SYMFILE@"
4170 func_append finalize_command " @SYMFILE@"
4171 preload=yes
4172 fi
4173 case $arg in
4174 *.la | *.lo) ;; # We handle these cases below.
4175 force)
4176 if test "$dlself" = no; then
4177 dlself=needless
4178 export_dynamic=yes
4179 fi
4180 prev=
4181 continue
4182 ;;
4183 self)
4184 if test "$prev" = dlprefiles; then
4185 dlself=yes
4186 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4187 dlself=yes
4188 else
4189 dlself=needless
4190 export_dynamic=yes
4191 fi
4192 prev=
4193 continue
4194 ;;
4195 *)
4196 if test "$prev" = dlfiles; then
4197 dlfiles="$dlfiles $arg"
4198 else
4199 dlprefiles="$dlprefiles $arg"
4200 fi
4201 prev=
4202 continue
4203 ;;
4204 esac
4205 ;;
4206 expsyms)
4207 export_symbols="$arg"
4208 test -f "$arg" \
4209 || func_fatal_error "symbol file \`$arg' does not exist"
4210 prev=
4211 continue
4212 ;;
4213 expsyms_regex)
4214 export_symbols_regex="$arg"
4215 prev=
4216 continue
4217 ;;
4218 framework)
4219 case $host in
4220 *-*-darwin*)
4221 case "$deplibs " in
4222 *" $qarg.ltframework "*) ;;
4223 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4224 ;;
4225 esac
4226 ;;
4227 esac
4228 prev=
4229 continue
4230 ;;
4231 inst_prefix)
4232 inst_prefix_dir="$arg"
4233 prev=
4234 continue
4235 ;;
4236 objectlist)
4237 if test -f "$arg"; then
4238 save_arg=$arg
4239 moreargs=
4240 for fil in `cat "$save_arg"`
4241 do
4242 # moreargs="$moreargs $fil"
4243 arg=$fil
4244 # A libtool-controlled object.
4245
4246 # Check to see that this really is a libtool object.
4247 if func_lalib_unsafe_p "$arg"; then
4248 pic_object=
4249 non_pic_object=
4250
4251 # Read the .lo file
4252 func_source "$arg"
4253
4254 if test -z "$pic_object" ||
4255 test -z "$non_pic_object" ||
4256 test "$pic_object" = none &&
4257 test "$non_pic_object" = none; then
4258 func_fatal_error "cannot find name of object for \`$arg'"
4259 fi
4260
4261 # Extract subdirectory from the argument.
4262 func_dirname "$arg" "/" ""
4263 xdir="$func_dirname_result"
4264
4265 if test "$pic_object" != none; then
4266 # Prepend the subdirectory the object is found in.
4267 pic_object="$xdir$pic_object"
4268
4269 if test "$prev" = dlfiles; then
4270 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4271 dlfiles="$dlfiles $pic_object"
4272 prev=
4273 continue
4274 else
4275 # If libtool objects are unsupported, then we need to preload.
4276 prev=dlprefiles
4277 fi
4278 fi
4279
4280 # CHECK ME: I think I busted this. -Ossama
4281 if test "$prev" = dlprefiles; then
4282 # Preload the old-style object.
4283 dlprefiles="$dlprefiles $pic_object"
4284 prev=
4285 fi
4286
4287 # A PIC object.
4288 func_append libobjs " $pic_object"
4289 arg="$pic_object"
4290 fi
4291
4292 # Non-PIC object.
4293 if test "$non_pic_object" != none; then
4294 # Prepend the subdirectory the object is found in.
4295 non_pic_object="$xdir$non_pic_object"
4296
4297 # A standard non-PIC object
4298 func_append non_pic_objects " $non_pic_object"
4299 if test -z "$pic_object" || test "$pic_object" = none ; then
4300 arg="$non_pic_object"
4301 fi
4302 else
4303 # If the PIC object exists, use it instead.
4304 # $xdir was prepended to $pic_object above.
4305 non_pic_object="$pic_object"
4306 func_append non_pic_objects " $non_pic_object"
4307 fi
4308 else
4309 # Only an error if not doing a dry-run.
4310 if $opt_dry_run; then
4311 # Extract subdirectory from the argument.
4312 func_dirname "$arg" "/" ""
4313 xdir="$func_dirname_result"
4314
4315 func_lo2o "$arg"
4316 pic_object=$xdir$objdir/$func_lo2o_result
4317 non_pic_object=$xdir$func_lo2o_result
4318 func_append libobjs " $pic_object"
4319 func_append non_pic_objects " $non_pic_object"
4320 else
4321 func_fatal_error "\`$arg' is not a valid libtool object"
4322 fi
4323 fi
4324 done
4325 else
4326 func_fatal_error "link input file \`$arg' does not exist"
4327 fi
4328 arg=$save_arg
4329 prev=
4330 continue
4331 ;;
4332 precious_regex)
4333 precious_files_regex="$arg"
4334 prev=
4335 continue
4336 ;;
4337 release)
4338 release="-$arg"
4339 prev=
4340 continue
4341 ;;
4342 rpath | xrpath)
4343 # We need an absolute path.
4344 case $arg in
4345 [\\/]* | [A-Za-z]:[\\/]*) ;;
4346 *)
4347 func_fatal_error "only absolute run-paths are allowed"
4348 ;;
4349 esac
4350 if test "$prev" = rpath; then
4351 case "$rpath " in
4352 *" $arg "*) ;;
4353 *) rpath="$rpath $arg" ;;
4354 esac
4355 else
4356 case "$xrpath " in
4357 *" $arg "*) ;;
4358 *) xrpath="$xrpath $arg" ;;
4359 esac
4360 fi
4361 prev=
4362 continue
4363 ;;
4364 shrext)
4365 shrext_cmds="$arg"
4366 prev=
4367 continue
4368 ;;
4369 weak)
4370 weak_libs="$weak_libs $arg"
4371 prev=
4372 continue
4373 ;;
4374 xcclinker)
4375 linker_flags="$linker_flags $qarg"
4376 compiler_flags="$compiler_flags $qarg"
4377 prev=
4378 func_append compile_command " $qarg"
4379 func_append finalize_command " $qarg"
4380 continue
4381 ;;
4382 xcompiler)
4383 compiler_flags="$compiler_flags $qarg"
4384 prev=
4385 func_append compile_command " $qarg"
4386 func_append finalize_command " $qarg"
4387 continue
4388 ;;
4389 xlinker)
4390 linker_flags="$linker_flags $qarg"
4391 compiler_flags="$compiler_flags $wl$qarg"
4392 prev=
4393 func_append compile_command " $wl$qarg"
4394 func_append finalize_command " $wl$qarg"
4395 continue
4396 ;;
4397 *)
4398 eval "$prev=\"\$arg\""
4399 prev=
4400 continue
4401 ;;
4402 esac
4403 fi # test -n "$prev"
4404
4405 prevarg="$arg"
4406
4407 case $arg in
4408 -all-static)
4409 if test -n "$link_static_flag"; then
4410 # See comment for -static flag below, for more details.
4411 func_append compile_command " $link_static_flag"
4412 func_append finalize_command " $link_static_flag"
4413 fi
4414 continue
4415 ;;
4416
4417 -allow-undefined)
4418 # FIXME: remove this flag sometime in the future.
4419 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4420 ;;
4421
4422 -avoid-version)
4423 avoid_version=yes
4424 continue
4425 ;;
4426
4427 -dlopen)
4428 prev=dlfiles
4429 continue
4430 ;;
4431
4432 -dlpreopen)
4433 prev=dlprefiles
4434 continue
4435 ;;
4436
4437 -export-dynamic)
4438 export_dynamic=yes
4439 continue
4440 ;;
4441
4442 -export-symbols | -export-symbols-regex)
4443 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4444 func_fatal_error "more than one -exported-symbols argument is not allowed"
4445 fi
4446 if test "X$arg" = "X-export-symbols"; then
4447 prev=expsyms
4448 else
4449 prev=expsyms_regex
4450 fi
4451 continue
4452 ;;
4453
4454 -framework)
4455 prev=framework
4456 continue
4457 ;;
4458
4459 -inst-prefix-dir)
4460 prev=inst_prefix
4461 continue
4462 ;;
4463
4464 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4465 # so, if we see these flags be careful not to treat them like -L
4466 -L[A-Z][A-Z]*:*)
4467 case $with_gcc/$host in
4468 no/*-*-irix* | /*-*-irix*)
4469 func_append compile_command " $arg"
4470 func_append finalize_command " $arg"
4471 ;;
4472 esac
4473 continue
4474 ;;
4475
4476 -L*)
4477 func_stripname '-L' '' "$arg"
4478 dir=$func_stripname_result
4479 if test -z "$dir"; then
4480 if test "$#" -gt 0; then
4481 func_fatal_error "require no space between \`-L' and \`$1'"
4482 else
4483 func_fatal_error "need path for \`-L' option"
4484 fi
4485 fi
4486 # We need an absolute path.
4487 case $dir in
4488 [\\/]* | [A-Za-z]:[\\/]*) ;;
4489 *)
4490 absdir=`cd "$dir" && pwd`
4491 test -z "$absdir" && \
4492 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4493 dir="$absdir"
4494 ;;
4495 esac
4496 case "$deplibs " in
4497 *" -L$dir "*) ;;
4498 *)
4499 deplibs="$deplibs -L$dir"
4500 lib_search_path="$lib_search_path $dir"
4501 ;;
4502 esac
4503 case $host in
4504 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4505 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4506 case :$dllsearchpath: in
4507 *":$dir:"*) ;;
4508 ::) dllsearchpath=$dir;;
4509 *) dllsearchpath="$dllsearchpath:$dir";;
4510 esac
4511 case :$dllsearchpath: in
4512 *":$testbindir:"*) ;;
4513 ::) dllsearchpath=$testbindir;;
4514 *) dllsearchpath="$dllsearchpath:$testbindir";;
4515 esac
4516 ;;
4517 esac
4518 continue
4519 ;;
4520
4521 -l*)
4522 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4523 case $host in
4524 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
4525 # These systems don't actually have a C or math library (as such)
4526 continue
4527 ;;
4528 *-*-os2*)
4529 # These systems don't actually have a C library (as such)
4530 test "X$arg" = "X-lc" && continue
4531 ;;
4532 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4533 # Do not include libc due to us having libc/libc_r.
4534 test "X$arg" = "X-lc" && continue
4535 ;;
4536 *-*-rhapsody* | *-*-darwin1.[012])
4537 # Rhapsody C and math libraries are in the System framework
4538 deplibs="$deplibs System.ltframework"
4539 continue
4540 ;;
4541 *-*-sco3.2v5* | *-*-sco5v6*)
4542 # Causes problems with __ctype
4543 test "X$arg" = "X-lc" && continue
4544 ;;
4545 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4546 # Compiler inserts libc in the correct place for threads to work
4547 test "X$arg" = "X-lc" && continue
4548 ;;
4549 esac
4550 elif test "X$arg" = "X-lc_r"; then
4551 case $host in
4552 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4553 # Do not include libc_r directly, use -pthread flag.
4554 continue
4555 ;;
4556 esac
4557 fi
4558 deplibs="$deplibs $arg"
4559 continue
4560 ;;
4561
4562 -module)
4563 module=yes
4564 continue
4565 ;;
4566
4567 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4568 # classes, name mangling, and exception handling.
4569 # Darwin uses the -arch flag to determine output architecture.
4570 -model|-arch|-isysroot)
4571 compiler_flags="$compiler_flags $arg"
4572 func_append compile_command " $arg"
4573 func_append finalize_command " $arg"
4574 prev=xcompiler
4575 continue
4576 ;;
4577
4578 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4579 compiler_flags="$compiler_flags $arg"
4580 func_append compile_command " $arg"
4581 func_append finalize_command " $arg"
4582 case "$new_inherited_linker_flags " in
4583 *" $arg "*) ;;
4584 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4585 esac
4586 continue
4587 ;;
4588
4589 -multi_module)
4590 single_module="${wl}-multi_module"
4591 continue
4592 ;;
4593
4594 -no-fast-install)
4595 fast_install=no
4596 continue
4597 ;;
4598
4599 -no-install)
4600 case $host in
4601 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4602 # The PATH hackery in wrapper scripts is required on Windows
4603 # and Darwin in order for the loader to find any dlls it needs.
4604 func_warning "\`-no-install' is ignored for $host"
4605 func_warning "assuming \`-no-fast-install' instead"
4606 fast_install=no
4607 ;;
4608 *) no_install=yes ;;
4609 esac
4610 continue
4611 ;;
4612
4613 -no-undefined)
4614 allow_undefined=no
4615 continue
4616 ;;
4617
4618 -objectlist)
4619 prev=objectlist
4620 continue
4621 ;;
4622
4623 -o) prev=output ;;
4624
4625 -precious-files-regex)
4626 prev=precious_regex
4627 continue
4628 ;;
4629
4630 -release)
4631 prev=release
4632 continue
4633 ;;
4634
4635 -rpath)
4636 prev=rpath
4637 continue
4638 ;;
4639
4640 -R)
4641 prev=xrpath
4642 continue
4643 ;;
4644
4645 -R*)
4646 func_stripname '-R' '' "$arg"
4647 dir=$func_stripname_result
4648 # We need an absolute path.
4649 case $dir in
4650 [\\/]* | [A-Za-z]:[\\/]*) ;;
4651 *)
4652 func_fatal_error "only absolute run-paths are allowed"
4653 ;;
4654 esac
4655 case "$xrpath " in
4656 *" $dir "*) ;;
4657 *) xrpath="$xrpath $dir" ;;
4658 esac
4659 continue
4660 ;;
4661
4662 -shared)
4663 # The effects of -shared are defined in a previous loop.
4664 continue
4665 ;;
4666
4667 -shrext)
4668 prev=shrext
4669 continue
4670 ;;
4671
4672 -static | -static-libtool-libs)
4673 # The effects of -static are defined in a previous loop.
4674 # We used to do the same as -all-static on platforms that
4675 # didn't have a PIC flag, but the assumption that the effects
4676 # would be equivalent was wrong. It would break on at least
4677 # Digital Unix and AIX.
4678 continue
4679 ;;
4680
4681 -thread-safe)
4682 thread_safe=yes
4683 continue
4684 ;;
4685
4686 -version-info)
4687 prev=vinfo
4688 continue
4689 ;;
4690
4691 -version-number)
4692 prev=vinfo
4693 vinfo_number=yes
4694 continue
4695 ;;
4696
4697 -weak)
4698 prev=weak
4699 continue
4700 ;;
4701
4702 -Wc,*)
4703 func_stripname '-Wc,' '' "$arg"
4704 args=$func_stripname_result
4705 arg=
4706 save_ifs="$IFS"; IFS=','
4707 for flag in $args; do
4708 IFS="$save_ifs"
4709 func_quote_for_eval "$flag"
4710 arg="$arg $wl$func_quote_for_eval_result"
4711 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4712 done
4713 IFS="$save_ifs"
4714 func_stripname ' ' '' "$arg"
4715 arg=$func_stripname_result
4716 ;;
4717
4718 -Wl,*)
4719 func_stripname '-Wl,' '' "$arg"
4720 args=$func_stripname_result
4721 arg=
4722 save_ifs="$IFS"; IFS=','
4723 for flag in $args; do
4724 IFS="$save_ifs"
4725 func_quote_for_eval "$flag"
4726 arg="$arg $wl$func_quote_for_eval_result"
4727 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4728 linker_flags="$linker_flags $func_quote_for_eval_result"
4729 done
4730 IFS="$save_ifs"
4731 func_stripname ' ' '' "$arg"
4732 arg=$func_stripname_result
4733 ;;
4734
4735 -Xcompiler)
4736 prev=xcompiler
4737 continue
4738 ;;
4739
4740 -Xlinker)
4741 prev=xlinker
4742 continue
4743 ;;
4744
4745 -XCClinker)
4746 prev=xcclinker
4747 continue
4748 ;;
4749
4750 # -msg_* for osf cc
4751 -msg_*)
4752 func_quote_for_eval "$arg"
4753 arg="$func_quote_for_eval_result"
4754 ;;
4755
4756 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4757 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4758 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4759 # +DA*, +DD* enable 64-bit mode on the HP compiler
4760 # -q* pass through compiler args for the IBM compiler
4761 # -m*, -t[45]*, -txscale* pass through architecture-specific
4762 # compiler args for GCC
4763 # -F/path gives path to uninstalled frameworks, gcc on darwin
4764 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4765 # @file GCC response files
4766 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4767 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4768 func_quote_for_eval "$arg"
4769 arg="$func_quote_for_eval_result"
4770 func_append compile_command " $arg"
4771 func_append finalize_command " $arg"
4772 compiler_flags="$compiler_flags $arg"
4773 continue
4774 ;;
4775
4776 # Some other compiler flag.
4777 -* | +*)
4778 func_quote_for_eval "$arg"
4779 arg="$func_quote_for_eval_result"
4780 ;;
4781
4782 *.$objext)
4783 # A standard object.
4784 objs="$objs $arg"
4785 ;;
4786
4787 *.lo)
4788 # A libtool-controlled object.
4789
4790 # Check to see that this really is a libtool object.
4791 if func_lalib_unsafe_p "$arg"; then
4792 pic_object=
4793 non_pic_object=
4794
4795 # Read the .lo file
4796 func_source "$arg"
4797
4798 if test -z "$pic_object" ||
4799 test -z "$non_pic_object" ||
4800 test "$pic_object" = none &&
4801 test "$non_pic_object" = none; then
4802 func_fatal_error "cannot find name of object for \`$arg'"
4803 fi
4804
4805 # Extract subdirectory from the argument.
4806 func_dirname "$arg" "/" ""
4807 xdir="$func_dirname_result"
4808
4809 if test "$pic_object" != none; then
4810 # Prepend the subdirectory the object is found in.
4811 pic_object="$xdir$pic_object"
4812
4813 if test "$prev" = dlfiles; then
4814 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4815 dlfiles="$dlfiles $pic_object"
4816 prev=
4817 continue
4818 else
4819 # If libtool objects are unsupported, then we need to preload.
4820 prev=dlprefiles
4821 fi
4822 fi
4823
4824 # CHECK ME: I think I busted this. -Ossama
4825 if test "$prev" = dlprefiles; then
4826 # Preload the old-style object.
4827 dlprefiles="$dlprefiles $pic_object"
4828 prev=
4829 fi
4830
4831 # A PIC object.
4832 func_append libobjs " $pic_object"
4833 arg="$pic_object"
4834 fi
4835
4836 # Non-PIC object.
4837 if test "$non_pic_object" != none; then
4838 # Prepend the subdirectory the object is found in.
4839 non_pic_object="$xdir$non_pic_object"
4840
4841 # A standard non-PIC object
4842 func_append non_pic_objects " $non_pic_object"
4843 if test -z "$pic_object" || test "$pic_object" = none ; then
4844 arg="$non_pic_object"
4845 fi
4846 else
4847 # If the PIC object exists, use it instead.
4848 # $xdir was prepended to $pic_object above.
4849 non_pic_object="$pic_object"
4850 func_append non_pic_objects " $non_pic_object"
4851 fi
4852 else
4853 # Only an error if not doing a dry-run.
4854 if $opt_dry_run; then
4855 # Extract subdirectory from the argument.
4856 func_dirname "$arg" "/" ""
4857 xdir="$func_dirname_result"
4858
4859 func_lo2o "$arg"
4860 pic_object=$xdir$objdir/$func_lo2o_result
4861 non_pic_object=$xdir$func_lo2o_result
4862 func_append libobjs " $pic_object"
4863 func_append non_pic_objects " $non_pic_object"
4864 else
4865 func_fatal_error "\`$arg' is not a valid libtool object"
4866 fi
4867 fi
4868 ;;
4869
4870 *.$libext)
4871 # An archive.
4872 deplibs="$deplibs $arg"
4873 old_deplibs="$old_deplibs $arg"
4874 continue
4875 ;;
4876
4877 *.la)
4878 # A libtool-controlled library.
4879
4880 if test "$prev" = dlfiles; then
4881 # This library was specified with -dlopen.
4882 dlfiles="$dlfiles $arg"
4883 prev=
4884 elif test "$prev" = dlprefiles; then
4885 # The library was specified with -dlpreopen.
4886 dlprefiles="$dlprefiles $arg"
4887 prev=
4888 else
4889 deplibs="$deplibs $arg"
4890 fi
4891 continue
4892 ;;
4893
4894 # Some other compiler argument.
4895 *)
4896 # Unknown arguments in both finalize_command and compile_command need
4897 # to be aesthetically quoted because they are evaled later.
4898 func_quote_for_eval "$arg"
4899 arg="$func_quote_for_eval_result"
4900 ;;
4901 esac # arg
4902
4903 # Now actually substitute the argument into the commands.
4904 if test -n "$arg"; then
4905 func_append compile_command " $arg"
4906 func_append finalize_command " $arg"
4907 fi
4908 done # argument parsing loop
4909
4910 test -n "$prev" && \
4911 func_fatal_help "the \`$prevarg' option requires an argument"
4912
4913 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4914 eval arg=\"$export_dynamic_flag_spec\"
4915 func_append compile_command " $arg"
4916 func_append finalize_command " $arg"
4917 fi
4918
4919 oldlibs=
4920 # calculate the name of the file, without its directory
4921 func_basename "$output"
4922 outputname="$func_basename_result"
4923 libobjs_save="$libobjs"
4924
4925 if test -n "$shlibpath_var"; then
4926 # get the directories listed in $shlibpath_var
4927 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4928 else
4929 shlib_search_path=
4930 fi
4931 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4932 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4933
4934 func_dirname "$output" "/" ""
4935 output_objdir="$func_dirname_result$objdir"
4936 # Create the object directory.
4937 func_mkdir_p "$output_objdir"
4938
4939 # Determine the type of output
4940 case $output in
4941 "")
4942 func_fatal_help "you must specify an output file"
4943 ;;
4944 *.$libext) linkmode=oldlib ;;
4945 *.lo | *.$objext) linkmode=obj ;;
4946 *.la) linkmode=lib ;;
4947 *) linkmode=prog ;; # Anything else should be a program.
4948 esac
4949
4950 specialdeplibs=
4951
4952 libs=
4953 # Find all interdependent deplibs by searching for libraries
4954 # that are linked more than once (e.g. -la -lb -la)
4955 for deplib in $deplibs; do
4956 if $opt_duplicate_deps ; then
4957 case "$libs " in
4958 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4959 esac
4960 fi
4961 libs="$libs $deplib"
4962 done
4963
4964 if test "$linkmode" = lib; then
4965 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4966
4967 # Compute libraries that are listed more than once in $predeps
4968 # $postdeps and mark them as special (i.e., whose duplicates are
4969 # not to be eliminated).
4970 pre_post_deps=
4971 if $opt_duplicate_compiler_generated_deps; then
4972 for pre_post_dep in $predeps $postdeps; do
4973 case "$pre_post_deps " in
4974 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4975 esac
4976 pre_post_deps="$pre_post_deps $pre_post_dep"
4977 done
4978 fi
4979 pre_post_deps=
4980 fi
4981
4982 deplibs=
4983 newdependency_libs=
4984 newlib_search_path=
4985 need_relink=no # whether we're linking any uninstalled libtool libraries
4986 notinst_deplibs= # not-installed libtool libraries
4987 notinst_path= # paths that contain not-installed libtool libraries
4988
4989 case $linkmode in
4990 lib)
4991 passes="conv dlpreopen link"
4992 for file in $dlfiles $dlprefiles; do
4993 case $file in
4994 *.la) ;;
4995 *)
4996 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4997 ;;
4998 esac
4999 done
5000 ;;
5001 prog)
5002 compile_deplibs=
5003 finalize_deplibs=
5004 alldeplibs=no
5005 newdlfiles=
5006 newdlprefiles=
5007 passes="conv scan dlopen dlpreopen link"
5008 ;;
5009 *) passes="conv"
5010 ;;
5011 esac
5012
5013 for pass in $passes; do
5014 # The preopen pass in lib mode reverses $deplibs; put it back here
5015 # so that -L comes before libs that need it for instance...
5016 if test "$linkmode,$pass" = "lib,link"; then
5017 ## FIXME: Find the place where the list is rebuilt in the wrong
5018 ## order, and fix it there properly
5019 tmp_deplibs=
5020 for deplib in $deplibs; do
5021 tmp_deplibs="$deplib $tmp_deplibs"
5022 done
5023 deplibs="$tmp_deplibs"
5024 fi
5025
5026 if test "$linkmode,$pass" = "lib,link" ||
5027 test "$linkmode,$pass" = "prog,scan"; then
5028 libs="$deplibs"
5029 deplibs=
5030 fi
5031 if test "$linkmode" = prog; then
5032 case $pass in
5033 dlopen) libs="$dlfiles" ;;
5034 dlpreopen) libs="$dlprefiles" ;;
5035 link)
5036 libs="$deplibs %DEPLIBS%"
5037 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
5038 ;;
5039 esac
5040 fi
5041 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5042 # Collect and forward deplibs of preopened libtool libs
5043 for lib in $dlprefiles; do
5044 # Ignore non-libtool-libs
5045 dependency_libs=
5046 case $lib in
5047 *.la) func_source "$lib" ;;
5048 esac
5049
5050 # Collect preopened libtool deplibs, except any this library
5051 # has declared as weak libs
5052 for deplib in $dependency_libs; do
5053 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5054 case " $weak_libs " in
5055 *" $deplib_base "*) ;;
5056 *) deplibs="$deplibs $deplib" ;;
5057 esac
5058 done
5059 done
5060 libs="$dlprefiles"
5061 fi
5062 if test "$pass" = dlopen; then
5063 # Collect dlpreopened libraries
5064 save_deplibs="$deplibs"
5065 deplibs=
5066 fi
5067
5068 for deplib in $libs; do
5069 lib=
5070 found=no
5071 case $deplib in
5072 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5073 if test "$linkmode,$pass" = "prog,link"; then
5074 compile_deplibs="$deplib $compile_deplibs"
5075 finalize_deplibs="$deplib $finalize_deplibs"
5076 else
5077 compiler_flags="$compiler_flags $deplib"
5078 if test "$linkmode" = lib ; then
5079 case "$new_inherited_linker_flags " in
5080 *" $deplib "*) ;;
5081 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5082 esac
5083 fi
5084 fi
5085 continue
5086 ;;
5087 -l*)
5088 if test "$linkmode" != lib && test "$linkmode" != prog; then
5089 func_warning "\`-l' is ignored for archives/objects"
5090 continue
5091 fi
5092 func_stripname '-l' '' "$deplib"
5093 name=$func_stripname_result
5094 if test "$linkmode" = lib; then
5095 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5096 else
5097 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5098 fi
5099 for searchdir in $searchdirs; do
5100 for search_ext in .la $std_shrext .so .a; do
5101 # Search the libtool library
5102 lib="$searchdir/lib${name}${search_ext}"
5103 if test -f "$lib"; then
5104 if test "$search_ext" = ".la"; then
5105 found=yes
5106 else
5107 found=no
5108 fi
5109 break 2
5110 fi
5111 done
5112 done
5113 if test "$found" != yes; then
5114 # deplib doesn't seem to be a libtool library
5115 if test "$linkmode,$pass" = "prog,link"; then
5116 compile_deplibs="$deplib $compile_deplibs"
5117 finalize_deplibs="$deplib $finalize_deplibs"
5118 else
5119 deplibs="$deplib $deplibs"
5120 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5121 fi
5122 continue
5123 else # deplib is a libtool library
5124 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5125 # We need to do some special things here, and not later.
5126 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5127 case " $predeps $postdeps " in
5128 *" $deplib "*)
5129 if func_lalib_p "$lib"; then
5130 library_names=
5131 old_library=
5132 func_source "$lib"
5133 for l in $old_library $library_names; do
5134 ll="$l"
5135 done
5136 if test "X$ll" = "X$old_library" ; then # only static version available
5137 found=no
5138 func_dirname "$lib" "" "."
5139 ladir="$func_dirname_result"
5140 lib=$ladir/$old_library
5141 if test "$linkmode,$pass" = "prog,link"; then
5142 compile_deplibs="$deplib $compile_deplibs"
5143 finalize_deplibs="$deplib $finalize_deplibs"
5144 else
5145 deplibs="$deplib $deplibs"
5146 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5147 fi
5148 continue
5149 fi
5150 fi
5151 ;;
5152 *) ;;
5153 esac
5154 fi
5155 fi
5156 ;; # -l
5157 *.ltframework)
5158 if test "$linkmode,$pass" = "prog,link"; then
5159 compile_deplibs="$deplib $compile_deplibs"
5160 finalize_deplibs="$deplib $finalize_deplibs"
5161 else
5162 deplibs="$deplib $deplibs"
5163 if test "$linkmode" = lib ; then
5164 case "$new_inherited_linker_flags " in
5165 *" $deplib "*) ;;
5166 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5167 esac
5168 fi
5169 fi
5170 continue
5171 ;;
5172 -L*)
5173 case $linkmode in
5174 lib)
5175 deplibs="$deplib $deplibs"
5176 test "$pass" = conv && continue
5177 newdependency_libs="$deplib $newdependency_libs"
5178 func_stripname '-L' '' "$deplib"
5179 newlib_search_path="$newlib_search_path $func_stripname_result"
5180 ;;
5181 prog)
5182 if test "$pass" = conv; then
5183 deplibs="$deplib $deplibs"
5184 continue
5185 fi
5186 if test "$pass" = scan; then
5187 deplibs="$deplib $deplibs"
5188 else
5189 compile_deplibs="$deplib $compile_deplibs"
5190 finalize_deplibs="$deplib $finalize_deplibs"
5191 fi
5192 func_stripname '-L' '' "$deplib"
5193 newlib_search_path="$newlib_search_path $func_stripname_result"
5194 ;;
5195 *)
5196 func_warning "\`-L' is ignored for archives/objects"
5197 ;;
5198 esac # linkmode
5199 continue
5200 ;; # -L
5201 -R*)
5202 if test "$pass" = link; then
5203 func_stripname '-R' '' "$deplib"
5204 dir=$func_stripname_result
5205 # Make sure the xrpath contains only unique directories.
5206 case "$xrpath " in
5207 *" $dir "*) ;;
5208 *) xrpath="$xrpath $dir" ;;
5209 esac
5210 fi
5211 deplibs="$deplib $deplibs"
5212 continue
5213 ;;
5214 *.la) lib="$deplib" ;;
5215 *.$libext)
5216 if test "$pass" = conv; then
5217 deplibs="$deplib $deplibs"
5218 continue
5219 fi
5220 case $linkmode in
5221 lib)
5222 # Linking convenience modules into shared libraries is allowed,
5223 # but linking other static libraries is non-portable.
5224 case " $dlpreconveniencelibs " in
5225 *" $deplib "*) ;;
5226 *)
5227 valid_a_lib=no
5228 case $deplibs_check_method in
5229 match_pattern*)
5230 set dummy $deplibs_check_method; shift
5231 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5232 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5233 | $EGREP "$match_pattern_regex" > /dev/null; then
5234 valid_a_lib=yes
5235 fi
5236 ;;
5237 pass_all)
5238 valid_a_lib=yes
5239 ;;
5240 esac
5241 if test "$valid_a_lib" != yes; then
5242 $ECHO
5243 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5244 $ECHO "*** I have the capability to make that library automatically link in when"
5245 $ECHO "*** you link to this library. But I can only do this if you have a"
5246 $ECHO "*** shared version of the library, which you do not appear to have"
5247 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5248 $ECHO "*** that it is just a static archive that I should not use here."
5249 else
5250 $ECHO
5251 $ECHO "*** Warning: Linking the shared library $output against the"
5252 $ECHO "*** static library $deplib is not portable!"
5253 deplibs="$deplib $deplibs"
5254 fi
5255 ;;
5256 esac
5257 continue
5258 ;;
5259 prog)
5260 if test "$pass" != link; then
5261 deplibs="$deplib $deplibs"
5262 else
5263 compile_deplibs="$deplib $compile_deplibs"
5264 finalize_deplibs="$deplib $finalize_deplibs"
5265 fi
5266 continue
5267 ;;
5268 esac # linkmode
5269 ;; # *.$libext
5270 *.lo | *.$objext)
5271 if test "$pass" = conv; then
5272 deplibs="$deplib $deplibs"
5273 elif test "$linkmode" = prog; then
5274 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5275 # If there is no dlopen support or we're linking statically,
5276 # we need to preload.
5277 newdlprefiles="$newdlprefiles $deplib"
5278 compile_deplibs="$deplib $compile_deplibs"
5279 finalize_deplibs="$deplib $finalize_deplibs"
5280 else
5281 newdlfiles="$newdlfiles $deplib"
5282 fi
5283 fi
5284 continue
5285 ;;
5286 %DEPLIBS%)
5287 alldeplibs=yes
5288 continue
5289 ;;
5290 esac # case $deplib
5291
5292 if test "$found" = yes || test -f "$lib"; then :
5293 else
5294 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5295 fi
5296
5297 # Check to see that this really is a libtool archive.
5298 func_lalib_unsafe_p "$lib" \
5299 || func_fatal_error "\`$lib' is not a valid libtool archive"
5300
5301 func_dirname "$lib" "" "."
5302 ladir="$func_dirname_result"
5303
5304 dlname=
5305 dlopen=
5306 dlpreopen=
5307 libdir=
5308 library_names=
5309 old_library=
5310 inherited_linker_flags=
5311 # If the library was installed with an old release of libtool,
5312 # it will not redefine variables installed, or shouldnotlink
5313 installed=yes
5314 shouldnotlink=no
5315 avoidtemprpath=
5316
5317
5318 # Read the .la file
5319 func_source "$lib"
5320
5321 # Convert "-framework foo" to "foo.ltframework"
5322 if test -n "$inherited_linker_flags"; then
5323 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5324 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5325 case " $new_inherited_linker_flags " in
5326 *" $tmp_inherited_linker_flag "*) ;;
5327 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5328 esac
5329 done
5330 fi
5331 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5332 if test "$linkmode,$pass" = "lib,link" ||
5333 test "$linkmode,$pass" = "prog,scan" ||
5334 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5335 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5336 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5337 fi
5338
5339 if test "$pass" = conv; then
5340 # Only check for convenience libraries
5341 deplibs="$lib $deplibs"
5342 if test -z "$libdir"; then
5343 if test -z "$old_library"; then
5344 func_fatal_error "cannot find name of link library for \`$lib'"
5345 fi
5346 # It is a libtool convenience library, so add in its objects.
5347 convenience="$convenience $ladir/$objdir/$old_library"
5348 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5349 tmp_libs=
5350 for deplib in $dependency_libs; do
5351 deplibs="$deplib $deplibs"
5352 if $opt_duplicate_deps ; then
5353 case "$tmp_libs " in
5354 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5355 esac
5356 fi
5357 tmp_libs="$tmp_libs $deplib"
5358 done
5359 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5360 func_fatal_error "\`$lib' is not a convenience library"
5361 fi
5362 continue
5363 fi # $pass = conv
5364
5365
5366 # Get the name of the library we link against.
5367 linklib=
5368 for l in $old_library $library_names; do
5369 linklib="$l"
5370 done
5371 if test -z "$linklib"; then
5372 func_fatal_error "cannot find name of link library for \`$lib'"
5373 fi
5374
5375 # This library was specified with -dlopen.
5376 if test "$pass" = dlopen; then
5377 if test -z "$libdir"; then
5378 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5379 fi
5380 if test -z "$dlname" ||
5381 test "$dlopen_support" != yes ||
5382 test "$build_libtool_libs" = no; then
5383 # If there is no dlname, no dlopen support or we're linking
5384 # statically, we need to preload. We also need to preload any
5385 # dependent libraries so libltdl's deplib preloader doesn't
5386 # bomb out in the load deplibs phase.
5387 dlprefiles="$dlprefiles $lib $dependency_libs"
5388 else
5389 newdlfiles="$newdlfiles $lib"
5390 fi
5391 continue
5392 fi # $pass = dlopen
5393
5394 # We need an absolute path.
5395 case $ladir in
5396 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5397 *)
5398 abs_ladir=`cd "$ladir" && pwd`
5399 if test -z "$abs_ladir"; then
5400 func_warning "cannot determine absolute directory name of \`$ladir'"
5401 func_warning "passing it literally to the linker, although it might fail"
5402 abs_ladir="$ladir"
5403 fi
5404 ;;
5405 esac
5406 func_basename "$lib"
5407 laname="$func_basename_result"
5408
5409 # Find the relevant object directory and library name.
5410 if test "X$installed" = Xyes; then
5411 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5412 func_warning "library \`$lib' was moved."
5413 dir="$ladir"
5414 absdir="$abs_ladir"
5415 libdir="$abs_ladir"
5416 else
5417 dir="$libdir"
5418 absdir="$libdir"
5419 fi
5420 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5421 else
5422 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5423 dir="$ladir"
5424 absdir="$abs_ladir"
5425 # Remove this search path later
5426 notinst_path="$notinst_path $abs_ladir"
5427 else
5428 dir="$ladir/$objdir"
5429 absdir="$abs_ladir/$objdir"
5430 # Remove this search path later
5431 notinst_path="$notinst_path $abs_ladir"
5432 fi
5433 fi # $installed = yes
5434 func_stripname 'lib' '.la' "$laname"
5435 name=$func_stripname_result
5436
5437 # This library was specified with -dlpreopen.
5438 if test "$pass" = dlpreopen; then
5439 if test -z "$libdir" && test "$linkmode" = prog; then
5440 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5441 fi
5442 # Prefer using a static library (so that no silly _DYNAMIC symbols
5443 # are required to link).
5444 if test -n "$old_library"; then
5445 newdlprefiles="$newdlprefiles $dir/$old_library"
5446 # Keep a list of preopened convenience libraries to check
5447 # that they are being used correctly in the link pass.
5448 test -z "$libdir" && \
5449 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5450 # Otherwise, use the dlname, so that lt_dlopen finds it.
5451 elif test -n "$dlname"; then
5452 newdlprefiles="$newdlprefiles $dir/$dlname"
5453 else
5454 newdlprefiles="$newdlprefiles $dir/$linklib"
5455 fi
5456 fi # $pass = dlpreopen
5457
5458 if test -z "$libdir"; then
5459 # Link the convenience library
5460 if test "$linkmode" = lib; then
5461 deplibs="$dir/$old_library $deplibs"
5462 elif test "$linkmode,$pass" = "prog,link"; then
5463 compile_deplibs="$dir/$old_library $compile_deplibs"
5464 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5465 else
5466 deplibs="$lib $deplibs" # used for prog,scan pass
5467 fi
5468 continue
5469 fi
5470
5471
5472 if test "$linkmode" = prog && test "$pass" != link; then
5473 newlib_search_path="$newlib_search_path $ladir"
5474 deplibs="$lib $deplibs"
5475
5476 linkalldeplibs=no
5477 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5478 test "$build_libtool_libs" = no; then
5479 linkalldeplibs=yes
5480 fi
5481
5482 tmp_libs=
5483 for deplib in $dependency_libs; do
5484 case $deplib in
5485 -L*) func_stripname '-L' '' "$deplib"
5486 newlib_search_path="$newlib_search_path $func_stripname_result"
5487 ;;
5488 esac
5489 # Need to link against all dependency_libs?
5490 if test "$linkalldeplibs" = yes; then
5491 deplibs="$deplib $deplibs"
5492 else
5493 # Need to hardcode shared library paths
5494 # or/and link against static libraries
5495 newdependency_libs="$deplib $newdependency_libs"
5496 fi
5497 if $opt_duplicate_deps ; then
5498 case "$tmp_libs " in
5499 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5500 esac
5501 fi
5502 tmp_libs="$tmp_libs $deplib"
5503 done # for deplib
5504 continue
5505 fi # $linkmode = prog...
5506
5507 if test "$linkmode,$pass" = "prog,link"; then
5508 if test -n "$library_names" &&
5509 { { test "$prefer_static_libs" = no ||
5510 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5511 test -z "$old_library"; }; then
5512 # We need to hardcode the library path
5513 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5514 # Make sure the rpath contains only unique directories.
5515 case "$temp_rpath:" in
5516 *"$absdir:"*) ;;
5517 *) temp_rpath="$temp_rpath$absdir:" ;;
5518 esac
5519 fi
5520
5521 # Hardcode the library path.
5522 # Skip directories that are in the system default run-time
5523 # search path.
5524 case " $sys_lib_dlsearch_path " in
5525 *" $absdir "*) ;;
5526 *)
5527 case "$compile_rpath " in
5528 *" $absdir "*) ;;
5529 *) compile_rpath="$compile_rpath $absdir"
5530 esac
5531 ;;
5532 esac
5533 case " $sys_lib_dlsearch_path " in
5534 *" $libdir "*) ;;
5535 *)
5536 case "$finalize_rpath " in
5537 *" $libdir "*) ;;
5538 *) finalize_rpath="$finalize_rpath $libdir"
5539 esac
5540 ;;
5541 esac
5542 fi # $linkmode,$pass = prog,link...
5543
5544 if test "$alldeplibs" = yes &&
5545 { test "$deplibs_check_method" = pass_all ||
5546 { test "$build_libtool_libs" = yes &&
5547 test -n "$library_names"; }; }; then
5548 # We only need to search for static libraries
5549 continue
5550 fi
5551 fi
5552
5553 link_static=no # Whether the deplib will be linked statically
5554 use_static_libs=$prefer_static_libs
5555 if test "$use_static_libs" = built && test "$installed" = yes; then
5556 use_static_libs=no
5557 fi
5558 if test -n "$library_names" &&
5559 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5560 case $host in
5561 *cygwin* | *mingw* | *cegcc*)
5562 # No point in relinking DLLs because paths are not encoded
5563 notinst_deplibs="$notinst_deplibs $lib"
5564 need_relink=no
5565 ;;
5566 *)
5567 if test "$installed" = no; then
5568 notinst_deplibs="$notinst_deplibs $lib"
5569 need_relink=yes
5570 fi
5571 ;;
5572 esac
5573 # This is a shared library
5574
5575 # Warn about portability, can't link against -module's on some
5576 # systems (darwin). Don't bleat about dlopened modules though!
5577 dlopenmodule=""
5578 for dlpremoduletest in $dlprefiles; do
5579 if test "X$dlpremoduletest" = "X$lib"; then
5580 dlopenmodule="$dlpremoduletest"
5581 break
5582 fi
5583 done
5584 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5585 $ECHO
5586 if test "$linkmode" = prog; then
5587 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5588 else
5589 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5590 fi
5591 $ECHO "*** $linklib is not portable!"
5592 fi
5593 if test "$linkmode" = lib &&
5594 test "$hardcode_into_libs" = yes; then
5595 # Hardcode the library path.
5596 # Skip directories that are in the system default run-time
5597 # search path.
5598 case " $sys_lib_dlsearch_path " in
5599 *" $absdir "*) ;;
5600 *)
5601 case "$compile_rpath " in
5602 *" $absdir "*) ;;
5603 *) compile_rpath="$compile_rpath $absdir"
5604 esac
5605 ;;
5606 esac
5607 case " $sys_lib_dlsearch_path " in
5608 *" $libdir "*) ;;
5609 *)
5610 case "$finalize_rpath " in
5611 *" $libdir "*) ;;
5612 *) finalize_rpath="$finalize_rpath $libdir"
5613 esac
5614 ;;
5615 esac
5616 fi
5617
5618 if test -n "$old_archive_from_expsyms_cmds"; then
5619 # figure out the soname
5620 set dummy $library_names
5621 shift
5622 realname="$1"
5623 shift
5624 libname=`eval "\\$ECHO \"$libname_spec\""`
5625 # use dlname if we got it. it's perfectly good, no?
5626 if test -n "$dlname"; then
5627 soname="$dlname"
5628 elif test -n "$soname_spec"; then
5629 # bleh windows
5630 case $host in
5631 *cygwin* | mingw* | *cegcc*)
5632 func_arith $current - $age
5633 major=$func_arith_result
5634 versuffix="-$major"
5635 ;;
5636 esac
5637 eval soname=\"$soname_spec\"
5638 else
5639 soname="$realname"
5640 fi
5641
5642 # Make a new name for the extract_expsyms_cmds to use
5643 soroot="$soname"
5644 func_basename "$soroot"
5645 soname="$func_basename_result"
5646 func_stripname 'lib' '.dll' "$soname"
5647 newlib=libimp-$func_stripname_result.a
5648
5649 # If the library has no export list, then create one now
5650 if test -f "$output_objdir/$soname-def"; then :
5651 else
5652 func_verbose "extracting exported symbol list from \`$soname'"
5653 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5654 fi
5655
5656 # Create $newlib
5657 if test -f "$output_objdir/$newlib"; then :; else
5658 func_verbose "generating import library for \`$soname'"
5659 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5660 fi
5661 # make sure the library variables are pointing to the new library
5662 dir=$output_objdir
5663 linklib=$newlib
5664 fi # test -n "$old_archive_from_expsyms_cmds"
5665
5666 if test "$linkmode" = prog || test "$mode" != relink; then
5667 add_shlibpath=
5668 add_dir=
5669 add=
5670 lib_linked=yes
5671 case $hardcode_action in
5672 immediate | unsupported)
5673 if test "$hardcode_direct" = no; then
5674 add="$dir/$linklib"
5675 case $host in
5676 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5677 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5678 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5679 *-*-unixware7*) add_dir="-L$dir" ;;
5680 *-*-darwin* )
5681 # if the lib is a (non-dlopened) module then we can not
5682 # link against it, someone is ignoring the earlier warnings
5683 if /usr/bin/file -L $add 2> /dev/null |
5684 $GREP ": [^:]* bundle" >/dev/null ; then
5685 if test "X$dlopenmodule" != "X$lib"; then
5686 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5687 if test -z "$old_library" ; then
5688 $ECHO
5689 $ECHO "*** And there doesn't seem to be a static archive available"
5690 $ECHO "*** The link will probably fail, sorry"
5691 else
5692 add="$dir/$old_library"
5693 fi
5694 elif test -n "$old_library"; then
5695 add="$dir/$old_library"
5696 fi
5697 fi
5698 esac
5699 elif test "$hardcode_minus_L" = no; then
5700 case $host in
5701 *-*-sunos*) add_shlibpath="$dir" ;;
5702 esac
5703 add_dir="-L$dir"
5704 add="-l$name"
5705 elif test "$hardcode_shlibpath_var" = no; then
5706 add_shlibpath="$dir"
5707 add="-l$name"
5708 else
5709 lib_linked=no
5710 fi
5711 ;;
5712 relink)
5713 if test "$hardcode_direct" = yes &&
5714 test "$hardcode_direct_absolute" = no; then
5715 add="$dir/$linklib"
5716 elif test "$hardcode_minus_L" = yes; then
5717 add_dir="-L$dir"
5718 # Try looking first in the location we're being installed to.
5719 if test -n "$inst_prefix_dir"; then
5720 case $libdir in
5721 [\\/]*)
5722 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5723 ;;
5724 esac
5725 fi
5726 add="-l$name"
5727 elif test "$hardcode_shlibpath_var" = yes; then
5728 add_shlibpath="$dir"
5729 add="-l$name"
5730 else
5731 lib_linked=no
5732 fi
5733 ;;
5734 *) lib_linked=no ;;
5735 esac
5736
5737 if test "$lib_linked" != yes; then
5738 func_fatal_configuration "unsupported hardcode properties"
5739 fi
5740
5741 if test -n "$add_shlibpath"; then
5742 case :$compile_shlibpath: in
5743 *":$add_shlibpath:"*) ;;
5744 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5745 esac
5746 fi
5747 if test "$linkmode" = prog; then
5748 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5749 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5750 else
5751 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5752 test -n "$add" && deplibs="$add $deplibs"
5753 if test "$hardcode_direct" != yes &&
5754 test "$hardcode_minus_L" != yes &&
5755 test "$hardcode_shlibpath_var" = yes; then
5756 case :$finalize_shlibpath: in
5757 *":$libdir:"*) ;;
5758 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5759 esac
5760 fi
5761 fi
5762 fi
5763
5764 if test "$linkmode" = prog || test "$mode" = relink; then
5765 add_shlibpath=
5766 add_dir=
5767 add=
5768 # Finalize command for both is simple: just hardcode it.
5769 if test "$hardcode_direct" = yes &&
5770 test "$hardcode_direct_absolute" = no; then
5771 add="$libdir/$linklib"
5772 elif test "$hardcode_minus_L" = yes; then
5773 add_dir="-L$libdir"
5774 add="-l$name"
5775 elif test "$hardcode_shlibpath_var" = yes; then
5776 case :$finalize_shlibpath: in
5777 *":$libdir:"*) ;;
5778 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5779 esac
5780 add="-l$name"
5781 elif test "$hardcode_automatic" = yes; then
5782 if test -n "$inst_prefix_dir" &&
5783 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5784 add="$inst_prefix_dir$libdir/$linklib"
5785 else
5786 add="$libdir/$linklib"
5787 fi
5788 else
5789 # We cannot seem to hardcode it, guess we'll fake it.
5790 add_dir="-L$libdir"
5791 # Try looking first in the location we're being installed to.
5792 if test -n "$inst_prefix_dir"; then
5793 case $libdir in
5794 [\\/]*)
5795 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5796 ;;
5797 esac
5798 fi
5799 add="-l$name"
5800 fi
5801
5802 if test "$linkmode" = prog; then
5803 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5804 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5805 else
5806 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5807 test -n "$add" && deplibs="$add $deplibs"
5808 fi
5809 fi
5810 elif test "$linkmode" = prog; then
5811 # Here we assume that one of hardcode_direct or hardcode_minus_L
5812 # is not unsupported. This is valid on all known static and
5813 # shared platforms.
5814 if test "$hardcode_direct" != unsupported; then
5815 test -n "$old_library" && linklib="$old_library"
5816 compile_deplibs="$dir/$linklib $compile_deplibs"
5817 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5818 else
5819 compile_deplibs="-l$name -L$dir $compile_deplibs"
5820 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5821 fi
5822 elif test "$build_libtool_libs" = yes; then
5823 # Not a shared library
5824 if test "$deplibs_check_method" != pass_all; then
5825 # We're trying link a shared library against a static one
5826 # but the system doesn't support it.
5827
5828 # Just print a warning and add the library to dependency_libs so
5829 # that the program can be linked against the static library.
5830 $ECHO
5831 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5832 $ECHO "*** I have the capability to make that library automatically link in when"
5833 $ECHO "*** you link to this library. But I can only do this if you have a"
5834 $ECHO "*** shared version of the library, which you do not appear to have."
5835 if test "$module" = yes; then
5836 $ECHO "*** But as you try to build a module library, libtool will still create "
5837 $ECHO "*** a static module, that should work as long as the dlopening application"
5838 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5839 if test -z "$global_symbol_pipe"; then
5840 $ECHO
5841 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5842 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5843 $ECHO "*** not find such a program. So, this module is probably useless."
5844 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5845 fi
5846 if test "$build_old_libs" = no; then
5847 build_libtool_libs=module
5848 build_old_libs=yes
5849 else
5850 build_libtool_libs=no
5851 fi
5852 fi
5853 else
5854 deplibs="$dir/$old_library $deplibs"
5855 link_static=yes
5856 fi
5857 fi # link shared/static library?
5858
5859 if test "$linkmode" = lib; then
5860 if test -n "$dependency_libs" &&
5861 { test "$hardcode_into_libs" != yes ||
5862 test "$build_old_libs" = yes ||
5863 test "$link_static" = yes; }; then
5864 # Extract -R from dependency_libs
5865 temp_deplibs=
5866 for libdir in $dependency_libs; do
5867 case $libdir in
5868 -R*) func_stripname '-R' '' "$libdir"
5869 temp_xrpath=$func_stripname_result
5870 case " $xrpath " in
5871 *" $temp_xrpath "*) ;;
5872 *) xrpath="$xrpath $temp_xrpath";;
5873 esac;;
5874 *) temp_deplibs="$temp_deplibs $libdir";;
5875 esac
5876 done
5877 dependency_libs="$temp_deplibs"
5878 fi
5879
5880 newlib_search_path="$newlib_search_path $absdir"
5881 # Link against this library
5882 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5883 # ... and its dependency_libs
5884 tmp_libs=
5885 for deplib in $dependency_libs; do
5886 newdependency_libs="$deplib $newdependency_libs"
5887 if $opt_duplicate_deps ; then
5888 case "$tmp_libs " in
5889 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5890 esac
5891 fi
5892 tmp_libs="$tmp_libs $deplib"
5893 done
5894
5895 if test "$link_all_deplibs" != no; then
5896 # Add the search paths of all dependency libraries
5897 for deplib in $dependency_libs; do
5898 path=
5899 case $deplib in
5900 -L*) path="$deplib" ;;
5901 *.la)
5902 func_dirname "$deplib" "" "."
5903 dir="$func_dirname_result"
5904 # We need an absolute path.
5905 case $dir in
5906 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5907 *)
5908 absdir=`cd "$dir" && pwd`
5909 if test -z "$absdir"; then
5910 func_warning "cannot determine absolute directory name of \`$dir'"
5911 absdir="$dir"
5912 fi
5913 ;;
5914 esac
5915 if $GREP "^installed=no" $deplib > /dev/null; then
5916 case $host in
5917 *-*-darwin*)
5918 depdepl=
5919 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5920 if test -n "$deplibrary_names" ; then
5921 for tmp in $deplibrary_names ; do
5922 depdepl=$tmp
5923 done
5924 if test -f "$absdir/$objdir/$depdepl" ; then
5925 depdepl="$absdir/$objdir/$depdepl"
5926 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5927 if test -z "$darwin_install_name"; then
5928 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5929 fi
5930 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5931 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5932 path=
5933 fi
5934 fi
5935 ;;
5936 *)
5937 path="-L$absdir/$objdir"
5938 ;;
5939 esac
5940 else
5941 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5942 test -z "$libdir" && \
5943 func_fatal_error "\`$deplib' is not a valid libtool archive"
5944 test "$absdir" != "$libdir" && \
5945 func_warning "\`$deplib' seems to be moved"
5946
5947 path="-L$absdir"
5948 fi
5949 ;;
5950 esac
5951 case " $deplibs " in
5952 *" $path "*) ;;
5953 *) deplibs="$path $deplibs" ;;
5954 esac
5955 done
5956 fi # link_all_deplibs != no
5957 fi # linkmode = lib
5958 done # for deplib in $libs
5959 if test "$pass" = link; then
5960 if test "$linkmode" = "prog"; then
5961 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5962 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5963 else
5964 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5965 fi
5966 fi
5967 dependency_libs="$newdependency_libs"
5968 if test "$pass" = dlpreopen; then
5969 # Link the dlpreopened libraries before other libraries
5970 for deplib in $save_deplibs; do
5971 deplibs="$deplib $deplibs"
5972 done
5973 fi
5974 if test "$pass" != dlopen; then
5975 if test "$pass" != conv; then
5976 # Make sure lib_search_path contains only unique directories.
5977 lib_search_path=
5978 for dir in $newlib_search_path; do
5979 case "$lib_search_path " in
5980 *" $dir "*) ;;
5981 *) lib_search_path="$lib_search_path $dir" ;;
5982 esac
5983 done
5984 newlib_search_path=
5985 fi
5986
5987 if test "$linkmode,$pass" != "prog,link"; then
5988 vars="deplibs"
5989 else
5990 vars="compile_deplibs finalize_deplibs"
5991 fi
5992 for var in $vars dependency_libs; do
5993 # Add libraries to $var in reverse order
5994 eval tmp_libs=\"\$$var\"
5995 new_libs=
5996 for deplib in $tmp_libs; do
5997 # FIXME: Pedantically, this is the right thing to do, so
5998 # that some nasty dependency loop isn't accidentally
5999 # broken:
6000 #new_libs="$deplib $new_libs"
6001 # Pragmatically, this seems to cause very few problems in
6002 # practice:
6003 case $deplib in
6004 -L*) new_libs="$deplib $new_libs" ;;
6005 -R*) ;;
6006 *)
6007 # And here is the reason: when a library appears more
6008 # than once as an explicit dependence of a library, or
6009 # is implicitly linked in more than once by the
6010 # compiler, it is considered special, and multiple
6011 # occurrences thereof are not removed. Compare this
6012 # with having the same library being listed as a
6013 # dependency of multiple other libraries: in this case,
6014 # we know (pedantically, we assume) the library does not
6015 # need to be listed more than once, so we keep only the
6016 # last copy. This is not always right, but it is rare
6017 # enough that we require users that really mean to play
6018 # such unportable linking tricks to link the library
6019 # using -Wl,-lname, so that libtool does not consider it
6020 # for duplicate removal.
6021 case " $specialdeplibs " in
6022 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6023 *)
6024 case " $new_libs " in
6025 *" $deplib "*) ;;
6026 *) new_libs="$deplib $new_libs" ;;
6027 esac
6028 ;;
6029 esac
6030 ;;
6031 esac
6032 done
6033 tmp_libs=
6034 for deplib in $new_libs; do
6035 case $deplib in
6036 -L*)
6037 case " $tmp_libs " in
6038 *" $deplib "*) ;;
6039 *) tmp_libs="$tmp_libs $deplib" ;;
6040 esac
6041 ;;
6042 *) tmp_libs="$tmp_libs $deplib" ;;
6043 esac
6044 done
6045 eval $var=\"$tmp_libs\"
6046 done # for var
6047 fi
6048 # Last step: remove runtime libs from dependency_libs
6049 # (they stay in deplibs)
6050 tmp_libs=
6051 for i in $dependency_libs ; do
6052 case " $predeps $postdeps $compiler_lib_search_path " in
6053 *" $i "*)
6054 i=""
6055 ;;
6056 esac
6057 if test -n "$i" ; then
6058 tmp_libs="$tmp_libs $i"
6059 fi
6060 done
6061 dependency_libs=$tmp_libs
6062 done # for pass
6063 if test "$linkmode" = prog; then
6064 dlfiles="$newdlfiles"
6065 fi
6066 if test "$linkmode" = prog || test "$linkmode" = lib; then
6067 dlprefiles="$newdlprefiles"
6068 fi
6069
6070 case $linkmode in
6071 oldlib)
6072 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6073 func_warning "\`-dlopen' is ignored for archives"
6074 fi
6075
6076 case " $deplibs" in
6077 *\ -l* | *\ -L*)
6078 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6079 esac
6080
6081 test -n "$rpath" && \
6082 func_warning "\`-rpath' is ignored for archives"
6083
6084 test -n "$xrpath" && \
6085 func_warning "\`-R' is ignored for archives"
6086
6087 test -n "$vinfo" && \
6088 func_warning "\`-version-info/-version-number' is ignored for archives"
6089
6090 test -n "$release" && \
6091 func_warning "\`-release' is ignored for archives"
6092
6093 test -n "$export_symbols$export_symbols_regex" && \
6094 func_warning "\`-export-symbols' is ignored for archives"
6095
6096 # Now set the variables for building old libraries.
6097 build_libtool_libs=no
6098 oldlibs="$output"
6099 objs="$objs$old_deplibs"
6100 ;;
6101
6102 lib)
6103 # Make sure we only generate libraries of the form `libNAME.la'.
6104 case $outputname in
6105 lib*)
6106 func_stripname 'lib' '.la' "$outputname"
6107 name=$func_stripname_result
6108 eval shared_ext=\"$shrext_cmds\"
6109 eval libname=\"$libname_spec\"
6110 ;;
6111 *)
6112 test "$module" = no && \
6113 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6114
6115 if test "$need_lib_prefix" != no; then
6116 # Add the "lib" prefix for modules if required
6117 func_stripname '' '.la' "$outputname"
6118 name=$func_stripname_result
6119 eval shared_ext=\"$shrext_cmds\"
6120 eval libname=\"$libname_spec\"
6121 else
6122 func_stripname '' '.la' "$outputname"
6123 libname=$func_stripname_result
6124 fi
6125 ;;
6126 esac
6127
6128 if test -n "$objs"; then
6129 if test "$deplibs_check_method" != pass_all; then
6130 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6131 else
6132 $ECHO
6133 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6134 $ECHO "*** objects $objs is not portable!"
6135 libobjs="$libobjs $objs"
6136 fi
6137 fi
6138
6139 test "$dlself" != no && \
6140 func_warning "\`-dlopen self' is ignored for libtool libraries"
6141
6142 set dummy $rpath
6143 shift
6144 test "$#" -gt 1 && \
6145 func_warning "ignoring multiple \`-rpath's for a libtool library"
6146
6147 install_libdir="$1"
6148
6149 oldlibs=
6150 if test -z "$rpath"; then
6151 if test "$build_libtool_libs" = yes; then
6152 # Building a libtool convenience library.
6153 # Some compilers have problems with a `.al' extension so
6154 # convenience libraries should have the same extension an
6155 # archive normally would.
6156 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6157 build_libtool_libs=convenience
6158 build_old_libs=yes
6159 fi
6160
6161 test -n "$vinfo" && \
6162 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6163
6164 test -n "$release" && \
6165 func_warning "\`-release' is ignored for convenience libraries"
6166 else
6167
6168 # Parse the version information argument.
6169 save_ifs="$IFS"; IFS=':'
6170 set dummy $vinfo 0 0 0
6171 shift
6172 IFS="$save_ifs"
6173
6174 test -n "$7" && \
6175 func_fatal_help "too many parameters to \`-version-info'"
6176
6177 # convert absolute version numbers to libtool ages
6178 # this retains compatibility with .la files and attempts
6179 # to make the code below a bit more comprehensible
6180
6181 case $vinfo_number in
6182 yes)
6183 number_major="$1"
6184 number_minor="$2"
6185 number_revision="$3"
6186 #
6187 # There are really only two kinds -- those that
6188 # use the current revision as the major version
6189 # and those that subtract age and use age as
6190 # a minor version. But, then there is irix
6191 # which has an extra 1 added just for fun
6192 #
6193 case $version_type in
6194 darwin|linux|osf|windows|none)
6195 func_arith $number_major + $number_minor
6196 current=$func_arith_result
6197 age="$number_minor"
6198 revision="$number_revision"
6199 ;;
6200 freebsd-aout|freebsd-elf|sunos)
6201 current="$number_major"
6202 revision="$number_minor"
6203 age="0"
6204 ;;
6205 irix|nonstopux)
6206 func_arith $number_major + $number_minor
6207 current=$func_arith_result
6208 age="$number_minor"
6209 revision="$number_minor"
6210 lt_irix_increment=no
6211 ;;
6212 *)
6213 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
6214 ;;
6215 esac
6216 ;;
6217 no)
6218 current="$1"
6219 revision="$2"
6220 age="$3"
6221 ;;
6222 esac
6223
6224 # Check that each of the things are valid numbers.
6225 case $current in
6226 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6227 *)
6228 func_error "CURRENT \`$current' must be a nonnegative integer"
6229 func_fatal_error "\`$vinfo' is not valid version information"
6230 ;;
6231 esac
6232
6233 case $revision in
6234 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6235 *)
6236 func_error "REVISION \`$revision' must be a nonnegative integer"
6237 func_fatal_error "\`$vinfo' is not valid version information"
6238 ;;
6239 esac
6240
6241 case $age in
6242 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6243 *)
6244 func_error "AGE \`$age' must be a nonnegative integer"
6245 func_fatal_error "\`$vinfo' is not valid version information"
6246 ;;
6247 esac
6248
6249 if test "$age" -gt "$current"; then
6250 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6251 func_fatal_error "\`$vinfo' is not valid version information"
6252 fi
6253
6254 # Calculate the version variables.
6255 major=
6256 versuffix=
6257 verstring=
6258 case $version_type in
6259 none) ;;
6260
6261 darwin)
6262 # Like Linux, but with the current version available in
6263 # verstring for coding it into the library header
6264 func_arith $current - $age
6265 major=.$func_arith_result
6266 versuffix="$major.$age.$revision"
6267 # Darwin ld doesn't like 0 for these options...
6268 func_arith $current + 1
6269 minor_current=$func_arith_result
6270 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6271 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6272 ;;
6273
6274 freebsd-aout)
6275 major=".$current"
6276 versuffix=".$current.$revision";
6277 ;;
6278
6279 freebsd-elf)
6280 major=".$current"
6281 versuffix=".$current"
6282 ;;
6283
6284 irix | nonstopux)
6285 if test "X$lt_irix_increment" = "Xno"; then
6286 func_arith $current - $age
6287 else
6288 func_arith $current - $age + 1
6289 fi
6290 major=$func_arith_result
6291
6292 case $version_type in
6293 nonstopux) verstring_prefix=nonstopux ;;
6294 *) verstring_prefix=sgi ;;
6295 esac
6296 verstring="$verstring_prefix$major.$revision"
6297
6298 # Add in all the interfaces that we are compatible with.
6299 loop=$revision
6300 while test "$loop" -ne 0; do
6301 func_arith $revision - $loop
6302 iface=$func_arith_result
6303 func_arith $loop - 1
6304 loop=$func_arith_result
6305 verstring="$verstring_prefix$major.$iface:$verstring"
6306 done
6307
6308 # Before this point, $major must not contain `.'.
6309 major=.$major
6310 versuffix="$major.$revision"
6311 ;;
6312
6313 linux)
6314 func_arith $current - $age
6315 major=.$func_arith_result
6316 versuffix="$major.$age.$revision"
6317 ;;
6318
6319 osf)
6320 func_arith $current - $age
6321 major=.$func_arith_result
6322 versuffix=".$current.$age.$revision"
6323 verstring="$current.$age.$revision"
6324
6325 # Add in all the interfaces that we are compatible with.
6326 loop=$age
6327 while test "$loop" -ne 0; do
6328 func_arith $current - $loop
6329 iface=$func_arith_result
6330 func_arith $loop - 1
6331 loop=$func_arith_result
6332 verstring="$verstring:${iface}.0"
6333 done
6334
6335 # Make executables depend on our current version.
6336 verstring="$verstring:${current}.0"
6337 ;;
6338
6339 qnx)
6340 major=".$current"
6341 versuffix=".$current"
6342 ;;
6343
6344 sunos)
6345 major=".$current"
6346 versuffix=".$current.$revision"
6347 ;;
6348
6349 windows)
6350 # Use '-' rather than '.', since we only want one
6351 # extension on DOS 8.3 filesystems.
6352 func_arith $current - $age
6353 major=$func_arith_result
6354 versuffix="-$major"
6355 ;;
6356
6357 *)
6358 func_fatal_configuration "unknown library version type \`$version_type'"
6359 ;;
6360 esac
6361
6362 # Clear the version info if we defaulted, and they specified a release.
6363 if test -z "$vinfo" && test -n "$release"; then
6364 major=
6365 case $version_type in
6366 darwin)
6367 # we can't check for "0.0" in archive_cmds due to quoting
6368 # problems, so we reset it completely
6369 verstring=
6370 ;;
6371 *)
6372 verstring="0.0"
6373 ;;
6374 esac
6375 if test "$need_version" = no; then
6376 versuffix=
6377 else
6378 versuffix=".0.0"
6379 fi
6380 fi
6381
6382 # Remove version info from name if versioning should be avoided
6383 if test "$avoid_version" = yes && test "$need_version" = no; then
6384 major=
6385 versuffix=
6386 verstring=""
6387 fi
6388
6389 # Check to see if the archive will have undefined symbols.
6390 if test "$allow_undefined" = yes; then
6391 if test "$allow_undefined_flag" = unsupported; then
6392 func_warning "undefined symbols not allowed in $host shared libraries"
6393 build_libtool_libs=no
6394 build_old_libs=yes
6395 fi
6396 else
6397 # Don't allow undefined symbols.
6398 allow_undefined_flag="$no_undefined_flag"
6399 fi
6400
6401 fi
6402
6403 func_generate_dlsyms "$libname" "$libname" "yes"
6404 libobjs="$libobjs $symfileobj"
6405 test "X$libobjs" = "X " && libobjs=
6406
6407 if test "$mode" != relink; then
6408 # Remove our outputs, but don't remove object files since they
6409 # may have been created when compiling PIC objects.
6410 removelist=
6411 tempremovelist=`$ECHO "$output_objdir/*"`
6412 for p in $tempremovelist; do
6413 case $p in
6414 *.$objext | *.gcno)
6415 ;;
6416 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6417 if test "X$precious_files_regex" != "X"; then
6418 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6419 then
6420 continue
6421 fi
6422 fi
6423 removelist="$removelist $p"
6424 ;;
6425 *) ;;
6426 esac
6427 done
6428 test -n "$removelist" && \
6429 func_show_eval "${RM}r \$removelist"
6430 fi
6431
6432 # Now set the variables for building old libraries.
6433 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6434 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6435
6436 # Transform .lo files to .o files.
6437 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6438 fi
6439
6440 # Eliminate all temporary directories.
6441 #for path in $notinst_path; do
6442 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6443 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6444 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6445 #done
6446
6447 if test -n "$xrpath"; then
6448 # If the user specified any rpath flags, then add them.
6449 temp_xrpath=
6450 for libdir in $xrpath; do
6451 temp_xrpath="$temp_xrpath -R$libdir"
6452 case "$finalize_rpath " in
6453 *" $libdir "*) ;;
6454 *) finalize_rpath="$finalize_rpath $libdir" ;;
6455 esac
6456 done
6457 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6458 dependency_libs="$temp_xrpath $dependency_libs"
6459 fi
6460 fi
6461
6462 # Make sure dlfiles contains only unique files that won't be dlpreopened
6463 old_dlfiles="$dlfiles"
6464 dlfiles=
6465 for lib in $old_dlfiles; do
6466 case " $dlprefiles $dlfiles " in
6467 *" $lib "*) ;;
6468 *) dlfiles="$dlfiles $lib" ;;
6469 esac
6470 done
6471
6472 # Make sure dlprefiles contains only unique files
6473 old_dlprefiles="$dlprefiles"
6474 dlprefiles=
6475 for lib in $old_dlprefiles; do
6476 case "$dlprefiles " in
6477 *" $lib "*) ;;
6478 *) dlprefiles="$dlprefiles $lib" ;;
6479 esac
6480 done
6481
6482 if test "$build_libtool_libs" = yes; then
6483 if test -n "$rpath"; then
6484 case $host in
6485 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
6486 # these systems don't actually have a c library (as such)!
6487 ;;
6488 *-*-rhapsody* | *-*-darwin1.[012])
6489 # Rhapsody C library is in the System framework
6490 deplibs="$deplibs System.ltframework"
6491 ;;
6492 *-*-netbsd*)
6493 # Don't link with libc until the a.out ld.so is fixed.
6494 ;;
6495 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6496 # Do not include libc due to us having libc/libc_r.
6497 ;;
6498 *-*-sco3.2v5* | *-*-sco5v6*)
6499 # Causes problems with __ctype
6500 ;;
6501 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6502 # Compiler inserts libc in the correct place for threads to work
6503 ;;
6504 *)
6505 # Add libc to deplibs on all other systems if necessary.
6506 if test "$build_libtool_need_lc" = "yes"; then
6507 deplibs="$deplibs -lc"
6508 fi
6509 ;;
6510 esac
6511 fi
6512
6513 # Transform deplibs into only deplibs that can be linked in shared.
6514 name_save=$name
6515 libname_save=$libname
6516 release_save=$release
6517 versuffix_save=$versuffix
6518 major_save=$major
6519 # I'm not sure if I'm treating the release correctly. I think
6520 # release should show up in the -l (ie -lgmp5) so we don't want to
6521 # add it in twice. Is that correct?
6522 release=""
6523 versuffix=""
6524 major=""
6525 newdeplibs=
6526 droppeddeps=no
6527 case $deplibs_check_method in
6528 pass_all)
6529 # Don't check for shared/static. Everything works.
6530 # This might be a little naive. We might want to check
6531 # whether the library exists or not. But this is on
6532 # osf3 & osf4 and I'm not really sure... Just
6533 # implementing what was already the behavior.
6534 newdeplibs=$deplibs
6535 ;;
6536 test_compile)
6537 # This code stresses the "libraries are programs" paradigm to its
6538 # limits. Maybe even breaks it. We compile a program, linking it
6539 # against the deplibs as a proxy for the library. Then we can check
6540 # whether they linked in statically or dynamically with ldd.
6541 $opt_dry_run || $RM conftest.c
6542 cat > conftest.c <<EOF
6543 int main() { return 0; }
6544 EOF
6545 $opt_dry_run || $RM conftest
6546 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6547 ldd_output=`ldd conftest`
6548 for i in $deplibs; do
6549 case $i in
6550 -l*)
6551 func_stripname -l '' "$i"
6552 name=$func_stripname_result
6553 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6554 case " $predeps $postdeps " in
6555 *" $i "*)
6556 newdeplibs="$newdeplibs $i"
6557 i=""
6558 ;;
6559 esac
6560 fi
6561 if test -n "$i" ; then
6562 libname=`eval "\\$ECHO \"$libname_spec\""`
6563 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6564 set dummy $deplib_matches; shift
6565 deplib_match=$1
6566 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6567 newdeplibs="$newdeplibs $i"
6568 else
6569 droppeddeps=yes
6570 $ECHO
6571 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6572 $ECHO "*** I have the capability to make that library automatically link in when"
6573 $ECHO "*** you link to this library. But I can only do this if you have a"
6574 $ECHO "*** shared version of the library, which I believe you do not have"
6575 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6576 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6577 fi
6578 fi
6579 ;;
6580 *)
6581 newdeplibs="$newdeplibs $i"
6582 ;;
6583 esac
6584 done
6585 else
6586 # Error occurred in the first compile. Let's try to salvage
6587 # the situation: Compile a separate program for each library.
6588 for i in $deplibs; do
6589 case $i in
6590 -l*)
6591 func_stripname -l '' "$i"
6592 name=$func_stripname_result
6593 $opt_dry_run || $RM conftest
6594 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6595 ldd_output=`ldd conftest`
6596 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6597 case " $predeps $postdeps " in
6598 *" $i "*)
6599 newdeplibs="$newdeplibs $i"
6600 i=""
6601 ;;
6602 esac
6603 fi
6604 if test -n "$i" ; then
6605 libname=`eval "\\$ECHO \"$libname_spec\""`
6606 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6607 set dummy $deplib_matches; shift
6608 deplib_match=$1
6609 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6610 newdeplibs="$newdeplibs $i"
6611 else
6612 droppeddeps=yes
6613 $ECHO
6614 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6615 $ECHO "*** I have the capability to make that library automatically link in when"
6616 $ECHO "*** you link to this library. But I can only do this if you have a"
6617 $ECHO "*** shared version of the library, which you do not appear to have"
6618 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6619 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6620 fi
6621 fi
6622 else
6623 droppeddeps=yes
6624 $ECHO
6625 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6626 $ECHO "*** make it link in! You will probably need to install it or some"
6627 $ECHO "*** library that it depends on before this library will be fully"
6628 $ECHO "*** functional. Installing it before continuing would be even better."
6629 fi
6630 ;;
6631 *)
6632 newdeplibs="$newdeplibs $i"
6633 ;;
6634 esac
6635 done
6636 fi
6637 ;;
6638 file_magic*)
6639 set dummy $deplibs_check_method; shift
6640 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6641 for a_deplib in $deplibs; do
6642 case $a_deplib in
6643 -l*)
6644 func_stripname -l '' "$a_deplib"
6645 name=$func_stripname_result
6646 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6647 case " $predeps $postdeps " in
6648 *" $a_deplib "*)
6649 newdeplibs="$newdeplibs $a_deplib"
6650 a_deplib=""
6651 ;;
6652 esac
6653 fi
6654 if test -n "$a_deplib" ; then
6655 libname=`eval "\\$ECHO \"$libname_spec\""`
6656 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6657 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6658 for potent_lib in $potential_libs; do
6659 # Follow soft links.
6660 if ls -lLd "$potent_lib" 2>/dev/null |
6661 $GREP " -> " >/dev/null; then
6662 continue
6663 fi
6664 # The statement above tries to avoid entering an
6665 # endless loop below, in case of cyclic links.
6666 # We might still enter an endless loop, since a link
6667 # loop can be closed while we follow links,
6668 # but so what?
6669 potlib="$potent_lib"
6670 while test -h "$potlib" 2>/dev/null; do
6671 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6672 case $potliblink in
6673 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6674 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6675 esac
6676 done
6677 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6678 $SED -e 10q |
6679 $EGREP "$file_magic_regex" > /dev/null; then
6680 newdeplibs="$newdeplibs $a_deplib"
6681 a_deplib=""
6682 break 2
6683 fi
6684 done
6685 done
6686 fi
6687 if test -n "$a_deplib" ; then
6688 droppeddeps=yes
6689 $ECHO
6690 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6691 $ECHO "*** I have the capability to make that library automatically link in when"
6692 $ECHO "*** you link to this library. But I can only do this if you have a"
6693 $ECHO "*** shared version of the library, which you do not appear to have"
6694 $ECHO "*** because I did check the linker path looking for a file starting"
6695 if test -z "$potlib" ; then
6696 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6697 else
6698 $ECHO "*** with $libname and none of the candidates passed a file format test"
6699 $ECHO "*** using a file magic. Last file checked: $potlib"
6700 fi
6701 fi
6702 ;;
6703 *)
6704 # Add a -L argument.
6705 newdeplibs="$newdeplibs $a_deplib"
6706 ;;
6707 esac
6708 done # Gone through all deplibs.
6709 ;;
6710 match_pattern*)
6711 set dummy $deplibs_check_method; shift
6712 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6713 for a_deplib in $deplibs; do
6714 case $a_deplib in
6715 -l*)
6716 func_stripname -l '' "$a_deplib"
6717 name=$func_stripname_result
6718 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6719 case " $predeps $postdeps " in
6720 *" $a_deplib "*)
6721 newdeplibs="$newdeplibs $a_deplib"
6722 a_deplib=""
6723 ;;
6724 esac
6725 fi
6726 if test -n "$a_deplib" ; then
6727 libname=`eval "\\$ECHO \"$libname_spec\""`
6728 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6729 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6730 for potent_lib in $potential_libs; do
6731 potlib="$potent_lib" # see symlink-check above in file_magic test
6732 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6733 $EGREP "$match_pattern_regex" > /dev/null; then
6734 newdeplibs="$newdeplibs $a_deplib"
6735 a_deplib=""
6736 break 2
6737 fi
6738 done
6739 done
6740 fi
6741 if test -n "$a_deplib" ; then
6742 droppeddeps=yes
6743 $ECHO
6744 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6745 $ECHO "*** I have the capability to make that library automatically link in when"
6746 $ECHO "*** you link to this library. But I can only do this if you have a"
6747 $ECHO "*** shared version of the library, which you do not appear to have"
6748 $ECHO "*** because I did check the linker path looking for a file starting"
6749 if test -z "$potlib" ; then
6750 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6751 else
6752 $ECHO "*** with $libname and none of the candidates passed a file format test"
6753 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6754 fi
6755 fi
6756 ;;
6757 *)
6758 # Add a -L argument.
6759 newdeplibs="$newdeplibs $a_deplib"
6760 ;;
6761 esac
6762 done # Gone through all deplibs.
6763 ;;
6764 none | unknown | *)
6765 newdeplibs=""
6766 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6767 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6768 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6769 for i in $predeps $postdeps ; do
6770 # can't use Xsed below, because $i might contain '/'
6771 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6772 done
6773 fi
6774 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6775 $GREP . >/dev/null; then
6776 $ECHO
6777 if test "X$deplibs_check_method" = "Xnone"; then
6778 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6779 else
6780 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6781 fi
6782 $ECHO "*** All declared inter-library dependencies are being dropped."
6783 droppeddeps=yes
6784 fi
6785 ;;
6786 esac
6787 versuffix=$versuffix_save
6788 major=$major_save
6789 release=$release_save
6790 libname=$libname_save
6791 name=$name_save
6792
6793 case $host in
6794 *-*-rhapsody* | *-*-darwin1.[012])
6795 # On Rhapsody replace the C library with the System framework
6796 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6797 ;;
6798 esac
6799
6800 if test "$droppeddeps" = yes; then
6801 if test "$module" = yes; then
6802 $ECHO
6803 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6804 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6805 $ECHO "*** a static module, that should work as long as the dlopening"
6806 $ECHO "*** application is linked with the -dlopen flag."
6807 if test -z "$global_symbol_pipe"; then
6808 $ECHO
6809 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6810 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6811 $ECHO "*** not find such a program. So, this module is probably useless."
6812 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6813 fi
6814 if test "$build_old_libs" = no; then
6815 oldlibs="$output_objdir/$libname.$libext"
6816 build_libtool_libs=module
6817 build_old_libs=yes
6818 else
6819 build_libtool_libs=no
6820 fi
6821 else
6822 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6823 $ECHO "*** automatically added whenever a program is linked with this library"
6824 $ECHO "*** or is declared to -dlopen it."
6825
6826 if test "$allow_undefined" = no; then
6827 $ECHO
6828 $ECHO "*** Since this library must not contain undefined symbols,"
6829 $ECHO "*** because either the platform does not support them or"
6830 $ECHO "*** it was explicitly requested with -no-undefined,"
6831 $ECHO "*** libtool will only create a static version of it."
6832 if test "$build_old_libs" = no; then
6833 oldlibs="$output_objdir/$libname.$libext"
6834 build_libtool_libs=module
6835 build_old_libs=yes
6836 else
6837 build_libtool_libs=no
6838 fi
6839 fi
6840 fi
6841 fi
6842 # Done checking deplibs!
6843 deplibs=$newdeplibs
6844 fi
6845 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6846 case $host in
6847 *-*-darwin*)
6848 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6849 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6850 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6851 ;;
6852 esac
6853
6854 # move library search paths that coincide with paths to not yet
6855 # installed libraries to the beginning of the library search list
6856 new_libs=
6857 for path in $notinst_path; do
6858 case " $new_libs " in
6859 *" -L$path/$objdir "*) ;;
6860 *)
6861 case " $deplibs " in
6862 *" -L$path/$objdir "*)
6863 new_libs="$new_libs -L$path/$objdir" ;;
6864 esac
6865 ;;
6866 esac
6867 done
6868 for deplib in $deplibs; do
6869 case $deplib in
6870 -L*)
6871 case " $new_libs " in
6872 *" $deplib "*) ;;
6873 *) new_libs="$new_libs $deplib" ;;
6874 esac
6875 ;;
6876 *) new_libs="$new_libs $deplib" ;;
6877 esac
6878 done
6879 deplibs="$new_libs"
6880
6881 # All the library-specific variables (install_libdir is set above).
6882 library_names=
6883 old_library=
6884 dlname=
6885
6886 # Test again, we may have decided not to build it any more
6887 if test "$build_libtool_libs" = yes; then
6888 if test "$hardcode_into_libs" = yes; then
6889 # Hardcode the library paths
6890 hardcode_libdirs=
6891 dep_rpath=
6892 rpath="$finalize_rpath"
6893 test "$mode" != relink && rpath="$compile_rpath$rpath"
6894 for libdir in $rpath; do
6895 if test -n "$hardcode_libdir_flag_spec"; then
6896 if test -n "$hardcode_libdir_separator"; then
6897 if test -z "$hardcode_libdirs"; then
6898 hardcode_libdirs="$libdir"
6899 else
6900 # Just accumulate the unique libdirs.
6901 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6902 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6903 ;;
6904 *)
6905 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6906 ;;
6907 esac
6908 fi
6909 else
6910 eval flag=\"$hardcode_libdir_flag_spec\"
6911 dep_rpath="$dep_rpath $flag"
6912 fi
6913 elif test -n "$runpath_var"; then
6914 case "$perm_rpath " in
6915 *" $libdir "*) ;;
6916 *) perm_rpath="$perm_rpath $libdir" ;;
6917 esac
6918 fi
6919 done
6920 # Substitute the hardcoded libdirs into the rpath.
6921 if test -n "$hardcode_libdir_separator" &&
6922 test -n "$hardcode_libdirs"; then
6923 libdir="$hardcode_libdirs"
6924 if test -n "$hardcode_libdir_flag_spec_ld"; then
6925 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6926 else
6927 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6928 fi
6929 fi
6930 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6931 # We should set the runpath_var.
6932 rpath=
6933 for dir in $perm_rpath; do
6934 rpath="$rpath$dir:"
6935 done
6936 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6937 fi
6938 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6939 fi
6940
6941 shlibpath="$finalize_shlibpath"
6942 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6943 if test -n "$shlibpath"; then
6944 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6945 fi
6946
6947 # Get the real and link names of the library.
6948 eval shared_ext=\"$shrext_cmds\"
6949 eval library_names=\"$library_names_spec\"
6950 set dummy $library_names
6951 shift
6952 realname="$1"
6953 shift
6954
6955 if test -n "$soname_spec"; then
6956 eval soname=\"$soname_spec\"
6957 else
6958 soname="$realname"
6959 fi
6960 if test -z "$dlname"; then
6961 dlname=$soname
6962 fi
6963
6964 lib="$output_objdir/$realname"
6965 linknames=
6966 for link
6967 do
6968 linknames="$linknames $link"
6969 done
6970
6971 # Use standard objects if they are pic
6972 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6973 test "X$libobjs" = "X " && libobjs=
6974
6975 delfiles=
6976 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6977 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6978 export_symbols="$output_objdir/$libname.uexp"
6979 delfiles="$delfiles $export_symbols"
6980 fi
6981
6982 orig_export_symbols=
6983 case $host_os in
6984 cygwin* | mingw* | cegcc*)
6985 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6986 # exporting using user supplied symfile
6987 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6988 # and it's NOT already a .def file. Must figure out
6989 # which of the given symbols are data symbols and tag
6990 # them as such. So, trigger use of export_symbols_cmds.
6991 # export_symbols gets reassigned inside the "prepare
6992 # the list of exported symbols" if statement, so the
6993 # include_expsyms logic still works.
6994 orig_export_symbols="$export_symbols"
6995 export_symbols=
6996 always_export_symbols=yes
6997 fi
6998 fi
6999 ;;
7000 esac
7001
7002 # Prepare the list of exported symbols
7003 if test -z "$export_symbols"; then
7004 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
7005 func_verbose "generating symbol list for \`$libname.la'"
7006 export_symbols="$output_objdir/$libname.exp"
7007 $opt_dry_run || $RM $export_symbols
7008 cmds=$export_symbols_cmds
7009 save_ifs="$IFS"; IFS='~'
7010 for cmd in $cmds; do
7011 IFS="$save_ifs"
7012 eval cmd=\"$cmd\"
7013 func_len " $cmd"
7014 len=$func_len_result
7015 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7016 func_show_eval "$cmd" 'exit $?'
7017 skipped_export=false
7018 else
7019 # The command line is too long to execute in one step.
7020 func_verbose "using reloadable object file for export list..."
7021 skipped_export=:
7022 # Break out early, otherwise skipped_export may be
7023 # set to false by a later but shorter cmd.
7024 break
7025 fi
7026 done
7027 IFS="$save_ifs"
7028 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7029 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7030 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7031 fi
7032 fi
7033 fi
7034
7035 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7036 tmp_export_symbols="$export_symbols"
7037 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7038 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7039 fi
7040
7041 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7042 # The given exports_symbols file has to be filtered, so filter it.
7043 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7044 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7045 # 's' commands which not all seds can handle. GNU sed should be fine
7046 # though. Also, the filter scales superlinearly with the number of
7047 # global variables. join(1) would be nice here, but unfortunately
7048 # isn't a blessed tool.
7049 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7050 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7051 export_symbols=$output_objdir/$libname.def
7052 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7053 fi
7054
7055 tmp_deplibs=
7056 for test_deplib in $deplibs; do
7057 case " $convenience " in
7058 *" $test_deplib "*) ;;
7059 *)
7060 tmp_deplibs="$tmp_deplibs $test_deplib"
7061 ;;
7062 esac
7063 done
7064 deplibs="$tmp_deplibs"
7065
7066 if test -n "$convenience"; then
7067 if test -n "$whole_archive_flag_spec" &&
7068 test "$compiler_needs_object" = yes &&
7069 test -z "$libobjs"; then
7070 # extract the archives, so we have objects to list.
7071 # TODO: could optimize this to just extract one archive.
7072 whole_archive_flag_spec=
7073 fi
7074 if test -n "$whole_archive_flag_spec"; then
7075 save_libobjs=$libobjs
7076 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7077 test "X$libobjs" = "X " && libobjs=
7078 else
7079 gentop="$output_objdir/${outputname}x"
7080 generated="$generated $gentop"
7081
7082 func_extract_archives $gentop $convenience
7083 libobjs="$libobjs $func_extract_archives_result"
7084 test "X$libobjs" = "X " && libobjs=
7085 fi
7086 fi
7087
7088 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7089 eval flag=\"$thread_safe_flag_spec\"
7090 linker_flags="$linker_flags $flag"
7091 fi
7092
7093 # Make a backup of the uninstalled library when relinking
7094 if test "$mode" = relink; then
7095 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7096 fi
7097
7098 # Do each of the archive commands.
7099 if test "$module" = yes && test -n "$module_cmds" ; then
7100 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7101 eval test_cmds=\"$module_expsym_cmds\"
7102 cmds=$module_expsym_cmds
7103 else
7104 eval test_cmds=\"$module_cmds\"
7105 cmds=$module_cmds
7106 fi
7107 else
7108 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7109 eval test_cmds=\"$archive_expsym_cmds\"
7110 cmds=$archive_expsym_cmds
7111 else
7112 eval test_cmds=\"$archive_cmds\"
7113 cmds=$archive_cmds
7114 fi
7115 fi
7116
7117 if test "X$skipped_export" != "X:" &&
7118 func_len " $test_cmds" &&
7119 len=$func_len_result &&
7120 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7121 :
7122 else
7123 # The command line is too long to link in one step, link piecewise
7124 # or, if using GNU ld and skipped_export is not :, use a linker
7125 # script.
7126
7127 # Save the value of $output and $libobjs because we want to
7128 # use them later. If we have whole_archive_flag_spec, we
7129 # want to use save_libobjs as it was before
7130 # whole_archive_flag_spec was expanded, because we can't
7131 # assume the linker understands whole_archive_flag_spec.
7132 # This may have to be revisited, in case too many
7133 # convenience libraries get linked in and end up exceeding
7134 # the spec.
7135 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7136 save_libobjs=$libobjs
7137 fi
7138 save_output=$output
7139 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7140
7141 # Clear the reloadable object creation command queue and
7142 # initialize k to one.
7143 test_cmds=
7144 concat_cmds=
7145 objlist=
7146 last_robj=
7147 k=1
7148
7149 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7150 output=${output_objdir}/${output_la}.lnkscript
7151 func_verbose "creating GNU ld script: $output"
7152 $ECHO 'INPUT (' > $output
7153 for obj in $save_libobjs
7154 do
7155 $ECHO "$obj" >> $output
7156 done
7157 $ECHO ')' >> $output
7158 delfiles="$delfiles $output"
7159 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7160 output=${output_objdir}/${output_la}.lnk
7161 func_verbose "creating linker input file list: $output"
7162 : > $output
7163 set x $save_libobjs
7164 shift
7165 firstobj=
7166 if test "$compiler_needs_object" = yes; then
7167 firstobj="$1 "
7168 shift
7169 fi
7170 for obj
7171 do
7172 $ECHO "$obj" >> $output
7173 done
7174 delfiles="$delfiles $output"
7175 output=$firstobj\"$file_list_spec$output\"
7176 else
7177 if test -n "$save_libobjs"; then
7178 func_verbose "creating reloadable object files..."
7179 output=$output_objdir/$output_la-${k}.$objext
7180 eval test_cmds=\"$reload_cmds\"
7181 func_len " $test_cmds"
7182 len0=$func_len_result
7183 len=$len0
7184
7185 # Loop over the list of objects to be linked.
7186 for obj in $save_libobjs
7187 do
7188 func_len " $obj"
7189 func_arith $len + $func_len_result
7190 len=$func_arith_result
7191 if test "X$objlist" = X ||
7192 test "$len" -lt "$max_cmd_len"; then
7193 func_append objlist " $obj"
7194 else
7195 # The command $test_cmds is almost too long, add a
7196 # command to the queue.
7197 if test "$k" -eq 1 ; then
7198 # The first file doesn't have a previous command to add.
7199 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7200 else
7201 # All subsequent reloadable object files will link in
7202 # the last one created.
7203 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7204 fi
7205 last_robj=$output_objdir/$output_la-${k}.$objext
7206 func_arith $k + 1
7207 k=$func_arith_result
7208 output=$output_objdir/$output_la-${k}.$objext
7209 objlist=$obj
7210 func_len " $last_robj"
7211 func_arith $len0 + $func_len_result
7212 len=$func_arith_result
7213 fi
7214 done
7215 # Handle the remaining objects by creating one last
7216 # reloadable object file. All subsequent reloadable object
7217 # files will link in the last one created.
7218 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7219 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7220 if test -n "$last_robj"; then
7221 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7222 fi
7223 delfiles="$delfiles $output"
7224
7225 else
7226 output=
7227 fi
7228
7229 if ${skipped_export-false}; then
7230 func_verbose "generating symbol list for \`$libname.la'"
7231 export_symbols="$output_objdir/$libname.exp"
7232 $opt_dry_run || $RM $export_symbols
7233 libobjs=$output
7234 # Append the command to create the export file.
7235 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7236 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7237 if test -n "$last_robj"; then
7238 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7239 fi
7240 fi
7241
7242 test -n "$save_libobjs" &&
7243 func_verbose "creating a temporary reloadable object file: $output"
7244
7245 # Loop through the commands generated above and execute them.
7246 save_ifs="$IFS"; IFS='~'
7247 for cmd in $concat_cmds; do
7248 IFS="$save_ifs"
7249 $opt_silent || {
7250 func_quote_for_expand "$cmd"
7251 eval "func_echo $func_quote_for_expand_result"
7252 }
7253 $opt_dry_run || eval "$cmd" || {
7254 lt_exit=$?
7255
7256 # Restore the uninstalled library and exit
7257 if test "$mode" = relink; then
7258 ( cd "$output_objdir" && \
7259 $RM "${realname}T" && \
7260 $MV "${realname}U" "$realname" )
7261 fi
7262
7263 exit $lt_exit
7264 }
7265 done
7266 IFS="$save_ifs"
7267
7268 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7269 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7270 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7271 fi
7272 fi
7273
7274 if ${skipped_export-false}; then
7275 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7276 tmp_export_symbols="$export_symbols"
7277 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7278 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7279 fi
7280
7281 if test -n "$orig_export_symbols"; then
7282 # The given exports_symbols file has to be filtered, so filter it.
7283 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7284 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7285 # 's' commands which not all seds can handle. GNU sed should be fine
7286 # though. Also, the filter scales superlinearly with the number of
7287 # global variables. join(1) would be nice here, but unfortunately
7288 # isn't a blessed tool.
7289 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7290 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7291 export_symbols=$output_objdir/$libname.def
7292 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7293 fi
7294 fi
7295
7296 libobjs=$output
7297 # Restore the value of output.
7298 output=$save_output
7299
7300 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7301 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7302 test "X$libobjs" = "X " && libobjs=
7303 fi
7304 # Expand the library linking commands again to reset the
7305 # value of $libobjs for piecewise linking.
7306
7307 # Do each of the archive commands.
7308 if test "$module" = yes && test -n "$module_cmds" ; then
7309 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7310 cmds=$module_expsym_cmds
7311 else
7312 cmds=$module_cmds
7313 fi
7314 else
7315 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7316 cmds=$archive_expsym_cmds
7317 else
7318 cmds=$archive_cmds
7319 fi
7320 fi
7321 fi
7322
7323 if test -n "$delfiles"; then
7324 # Append the command to remove temporary files to $cmds.
7325 eval cmds=\"\$cmds~\$RM $delfiles\"
7326 fi
7327
7328 # Add any objects from preloaded convenience libraries
7329 if test -n "$dlprefiles"; then
7330 gentop="$output_objdir/${outputname}x"
7331 generated="$generated $gentop"
7332
7333 func_extract_archives $gentop $dlprefiles
7334 libobjs="$libobjs $func_extract_archives_result"
7335 test "X$libobjs" = "X " && libobjs=
7336 fi
7337
7338 save_ifs="$IFS"; IFS='~'
7339 for cmd in $cmds; do
7340 IFS="$save_ifs"
7341 eval cmd=\"$cmd\"
7342 $opt_silent || {
7343 func_quote_for_expand "$cmd"
7344 eval "func_echo $func_quote_for_expand_result"
7345 }
7346 $opt_dry_run || eval "$cmd" || {
7347 lt_exit=$?
7348
7349 # Restore the uninstalled library and exit
7350 if test "$mode" = relink; then
7351 ( cd "$output_objdir" && \
7352 $RM "${realname}T" && \
7353 $MV "${realname}U" "$realname" )
7354 fi
7355
7356 exit $lt_exit
7357 }
7358 done
7359 IFS="$save_ifs"
7360
7361 # Restore the uninstalled library and exit
7362 if test "$mode" = relink; then
7363 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7364
7365 if test -n "$convenience"; then
7366 if test -z "$whole_archive_flag_spec"; then
7367 func_show_eval '${RM}r "$gentop"'
7368 fi
7369 fi
7370
7371 exit $EXIT_SUCCESS
7372 fi
7373
7374 # Create links to the real library.
7375 for linkname in $linknames; do
7376 if test "$realname" != "$linkname"; then
7377 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7378 fi
7379 done
7380
7381 # If -module or -export-dynamic was specified, set the dlname.
7382 if test "$module" = yes || test "$export_dynamic" = yes; then
7383 # On all known operating systems, these are identical.
7384 dlname="$soname"
7385 fi
7386 fi
7387 ;;
7388
7389 obj)
7390 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7391 func_warning "\`-dlopen' is ignored for objects"
7392 fi
7393
7394 case " $deplibs" in
7395 *\ -l* | *\ -L*)
7396 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7397 esac
7398
7399 test -n "$rpath" && \
7400 func_warning "\`-rpath' is ignored for objects"
7401
7402 test -n "$xrpath" && \
7403 func_warning "\`-R' is ignored for objects"
7404
7405 test -n "$vinfo" && \
7406 func_warning "\`-version-info' is ignored for objects"
7407
7408 test -n "$release" && \
7409 func_warning "\`-release' is ignored for objects"
7410
7411 case $output in
7412 *.lo)
7413 test -n "$objs$old_deplibs" && \
7414 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7415
7416 libobj=$output
7417 func_lo2o "$libobj"
7418 obj=$func_lo2o_result
7419 ;;
7420 *)
7421 libobj=
7422 obj="$output"
7423 ;;
7424 esac
7425
7426 # Delete the old objects.
7427 $opt_dry_run || $RM $obj $libobj
7428
7429 # Objects from convenience libraries. This assumes
7430 # single-version convenience libraries. Whenever we create
7431 # different ones for PIC/non-PIC, this we'll have to duplicate
7432 # the extraction.
7433 reload_conv_objs=
7434 gentop=
7435 # reload_cmds runs $LD directly, so let us get rid of
7436 # -Wl from whole_archive_flag_spec and hope we can get by with
7437 # turning comma into space..
7438 wl=
7439
7440 if test -n "$convenience"; then
7441 if test -n "$whole_archive_flag_spec"; then
7442 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7443 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7444 else
7445 gentop="$output_objdir/${obj}x"
7446 generated="$generated $gentop"
7447
7448 func_extract_archives $gentop $convenience
7449 reload_conv_objs="$reload_objs $func_extract_archives_result"
7450 fi
7451 fi
7452
7453 # Create the old-style object.
7454 reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7455
7456 output="$obj"
7457 func_execute_cmds "$reload_cmds" 'exit $?'
7458
7459 # Exit if we aren't doing a library object file.
7460 if test -z "$libobj"; then
7461 if test -n "$gentop"; then
7462 func_show_eval '${RM}r "$gentop"'
7463 fi
7464
7465 exit $EXIT_SUCCESS
7466 fi
7467
7468 if test "$build_libtool_libs" != yes; then
7469 if test -n "$gentop"; then
7470 func_show_eval '${RM}r "$gentop"'
7471 fi
7472
7473 # Create an invalid libtool object if no PIC, so that we don't
7474 # accidentally link it into a program.
7475 # $show "echo timestamp > $libobj"
7476 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7477 exit $EXIT_SUCCESS
7478 fi
7479
7480 if test -n "$pic_flag" || test "$pic_mode" != default; then
7481 # Only do commands if we really have different PIC objects.
7482 reload_objs="$libobjs $reload_conv_objs"
7483 output="$libobj"
7484 func_execute_cmds "$reload_cmds" 'exit $?'
7485 fi
7486
7487 if test -n "$gentop"; then
7488 func_show_eval '${RM}r "$gentop"'
7489 fi
7490
7491 exit $EXIT_SUCCESS
7492 ;;
7493
7494 prog)
7495 case $host in
7496 *cygwin*) func_stripname '' '.exe' "$output"
7497 output=$func_stripname_result.exe;;
7498 esac
7499 test -n "$vinfo" && \
7500 func_warning "\`-version-info' is ignored for programs"
7501
7502 test -n "$release" && \
7503 func_warning "\`-release' is ignored for programs"
7504
7505 test "$preload" = yes \
7506 && test "$dlopen_support" = unknown \
7507 && test "$dlopen_self" = unknown \
7508 && test "$dlopen_self_static" = unknown && \
7509 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7510
7511 case $host in
7512 *-*-rhapsody* | *-*-darwin1.[012])
7513 # On Rhapsody replace the C library is the System framework
7514 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7515 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7516 ;;
7517 esac
7518
7519 case $host in
7520 *-*-darwin*)
7521 # Don't allow lazy linking, it breaks C++ global constructors
7522 # But is supposedly fixed on 10.4 or later (yay!).
7523 if test "$tagname" = CXX ; then
7524 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7525 10.[0123])
7526 compile_command="$compile_command ${wl}-bind_at_load"
7527 finalize_command="$finalize_command ${wl}-bind_at_load"
7528 ;;
7529 esac
7530 fi
7531 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7532 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7533 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7534 ;;
7535 esac
7536
7537
7538 # move library search paths that coincide with paths to not yet
7539 # installed libraries to the beginning of the library search list
7540 new_libs=
7541 for path in $notinst_path; do
7542 case " $new_libs " in
7543 *" -L$path/$objdir "*) ;;
7544 *)
7545 case " $compile_deplibs " in
7546 *" -L$path/$objdir "*)
7547 new_libs="$new_libs -L$path/$objdir" ;;
7548 esac
7549 ;;
7550 esac
7551 done
7552 for deplib in $compile_deplibs; do
7553 case $deplib in
7554 -L*)
7555 case " $new_libs " in
7556 *" $deplib "*) ;;
7557 *) new_libs="$new_libs $deplib" ;;
7558 esac
7559 ;;
7560 *) new_libs="$new_libs $deplib" ;;
7561 esac
7562 done
7563 compile_deplibs="$new_libs"
7564
7565
7566 compile_command="$compile_command $compile_deplibs"
7567 finalize_command="$finalize_command $finalize_deplibs"
7568
7569 if test -n "$rpath$xrpath"; then
7570 # If the user specified any rpath flags, then add them.
7571 for libdir in $rpath $xrpath; do
7572 # This is the magic to use -rpath.
7573 case "$finalize_rpath " in
7574 *" $libdir "*) ;;
7575 *) finalize_rpath="$finalize_rpath $libdir" ;;
7576 esac
7577 done
7578 fi
7579
7580 # Now hardcode the library paths
7581 rpath=
7582 hardcode_libdirs=
7583 for libdir in $compile_rpath $finalize_rpath; do
7584 if test -n "$hardcode_libdir_flag_spec"; then
7585 if test -n "$hardcode_libdir_separator"; then
7586 if test -z "$hardcode_libdirs"; then
7587 hardcode_libdirs="$libdir"
7588 else
7589 # Just accumulate the unique libdirs.
7590 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7591 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7592 ;;
7593 *)
7594 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7595 ;;
7596 esac
7597 fi
7598 else
7599 eval flag=\"$hardcode_libdir_flag_spec\"
7600 rpath="$rpath $flag"
7601 fi
7602 elif test -n "$runpath_var"; then
7603 case "$perm_rpath " in
7604 *" $libdir "*) ;;
7605 *) perm_rpath="$perm_rpath $libdir" ;;
7606 esac
7607 fi
7608 case $host in
7609 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7610 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7611 case :$dllsearchpath: in
7612 *":$libdir:"*) ;;
7613 ::) dllsearchpath=$libdir;;
7614 *) dllsearchpath="$dllsearchpath:$libdir";;
7615 esac
7616 case :$dllsearchpath: in
7617 *":$testbindir:"*) ;;
7618 ::) dllsearchpath=$testbindir;;
7619 *) dllsearchpath="$dllsearchpath:$testbindir";;
7620 esac
7621 ;;
7622 esac
7623 done
7624 # Substitute the hardcoded libdirs into the rpath.
7625 if test -n "$hardcode_libdir_separator" &&
7626 test -n "$hardcode_libdirs"; then
7627 libdir="$hardcode_libdirs"
7628 eval rpath=\" $hardcode_libdir_flag_spec\"
7629 fi
7630 compile_rpath="$rpath"
7631
7632 rpath=
7633 hardcode_libdirs=
7634 for libdir in $finalize_rpath; do
7635 if test -n "$hardcode_libdir_flag_spec"; then
7636 if test -n "$hardcode_libdir_separator"; then
7637 if test -z "$hardcode_libdirs"; then
7638 hardcode_libdirs="$libdir"
7639 else
7640 # Just accumulate the unique libdirs.
7641 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7642 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7643 ;;
7644 *)
7645 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7646 ;;
7647 esac
7648 fi
7649 else
7650 eval flag=\"$hardcode_libdir_flag_spec\"
7651 rpath="$rpath $flag"
7652 fi
7653 elif test -n "$runpath_var"; then
7654 case "$finalize_perm_rpath " in
7655 *" $libdir "*) ;;
7656 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7657 esac
7658 fi
7659 done
7660 # Substitute the hardcoded libdirs into the rpath.
7661 if test -n "$hardcode_libdir_separator" &&
7662 test -n "$hardcode_libdirs"; then
7663 libdir="$hardcode_libdirs"
7664 eval rpath=\" $hardcode_libdir_flag_spec\"
7665 fi
7666 finalize_rpath="$rpath"
7667
7668 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7669 # Transform all the library objects into standard objects.
7670 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7671 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7672 fi
7673
7674 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7675
7676 # template prelinking step
7677 if test -n "$prelink_cmds"; then
7678 func_execute_cmds "$prelink_cmds" 'exit $?'
7679 fi
7680
7681 wrappers_required=yes
7682 case $host in
7683 *cygwin* | *mingw* )
7684 if test "$build_libtool_libs" != yes; then
7685 wrappers_required=no
7686 fi
7687 ;;
7688 *cegcc)
7689 # Disable wrappers for cegcc, we are cross compiling anyway.
7690 wrappers_required=no
7691 ;;
7692 *)
7693 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7694 wrappers_required=no
7695 fi
7696 ;;
7697 esac
7698 if test "$wrappers_required" = no; then
7699 # Replace the output file specification.
7700 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7701 link_command="$compile_command$compile_rpath"
7702
7703 # We have no uninstalled library dependencies, so finalize right now.
7704 exit_status=0
7705 func_show_eval "$link_command" 'exit_status=$?'
7706
7707 # Delete the generated files.
7708 if test -f "$output_objdir/${outputname}S.${objext}"; then
7709 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7710 fi
7711
7712 exit $exit_status
7713 fi
7714
7715 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7716 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7717 fi
7718 if test -n "$finalize_shlibpath"; then
7719 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7720 fi
7721
7722 compile_var=
7723 finalize_var=
7724 if test -n "$runpath_var"; then
7725 if test -n "$perm_rpath"; then
7726 # We should set the runpath_var.
7727 rpath=
7728 for dir in $perm_rpath; do
7729 rpath="$rpath$dir:"
7730 done
7731 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7732 fi
7733 if test -n "$finalize_perm_rpath"; then
7734 # We should set the runpath_var.
7735 rpath=
7736 for dir in $finalize_perm_rpath; do
7737 rpath="$rpath$dir:"
7738 done
7739 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7740 fi
7741 fi
7742
7743 if test "$no_install" = yes; then
7744 # We don't need to create a wrapper script.
7745 link_command="$compile_var$compile_command$compile_rpath"
7746 # Replace the output file specification.
7747 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7748 # Delete the old output file.
7749 $opt_dry_run || $RM $output
7750 # Link the executable and exit
7751 func_show_eval "$link_command" 'exit $?'
7752 exit $EXIT_SUCCESS
7753 fi
7754
7755 if test "$hardcode_action" = relink; then
7756 # Fast installation is not supported
7757 link_command="$compile_var$compile_command$compile_rpath"
7758 relink_command="$finalize_var$finalize_command$finalize_rpath"
7759
7760 func_warning "this platform does not like uninstalled shared libraries"
7761 func_warning "\`$output' will be relinked during installation"
7762 else
7763 if test "$fast_install" != no; then
7764 link_command="$finalize_var$compile_command$finalize_rpath"
7765 if test "$fast_install" = yes; then
7766 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7767 else
7768 # fast_install is set to needless
7769 relink_command=
7770 fi
7771 else
7772 link_command="$compile_var$compile_command$compile_rpath"
7773 relink_command="$finalize_var$finalize_command$finalize_rpath"
7774 fi
7775 fi
7776
7777 # Replace the output file specification.
7778 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7779
7780 # Delete the old output files.
7781 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7782
7783 func_show_eval "$link_command" 'exit $?'
7784
7785 # Now create the wrapper script.
7786 func_verbose "creating $output"
7787
7788 # Quote the relink command for shipping.
7789 if test -n "$relink_command"; then
7790 # Preserve any variables that may affect compiler behavior
7791 for var in $variables_saved_for_relink; do
7792 if eval test -z \"\${$var+set}\"; then
7793 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7794 elif eval var_value=\$$var; test -z "$var_value"; then
7795 relink_command="$var=; export $var; $relink_command"
7796 else
7797 func_quote_for_eval "$var_value"
7798 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7799 fi
7800 done
7801 relink_command="(cd `pwd`; $relink_command)"
7802 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7803 fi
7804
7805 # Quote $ECHO for shipping.
7806 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7807 case $progpath in
7808 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7809 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7810 esac
7811 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7812 else
7813 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7814 fi
7815
7816 # Only actually do things if not in dry run mode.
7817 $opt_dry_run || {
7818 # win32 will think the script is a binary if it has
7819 # a .exe suffix, so we strip it off here.
7820 case $output in
7821 *.exe) func_stripname '' '.exe' "$output"
7822 output=$func_stripname_result ;;
7823 esac
7824 # test for cygwin because mv fails w/o .exe extensions
7825 case $host in
7826 *cygwin*)
7827 exeext=.exe
7828 func_stripname '' '.exe' "$outputname"
7829 outputname=$func_stripname_result ;;
7830 *) exeext= ;;
7831 esac
7832 case $host in
7833 *cygwin* | *mingw* )
7834 func_dirname_and_basename "$output" "" "."
7835 output_name=$func_basename_result
7836 output_path=$func_dirname_result
7837 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7838 cwrapper="$output_path/$output_name.exe"
7839 $RM $cwrappersource $cwrapper
7840 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7841
7842 func_emit_cwrapperexe_src > $cwrappersource
7843
7844 # The wrapper executable is built using the $host compiler,
7845 # because it contains $host paths and files. If cross-
7846 # compiling, it, like the target executable, must be
7847 # executed on the $host or under an emulation environment.
7848 $opt_dry_run || {
7849 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7850 $STRIP $cwrapper
7851 }
7852
7853 # Now, create the wrapper script for func_source use:
7854 func_ltwrapper_scriptname $cwrapper
7855 $RM $func_ltwrapper_scriptname_result
7856 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7857 $opt_dry_run || {
7858 # note: this script will not be executed, so do not chmod.
7859 if test "x$build" = "x$host" ; then
7860 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7861 else
7862 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7863 fi
7864 }
7865 ;;
7866 * )
7867 $RM $output
7868 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7869
7870 func_emit_wrapper no > $output
7871 chmod +x $output
7872 ;;
7873 esac
7874 }
7875 exit $EXIT_SUCCESS
7876 ;;
7877 esac
7878
7879 # See if we need to build an old-fashioned archive.
7880 for oldlib in $oldlibs; do
7881
7882 if test "$build_libtool_libs" = convenience; then
7883 oldobjs="$libobjs_save $symfileobj"
7884 addlibs="$convenience"
7885 build_libtool_libs=no
7886 else
7887 if test "$build_libtool_libs" = module; then
7888 oldobjs="$libobjs_save"
7889 build_libtool_libs=no
7890 else
7891 oldobjs="$old_deplibs $non_pic_objects"
7892 if test "$preload" = yes && test -f "$symfileobj"; then
7893 oldobjs="$oldobjs $symfileobj"
7894 fi
7895 fi
7896 addlibs="$old_convenience"
7897 fi
7898
7899 if test -n "$addlibs"; then
7900 gentop="$output_objdir/${outputname}x"
7901 generated="$generated $gentop"
7902
7903 func_extract_archives $gentop $addlibs
7904 oldobjs="$oldobjs $func_extract_archives_result"
7905 fi
7906
7907 # Do each command in the archive commands.
7908 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7909 cmds=$old_archive_from_new_cmds
7910 else
7911
7912 # Add any objects from preloaded convenience libraries
7913 if test -n "$dlprefiles"; then
7914 gentop="$output_objdir/${outputname}x"
7915 generated="$generated $gentop"
7916
7917 func_extract_archives $gentop $dlprefiles
7918 oldobjs="$oldobjs $func_extract_archives_result"
7919 fi
7920
7921 # POSIX demands no paths to be encoded in archives. We have
7922 # to avoid creating archives with duplicate basenames if we
7923 # might have to extract them afterwards, e.g., when creating a
7924 # static archive out of a convenience library, or when linking
7925 # the entirety of a libtool archive into another (currently
7926 # not supported by libtool).
7927 if (for obj in $oldobjs
7928 do
7929 func_basename "$obj"
7930 $ECHO "$func_basename_result"
7931 done | sort | sort -uc >/dev/null 2>&1); then
7932 :
7933 else
7934 $ECHO "copying selected object files to avoid basename conflicts..."
7935 gentop="$output_objdir/${outputname}x"
7936 generated="$generated $gentop"
7937 func_mkdir_p "$gentop"
7938 save_oldobjs=$oldobjs
7939 oldobjs=
7940 counter=1
7941 for obj in $save_oldobjs
7942 do
7943 func_basename "$obj"
7944 objbase="$func_basename_result"
7945 case " $oldobjs " in
7946 " ") oldobjs=$obj ;;
7947 *[\ /]"$objbase "*)
7948 while :; do
7949 # Make sure we don't pick an alternate name that also
7950 # overlaps.
7951 newobj=lt$counter-$objbase
7952 func_arith $counter + 1
7953 counter=$func_arith_result
7954 case " $oldobjs " in
7955 *[\ /]"$newobj "*) ;;
7956 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7957 esac
7958 done
7959 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7960 oldobjs="$oldobjs $gentop/$newobj"
7961 ;;
7962 *) oldobjs="$oldobjs $obj" ;;
7963 esac
7964 done
7965 fi
7966 eval cmds=\"$old_archive_cmds\"
7967
7968 func_len " $cmds"
7969 len=$func_len_result
7970 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7971 cmds=$old_archive_cmds
7972 else
7973 # the command line is too long to link in one step, link in parts
7974 func_verbose "using piecewise archive linking..."
7975 save_RANLIB=$RANLIB
7976 RANLIB=:
7977 objlist=
7978 concat_cmds=
7979 save_oldobjs=$oldobjs
7980 oldobjs=
7981 # Is there a better way of finding the last object in the list?
7982 for obj in $save_oldobjs
7983 do
7984 last_oldobj=$obj
7985 done
7986 eval test_cmds=\"$old_archive_cmds\"
7987 func_len " $test_cmds"
7988 len0=$func_len_result
7989 len=$len0
7990 for obj in $save_oldobjs
7991 do
7992 func_len " $obj"
7993 func_arith $len + $func_len_result
7994 len=$func_arith_result
7995 func_append objlist " $obj"
7996 if test "$len" -lt "$max_cmd_len"; then
7997 :
7998 else
7999 # the above command should be used before it gets too long
8000 oldobjs=$objlist
8001 if test "$obj" = "$last_oldobj" ; then
8002 RANLIB=$save_RANLIB
8003 fi
8004 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8005 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
8006 objlist=
8007 len=$len0
8008 fi
8009 done
8010 RANLIB=$save_RANLIB
8011 oldobjs=$objlist
8012 if test "X$oldobjs" = "X" ; then
8013 eval cmds=\"\$concat_cmds\"
8014 else
8015 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8016 fi
8017 fi
8018 fi
8019 func_execute_cmds "$cmds" 'exit $?'
8020 done
8021
8022 test -n "$generated" && \
8023 func_show_eval "${RM}r$generated"
8024
8025 # Now create the libtool archive.
8026 case $output in
8027 *.la)
8028 old_library=
8029 test "$build_old_libs" = yes && old_library="$libname.$libext"
8030 func_verbose "creating $output"
8031
8032 # Preserve any variables that may affect compiler behavior
8033 for var in $variables_saved_for_relink; do
8034 if eval test -z \"\${$var+set}\"; then
8035 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8036 elif eval var_value=\$$var; test -z "$var_value"; then
8037 relink_command="$var=; export $var; $relink_command"
8038 else
8039 func_quote_for_eval "$var_value"
8040 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8041 fi
8042 done
8043 # Quote the link command for shipping.
8044 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8045 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8046 if test "$hardcode_automatic" = yes ; then
8047 relink_command=
8048 fi
8049
8050 # Only create the output if not a dry run.
8051 $opt_dry_run || {
8052 for installed in no yes; do
8053 if test "$installed" = yes; then
8054 if test -z "$install_libdir"; then
8055 break
8056 fi
8057 output="$output_objdir/$outputname"i
8058 # Replace all uninstalled libtool libraries with the installed ones
8059 newdependency_libs=
8060 for deplib in $dependency_libs; do
8061 case $deplib in
8062 *.la)
8063 func_basename "$deplib"
8064 name="$func_basename_result"
8065 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8066 test -z "$libdir" && \
8067 func_fatal_error "\`$deplib' is not a valid libtool archive"
8068 newdependency_libs="$newdependency_libs $libdir/$name"
8069 ;;
8070 *) newdependency_libs="$newdependency_libs $deplib" ;;
8071 esac
8072 done
8073 dependency_libs="$newdependency_libs"
8074 newdlfiles=
8075
8076 for lib in $dlfiles; do
8077 case $lib in
8078 *.la)
8079 func_basename "$lib"
8080 name="$func_basename_result"
8081 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8082 test -z "$libdir" && \
8083 func_fatal_error "\`$lib' is not a valid libtool archive"
8084 newdlfiles="$newdlfiles $libdir/$name"
8085 ;;
8086 *) newdlfiles="$newdlfiles $lib" ;;
8087 esac
8088 done
8089 dlfiles="$newdlfiles"
8090 newdlprefiles=
8091 for lib in $dlprefiles; do
8092 case $lib in
8093 *.la)
8094 # Only pass preopened files to the pseudo-archive (for
8095 # eventual linking with the app. that links it) if we
8096 # didn't already link the preopened objects directly into
8097 # the library:
8098 func_basename "$lib"
8099 name="$func_basename_result"
8100 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8101 test -z "$libdir" && \
8102 func_fatal_error "\`$lib' is not a valid libtool archive"
8103 newdlprefiles="$newdlprefiles $libdir/$name"
8104 ;;
8105 esac
8106 done
8107 dlprefiles="$newdlprefiles"
8108 else
8109 newdlfiles=
8110 for lib in $dlfiles; do
8111 case $lib in
8112 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8113 *) abs=`pwd`"/$lib" ;;
8114 esac
8115 newdlfiles="$newdlfiles $abs"
8116 done
8117 dlfiles="$newdlfiles"
8118 newdlprefiles=
8119 for lib in $dlprefiles; do
8120 case $lib in
8121 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8122 *) abs=`pwd`"/$lib" ;;
8123 esac
8124 newdlprefiles="$newdlprefiles $abs"
8125 done
8126 dlprefiles="$newdlprefiles"
8127 fi
8128 $RM $output
8129 # place dlname in correct position for cygwin
8130 tdlname=$dlname
8131 case $host,$output,$installed,$module,$dlname in
8132 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8133 esac
8134 $ECHO > $output "\
8135 # $outputname - a libtool library file
8136 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8137 #
8138 # Please DO NOT delete this file!
8139 # It is necessary for linking the library.
8140
8141 # The name that we can dlopen(3).
8142 dlname='$tdlname'
8143
8144 # Names of this library.
8145 library_names='$library_names'
8146
8147 # The name of the static archive.
8148 old_library='$old_library'
8149
8150 # Linker flags that can not go in dependency_libs.
8151 inherited_linker_flags='$new_inherited_linker_flags'
8152
8153 # Libraries that this one depends upon.
8154 dependency_libs='$dependency_libs'
8155
8156 # Names of additional weak libraries provided by this library
8157 weak_library_names='$weak_libs'
8158
8159 # Version information for $libname.
8160 current=$current
8161 age=$age
8162 revision=$revision
8163
8164 # Is this an already installed library?
8165 installed=$installed
8166
8167 # Should we warn about portability when linking against -modules?
8168 shouldnotlink=$module
8169
8170 # Files to dlopen/dlpreopen
8171 dlopen='$dlfiles'
8172 dlpreopen='$dlprefiles'
8173
8174 # Directory that this library needs to be installed in:
8175 libdir='$install_libdir'"
8176 if test "$installed" = no && test "$need_relink" = yes; then
8177 $ECHO >> $output "\
8178 relink_command=\"$relink_command\""
8179 fi
8180 done
8181 }
8182
8183 # Do a symbolic link so that the libtool archive can be found in
8184 # LD_LIBRARY_PATH before the program is installed.
8185 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8186 ;;
8187 esac
8188 exit $EXIT_SUCCESS
8189 }
8190
8191 { test "$mode" = link || test "$mode" = relink; } &&
8192 func_mode_link ${1+"$@"}
8193
8194
8195 # func_mode_uninstall arg...
8196 func_mode_uninstall ()
8197 {
8198 $opt_debug
8199 RM="$nonopt"
8200 files=
8201 rmforce=
8202 exit_status=0
8203
8204 # This variable tells wrapper scripts just to set variables rather
8205 # than running their programs.
8206 libtool_install_magic="$magic"
8207
8208 for arg
8209 do
8210 case $arg in
8211 -f) RM="$RM $arg"; rmforce=yes ;;
8212 -*) RM="$RM $arg" ;;
8213 *) files="$files $arg" ;;
8214 esac
8215 done
8216
8217 test -z "$RM" && \
8218 func_fatal_help "you must specify an RM program"
8219
8220 rmdirs=
8221
8222 origobjdir="$objdir"
8223 for file in $files; do
8224 func_dirname "$file" "" "."
8225 dir="$func_dirname_result"
8226 if test "X$dir" = X.; then
8227 objdir="$origobjdir"
8228 else
8229 objdir="$dir/$origobjdir"
8230 fi
8231 func_basename "$file"
8232 name="$func_basename_result"
8233 test "$mode" = uninstall && objdir="$dir"
8234
8235 # Remember objdir for removal later, being careful to avoid duplicates
8236 if test "$mode" = clean; then
8237 case " $rmdirs " in
8238 *" $objdir "*) ;;
8239 *) rmdirs="$rmdirs $objdir" ;;
8240 esac
8241 fi
8242
8243 # Don't error if the file doesn't exist and rm -f was used.
8244 if { test -L "$file"; } >/dev/null 2>&1 ||
8245 { test -h "$file"; } >/dev/null 2>&1 ||
8246 test -f "$file"; then
8247 :
8248 elif test -d "$file"; then
8249 exit_status=1
8250 continue
8251 elif test "$rmforce" = yes; then
8252 continue
8253 fi
8254
8255 rmfiles="$file"
8256
8257 case $name in
8258 *.la)
8259 # Possibly a libtool archive, so verify it.
8260 if func_lalib_p "$file"; then
8261 func_source $dir/$name
8262
8263 # Delete the libtool libraries and symlinks.
8264 for n in $library_names; do
8265 rmfiles="$rmfiles $objdir/$n"
8266 done
8267 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8268
8269 case "$mode" in
8270 clean)
8271 case " $library_names " in
8272 # " " in the beginning catches empty $dlname
8273 *" $dlname "*) ;;
8274 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8275 esac
8276 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8277 ;;
8278 uninstall)
8279 if test -n "$library_names"; then
8280 # Do each command in the postuninstall commands.
8281 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8282 fi
8283
8284 if test -n "$old_library"; then
8285 # Do each command in the old_postuninstall commands.
8286 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8287 fi
8288 # FIXME: should reinstall the best remaining shared library.
8289 ;;
8290 esac
8291 fi
8292 ;;
8293
8294 *.lo)
8295 # Possibly a libtool object, so verify it.
8296 if func_lalib_p "$file"; then
8297
8298 # Read the .lo file
8299 func_source $dir/$name
8300
8301 # Add PIC object to the list of files to remove.
8302 if test -n "$pic_object" &&
8303 test "$pic_object" != none; then
8304 rmfiles="$rmfiles $dir/$pic_object"
8305 fi
8306
8307 # Add non-PIC object to the list of files to remove.
8308 if test -n "$non_pic_object" &&
8309 test "$non_pic_object" != none; then
8310 rmfiles="$rmfiles $dir/$non_pic_object"
8311 fi
8312 fi
8313 ;;
8314
8315 *)
8316 if test "$mode" = clean ; then
8317 noexename=$name
8318 case $file in
8319 *.exe)
8320 func_stripname '' '.exe' "$file"
8321 file=$func_stripname_result
8322 func_stripname '' '.exe' "$name"
8323 noexename=$func_stripname_result
8324 # $file with .exe has already been added to rmfiles,
8325 # add $file without .exe
8326 rmfiles="$rmfiles $file"
8327 ;;
8328 esac
8329 # Do a test to see if this is a libtool program.
8330 if func_ltwrapper_p "$file"; then
8331 if func_ltwrapper_executable_p "$file"; then
8332 func_ltwrapper_scriptname "$file"
8333 relink_command=
8334 func_source $func_ltwrapper_scriptname_result
8335 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8336 else
8337 relink_command=
8338 func_source $dir/$noexename
8339 fi
8340
8341 # note $name still contains .exe if it was in $file originally
8342 # as does the version of $file that was added into $rmfiles
8343 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8344 if test "$fast_install" = yes && test -n "$relink_command"; then
8345 rmfiles="$rmfiles $objdir/lt-$name"
8346 fi
8347 if test "X$noexename" != "X$name" ; then
8348 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8349 fi
8350 fi
8351 fi
8352 ;;
8353 esac
8354 func_show_eval "$RM $rmfiles" 'exit_status=1'
8355 done
8356 objdir="$origobjdir"
8357
8358 # Try to remove the ${objdir}s in the directories where we deleted files
8359 for dir in $rmdirs; do
8360 if test -d "$dir"; then
8361 func_show_eval "rmdir $dir >/dev/null 2>&1"
8362 fi
8363 done
8364
8365 exit $exit_status
8366 }
8367
8368 { test "$mode" = uninstall || test "$mode" = clean; } &&
8369 func_mode_uninstall ${1+"$@"}
8370
8371 test -z "$mode" && {
8372 help="$generic_help"
8373 func_fatal_help "you must specify a MODE"
8374 }
8375
8376 test -z "$exec_cmd" && \
8377 func_fatal_help "invalid operation mode \`$mode'"
8378
8379 if test -n "$exec_cmd"; then
8380 eval exec "$exec_cmd"
8381 exit $EXIT_FAILURE
8382 fi
8383
8384 exit $exit_status
8385
8386
8387 # The TAGs below are defined such that we never get into a situation
8388 # in which we disable both kinds of libraries. Given conflicting
8389 # choices, we go for a static library, that is the most portable,
8390 # since we can't tell whether shared libraries were disabled because
8391 # the user asked for that or because the platform doesn't support
8392 # them. This is particularly important on AIX, because we don't
8393 # support having both static and shared libraries enabled at the same
8394 # time on that platform, so we default to a shared-only configuration.
8395 # If a disable-shared tag is given, we'll fallback to a static-only
8396 # configuration. But we'll never go from static-only to shared-only.
8397
8398 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8399 build_libtool_libs=no
8400 build_old_libs=yes
8401 # ### END LIBTOOL TAG CONFIG: disable-shared
8402
8403 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8404 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8405 # ### END LIBTOOL TAG CONFIG: disable-static
8406
8407 # Local Variables:
8408 # mode:shell-script
8409 # sh-indentation:2
8410 # End:
8411 # vi:sw=2
8412
+0
-7377
m4/libtool.m4 less more
0 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1 #
2 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3 # 2006, 2007, 2008 Free Software Foundation, Inc.
4 # Written by Gordon Matzigkeit, 1996
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 m4_define([_LT_COPYING], [dnl
11 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
12 # 2006, 2007, 2008 Free Software Foundation, Inc.
13 # Written by Gordon Matzigkeit, 1996
14 #
15 # This file is part of GNU Libtool.
16 #
17 # GNU Libtool is free software; you can redistribute it and/or
18 # modify it under the terms of the GNU General Public License as
19 # published by the Free Software Foundation; either version 2 of
20 # the License, or (at your option) any later version.
21 #
22 # As a special exception to the GNU General Public License,
23 # if you distribute this file as part of a program or library that
24 # is built using GNU Libtool, you may include this file under the
25 # same distribution terms that you use for the rest of that program.
26 #
27 # GNU Libtool is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
31 #
32 # You should have received a copy of the GNU General Public License
33 # along with GNU Libtool; see the file COPYING. If not, a copy
34 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
35 # obtained by writing to the Free Software Foundation, Inc.,
36 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37 ])
38
39 # serial 56 LT_INIT
40
41
42 # LT_PREREQ(VERSION)
43 # ------------------
44 # Complain and exit if this libtool version is less that VERSION.
45 m4_defun([LT_PREREQ],
46 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
47 [m4_default([$3],
48 [m4_fatal([Libtool version $1 or higher is required],
49 63)])],
50 [$2])])
51
52
53 # _LT_CHECK_BUILDDIR
54 # ------------------
55 # Complain if the absolute build directory name contains unusual characters
56 m4_defun([_LT_CHECK_BUILDDIR],
57 [case `pwd` in
58 *\ * | *\ *)
59 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
60 esac
61 ])
62
63
64 # LT_INIT([OPTIONS])
65 # ------------------
66 AC_DEFUN([LT_INIT],
67 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
68 AC_BEFORE([$0], [LT_LANG])dnl
69 AC_BEFORE([$0], [LT_OUTPUT])dnl
70 AC_BEFORE([$0], [LTDL_INIT])dnl
71 m4_require([_LT_CHECK_BUILDDIR])dnl
72
73 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
74 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
75 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
76 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
77 dnl unless we require an AC_DEFUNed macro:
78 AC_REQUIRE([LTOPTIONS_VERSION])dnl
79 AC_REQUIRE([LTSUGAR_VERSION])dnl
80 AC_REQUIRE([LTVERSION_VERSION])dnl
81 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
82 m4_require([_LT_PROG_LTMAIN])dnl
83
84 dnl Parse OPTIONS
85 _LT_SET_OPTIONS([$0], [$1])
86
87 # This can be used to rebuild libtool when needed
88 LIBTOOL_DEPS="$ltmain"
89
90 # Always use our own libtool.
91 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
92 AC_SUBST(LIBTOOL)dnl
93
94 _LT_SETUP
95
96 # Only expand once:
97 m4_define([LT_INIT])
98 ])# LT_INIT
99
100 # Old names:
101 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
102 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
103 dnl aclocal-1.4 backwards compatibility:
104 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
105 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
106
107
108 # _LT_CC_BASENAME(CC)
109 # -------------------
110 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
111 m4_defun([_LT_CC_BASENAME],
112 [for cc_temp in $1""; do
113 case $cc_temp in
114 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
115 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
116 \-*) ;;
117 *) break;;
118 esac
119 done
120 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
121 ])
122
123
124 # _LT_FILEUTILS_DEFAULTS
125 # ----------------------
126 # It is okay to use these file commands and assume they have been set
127 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
128 m4_defun([_LT_FILEUTILS_DEFAULTS],
129 [: ${CP="cp -f"}
130 : ${MV="mv -f"}
131 : ${RM="rm -f"}
132 ])# _LT_FILEUTILS_DEFAULTS
133
134
135 # _LT_SETUP
136 # ---------
137 m4_defun([_LT_SETUP],
138 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
139 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
140 _LT_DECL([], [host_alias], [0], [The host system])dnl
141 _LT_DECL([], [host], [0])dnl
142 _LT_DECL([], [host_os], [0])dnl
143 dnl
144 _LT_DECL([], [build_alias], [0], [The build system])dnl
145 _LT_DECL([], [build], [0])dnl
146 _LT_DECL([], [build_os], [0])dnl
147 dnl
148 AC_REQUIRE([AC_PROG_CC])dnl
149 AC_REQUIRE([LT_PATH_LD])dnl
150 AC_REQUIRE([LT_PATH_NM])dnl
151 dnl
152 AC_REQUIRE([AC_PROG_LN_S])dnl
153 test -z "$LN_S" && LN_S="ln -s"
154 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
155 dnl
156 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
157 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
158 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
159 dnl
160 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
161 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
162 m4_require([_LT_CMD_RELOAD])dnl
163 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
164 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
165 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
166
167 _LT_CONFIG_LIBTOOL_INIT([
168 # See if we are running on zsh, and set the options which allow our
169 # commands through without removal of \ escapes INIT.
170 if test -n "\${ZSH_VERSION+set}" ; then
171 setopt NO_GLOB_SUBST
172 fi
173 ])
174 if test -n "${ZSH_VERSION+set}" ; then
175 setopt NO_GLOB_SUBST
176 fi
177
178 _LT_CHECK_OBJDIR
179
180 m4_require([_LT_TAG_COMPILER])dnl
181 _LT_PROG_ECHO_BACKSLASH
182
183 case $host_os in
184 aix3*)
185 # AIX sometimes has problems with the GCC collect2 program. For some
186 # reason, if we set the COLLECT_NAMES environment variable, the problems
187 # vanish in a puff of smoke.
188 if test "X${COLLECT_NAMES+set}" != Xset; then
189 COLLECT_NAMES=
190 export COLLECT_NAMES
191 fi
192 ;;
193 esac
194
195 # Sed substitution that helps us do robust quoting. It backslashifies
196 # metacharacters that are still active within double-quoted strings.
197 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
198
199 # Same as above, but do not quote variable references.
200 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
201
202 # Sed substitution to delay expansion of an escaped shell variable in a
203 # double_quote_subst'ed string.
204 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
205
206 # Sed substitution to delay expansion of an escaped single quote.
207 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
208
209 # Sed substitution to avoid accidental globbing in evaled expressions
210 no_glob_subst='s/\*/\\\*/g'
211
212 # Global variables:
213 ofile=libtool
214 can_build_shared=yes
215
216 # All known linkers require a `.a' archive for static linking (except MSVC,
217 # which needs '.lib').
218 libext=a
219
220 with_gnu_ld="$lt_cv_prog_gnu_ld"
221
222 old_CC="$CC"
223 old_CFLAGS="$CFLAGS"
224
225 # Set sane defaults for various variables
226 test -z "$CC" && CC=cc
227 test -z "$LTCC" && LTCC=$CC
228 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
229 test -z "$LD" && LD=ld
230 test -z "$ac_objext" && ac_objext=o
231
232 _LT_CC_BASENAME([$compiler])
233
234 # Only perform the check for file, if the check method requires it
235 test -z "$MAGIC_CMD" && MAGIC_CMD=file
236 case $deplibs_check_method in
237 file_magic*)
238 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
239 _LT_PATH_MAGIC
240 fi
241 ;;
242 esac
243
244 # Use C for the default configuration in the libtool script
245 LT_SUPPORTED_TAG([CC])
246 _LT_LANG_C_CONFIG
247 _LT_LANG_DEFAULT_CONFIG
248 _LT_CONFIG_COMMANDS
249 ])# _LT_SETUP
250
251
252 # _LT_PROG_LTMAIN
253 # ---------------
254 # Note that this code is called both from `configure', and `config.status'
255 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
256 # `config.status' has no value for ac_aux_dir unless we are using Automake,
257 # so we pass a copy along to make sure it has a sensible value anyway.
258 m4_defun([_LT_PROG_LTMAIN],
259 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
260 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
261 ltmain="$ac_aux_dir/ltmain.sh"
262 ])# _LT_PROG_LTMAIN
263
264
265 ## ------------------------------------- ##
266 ## Accumulate code for creating libtool. ##
267 ## ------------------------------------- ##
268
269 # So that we can recreate a full libtool script including additional
270 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
271 # in macros and then make a single call at the end using the `libtool'
272 # label.
273
274
275 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
276 # ----------------------------------------
277 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
278 m4_define([_LT_CONFIG_LIBTOOL_INIT],
279 [m4_ifval([$1],
280 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
281 [$1
282 ])])])
283
284 # Initialize.
285 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
286
287
288 # _LT_CONFIG_LIBTOOL([COMMANDS])
289 # ------------------------------
290 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
291 m4_define([_LT_CONFIG_LIBTOOL],
292 [m4_ifval([$1],
293 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
294 [$1
295 ])])])
296
297 # Initialize.
298 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
299
300
301 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
302 # -----------------------------------------------------
303 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
304 [_LT_CONFIG_LIBTOOL([$1])
305 _LT_CONFIG_LIBTOOL_INIT([$2])
306 ])
307
308
309 # _LT_FORMAT_COMMENT([COMMENT])
310 # -----------------------------
311 # Add leading comment marks to the start of each line, and a trailing
312 # full-stop to the whole comment if one is not present already.
313 m4_define([_LT_FORMAT_COMMENT],
314 [m4_ifval([$1], [
315 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
316 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
317 )])
318
319
320
321 ## ------------------------ ##
322 ## FIXME: Eliminate VARNAME ##
323 ## ------------------------ ##
324
325
326 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
327 # -------------------------------------------------------------------
328 # CONFIGNAME is the name given to the value in the libtool script.
329 # VARNAME is the (base) name used in the configure script.
330 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
331 # VARNAME. Any other value will be used directly.
332 m4_define([_LT_DECL],
333 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
334 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
335 [m4_ifval([$1], [$1], [$2])])
336 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
337 m4_ifval([$4],
338 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
339 lt_dict_add_subkey([lt_decl_dict], [$2],
340 [tagged?], [m4_ifval([$5], [yes], [no])])])
341 ])
342
343
344 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
345 # --------------------------------------------------------
346 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
347
348
349 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
350 # ------------------------------------------------
351 m4_define([lt_decl_tag_varnames],
352 [_lt_decl_filter([tagged?], [yes], $@)])
353
354
355 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
356 # ---------------------------------------------------------
357 m4_define([_lt_decl_filter],
358 [m4_case([$#],
359 [0], [m4_fatal([$0: too few arguments: $#])],
360 [1], [m4_fatal([$0: too few arguments: $#: $1])],
361 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
362 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
363 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
364 ])
365
366
367 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
368 # --------------------------------------------------
369 m4_define([lt_decl_quote_varnames],
370 [_lt_decl_filter([value], [1], $@)])
371
372
373 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
374 # ---------------------------------------------------
375 m4_define([lt_decl_dquote_varnames],
376 [_lt_decl_filter([value], [2], $@)])
377
378
379 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
380 # ---------------------------------------------------
381 m4_define([lt_decl_varnames_tagged],
382 [m4_assert([$# <= 2])dnl
383 _$0(m4_quote(m4_default([$1], [[, ]])),
384 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
385 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
386 m4_define([_lt_decl_varnames_tagged],
387 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
388
389
390 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
391 # ------------------------------------------------
392 m4_define([lt_decl_all_varnames],
393 [_$0(m4_quote(m4_default([$1], [[, ]])),
394 m4_if([$2], [],
395 m4_quote(lt_decl_varnames),
396 m4_quote(m4_shift($@))))[]dnl
397 ])
398 m4_define([_lt_decl_all_varnames],
399 [lt_join($@, lt_decl_varnames_tagged([$1],
400 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
401 ])
402
403
404 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
405 # ------------------------------------
406 # Quote a variable value, and forward it to `config.status' so that its
407 # declaration there will have the same value as in `configure'. VARNAME
408 # must have a single quote delimited value for this to work.
409 m4_define([_LT_CONFIG_STATUS_DECLARE],
410 [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
411
412
413 # _LT_CONFIG_STATUS_DECLARATIONS
414 # ------------------------------
415 # We delimit libtool config variables with single quotes, so when
416 # we write them to config.status, we have to be sure to quote all
417 # embedded single quotes properly. In configure, this macro expands
418 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
419 #
420 # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
421 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
422 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
423 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
424
425
426 # _LT_LIBTOOL_TAGS
427 # ----------------
428 # Output comment and list of tags supported by the script
429 m4_defun([_LT_LIBTOOL_TAGS],
430 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
431 available_tags="_LT_TAGS"dnl
432 ])
433
434
435 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
436 # -----------------------------------
437 # Extract the dictionary values for VARNAME (optionally with TAG) and
438 # expand to a commented shell variable setting:
439 #
440 # # Some comment about what VAR is for.
441 # visible_name=$lt_internal_name
442 m4_define([_LT_LIBTOOL_DECLARE],
443 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
444 [description])))[]dnl
445 m4_pushdef([_libtool_name],
446 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
447 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
448 [0], [_libtool_name=[$]$1],
449 [1], [_libtool_name=$lt_[]$1],
450 [2], [_libtool_name=$lt_[]$1],
451 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
452 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
453 ])
454
455
456 # _LT_LIBTOOL_CONFIG_VARS
457 # -----------------------
458 # Produce commented declarations of non-tagged libtool config variables
459 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
460 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
461 # section) are produced by _LT_LIBTOOL_TAG_VARS.
462 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
463 [m4_foreach([_lt_var],
464 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
465 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
466
467
468 # _LT_LIBTOOL_TAG_VARS(TAG)
469 # -------------------------
470 m4_define([_LT_LIBTOOL_TAG_VARS],
471 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
472 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
473
474
475 # _LT_TAGVAR(VARNAME, [TAGNAME])
476 # ------------------------------
477 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
478
479
480 # _LT_CONFIG_COMMANDS
481 # -------------------
482 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
483 # variables for single and double quote escaping we saved from calls
484 # to _LT_DECL, we can put quote escaped variables declarations
485 # into `config.status', and then the shell code to quote escape them in
486 # for loops in `config.status'. Finally, any additional code accumulated
487 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
488 m4_defun([_LT_CONFIG_COMMANDS],
489 [AC_PROVIDE_IFELSE([LT_OUTPUT],
490 dnl If the libtool generation code has been placed in $CONFIG_LT,
491 dnl instead of duplicating it all over again into config.status,
492 dnl then we will have config.status run $CONFIG_LT later, so it
493 dnl needs to know what name is stored there:
494 [AC_CONFIG_COMMANDS([libtool],
495 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
496 dnl If the libtool generation code is destined for config.status,
497 dnl expand the accumulated commands and init code now:
498 [AC_CONFIG_COMMANDS([libtool],
499 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
500 ])#_LT_CONFIG_COMMANDS
501
502
503 # Initialize.
504 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
505 [
506
507 # The HP-UX ksh and POSIX shell print the target directory to stdout
508 # if CDPATH is set.
509 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
510
511 sed_quote_subst='$sed_quote_subst'
512 double_quote_subst='$double_quote_subst'
513 delay_variable_subst='$delay_variable_subst'
514 _LT_CONFIG_STATUS_DECLARATIONS
515 LTCC='$LTCC'
516 LTCFLAGS='$LTCFLAGS'
517 compiler='$compiler_DEFAULT'
518
519 # Quote evaled strings.
520 for var in lt_decl_all_varnames([[ \
521 ]], lt_decl_quote_varnames); do
522 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
523 *[[\\\\\\\`\\"\\\$]]*)
524 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
525 ;;
526 *)
527 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
528 ;;
529 esac
530 done
531
532 # Double-quote double-evaled strings.
533 for var in lt_decl_all_varnames([[ \
534 ]], lt_decl_dquote_varnames); do
535 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
536 *[[\\\\\\\`\\"\\\$]]*)
537 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
538 ;;
539 *)
540 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
541 ;;
542 esac
543 done
544
545 # Fix-up fallback echo if it was mangled by the above quoting rules.
546 case \$lt_ECHO in
547 *'\\\[$]0 --fallback-echo"')dnl "
548 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
549 ;;
550 esac
551
552 _LT_OUTPUT_LIBTOOL_INIT
553 ])
554
555
556 # LT_OUTPUT
557 # ---------
558 # This macro allows early generation of the libtool script (before
559 # AC_OUTPUT is called), incase it is used in configure for compilation
560 # tests.
561 AC_DEFUN([LT_OUTPUT],
562 [: ${CONFIG_LT=./config.lt}
563 AC_MSG_NOTICE([creating $CONFIG_LT])
564 cat >"$CONFIG_LT" <<_LTEOF
565 #! $SHELL
566 # Generated by $as_me.
567 # Run this file to recreate a libtool stub with the current configuration.
568
569 lt_cl_silent=false
570 SHELL=\${CONFIG_SHELL-$SHELL}
571 _LTEOF
572
573 cat >>"$CONFIG_LT" <<\_LTEOF
574 AS_SHELL_SANITIZE
575 _AS_PREPARE
576
577 exec AS_MESSAGE_FD>&1
578 exec AS_MESSAGE_LOG_FD>>config.log
579 {
580 echo
581 AS_BOX([Running $as_me.])
582 } >&AS_MESSAGE_LOG_FD
583
584 lt_cl_help="\
585 \`$as_me' creates a local libtool stub from the current configuration,
586 for use in further configure time tests before the real libtool is
587 generated.
588
589 Usage: $[0] [[OPTIONS]]
590
591 -h, --help print this help, then exit
592 -V, --version print version number, then exit
593 -q, --quiet do not print progress messages
594 -d, --debug don't remove temporary files
595
596 Report bugs to <bug-libtool@gnu.org>."
597
598 lt_cl_version="\
599 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
600 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
601 configured by $[0], generated by m4_PACKAGE_STRING.
602
603 Copyright (C) 2008 Free Software Foundation, Inc.
604 This config.lt script is free software; the Free Software Foundation
605 gives unlimited permision to copy, distribute and modify it."
606
607 while test $[#] != 0
608 do
609 case $[1] in
610 --version | --v* | -V )
611 echo "$lt_cl_version"; exit 0 ;;
612 --help | --h* | -h )
613 echo "$lt_cl_help"; exit 0 ;;
614 --debug | --d* | -d )
615 debug=: ;;
616 --quiet | --q* | --silent | --s* | -q )
617 lt_cl_silent=: ;;
618
619 -*) AC_MSG_ERROR([unrecognized option: $[1]
620 Try \`$[0] --help' for more information.]) ;;
621
622 *) AC_MSG_ERROR([unrecognized argument: $[1]
623 Try \`$[0] --help' for more information.]) ;;
624 esac
625 shift
626 done
627
628 if $lt_cl_silent; then
629 exec AS_MESSAGE_FD>/dev/null
630 fi
631 _LTEOF
632
633 cat >>"$CONFIG_LT" <<_LTEOF
634 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
635 _LTEOF
636
637 cat >>"$CONFIG_LT" <<\_LTEOF
638 AC_MSG_NOTICE([creating $ofile])
639 _LT_OUTPUT_LIBTOOL_COMMANDS
640 AS_EXIT(0)
641 _LTEOF
642 chmod +x "$CONFIG_LT"
643
644 # configure is writing to config.log, but config.lt does its own redirection,
645 # appending to config.log, which fails on DOS, as config.log is still kept
646 # open by configure. Here we exec the FD to /dev/null, effectively closing
647 # config.log, so it can be properly (re)opened and appended to by config.lt.
648 if test "$no_create" != yes; then
649 lt_cl_success=:
650 test "$silent" = yes &&
651 lt_config_lt_args="$lt_config_lt_args --quiet"
652 exec AS_MESSAGE_LOG_FD>/dev/null
653 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
654 exec AS_MESSAGE_LOG_FD>>config.log
655 $lt_cl_success || AS_EXIT(1)
656 fi
657 ])# LT_OUTPUT
658
659
660 # _LT_CONFIG(TAG)
661 # ---------------
662 # If TAG is the built-in tag, create an initial libtool script with a
663 # default configuration from the untagged config vars. Otherwise add code
664 # to config.status for appending the configuration named by TAG from the
665 # matching tagged config vars.
666 m4_defun([_LT_CONFIG],
667 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
668 _LT_CONFIG_SAVE_COMMANDS([
669 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
670 m4_if(_LT_TAG, [C], [
671 # See if we are running on zsh, and set the options which allow our
672 # commands through without removal of \ escapes.
673 if test -n "${ZSH_VERSION+set}" ; then
674 setopt NO_GLOB_SUBST
675 fi
676
677 cfgfile="${ofile}T"
678 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
679 $RM "$cfgfile"
680
681 cat <<_LT_EOF >> "$cfgfile"
682 #! $SHELL
683
684 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
685 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
686 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
687 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
688 #
689 _LT_COPYING
690 _LT_LIBTOOL_TAGS
691
692 # ### BEGIN LIBTOOL CONFIG
693 _LT_LIBTOOL_CONFIG_VARS
694 _LT_LIBTOOL_TAG_VARS
695 # ### END LIBTOOL CONFIG
696
697 _LT_EOF
698
699 case $host_os in
700 aix3*)
701 cat <<\_LT_EOF >> "$cfgfile"
702 # AIX sometimes has problems with the GCC collect2 program. For some
703 # reason, if we set the COLLECT_NAMES environment variable, the problems
704 # vanish in a puff of smoke.
705 if test "X${COLLECT_NAMES+set}" != Xset; then
706 COLLECT_NAMES=
707 export COLLECT_NAMES
708 fi
709 _LT_EOF
710 ;;
711 esac
712
713 _LT_PROG_LTMAIN
714
715 # We use sed instead of cat because bash on DJGPP gets confused if
716 # if finds mixed CR/LF and LF-only lines. Since sed operates in
717 # text mode, it properly converts lines to CR/LF. This bash problem
718 # is reportedly fixed, but why not run on old versions too?
719 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
720 || (rm -f "$cfgfile"; exit 1)
721
722 _LT_PROG_XSI_SHELLFNS
723
724 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
725 || (rm -f "$cfgfile"; exit 1)
726
727 mv -f "$cfgfile" "$ofile" ||
728 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
729 chmod +x "$ofile"
730 ],
731 [cat <<_LT_EOF >> "$ofile"
732
733 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
734 dnl in a comment (ie after a #).
735 # ### BEGIN LIBTOOL TAG CONFIG: $1
736 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
737 # ### END LIBTOOL TAG CONFIG: $1
738 _LT_EOF
739 ])dnl /m4_if
740 ],
741 [m4_if([$1], [], [
742 PACKAGE='$PACKAGE'
743 VERSION='$VERSION'
744 TIMESTAMP='$TIMESTAMP'
745 RM='$RM'
746 ofile='$ofile'], [])
747 ])dnl /_LT_CONFIG_SAVE_COMMANDS
748 ])# _LT_CONFIG
749
750
751 # LT_SUPPORTED_TAG(TAG)
752 # ---------------------
753 # Trace this macro to discover what tags are supported by the libtool
754 # --tag option, using:
755 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
756 AC_DEFUN([LT_SUPPORTED_TAG], [])
757
758
759 # C support is built-in for now
760 m4_define([_LT_LANG_C_enabled], [])
761 m4_define([_LT_TAGS], [])
762
763
764 # LT_LANG(LANG)
765 # -------------
766 # Enable libtool support for the given language if not already enabled.
767 AC_DEFUN([LT_LANG],
768 [AC_BEFORE([$0], [LT_OUTPUT])dnl
769 m4_case([$1],
770 [C], [_LT_LANG(C)],
771 [C++], [_LT_LANG(CXX)],
772 [Java], [_LT_LANG(GCJ)],
773 [Fortran 77], [_LT_LANG(F77)],
774 [Fortran], [_LT_LANG(FC)],
775 [Windows Resource], [_LT_LANG(RC)],
776 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
777 [_LT_LANG($1)],
778 [m4_fatal([$0: unsupported language: "$1"])])])dnl
779 ])# LT_LANG
780
781
782 # _LT_LANG(LANGNAME)
783 # ------------------
784 m4_defun([_LT_LANG],
785 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
786 [LT_SUPPORTED_TAG([$1])dnl
787 m4_append([_LT_TAGS], [$1 ])dnl
788 m4_define([_LT_LANG_]$1[_enabled], [])dnl
789 _LT_LANG_$1_CONFIG($1)])dnl
790 ])# _LT_LANG
791
792
793 # _LT_LANG_DEFAULT_CONFIG
794 # -----------------------
795 m4_defun([_LT_LANG_DEFAULT_CONFIG],
796 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
797 [LT_LANG(CXX)],
798 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
799
800 AC_PROVIDE_IFELSE([AC_PROG_F77],
801 [LT_LANG(F77)],
802 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
803
804 AC_PROVIDE_IFELSE([AC_PROG_FC],
805 [LT_LANG(FC)],
806 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
807
808 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
809 dnl pulling things in needlessly.
810 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
811 [LT_LANG(GCJ)],
812 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
813 [LT_LANG(GCJ)],
814 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
815 [LT_LANG(GCJ)],
816 [m4_ifdef([AC_PROG_GCJ],
817 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
818 m4_ifdef([A][M_PROG_GCJ],
819 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
820 m4_ifdef([LT_PROG_GCJ],
821 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
822
823 AC_PROVIDE_IFELSE([LT_PROG_RC],
824 [LT_LANG(RC)],
825 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
826 ])# _LT_LANG_DEFAULT_CONFIG
827
828 # Obsolete macros:
829 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
830 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
831 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
832 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
833 dnl aclocal-1.4 backwards compatibility:
834 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
835 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
836 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
837 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
838
839
840 # _LT_TAG_COMPILER
841 # ----------------
842 m4_defun([_LT_TAG_COMPILER],
843 [AC_REQUIRE([AC_PROG_CC])dnl
844
845 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
846 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
847 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
848 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
849
850 # If no C compiler was specified, use CC.
851 LTCC=${LTCC-"$CC"}
852
853 # If no C compiler flags were specified, use CFLAGS.
854 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
855
856 # Allow CC to be a program name with arguments.
857 compiler=$CC
858 ])# _LT_TAG_COMPILER
859
860
861 # _LT_COMPILER_BOILERPLATE
862 # ------------------------
863 # Check for compiler boilerplate output or warnings with
864 # the simple compiler test code.
865 m4_defun([_LT_COMPILER_BOILERPLATE],
866 [m4_require([_LT_DECL_SED])dnl
867 ac_outfile=conftest.$ac_objext
868 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
869 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
870 _lt_compiler_boilerplate=`cat conftest.err`
871 $RM conftest*
872 ])# _LT_COMPILER_BOILERPLATE
873
874
875 # _LT_LINKER_BOILERPLATE
876 # ----------------------
877 # Check for linker boilerplate output or warnings with
878 # the simple link test code.
879 m4_defun([_LT_LINKER_BOILERPLATE],
880 [m4_require([_LT_DECL_SED])dnl
881 ac_outfile=conftest.$ac_objext
882 echo "$lt_simple_link_test_code" >conftest.$ac_ext
883 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
884 _lt_linker_boilerplate=`cat conftest.err`
885 $RM -r conftest*
886 ])# _LT_LINKER_BOILERPLATE
887
888 # _LT_REQUIRED_DARWIN_CHECKS
889 # -------------------------
890 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
891 case $host_os in
892 rhapsody* | darwin*)
893 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
894 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
895 AC_CHECK_TOOL([LIPO], [lipo], [:])
896 AC_CHECK_TOOL([OTOOL], [otool], [:])
897 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
898 _LT_DECL([], [DSYMUTIL], [1],
899 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
900 _LT_DECL([], [NMEDIT], [1],
901 [Tool to change global to local symbols on Mac OS X])
902 _LT_DECL([], [LIPO], [1],
903 [Tool to manipulate fat objects and archives on Mac OS X])
904 _LT_DECL([], [OTOOL], [1],
905 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
906 _LT_DECL([], [OTOOL64], [1],
907 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
908
909 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
910 [lt_cv_apple_cc_single_mod=no
911 if test -z "${LT_MULTI_MODULE}"; then
912 # By default we will add the -single_module flag. You can override
913 # by either setting the environment variable LT_MULTI_MODULE
914 # non-empty at configure time, or by adding -multi_module to the
915 # link flags.
916 rm -rf libconftest.dylib*
917 echo "int foo(void){return 1;}" > conftest.c
918 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
919 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
920 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
921 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
922 _lt_result=$?
923 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
924 lt_cv_apple_cc_single_mod=yes
925 else
926 cat conftest.err >&AS_MESSAGE_LOG_FD
927 fi
928 rm -rf libconftest.dylib*
929 rm -f conftest.*
930 fi])
931 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
932 [lt_cv_ld_exported_symbols_list],
933 [lt_cv_ld_exported_symbols_list=no
934 save_LDFLAGS=$LDFLAGS
935 echo "_main" > conftest.sym
936 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
937 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
938 [lt_cv_ld_exported_symbols_list=yes],
939 [lt_cv_ld_exported_symbols_list=no])
940 LDFLAGS="$save_LDFLAGS"
941 ])
942 case $host_os in
943 rhapsody* | darwin1.[[012]])
944 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
945 darwin1.*)
946 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
947 darwin*) # darwin 5.x on
948 # if running on 10.5 or later, the deployment target defaults
949 # to the OS version, if on x86, and 10.4, the deployment
950 # target defaults to 10.4. Don't you love it?
951 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
952 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
953 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
954 10.[[012]]*)
955 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
956 10.*)
957 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
958 esac
959 ;;
960 esac
961 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
962 _lt_dar_single_mod='$single_module'
963 fi
964 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
965 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
966 else
967 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
968 fi
969 if test "$DSYMUTIL" != ":"; then
970 _lt_dsymutil='~$DSYMUTIL $lib || :'
971 else
972 _lt_dsymutil=
973 fi
974 ;;
975 esac
976 ])
977
978
979 # _LT_DARWIN_LINKER_FEATURES
980 # --------------------------
981 # Checks for linker and compiler features on darwin
982 m4_defun([_LT_DARWIN_LINKER_FEATURES],
983 [
984 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
985 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
986 _LT_TAGVAR(hardcode_direct, $1)=no
987 _LT_TAGVAR(hardcode_automatic, $1)=yes
988 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
989 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
990 _LT_TAGVAR(link_all_deplibs, $1)=yes
991 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
992 case $cc_basename in
993 ifort*) _lt_dar_can_shared=yes ;;
994 *) _lt_dar_can_shared=$GCC ;;
995 esac
996 if test "$_lt_dar_can_shared" = "yes"; then
997 output_verbose_link_cmd=echo
998 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
999 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1000 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1001 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1002 m4_if([$1], [CXX],
1003 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1004 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1005 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1006 fi
1007 ],[])
1008 else
1009 _LT_TAGVAR(ld_shlibs, $1)=no
1010 fi
1011 ])
1012
1013 # _LT_SYS_MODULE_PATH_AIX
1014 # -----------------------
1015 # Links a minimal program and checks the executable
1016 # for the system default hardcoded library path. In most cases,
1017 # this is /usr/lib:/lib, but when the MPI compilers are used
1018 # the location of the communication and MPI libs are included too.
1019 # If we don't find anything, use the default library path according
1020 # to the aix ld manual.
1021 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1022 [m4_require([_LT_DECL_SED])dnl
1023 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1024 lt_aix_libpath_sed='
1025 /Import File Strings/,/^$/ {
1026 /^0/ {
1027 s/^0 *\(.*\)$/\1/
1028 p
1029 }
1030 }'
1031 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1032 # Check for a 64-bit object if we didn't find anything.
1033 if test -z "$aix_libpath"; then
1034 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1035 fi],[])
1036 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1037 ])# _LT_SYS_MODULE_PATH_AIX
1038
1039
1040 # _LT_SHELL_INIT(ARG)
1041 # -------------------
1042 m4_define([_LT_SHELL_INIT],
1043 [ifdef([AC_DIVERSION_NOTICE],
1044 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1045 [AC_DIVERT_PUSH(NOTICE)])
1046 $1
1047 AC_DIVERT_POP
1048 ])# _LT_SHELL_INIT
1049
1050
1051 # _LT_PROG_ECHO_BACKSLASH
1052 # -----------------------
1053 # Add some code to the start of the generated configure script which
1054 # will find an echo command which doesn't interpret backslashes.
1055 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1056 [_LT_SHELL_INIT([
1057 # Check that we are running under the correct shell.
1058 SHELL=${CONFIG_SHELL-/bin/sh}
1059
1060 case X$lt_ECHO in
1061 X*--fallback-echo)
1062 # Remove one level of quotation (which was required for Make).
1063 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1064 ;;
1065 esac
1066
1067 ECHO=${lt_ECHO-echo}
1068 if test "X[$]1" = X--no-reexec; then
1069 # Discard the --no-reexec flag, and continue.
1070 shift
1071 elif test "X[$]1" = X--fallback-echo; then
1072 # Avoid inline document here, it may be left over
1073 :
1074 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1075 # Yippee, $ECHO works!
1076 :
1077 else
1078 # Restart under the correct shell.
1079 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1080 fi
1081
1082 if test "X[$]1" = X--fallback-echo; then
1083 # used as fallback echo
1084 shift
1085 cat <<_LT_EOF
1086 [$]*
1087 _LT_EOF
1088 exit 0
1089 fi
1090
1091 # The HP-UX ksh and POSIX shell print the target directory to stdout
1092 # if CDPATH is set.
1093 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1094
1095 if test -z "$lt_ECHO"; then
1096 if test "X${echo_test_string+set}" != Xset; then
1097 # find a string as large as possible, as long as the shell can cope with it
1098 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1099 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1100 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1101 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1102 then
1103 break
1104 fi
1105 done
1106 fi
1107
1108 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1109 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1110 test "X$echo_testing_string" = "X$echo_test_string"; then
1111 :
1112 else
1113 # The Solaris, AIX, and Digital Unix default echo programs unquote
1114 # backslashes. This makes it impossible to quote backslashes using
1115 # echo "$something" | sed 's/\\/\\\\/g'
1116 #
1117 # So, first we look for a working echo in the user's PATH.
1118
1119 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1120 for dir in $PATH /usr/ucb; do
1121 IFS="$lt_save_ifs"
1122 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1123 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1124 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1125 test "X$echo_testing_string" = "X$echo_test_string"; then
1126 ECHO="$dir/echo"
1127 break
1128 fi
1129 done
1130 IFS="$lt_save_ifs"
1131
1132 if test "X$ECHO" = Xecho; then
1133 # We didn't find a better echo, so look for alternatives.
1134 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1135 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1136 test "X$echo_testing_string" = "X$echo_test_string"; then
1137 # This shell has a builtin print -r that does the trick.
1138 ECHO='print -r'
1139 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1140 test "X$CONFIG_SHELL" != X/bin/ksh; then
1141 # If we have ksh, try running configure again with it.
1142 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1143 export ORIGINAL_CONFIG_SHELL
1144 CONFIG_SHELL=/bin/ksh
1145 export CONFIG_SHELL
1146 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1147 else
1148 # Try using printf.
1149 ECHO='printf %s\n'
1150 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1151 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1152 test "X$echo_testing_string" = "X$echo_test_string"; then
1153 # Cool, printf works
1154 :
1155 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1156 test "X$echo_testing_string" = 'X\t' &&
1157 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1158 test "X$echo_testing_string" = "X$echo_test_string"; then
1159 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1160 export CONFIG_SHELL
1161 SHELL="$CONFIG_SHELL"
1162 export SHELL
1163 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1164 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1165 test "X$echo_testing_string" = 'X\t' &&
1166 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1167 test "X$echo_testing_string" = "X$echo_test_string"; then
1168 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1169 else
1170 # maybe with a smaller string...
1171 prev=:
1172
1173 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1174 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1175 then
1176 break
1177 fi
1178 prev="$cmd"
1179 done
1180
1181 if test "$prev" != 'sed 50q "[$]0"'; then
1182 echo_test_string=`eval $prev`
1183 export echo_test_string
1184 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1185 else
1186 # Oops. We lost completely, so just stick with echo.
1187 ECHO=echo
1188 fi
1189 fi
1190 fi
1191 fi
1192 fi
1193 fi
1194
1195 # Copy echo and quote the copy suitably for passing to libtool from
1196 # the Makefile, instead of quoting the original, which is used later.
1197 lt_ECHO=$ECHO
1198 if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1199 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1200 fi
1201
1202 AC_SUBST(lt_ECHO)
1203 ])
1204 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1205 _LT_DECL([], [ECHO], [1],
1206 [An echo program that does not interpret backslashes])
1207 ])# _LT_PROG_ECHO_BACKSLASH
1208
1209
1210 # _LT_ENABLE_LOCK
1211 # ---------------
1212 m4_defun([_LT_ENABLE_LOCK],
1213 [AC_ARG_ENABLE([libtool-lock],
1214 [AS_HELP_STRING([--disable-libtool-lock],
1215 [avoid locking (might break parallel builds)])])
1216 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1217
1218 # Some flags need to be propagated to the compiler or linker for good
1219 # libtool support.
1220 case $host in
1221 ia64-*-hpux*)
1222 # Find out which ABI we are using.
1223 echo 'int i;' > conftest.$ac_ext
1224 if AC_TRY_EVAL(ac_compile); then
1225 case `/usr/bin/file conftest.$ac_objext` in
1226 *ELF-32*)
1227 HPUX_IA64_MODE="32"
1228 ;;
1229 *ELF-64*)
1230 HPUX_IA64_MODE="64"
1231 ;;
1232 esac
1233 fi
1234 rm -rf conftest*
1235 ;;
1236 *-*-irix6*)
1237 # Find out which ABI we are using.
1238 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1239 if AC_TRY_EVAL(ac_compile); then
1240 if test "$lt_cv_prog_gnu_ld" = yes; then
1241 case `/usr/bin/file conftest.$ac_objext` in
1242 *32-bit*)
1243 LD="${LD-ld} -melf32bsmip"
1244 ;;
1245 *N32*)
1246 LD="${LD-ld} -melf32bmipn32"
1247 ;;
1248 *64-bit*)
1249 LD="${LD-ld} -melf64bmip"
1250 ;;
1251 esac
1252 else
1253 case `/usr/bin/file conftest.$ac_objext` in
1254 *32-bit*)
1255 LD="${LD-ld} -32"
1256 ;;
1257 *N32*)
1258 LD="${LD-ld} -n32"
1259 ;;
1260 *64-bit*)
1261 LD="${LD-ld} -64"
1262 ;;
1263 esac
1264 fi
1265 fi
1266 rm -rf conftest*
1267 ;;
1268
1269 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1270 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1271 # Find out which ABI we are using.
1272 echo 'int i;' > conftest.$ac_ext
1273 if AC_TRY_EVAL(ac_compile); then
1274 case `/usr/bin/file conftest.o` in
1275 *32-bit*)
1276 case $host in
1277 x86_64-*kfreebsd*-gnu)
1278 LD="${LD-ld} -m elf_i386_fbsd"
1279 ;;
1280 x86_64-*linux*)
1281 LD="${LD-ld} -m elf_i386"
1282 ;;
1283 ppc64-*linux*|powerpc64-*linux*)
1284 LD="${LD-ld} -m elf32ppclinux"
1285 ;;
1286 s390x-*linux*)
1287 LD="${LD-ld} -m elf_s390"
1288 ;;
1289 sparc64-*linux*)
1290 LD="${LD-ld} -m elf32_sparc"
1291 ;;
1292 esac
1293 ;;
1294 *64-bit*)
1295 case $host in
1296 x86_64-*kfreebsd*-gnu)
1297 LD="${LD-ld} -m elf_x86_64_fbsd"
1298 ;;
1299 x86_64-*linux*)
1300 LD="${LD-ld} -m elf_x86_64"
1301 ;;
1302 ppc*-*linux*|powerpc*-*linux*)
1303 LD="${LD-ld} -m elf64ppc"
1304 ;;
1305 s390*-*linux*|s390*-*tpf*)
1306 LD="${LD-ld} -m elf64_s390"
1307 ;;
1308 sparc*-*linux*)
1309 LD="${LD-ld} -m elf64_sparc"
1310 ;;
1311 esac
1312 ;;
1313 esac
1314 fi
1315 rm -rf conftest*
1316 ;;
1317
1318 *-*-sco3.2v5*)
1319 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1320 SAVE_CFLAGS="$CFLAGS"
1321 CFLAGS="$CFLAGS -belf"
1322 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1323 [AC_LANG_PUSH(C)
1324 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1325 AC_LANG_POP])
1326 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1327 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1328 CFLAGS="$SAVE_CFLAGS"
1329 fi
1330 ;;
1331 sparc*-*solaris*)
1332 # Find out which ABI we are using.
1333 echo 'int i;' > conftest.$ac_ext
1334 if AC_TRY_EVAL(ac_compile); then
1335 case `/usr/bin/file conftest.o` in
1336 *64-bit*)
1337 case $lt_cv_prog_gnu_ld in
1338 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1339 *)
1340 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1341 LD="${LD-ld} -64"
1342 fi
1343 ;;
1344 esac
1345 ;;
1346 esac
1347 fi
1348 rm -rf conftest*
1349 ;;
1350 esac
1351
1352 need_locks="$enable_libtool_lock"
1353 ])# _LT_ENABLE_LOCK
1354
1355
1356 # _LT_CMD_OLD_ARCHIVE
1357 # -------------------
1358 m4_defun([_LT_CMD_OLD_ARCHIVE],
1359 [AC_CHECK_TOOL(AR, ar, false)
1360 test -z "$AR" && AR=ar
1361 test -z "$AR_FLAGS" && AR_FLAGS=cru
1362 _LT_DECL([], [AR], [1], [The archiver])
1363 _LT_DECL([], [AR_FLAGS], [1])
1364
1365 AC_CHECK_TOOL(STRIP, strip, :)
1366 test -z "$STRIP" && STRIP=:
1367 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1368
1369 AC_CHECK_TOOL(RANLIB, ranlib, :)
1370 test -z "$RANLIB" && RANLIB=:
1371 _LT_DECL([], [RANLIB], [1],
1372 [Commands used to install an old-style archive])
1373
1374 # Determine commands to create old-style static archives.
1375 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1376 old_postinstall_cmds='chmod 644 $oldlib'
1377 old_postuninstall_cmds=
1378
1379 if test -n "$RANLIB"; then
1380 case $host_os in
1381 openbsd*)
1382 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1383 ;;
1384 *)
1385 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1386 ;;
1387 esac
1388 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1389 fi
1390 _LT_DECL([], [old_postinstall_cmds], [2])
1391 _LT_DECL([], [old_postuninstall_cmds], [2])
1392 _LT_TAGDECL([], [old_archive_cmds], [2],
1393 [Commands used to build an old-style archive])
1394 ])# _LT_CMD_OLD_ARCHIVE
1395
1396
1397 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1398 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1399 # ----------------------------------------------------------------
1400 # Check whether the given compiler option works
1401 AC_DEFUN([_LT_COMPILER_OPTION],
1402 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1403 m4_require([_LT_DECL_SED])dnl
1404 AC_CACHE_CHECK([$1], [$2],
1405 [$2=no
1406 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1407 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1408 lt_compiler_flag="$3"
1409 # Insert the option either (1) after the last *FLAGS variable, or
1410 # (2) before a word containing "conftest.", or (3) at the end.
1411 # Note that $ac_compile itself does not contain backslashes and begins
1412 # with a dollar sign (not a hyphen), so the echo should work correctly.
1413 # The option is referenced via a variable to avoid confusing sed.
1414 lt_compile=`echo "$ac_compile" | $SED \
1415 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1416 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1417 -e 's:$: $lt_compiler_flag:'`
1418 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1419 (eval "$lt_compile" 2>conftest.err)
1420 ac_status=$?
1421 cat conftest.err >&AS_MESSAGE_LOG_FD
1422 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1423 if (exit $ac_status) && test -s "$ac_outfile"; then
1424 # The compiler can only warn and ignore the option if not recognized
1425 # So say no if there are warnings other than the usual output.
1426 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1427 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1428 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1429 $2=yes
1430 fi
1431 fi
1432 $RM conftest*
1433 ])
1434
1435 if test x"[$]$2" = xyes; then
1436 m4_if([$5], , :, [$5])
1437 else
1438 m4_if([$6], , :, [$6])
1439 fi
1440 ])# _LT_COMPILER_OPTION
1441
1442 # Old name:
1443 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1444 dnl aclocal-1.4 backwards compatibility:
1445 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1446
1447
1448 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1449 # [ACTION-SUCCESS], [ACTION-FAILURE])
1450 # ----------------------------------------------------
1451 # Check whether the given linker option works
1452 AC_DEFUN([_LT_LINKER_OPTION],
1453 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1454 m4_require([_LT_DECL_SED])dnl
1455 AC_CACHE_CHECK([$1], [$2],
1456 [$2=no
1457 save_LDFLAGS="$LDFLAGS"
1458 LDFLAGS="$LDFLAGS $3"
1459 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1460 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1461 # The linker can only warn and ignore the option if not recognized
1462 # So say no if there are warnings
1463 if test -s conftest.err; then
1464 # Append any errors to the config.log.
1465 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1466 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1467 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1468 if diff conftest.exp conftest.er2 >/dev/null; then
1469 $2=yes
1470 fi
1471 else
1472 $2=yes
1473 fi
1474 fi
1475 $RM -r conftest*
1476 LDFLAGS="$save_LDFLAGS"
1477 ])
1478
1479 if test x"[$]$2" = xyes; then
1480 m4_if([$4], , :, [$4])
1481 else
1482 m4_if([$5], , :, [$5])
1483 fi
1484 ])# _LT_LINKER_OPTION
1485
1486 # Old name:
1487 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1488 dnl aclocal-1.4 backwards compatibility:
1489 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1490
1491
1492 # LT_CMD_MAX_LEN
1493 #---------------
1494 AC_DEFUN([LT_CMD_MAX_LEN],
1495 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1496 # find the maximum length of command line arguments
1497 AC_MSG_CHECKING([the maximum length of command line arguments])
1498 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1499 i=0
1500 teststring="ABCD"
1501
1502 case $build_os in
1503 msdosdjgpp*)
1504 # On DJGPP, this test can blow up pretty badly due to problems in libc
1505 # (any single argument exceeding 2000 bytes causes a buffer overrun
1506 # during glob expansion). Even if it were fixed, the result of this
1507 # check would be larger than it should be.
1508 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1509 ;;
1510
1511 gnu*)
1512 # Under GNU Hurd, this test is not required because there is
1513 # no limit to the length of command line arguments.
1514 # Libtool will interpret -1 as no limit whatsoever
1515 lt_cv_sys_max_cmd_len=-1;
1516 ;;
1517
1518 cygwin* | mingw* | cegcc*)
1519 # On Win9x/ME, this test blows up -- it succeeds, but takes
1520 # about 5 minutes as the teststring grows exponentially.
1521 # Worse, since 9x/ME are not pre-emptively multitasking,
1522 # you end up with a "frozen" computer, even though with patience
1523 # the test eventually succeeds (with a max line length of 256k).
1524 # Instead, let's just punt: use the minimum linelength reported by
1525 # all of the supported platforms: 8192 (on NT/2K/XP).
1526 lt_cv_sys_max_cmd_len=8192;
1527 ;;
1528
1529 amigaos*)
1530 # On AmigaOS with pdksh, this test takes hours, literally.
1531 # So we just punt and use a minimum line length of 8192.
1532 lt_cv_sys_max_cmd_len=8192;
1533 ;;
1534
1535 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1536 # This has been around since 386BSD, at least. Likely further.
1537 if test -x /sbin/sysctl; then
1538 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1539 elif test -x /usr/sbin/sysctl; then
1540 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1541 else
1542 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1543 fi
1544 # And add a safety zone
1545 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1546 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1547 ;;
1548
1549 interix*)
1550 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1551 lt_cv_sys_max_cmd_len=196608
1552 ;;
1553
1554 osf*)
1555 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1556 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1557 # nice to cause kernel panics so lets avoid the loop below.
1558 # First set a reasonable default.
1559 lt_cv_sys_max_cmd_len=16384
1560 #
1561 if test -x /sbin/sysconfig; then
1562 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1563 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1564 esac
1565 fi
1566 ;;
1567 sco3.2v5*)
1568 lt_cv_sys_max_cmd_len=102400
1569 ;;
1570 sysv5* | sco5v6* | sysv4.2uw2*)
1571 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1572 if test -n "$kargmax"; then
1573 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1574 else
1575 lt_cv_sys_max_cmd_len=32768
1576 fi
1577 ;;
1578 *)
1579 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1580 if test -n "$lt_cv_sys_max_cmd_len"; then
1581 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1582 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1583 else
1584 # Make teststring a little bigger before we do anything with it.
1585 # a 1K string should be a reasonable start.
1586 for i in 1 2 3 4 5 6 7 8 ; do
1587 teststring=$teststring$teststring
1588 done
1589 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1590 # If test is not a shell built-in, we'll probably end up computing a
1591 # maximum length that is only half of the actual maximum length, but
1592 # we can't tell.
1593 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1594 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1595 test $i != 17 # 1/2 MB should be enough
1596 do
1597 i=`expr $i + 1`
1598 teststring=$teststring$teststring
1599 done
1600 # Only check the string length outside the loop.
1601 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1602 teststring=
1603 # Add a significant safety factor because C++ compilers can tack on
1604 # massive amounts of additional arguments before passing them to the
1605 # linker. It appears as though 1/2 is a usable value.
1606 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1607 fi
1608 ;;
1609 esac
1610 ])
1611 if test -n $lt_cv_sys_max_cmd_len ; then
1612 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1613 else
1614 AC_MSG_RESULT(none)
1615 fi
1616 max_cmd_len=$lt_cv_sys_max_cmd_len
1617 _LT_DECL([], [max_cmd_len], [0],
1618 [What is the maximum length of a command?])
1619 ])# LT_CMD_MAX_LEN
1620
1621 # Old name:
1622 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1623 dnl aclocal-1.4 backwards compatibility:
1624 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1625
1626
1627 # _LT_HEADER_DLFCN
1628 # ----------------
1629 m4_defun([_LT_HEADER_DLFCN],
1630 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1631 ])# _LT_HEADER_DLFCN
1632
1633
1634 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1635 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1636 # ----------------------------------------------------------------
1637 m4_defun([_LT_TRY_DLOPEN_SELF],
1638 [m4_require([_LT_HEADER_DLFCN])dnl
1639 if test "$cross_compiling" = yes; then :
1640 [$4]
1641 else
1642 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1643 lt_status=$lt_dlunknown
1644 cat > conftest.$ac_ext <<_LT_EOF
1645 [#line __oline__ "configure"
1646 #include "confdefs.h"
1647
1648 #if HAVE_DLFCN_H
1649 #include <dlfcn.h>
1650 #endif
1651
1652 #include <stdio.h>
1653
1654 #ifdef RTLD_GLOBAL
1655 # define LT_DLGLOBAL RTLD_GLOBAL
1656 #else
1657 # ifdef DL_GLOBAL
1658 # define LT_DLGLOBAL DL_GLOBAL
1659 # else
1660 # define LT_DLGLOBAL 0
1661 # endif
1662 #endif
1663
1664 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1665 find out it does not work in some platform. */
1666 #ifndef LT_DLLAZY_OR_NOW
1667 # ifdef RTLD_LAZY
1668 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1669 # else
1670 # ifdef DL_LAZY
1671 # define LT_DLLAZY_OR_NOW DL_LAZY
1672 # else
1673 # ifdef RTLD_NOW
1674 # define LT_DLLAZY_OR_NOW RTLD_NOW
1675 # else
1676 # ifdef DL_NOW
1677 # define LT_DLLAZY_OR_NOW DL_NOW
1678 # else
1679 # define LT_DLLAZY_OR_NOW 0
1680 # endif
1681 # endif
1682 # endif
1683 # endif
1684 #endif
1685
1686 void fnord() { int i=42;}
1687 int main ()
1688 {
1689 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1690 int status = $lt_dlunknown;
1691
1692 if (self)
1693 {
1694 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1695 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1696 /* dlclose (self); */
1697 }
1698 else
1699 puts (dlerror ());
1700
1701 return status;
1702 }]
1703 _LT_EOF
1704 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1705 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1706 lt_status=$?
1707 case x$lt_status in
1708 x$lt_dlno_uscore) $1 ;;
1709 x$lt_dlneed_uscore) $2 ;;
1710 x$lt_dlunknown|x*) $3 ;;
1711 esac
1712 else :
1713 # compilation failed
1714 $3
1715 fi
1716 fi
1717 rm -fr conftest*
1718 ])# _LT_TRY_DLOPEN_SELF
1719
1720
1721 # LT_SYS_DLOPEN_SELF
1722 # ------------------
1723 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1724 [m4_require([_LT_HEADER_DLFCN])dnl
1725 if test "x$enable_dlopen" != xyes; then
1726 enable_dlopen=unknown
1727 enable_dlopen_self=unknown
1728 enable_dlopen_self_static=unknown
1729 else
1730 lt_cv_dlopen=no
1731 lt_cv_dlopen_libs=
1732
1733 case $host_os in
1734 beos*)
1735 lt_cv_dlopen="load_add_on"
1736 lt_cv_dlopen_libs=
1737 lt_cv_dlopen_self=yes
1738 ;;
1739
1740 mingw* | pw32* | cegcc*)
1741 lt_cv_dlopen="LoadLibrary"
1742 lt_cv_dlopen_libs=
1743 ;;
1744
1745 cygwin*)
1746 lt_cv_dlopen="dlopen"
1747 lt_cv_dlopen_libs=
1748 ;;
1749
1750 darwin*)
1751 # if libdl is installed we need to link against it
1752 AC_CHECK_LIB([dl], [dlopen],
1753 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1754 lt_cv_dlopen="dyld"
1755 lt_cv_dlopen_libs=
1756 lt_cv_dlopen_self=yes
1757 ])
1758 ;;
1759
1760 *)
1761 AC_CHECK_FUNC([shl_load],
1762 [lt_cv_dlopen="shl_load"],
1763 [AC_CHECK_LIB([dld], [shl_load],
1764 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1765 [AC_CHECK_FUNC([dlopen],
1766 [lt_cv_dlopen="dlopen"],
1767 [AC_CHECK_LIB([dl], [dlopen],
1768 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1769 [AC_CHECK_LIB([svld], [dlopen],
1770 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1771 [AC_CHECK_LIB([dld], [dld_link],
1772 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1773 ])
1774 ])
1775 ])
1776 ])
1777 ])
1778 ;;
1779 esac
1780
1781 if test "x$lt_cv_dlopen" != xno; then
1782 enable_dlopen=yes
1783 else
1784 enable_dlopen=no
1785 fi
1786
1787 case $lt_cv_dlopen in
1788 dlopen)
1789 save_CPPFLAGS="$CPPFLAGS"
1790 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1791
1792 save_LDFLAGS="$LDFLAGS"
1793 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1794
1795 save_LIBS="$LIBS"
1796 LIBS="$lt_cv_dlopen_libs $LIBS"
1797
1798 AC_CACHE_CHECK([whether a program can dlopen itself],
1799 lt_cv_dlopen_self, [dnl
1800 _LT_TRY_DLOPEN_SELF(
1801 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1802 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1803 ])
1804
1805 if test "x$lt_cv_dlopen_self" = xyes; then
1806 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1807 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1808 lt_cv_dlopen_self_static, [dnl
1809 _LT_TRY_DLOPEN_SELF(
1810 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1811 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1812 ])
1813 fi
1814
1815 CPPFLAGS="$save_CPPFLAGS"
1816 LDFLAGS="$save_LDFLAGS"
1817 LIBS="$save_LIBS"
1818 ;;
1819 esac
1820
1821 case $lt_cv_dlopen_self in
1822 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1823 *) enable_dlopen_self=unknown ;;
1824 esac
1825
1826 case $lt_cv_dlopen_self_static in
1827 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1828 *) enable_dlopen_self_static=unknown ;;
1829 esac
1830 fi
1831 _LT_DECL([dlopen_support], [enable_dlopen], [0],
1832 [Whether dlopen is supported])
1833 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1834 [Whether dlopen of programs is supported])
1835 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1836 [Whether dlopen of statically linked programs is supported])
1837 ])# LT_SYS_DLOPEN_SELF
1838
1839 # Old name:
1840 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1841 dnl aclocal-1.4 backwards compatibility:
1842 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1843
1844
1845 # _LT_COMPILER_C_O([TAGNAME])
1846 # ---------------------------
1847 # Check to see if options -c and -o are simultaneously supported by compiler.
1848 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
1849 m4_defun([_LT_COMPILER_C_O],
1850 [m4_require([_LT_DECL_SED])dnl
1851 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1852 m4_require([_LT_TAG_COMPILER])dnl
1853 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1854 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1855 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1856 $RM -r conftest 2>/dev/null
1857 mkdir conftest
1858 cd conftest
1859 mkdir out
1860 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1861
1862 lt_compiler_flag="-o out/conftest2.$ac_objext"
1863 # Insert the option either (1) after the last *FLAGS variable, or
1864 # (2) before a word containing "conftest.", or (3) at the end.
1865 # Note that $ac_compile itself does not contain backslashes and begins
1866 # with a dollar sign (not a hyphen), so the echo should work correctly.
1867 lt_compile=`echo "$ac_compile" | $SED \
1868 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1869 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1870 -e 's:$: $lt_compiler_flag:'`
1871 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1872 (eval "$lt_compile" 2>out/conftest.err)
1873 ac_status=$?
1874 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1875 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1876 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1877 then
1878 # The compiler can only warn and ignore the option if not recognized
1879 # So say no if there are warnings
1880 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1881 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1882 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1883 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1884 fi
1885 fi
1886 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1887 $RM conftest*
1888 # SGI C++ compiler will create directory out/ii_files/ for
1889 # template instantiation
1890 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1891 $RM out/* && rmdir out
1892 cd ..
1893 $RM -r conftest
1894 $RM conftest*
1895 ])
1896 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1897 [Does compiler simultaneously support -c and -o options?])
1898 ])# _LT_COMPILER_C_O
1899
1900
1901 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
1902 # ----------------------------------
1903 # Check to see if we can do hard links to lock some files if needed
1904 m4_defun([_LT_COMPILER_FILE_LOCKS],
1905 [m4_require([_LT_ENABLE_LOCK])dnl
1906 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1907 _LT_COMPILER_C_O([$1])
1908
1909 hard_links="nottested"
1910 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1911 # do not overwrite the value of need_locks provided by the user
1912 AC_MSG_CHECKING([if we can lock with hard links])
1913 hard_links=yes
1914 $RM conftest*
1915 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1916 touch conftest.a
1917 ln conftest.a conftest.b 2>&5 || hard_links=no
1918 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1919 AC_MSG_RESULT([$hard_links])
1920 if test "$hard_links" = no; then
1921 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1922 need_locks=warn
1923 fi
1924 else
1925 need_locks=no
1926 fi
1927 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1928 ])# _LT_COMPILER_FILE_LOCKS
1929
1930
1931 # _LT_CHECK_OBJDIR
1932 # ----------------
1933 m4_defun([_LT_CHECK_OBJDIR],
1934 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1935 [rm -f .libs 2>/dev/null
1936 mkdir .libs 2>/dev/null
1937 if test -d .libs; then
1938 lt_cv_objdir=.libs
1939 else
1940 # MS-DOS does not allow filenames that begin with a dot.
1941 lt_cv_objdir=_libs
1942 fi
1943 rmdir .libs 2>/dev/null])
1944 objdir=$lt_cv_objdir
1945 _LT_DECL([], [objdir], [0],
1946 [The name of the directory that contains temporary libtool files])dnl
1947 m4_pattern_allow([LT_OBJDIR])dnl
1948 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1949 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1950 ])# _LT_CHECK_OBJDIR
1951
1952
1953 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1954 # --------------------------------------
1955 # Check hardcoding attributes.
1956 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1957 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1958 _LT_TAGVAR(hardcode_action, $1)=
1959 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1960 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1961 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1962
1963 # We can hardcode non-existent directories.
1964 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1965 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1966 # have to relink, otherwise we might link with an installed library
1967 # when we should be linking with a yet-to-be-installed one
1968 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1969 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1970 # Linking always hardcodes the temporary library directory.
1971 _LT_TAGVAR(hardcode_action, $1)=relink
1972 else
1973 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1974 _LT_TAGVAR(hardcode_action, $1)=immediate
1975 fi
1976 else
1977 # We cannot hardcode anything, or else we can only hardcode existing
1978 # directories.
1979 _LT_TAGVAR(hardcode_action, $1)=unsupported
1980 fi
1981 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1982
1983 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1984 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1985 # Fast installation is not supported
1986 enable_fast_install=no
1987 elif test "$shlibpath_overrides_runpath" = yes ||
1988 test "$enable_shared" = no; then
1989 # Fast installation is not necessary
1990 enable_fast_install=needless
1991 fi
1992 _LT_TAGDECL([], [hardcode_action], [0],
1993 [How to hardcode a shared library path into an executable])
1994 ])# _LT_LINKER_HARDCODE_LIBPATH
1995
1996
1997 # _LT_CMD_STRIPLIB
1998 # ----------------
1999 m4_defun([_LT_CMD_STRIPLIB],
2000 [m4_require([_LT_DECL_EGREP])
2001 striplib=
2002 old_striplib=
2003 AC_MSG_CHECKING([whether stripping libraries is possible])
2004 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2005 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2006 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2007 AC_MSG_RESULT([yes])
2008 else
2009 # FIXME - insert some real tests, host_os isn't really good enough
2010 case $host_os in
2011 darwin*)
2012 if test -n "$STRIP" ; then
2013 striplib="$STRIP -x"
2014 old_striplib="$STRIP -S"
2015 AC_MSG_RESULT([yes])
2016 else
2017 AC_MSG_RESULT([no])
2018 fi
2019 ;;
2020 *)
2021 AC_MSG_RESULT([no])
2022 ;;
2023 esac
2024 fi
2025 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2026 _LT_DECL([], [striplib], [1])
2027 ])# _LT_CMD_STRIPLIB
2028
2029
2030 # _LT_SYS_DYNAMIC_LINKER([TAG])
2031 # -----------------------------
2032 # PORTME Fill in your ld.so characteristics
2033 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2034 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2035 m4_require([_LT_DECL_EGREP])dnl
2036 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2037 m4_require([_LT_DECL_OBJDUMP])dnl
2038 m4_require([_LT_DECL_SED])dnl
2039 AC_MSG_CHECKING([dynamic linker characteristics])
2040 m4_if([$1],
2041 [], [
2042 if test "$GCC" = yes; then
2043 case $host_os in
2044 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2045 *) lt_awk_arg="/^libraries:/" ;;
2046 esac
2047 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2048 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2049 # if the path contains ";" then we assume it to be the separator
2050 # otherwise default to the standard path separator (i.e. ":") - it is
2051 # assumed that no part of a normal pathname contains ";" but that should
2052 # okay in the real world where ";" in dirpaths is itself problematic.
2053 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2054 else
2055 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2056 fi
2057 # Ok, now we have the path, separated by spaces, we can step through it
2058 # and add multilib dir if necessary.
2059 lt_tmp_lt_search_path_spec=
2060 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2061 for lt_sys_path in $lt_search_path_spec; do
2062 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2063 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2064 else
2065 test -d "$lt_sys_path" && \
2066 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2067 fi
2068 done
2069 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2070 BEGIN {RS=" "; FS="/|\n";} {
2071 lt_foo="";
2072 lt_count=0;
2073 for (lt_i = NF; lt_i > 0; lt_i--) {
2074 if ($lt_i != "" && $lt_i != ".") {
2075 if ($lt_i == "..") {
2076 lt_count++;
2077 } else {
2078 if (lt_count == 0) {
2079 lt_foo="/" $lt_i lt_foo;
2080 } else {
2081 lt_count--;
2082 }
2083 }
2084 }
2085 }
2086 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2087 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2088 }'`
2089 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2090 else
2091 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2092 fi])
2093 library_names_spec=
2094 libname_spec='lib$name'
2095 soname_spec=
2096 shrext_cmds=".so"
2097 postinstall_cmds=
2098 postuninstall_cmds=
2099 finish_cmds=
2100 finish_eval=
2101 shlibpath_var=
2102 shlibpath_overrides_runpath=unknown
2103 version_type=none
2104 dynamic_linker="$host_os ld.so"
2105 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2106 need_lib_prefix=unknown
2107 hardcode_into_libs=no
2108
2109 # when you set need_version to no, make sure it does not cause -set_version
2110 # flags to be left without arguments
2111 need_version=unknown
2112
2113 case $host_os in
2114 aix3*)
2115 version_type=linux
2116 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2117 shlibpath_var=LIBPATH
2118
2119 # AIX 3 has no versioning support, so we append a major version to the name.
2120 soname_spec='${libname}${release}${shared_ext}$major'
2121 ;;
2122
2123 aix[[4-9]]*)
2124 version_type=linux
2125 need_lib_prefix=no
2126 need_version=no
2127 hardcode_into_libs=yes
2128 if test "$host_cpu" = ia64; then
2129 # AIX 5 supports IA64
2130 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2131 shlibpath_var=LD_LIBRARY_PATH
2132 else
2133 # With GCC up to 2.95.x, collect2 would create an import file
2134 # for dependence libraries. The import file would start with
2135 # the line `#! .'. This would cause the generated library to
2136 # depend on `.', always an invalid library. This was fixed in
2137 # development snapshots of GCC prior to 3.0.
2138 case $host_os in
2139 aix4 | aix4.[[01]] | aix4.[[01]].*)
2140 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2141 echo ' yes '
2142 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2143 :
2144 else
2145 can_build_shared=no
2146 fi
2147 ;;
2148 esac
2149 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2150 # soname into executable. Probably we can add versioning support to
2151 # collect2, so additional links can be useful in future.
2152 if test "$aix_use_runtimelinking" = yes; then
2153 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2154 # instead of lib<name>.a to let people know that these are not
2155 # typical AIX shared libraries.
2156 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2157 else
2158 # We preserve .a as extension for shared libraries through AIX4.2
2159 # and later when we are not doing run time linking.
2160 library_names_spec='${libname}${release}.a $libname.a'
2161 soname_spec='${libname}${release}${shared_ext}$major'
2162 fi
2163 shlibpath_var=LIBPATH
2164 fi
2165 ;;
2166
2167 amigaos*)
2168 case $host_cpu in
2169 powerpc)
2170 # Since July 2007 AmigaOS4 officially supports .so libraries.
2171 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2172 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173 ;;
2174 m68k)
2175 library_names_spec='$libname.ixlibrary $libname.a'
2176 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2177 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2178 ;;
2179 esac
2180 ;;
2181
2182 beos*)
2183 library_names_spec='${libname}${shared_ext}'
2184 dynamic_linker="$host_os ld.so"
2185 shlibpath_var=LIBRARY_PATH
2186 ;;
2187
2188 bsdi[[45]]*)
2189 version_type=linux
2190 need_version=no
2191 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2192 soname_spec='${libname}${release}${shared_ext}$major'
2193 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2194 shlibpath_var=LD_LIBRARY_PATH
2195 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2196 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2197 # the default ld.so.conf also contains /usr/contrib/lib and
2198 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2199 # libtool to hard-code these into programs
2200 ;;
2201
2202 cygwin* | mingw* | pw32* | cegcc*)
2203 version_type=windows
2204 shrext_cmds=".dll"
2205 need_version=no
2206 need_lib_prefix=no
2207
2208 case $GCC,$host_os in
2209 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2210 library_names_spec='$libname.dll.a'
2211 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2212 postinstall_cmds='base_file=`basename \${file}`~
2213 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2214 dldir=$destdir/`dirname \$dlpath`~
2215 test -d \$dldir || mkdir -p \$dldir~
2216 $install_prog $dir/$dlname \$dldir/$dlname~
2217 chmod a+x \$dldir/$dlname~
2218 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2219 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2220 fi'
2221 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2222 dlpath=$dir/\$dldll~
2223 $RM \$dlpath'
2224 shlibpath_overrides_runpath=yes
2225
2226 case $host_os in
2227 cygwin*)
2228 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2229 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2230 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2231 ;;
2232 mingw* | cegcc*)
2233 # MinGW DLLs use traditional 'lib' prefix
2234 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2235 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2236 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2237 # It is most probably a Windows format PATH printed by
2238 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2239 # path with ; separators, and with drive letters. We can handle the
2240 # drive letters (cygwin fileutils understands them), so leave them,
2241 # especially as we might pass files found there to a mingw objdump,
2242 # which wouldn't understand a cygwinified path. Ahh.
2243 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2244 else
2245 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2246 fi
2247 ;;
2248 pw32*)
2249 # pw32 DLLs use 'pw' prefix rather than 'lib'
2250 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251 ;;
2252 esac
2253 ;;
2254
2255 *)
2256 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2257 ;;
2258 esac
2259 dynamic_linker='Win32 ld.exe'
2260 # FIXME: first we should search . and the directory the executable is in
2261 shlibpath_var=PATH
2262 ;;
2263
2264 darwin* | rhapsody*)
2265 dynamic_linker="$host_os dyld"
2266 version_type=darwin
2267 need_lib_prefix=no
2268 need_version=no
2269 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2270 soname_spec='${libname}${release}${major}$shared_ext'
2271 shlibpath_overrides_runpath=yes
2272 shlibpath_var=DYLD_LIBRARY_PATH
2273 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2274 m4_if([$1], [],[
2275 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2276 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2277 ;;
2278
2279 dgux*)
2280 version_type=linux
2281 need_lib_prefix=no
2282 need_version=no
2283 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2284 soname_spec='${libname}${release}${shared_ext}$major'
2285 shlibpath_var=LD_LIBRARY_PATH
2286 ;;
2287
2288 freebsd1*)
2289 dynamic_linker=no
2290 ;;
2291
2292 freebsd* | dragonfly*)
2293 # DragonFly does not have aout. When/if they implement a new
2294 # versioning mechanism, adjust this.
2295 if test -x /usr/bin/objformat; then
2296 objformat=`/usr/bin/objformat`
2297 else
2298 case $host_os in
2299 freebsd[[123]]*) objformat=aout ;;
2300 *) objformat=elf ;;
2301 esac
2302 fi
2303 version_type=freebsd-$objformat
2304 case $version_type in
2305 freebsd-elf*)
2306 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2307 need_version=no
2308 need_lib_prefix=no
2309 ;;
2310 freebsd-*)
2311 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2312 need_version=yes
2313 ;;
2314 esac
2315 shlibpath_var=LD_LIBRARY_PATH
2316 case $host_os in
2317 freebsd2*)
2318 shlibpath_overrides_runpath=yes
2319 ;;
2320 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2321 shlibpath_overrides_runpath=yes
2322 hardcode_into_libs=yes
2323 ;;
2324 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2325 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2326 shlibpath_overrides_runpath=no
2327 hardcode_into_libs=yes
2328 ;;
2329 *) # from 4.6 on, and DragonFly
2330 shlibpath_overrides_runpath=yes
2331 hardcode_into_libs=yes
2332 ;;
2333 esac
2334 ;;
2335
2336 gnu*)
2337 version_type=linux
2338 need_lib_prefix=no
2339 need_version=no
2340 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2341 soname_spec='${libname}${release}${shared_ext}$major'
2342 shlibpath_var=LD_LIBRARY_PATH
2343 hardcode_into_libs=yes
2344 ;;
2345
2346 hpux9* | hpux10* | hpux11*)
2347 # Give a soname corresponding to the major version so that dld.sl refuses to
2348 # link against other versions.
2349 version_type=sunos
2350 need_lib_prefix=no
2351 need_version=no
2352 case $host_cpu in
2353 ia64*)
2354 shrext_cmds='.so'
2355 hardcode_into_libs=yes
2356 dynamic_linker="$host_os dld.so"
2357 shlibpath_var=LD_LIBRARY_PATH
2358 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2359 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2360 soname_spec='${libname}${release}${shared_ext}$major'
2361 if test "X$HPUX_IA64_MODE" = X32; then
2362 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2363 else
2364 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2365 fi
2366 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2367 ;;
2368 hppa*64*)
2369 shrext_cmds='.sl'
2370 hardcode_into_libs=yes
2371 dynamic_linker="$host_os dld.sl"
2372 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2373 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2374 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2375 soname_spec='${libname}${release}${shared_ext}$major'
2376 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2377 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2378 ;;
2379 *)
2380 shrext_cmds='.sl'
2381 dynamic_linker="$host_os dld.sl"
2382 shlibpath_var=SHLIB_PATH
2383 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2384 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2385 soname_spec='${libname}${release}${shared_ext}$major'
2386 ;;
2387 esac
2388 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2389 postinstall_cmds='chmod 555 $lib'
2390 ;;
2391
2392 interix[[3-9]]*)
2393 version_type=linux
2394 need_lib_prefix=no
2395 need_version=no
2396 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2397 soname_spec='${libname}${release}${shared_ext}$major'
2398 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2399 shlibpath_var=LD_LIBRARY_PATH
2400 shlibpath_overrides_runpath=no
2401 hardcode_into_libs=yes
2402 ;;
2403
2404 irix5* | irix6* | nonstopux*)
2405 case $host_os in
2406 nonstopux*) version_type=nonstopux ;;
2407 *)
2408 if test "$lt_cv_prog_gnu_ld" = yes; then
2409 version_type=linux
2410 else
2411 version_type=irix
2412 fi ;;
2413 esac
2414 need_lib_prefix=no
2415 need_version=no
2416 soname_spec='${libname}${release}${shared_ext}$major'
2417 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2418 case $host_os in
2419 irix5* | nonstopux*)
2420 libsuff= shlibsuff=
2421 ;;
2422 *)
2423 case $LD in # libtool.m4 will add one of these switches to LD
2424 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2425 libsuff= shlibsuff= libmagic=32-bit;;
2426 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2427 libsuff=32 shlibsuff=N32 libmagic=N32;;
2428 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2429 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2430 *) libsuff= shlibsuff= libmagic=never-match;;
2431 esac
2432 ;;
2433 esac
2434 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2435 shlibpath_overrides_runpath=no
2436 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2437 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2438 hardcode_into_libs=yes
2439 ;;
2440
2441 # No shared lib support for Linux oldld, aout, or coff.
2442 linux*oldld* | linux*aout* | linux*coff*)
2443 dynamic_linker=no
2444 ;;
2445
2446 # This must be Linux ELF.
2447 linux* | k*bsd*-gnu | kopensolaris*-gnu)
2448 version_type=linux
2449 need_lib_prefix=no
2450 need_version=no
2451 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2452 soname_spec='${libname}${release}${shared_ext}$major'
2453 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2454 shlibpath_var=LD_LIBRARY_PATH
2455 shlibpath_overrides_runpath=no
2456 # Some binutils ld are patched to set DT_RUNPATH
2457 save_LDFLAGS=$LDFLAGS
2458 save_libdir=$libdir
2459 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2460 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2461 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2462 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2463 [shlibpath_overrides_runpath=yes])])
2464 LDFLAGS=$save_LDFLAGS
2465 libdir=$save_libdir
2466
2467 # This implies no fast_install, which is unacceptable.
2468 # Some rework will be needed to allow for fast_install
2469 # before this can be enabled.
2470 hardcode_into_libs=yes
2471
2472 # Append ld.so.conf contents to the search path
2473 if test -f /etc/ld.so.conf; then
2474 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2475 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2476 fi
2477
2478 # We used to test for /lib/ld.so.1 and disable shared libraries on
2479 # powerpc, because MkLinux only supported shared libraries with the
2480 # GNU dynamic linker. Since this was broken with cross compilers,
2481 # most powerpc-linux boxes support dynamic linking these days and
2482 # people can always --disable-shared, the test was removed, and we
2483 # assume the GNU/Linux dynamic linker is in use.
2484 dynamic_linker='GNU/Linux ld.so'
2485 ;;
2486
2487 netbsdelf*-gnu)
2488 version_type=linux
2489 need_lib_prefix=no
2490 need_version=no
2491 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2492 soname_spec='${libname}${release}${shared_ext}$major'
2493 shlibpath_var=LD_LIBRARY_PATH
2494 shlibpath_overrides_runpath=no
2495 hardcode_into_libs=yes
2496 dynamic_linker='NetBSD ld.elf_so'
2497 ;;
2498
2499 netbsd*)
2500 version_type=sunos
2501 need_lib_prefix=no
2502 need_version=no
2503 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2504 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2505 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2506 dynamic_linker='NetBSD (a.out) ld.so'
2507 else
2508 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2509 soname_spec='${libname}${release}${shared_ext}$major'
2510 dynamic_linker='NetBSD ld.elf_so'
2511 fi
2512 shlibpath_var=LD_LIBRARY_PATH
2513 shlibpath_overrides_runpath=yes
2514 hardcode_into_libs=yes
2515 ;;
2516
2517 newsos6)
2518 version_type=linux
2519 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2520 shlibpath_var=LD_LIBRARY_PATH
2521 shlibpath_overrides_runpath=yes
2522 ;;
2523
2524 *nto* | *qnx*)
2525 version_type=qnx
2526 need_lib_prefix=no
2527 need_version=no
2528 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2529 soname_spec='${libname}${release}${shared_ext}$major'
2530 shlibpath_var=LD_LIBRARY_PATH
2531 shlibpath_overrides_runpath=no
2532 hardcode_into_libs=yes
2533 dynamic_linker='ldqnx.so'
2534 ;;
2535
2536 openbsd*)
2537 version_type=sunos
2538 sys_lib_dlsearch_path_spec="/usr/lib"
2539 need_lib_prefix=no
2540 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2541 case $host_os in
2542 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2543 *) need_version=no ;;
2544 esac
2545 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2546 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2547 shlibpath_var=LD_LIBRARY_PATH
2548 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2549 case $host_os in
2550 openbsd2.[[89]] | openbsd2.[[89]].*)
2551 shlibpath_overrides_runpath=no
2552 ;;
2553 *)
2554 shlibpath_overrides_runpath=yes
2555 ;;
2556 esac
2557 else
2558 shlibpath_overrides_runpath=yes
2559 fi
2560 ;;
2561
2562 os2*)
2563 libname_spec='$name'
2564 shrext_cmds=".dll"
2565 need_lib_prefix=no
2566 library_names_spec='$libname${shared_ext} $libname.a'
2567 dynamic_linker='OS/2 ld.exe'
2568 shlibpath_var=LIBPATH
2569 ;;
2570
2571 osf3* | osf4* | osf5*)
2572 version_type=osf
2573 need_lib_prefix=no
2574 need_version=no
2575 soname_spec='${libname}${release}${shared_ext}$major'
2576 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2577 shlibpath_var=LD_LIBRARY_PATH
2578 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2579 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2580 ;;
2581
2582 rdos*)
2583 dynamic_linker=no
2584 ;;
2585
2586 solaris*)
2587 version_type=linux
2588 need_lib_prefix=no
2589 need_version=no
2590 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2591 soname_spec='${libname}${release}${shared_ext}$major'
2592 shlibpath_var=LD_LIBRARY_PATH
2593 shlibpath_overrides_runpath=yes
2594 hardcode_into_libs=yes
2595 # ldd complains unless libraries are executable
2596 postinstall_cmds='chmod +x $lib'
2597 ;;
2598
2599 sunos4*)
2600 version_type=sunos
2601 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2602 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2603 shlibpath_var=LD_LIBRARY_PATH
2604 shlibpath_overrides_runpath=yes
2605 if test "$with_gnu_ld" = yes; then
2606 need_lib_prefix=no
2607 fi
2608 need_version=yes
2609 ;;
2610
2611 sysv4 | sysv4.3*)
2612 version_type=linux
2613 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2614 soname_spec='${libname}${release}${shared_ext}$major'
2615 shlibpath_var=LD_LIBRARY_PATH
2616 case $host_vendor in
2617 sni)
2618 shlibpath_overrides_runpath=no
2619 need_lib_prefix=no
2620 runpath_var=LD_RUN_PATH
2621 ;;
2622 siemens)
2623 need_lib_prefix=no
2624 ;;
2625 motorola)
2626 need_lib_prefix=no
2627 need_version=no
2628 shlibpath_overrides_runpath=no
2629 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2630 ;;
2631 esac
2632 ;;
2633
2634 sysv4*MP*)
2635 if test -d /usr/nec ;then
2636 version_type=linux
2637 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2638 soname_spec='$libname${shared_ext}.$major'
2639 shlibpath_var=LD_LIBRARY_PATH
2640 fi
2641 ;;
2642
2643 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2644 version_type=freebsd-elf
2645 need_lib_prefix=no
2646 need_version=no
2647 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2648 soname_spec='${libname}${release}${shared_ext}$major'
2649 shlibpath_var=LD_LIBRARY_PATH
2650 shlibpath_overrides_runpath=yes
2651 hardcode_into_libs=yes
2652 if test "$with_gnu_ld" = yes; then
2653 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2654 else
2655 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2656 case $host_os in
2657 sco3.2v5*)
2658 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2659 ;;
2660 esac
2661 fi
2662 sys_lib_dlsearch_path_spec='/usr/lib'
2663 ;;
2664
2665 tpf*)
2666 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2667 version_type=linux
2668 need_lib_prefix=no
2669 need_version=no
2670 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2671 shlibpath_var=LD_LIBRARY_PATH
2672 shlibpath_overrides_runpath=no
2673 hardcode_into_libs=yes
2674 ;;
2675
2676 uts4*)
2677 version_type=linux
2678 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2679 soname_spec='${libname}${release}${shared_ext}$major'
2680 shlibpath_var=LD_LIBRARY_PATH
2681 ;;
2682
2683 *)
2684 dynamic_linker=no
2685 ;;
2686 esac
2687 AC_MSG_RESULT([$dynamic_linker])
2688 test "$dynamic_linker" = no && can_build_shared=no
2689
2690 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2691 if test "$GCC" = yes; then
2692 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2693 fi
2694
2695 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2696 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2697 fi
2698 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2699 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2700 fi
2701
2702 _LT_DECL([], [variables_saved_for_relink], [1],
2703 [Variables whose values should be saved in libtool wrapper scripts and
2704 restored at link time])
2705 _LT_DECL([], [need_lib_prefix], [0],
2706 [Do we need the "lib" prefix for modules?])
2707 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2708 _LT_DECL([], [version_type], [0], [Library versioning type])
2709 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2710 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2711 _LT_DECL([], [shlibpath_overrides_runpath], [0],
2712 [Is shlibpath searched before the hard-coded library search path?])
2713 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2714 _LT_DECL([], [library_names_spec], [1],
2715 [[List of archive names. First name is the real one, the rest are links.
2716 The last name is the one that the linker finds with -lNAME]])
2717 _LT_DECL([], [soname_spec], [1],
2718 [[The coded name of the library, if different from the real name]])
2719 _LT_DECL([], [postinstall_cmds], [2],
2720 [Command to use after installation of a shared archive])
2721 _LT_DECL([], [postuninstall_cmds], [2],
2722 [Command to use after uninstallation of a shared archive])
2723 _LT_DECL([], [finish_cmds], [2],
2724 [Commands used to finish a libtool library installation in a directory])
2725 _LT_DECL([], [finish_eval], [1],
2726 [[As "finish_cmds", except a single script fragment to be evaled but
2727 not shown]])
2728 _LT_DECL([], [hardcode_into_libs], [0],
2729 [Whether we should hardcode library paths into libraries])
2730 _LT_DECL([], [sys_lib_search_path_spec], [2],
2731 [Compile-time system search path for libraries])
2732 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2733 [Run-time system search path for libraries])
2734 ])# _LT_SYS_DYNAMIC_LINKER
2735
2736
2737 # _LT_PATH_TOOL_PREFIX(TOOL)
2738 # --------------------------
2739 # find a file program which can recognize shared library
2740 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2741 [m4_require([_LT_DECL_EGREP])dnl
2742 AC_MSG_CHECKING([for $1])
2743 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2744 [case $MAGIC_CMD in
2745 [[\\/*] | ?:[\\/]*])
2746 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2747 ;;
2748 *)
2749 lt_save_MAGIC_CMD="$MAGIC_CMD"
2750 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2751 dnl $ac_dummy forces splitting on constant user-supplied paths.
2752 dnl POSIX.2 word splitting is done only on the output of word expansions,
2753 dnl not every word. This closes a longstanding sh security hole.
2754 ac_dummy="m4_if([$2], , $PATH, [$2])"
2755 for ac_dir in $ac_dummy; do
2756 IFS="$lt_save_ifs"
2757 test -z "$ac_dir" && ac_dir=.
2758 if test -f $ac_dir/$1; then
2759 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2760 if test -n "$file_magic_test_file"; then
2761 case $deplibs_check_method in
2762 "file_magic "*)
2763 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2764 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2765 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2766 $EGREP "$file_magic_regex" > /dev/null; then
2767 :
2768 else
2769 cat <<_LT_EOF 1>&2
2770
2771 *** Warning: the command libtool uses to detect shared libraries,
2772 *** $file_magic_cmd, produces output that libtool cannot recognize.
2773 *** The result is that libtool may fail to recognize shared libraries
2774 *** as such. This will affect the creation of libtool libraries that
2775 *** depend on shared libraries, but programs linked with such libtool
2776 *** libraries will work regardless of this problem. Nevertheless, you
2777 *** may want to report the problem to your system manager and/or to
2778 *** bug-libtool@gnu.org
2779
2780 _LT_EOF
2781 fi ;;
2782 esac
2783 fi
2784 break
2785 fi
2786 done
2787 IFS="$lt_save_ifs"
2788 MAGIC_CMD="$lt_save_MAGIC_CMD"
2789 ;;
2790 esac])
2791 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2792 if test -n "$MAGIC_CMD"; then
2793 AC_MSG_RESULT($MAGIC_CMD)
2794 else
2795 AC_MSG_RESULT(no)
2796 fi
2797 _LT_DECL([], [MAGIC_CMD], [0],
2798 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2799 ])# _LT_PATH_TOOL_PREFIX
2800
2801 # Old name:
2802 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2803 dnl aclocal-1.4 backwards compatibility:
2804 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2805
2806
2807 # _LT_PATH_MAGIC
2808 # --------------
2809 # find a file program which can recognize a shared library
2810 m4_defun([_LT_PATH_MAGIC],
2811 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2812 if test -z "$lt_cv_path_MAGIC_CMD"; then
2813 if test -n "$ac_tool_prefix"; then
2814 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2815 else
2816 MAGIC_CMD=:
2817 fi
2818 fi
2819 ])# _LT_PATH_MAGIC
2820
2821
2822 # LT_PATH_LD
2823 # ----------
2824 # find the pathname to the GNU or non-GNU linker
2825 AC_DEFUN([LT_PATH_LD],
2826 [AC_REQUIRE([AC_PROG_CC])dnl
2827 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2828 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2829 m4_require([_LT_DECL_SED])dnl
2830 m4_require([_LT_DECL_EGREP])dnl
2831
2832 AC_ARG_WITH([gnu-ld],
2833 [AS_HELP_STRING([--with-gnu-ld],
2834 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2835 [test "$withval" = no || with_gnu_ld=yes],
2836 [with_gnu_ld=no])dnl
2837
2838 ac_prog=ld
2839 if test "$GCC" = yes; then
2840 # Check if gcc -print-prog-name=ld gives a path.
2841 AC_MSG_CHECKING([for ld used by $CC])
2842 case $host in
2843 *-*-mingw*)
2844 # gcc leaves a trailing carriage return which upsets mingw
2845 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2846 *)
2847 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2848 esac
2849 case $ac_prog in
2850 # Accept absolute paths.
2851 [[\\/]]* | ?:[[\\/]]*)
2852 re_direlt='/[[^/]][[^/]]*/\.\./'
2853 # Canonicalize the pathname of ld
2854 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2855 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2856 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2857 done
2858 test -z "$LD" && LD="$ac_prog"
2859 ;;
2860 "")
2861 # If it fails, then pretend we aren't using GCC.
2862 ac_prog=ld
2863 ;;
2864 *)
2865 # If it is relative, then search for the first ld in PATH.
2866 with_gnu_ld=unknown
2867 ;;
2868 esac
2869 elif test "$with_gnu_ld" = yes; then
2870 AC_MSG_CHECKING([for GNU ld])
2871 else
2872 AC_MSG_CHECKING([for non-GNU ld])
2873 fi
2874 AC_CACHE_VAL(lt_cv_path_LD,
2875 [if test -z "$LD"; then
2876 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2877 for ac_dir in $PATH; do
2878 IFS="$lt_save_ifs"
2879 test -z "$ac_dir" && ac_dir=.
2880 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2881 lt_cv_path_LD="$ac_dir/$ac_prog"
2882 # Check to see if the program is GNU ld. I'd rather use --version,
2883 # but apparently some variants of GNU ld only accept -v.
2884 # Break only if it was the GNU/non-GNU ld that we prefer.
2885 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2886 *GNU* | *'with BFD'*)
2887 test "$with_gnu_ld" != no && break
2888 ;;
2889 *)
2890 test "$with_gnu_ld" != yes && break
2891 ;;
2892 esac
2893 fi
2894 done
2895 IFS="$lt_save_ifs"
2896 else
2897 lt_cv_path_LD="$LD" # Let the user override the test with a path.
2898 fi])
2899 LD="$lt_cv_path_LD"
2900 if test -n "$LD"; then
2901 AC_MSG_RESULT($LD)
2902 else
2903 AC_MSG_RESULT(no)
2904 fi
2905 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2906 _LT_PATH_LD_GNU
2907 AC_SUBST([LD])
2908
2909 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2910 ])# LT_PATH_LD
2911
2912 # Old names:
2913 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2914 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2915 dnl aclocal-1.4 backwards compatibility:
2916 dnl AC_DEFUN([AM_PROG_LD], [])
2917 dnl AC_DEFUN([AC_PROG_LD], [])
2918
2919
2920 # _LT_PATH_LD_GNU
2921 #- --------------
2922 m4_defun([_LT_PATH_LD_GNU],
2923 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2924 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
2925 case `$LD -v 2>&1 </dev/null` in
2926 *GNU* | *'with BFD'*)
2927 lt_cv_prog_gnu_ld=yes
2928 ;;
2929 *)
2930 lt_cv_prog_gnu_ld=no
2931 ;;
2932 esac])
2933 with_gnu_ld=$lt_cv_prog_gnu_ld
2934 ])# _LT_PATH_LD_GNU
2935
2936
2937 # _LT_CMD_RELOAD
2938 # --------------
2939 # find reload flag for linker
2940 # -- PORTME Some linkers may need a different reload flag.
2941 m4_defun([_LT_CMD_RELOAD],
2942 [AC_CACHE_CHECK([for $LD option to reload object files],
2943 lt_cv_ld_reload_flag,
2944 [lt_cv_ld_reload_flag='-r'])
2945 reload_flag=$lt_cv_ld_reload_flag
2946 case $reload_flag in
2947 "" | " "*) ;;
2948 *) reload_flag=" $reload_flag" ;;
2949 esac
2950 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2951 case $host_os in
2952 darwin*)
2953 if test "$GCC" = yes; then
2954 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2955 else
2956 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2957 fi
2958 ;;
2959 esac
2960 _LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2961 _LT_DECL([], [reload_cmds], [2])dnl
2962 ])# _LT_CMD_RELOAD
2963
2964
2965 # _LT_CHECK_MAGIC_METHOD
2966 # ----------------------
2967 # how to check for library dependencies
2968 # -- PORTME fill in with the dynamic library characteristics
2969 m4_defun([_LT_CHECK_MAGIC_METHOD],
2970 [m4_require([_LT_DECL_EGREP])
2971 m4_require([_LT_DECL_OBJDUMP])
2972 AC_CACHE_CHECK([how to recognize dependent libraries],
2973 lt_cv_deplibs_check_method,
2974 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2975 lt_cv_file_magic_test_file=
2976 lt_cv_deplibs_check_method='unknown'
2977 # Need to set the preceding variable on all platforms that support
2978 # interlibrary dependencies.
2979 # 'none' -- dependencies not supported.
2980 # `unknown' -- same as none, but documents that we really don't know.
2981 # 'pass_all' -- all dependencies passed with no checks.
2982 # 'test_compile' -- check by making test program.
2983 # 'file_magic [[regex]]' -- check by looking for files in library path
2984 # which responds to the $file_magic_cmd with a given extended regex.
2985 # If you have `file' or equivalent on your system and you're not sure
2986 # whether `pass_all' will *always* work, you probably want this one.
2987
2988 case $host_os in
2989 aix[[4-9]]*)
2990 lt_cv_deplibs_check_method=pass_all
2991 ;;
2992
2993 beos*)
2994 lt_cv_deplibs_check_method=pass_all
2995 ;;
2996
2997 bsdi[[45]]*)
2998 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2999 lt_cv_file_magic_cmd='/usr/bin/file -L'
3000 lt_cv_file_magic_test_file=/shlib/libc.so
3001 ;;
3002
3003 cygwin*)
3004 # func_win32_libid is a shell function defined in ltmain.sh
3005 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3006 lt_cv_file_magic_cmd='func_win32_libid'
3007 ;;
3008
3009 mingw* | pw32*)
3010 # Base MSYS/MinGW do not provide the 'file' command needed by
3011 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3012 # unless we find 'file', for example because we are cross-compiling.
3013 if ( file / ) >/dev/null 2>&1; then
3014 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3015 lt_cv_file_magic_cmd='func_win32_libid'
3016 else
3017 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3018 lt_cv_file_magic_cmd='$OBJDUMP -f'
3019 fi
3020 ;;
3021
3022 cegcc)
3023 # use the weaker test based on 'objdump'. See mingw*.
3024 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3025 lt_cv_file_magic_cmd='$OBJDUMP -f'
3026 ;;
3027
3028 darwin* | rhapsody*)
3029 lt_cv_deplibs_check_method=pass_all
3030 ;;
3031
3032 freebsd* | dragonfly*)
3033 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3034 case $host_cpu in
3035 i*86 )
3036 # Not sure whether the presence of OpenBSD here was a mistake.
3037 # Let's accept both of them until this is cleared up.
3038 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3039 lt_cv_file_magic_cmd=/usr/bin/file
3040 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3041 ;;
3042 esac
3043 else
3044 lt_cv_deplibs_check_method=pass_all
3045 fi
3046 ;;
3047
3048 gnu*)
3049 lt_cv_deplibs_check_method=pass_all
3050 ;;
3051
3052 hpux10.20* | hpux11*)
3053 lt_cv_file_magic_cmd=/usr/bin/file
3054 case $host_cpu in
3055 ia64*)
3056 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3057 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3058 ;;
3059 hppa*64*)
3060 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3061 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3062 ;;
3063 *)
3064 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3065 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3066 ;;
3067 esac
3068 ;;
3069
3070 interix[[3-9]]*)
3071 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3072 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3073 ;;
3074
3075 irix5* | irix6* | nonstopux*)
3076 case $LD in
3077 *-32|*"-32 ") libmagic=32-bit;;
3078 *-n32|*"-n32 ") libmagic=N32;;
3079 *-64|*"-64 ") libmagic=64-bit;;
3080 *) libmagic=never-match;;
3081 esac
3082 lt_cv_deplibs_check_method=pass_all
3083 ;;
3084
3085 # This must be Linux ELF.
3086 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3087 lt_cv_deplibs_check_method=pass_all
3088 ;;
3089
3090 netbsd* | netbsdelf*-gnu)
3091 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3092 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3093 else
3094 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3095 fi
3096 ;;
3097
3098 newos6*)
3099 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3100 lt_cv_file_magic_cmd=/usr/bin/file
3101 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3102 ;;
3103
3104 *nto* | *qnx*)
3105 lt_cv_deplibs_check_method=pass_all
3106 ;;
3107
3108 openbsd*)
3109 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3110 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3111 else
3112 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3113 fi
3114 ;;
3115
3116 osf3* | osf4* | osf5*)
3117 lt_cv_deplibs_check_method=pass_all
3118 ;;
3119
3120 rdos*)
3121 lt_cv_deplibs_check_method=pass_all
3122 ;;
3123
3124 solaris*)
3125 lt_cv_deplibs_check_method=pass_all
3126 ;;
3127
3128 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3129 lt_cv_deplibs_check_method=pass_all
3130 ;;
3131
3132 sysv4 | sysv4.3*)
3133 case $host_vendor in
3134 motorola)
3135 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3136 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3137 ;;
3138 ncr)
3139 lt_cv_deplibs_check_method=pass_all
3140 ;;
3141 sequent)
3142 lt_cv_file_magic_cmd='/bin/file'
3143 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3144 ;;
3145 sni)
3146 lt_cv_file_magic_cmd='/bin/file'
3147 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3148 lt_cv_file_magic_test_file=/lib/libc.so
3149 ;;
3150 siemens)
3151 lt_cv_deplibs_check_method=pass_all
3152 ;;
3153 pc)
3154 lt_cv_deplibs_check_method=pass_all
3155 ;;
3156 esac
3157 ;;
3158
3159 tpf*)
3160 lt_cv_deplibs_check_method=pass_all
3161 ;;
3162 esac
3163 ])
3164 file_magic_cmd=$lt_cv_file_magic_cmd
3165 deplibs_check_method=$lt_cv_deplibs_check_method
3166 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3167
3168 _LT_DECL([], [deplibs_check_method], [1],
3169 [Method to check whether dependent libraries are shared objects])
3170 _LT_DECL([], [file_magic_cmd], [1],
3171 [Command to use when deplibs_check_method == "file_magic"])
3172 ])# _LT_CHECK_MAGIC_METHOD
3173
3174
3175 # LT_PATH_NM
3176 # ----------
3177 # find the pathname to a BSD- or MS-compatible name lister
3178 AC_DEFUN([LT_PATH_NM],
3179 [AC_REQUIRE([AC_PROG_CC])dnl
3180 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3181 [if test -n "$NM"; then
3182 # Let the user override the test.
3183 lt_cv_path_NM="$NM"
3184 else
3185 lt_nm_to_check="${ac_tool_prefix}nm"
3186 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3187 lt_nm_to_check="$lt_nm_to_check nm"
3188 fi
3189 for lt_tmp_nm in $lt_nm_to_check; do
3190 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3191 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3192 IFS="$lt_save_ifs"
3193 test -z "$ac_dir" && ac_dir=.
3194 tmp_nm="$ac_dir/$lt_tmp_nm"
3195 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3196 # Check to see if the nm accepts a BSD-compat flag.
3197 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3198 # nm: unknown option "B" ignored
3199 # Tru64's nm complains that /dev/null is an invalid object file
3200 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3201 */dev/null* | *'Invalid file or object type'*)
3202 lt_cv_path_NM="$tmp_nm -B"
3203 break
3204 ;;
3205 *)
3206 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3207 */dev/null*)
3208 lt_cv_path_NM="$tmp_nm -p"
3209 break
3210 ;;
3211 *)
3212 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3213 continue # so that we can try to find one that supports BSD flags
3214 ;;
3215 esac
3216 ;;
3217 esac
3218 fi
3219 done
3220 IFS="$lt_save_ifs"
3221 done
3222 : ${lt_cv_path_NM=no}
3223 fi])
3224 if test "$lt_cv_path_NM" != "no"; then
3225 NM="$lt_cv_path_NM"
3226 else
3227 # Didn't find any BSD compatible name lister, look for dumpbin.
3228 AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3229 AC_SUBST([DUMPBIN])
3230 if test "$DUMPBIN" != ":"; then
3231 NM="$DUMPBIN"
3232 fi
3233 fi
3234 test -z "$NM" && NM=nm
3235 AC_SUBST([NM])
3236 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3237
3238 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3239 [lt_cv_nm_interface="BSD nm"
3240 echo "int some_variable = 0;" > conftest.$ac_ext
3241 (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3242 (eval "$ac_compile" 2>conftest.err)
3243 cat conftest.err >&AS_MESSAGE_LOG_FD
3244 (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3245 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3246 cat conftest.err >&AS_MESSAGE_LOG_FD
3247 (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3248 cat conftest.out >&AS_MESSAGE_LOG_FD
3249 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3250 lt_cv_nm_interface="MS dumpbin"
3251 fi
3252 rm -f conftest*])
3253 ])# LT_PATH_NM
3254
3255 # Old names:
3256 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3257 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3258 dnl aclocal-1.4 backwards compatibility:
3259 dnl AC_DEFUN([AM_PROG_NM], [])
3260 dnl AC_DEFUN([AC_PROG_NM], [])
3261
3262
3263 # LT_LIB_M
3264 # --------
3265 # check for math library
3266 AC_DEFUN([LT_LIB_M],
3267 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3268 LIBM=
3269 case $host in
3270 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3271 # These system don't have libm, or don't need it
3272 ;;
3273 *-ncr-sysv4.3*)
3274 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3275 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3276 ;;
3277 *)
3278 AC_CHECK_LIB(m, cos, LIBM="-lm")
3279 ;;
3280 esac
3281 AC_SUBST([LIBM])
3282 ])# LT_LIB_M
3283
3284 # Old name:
3285 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3286 dnl aclocal-1.4 backwards compatibility:
3287 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3288
3289
3290 # _LT_COMPILER_NO_RTTI([TAGNAME])
3291 # -------------------------------
3292 m4_defun([_LT_COMPILER_NO_RTTI],
3293 [m4_require([_LT_TAG_COMPILER])dnl
3294
3295 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3296
3297 if test "$GCC" = yes; then
3298 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3299
3300 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3301 lt_cv_prog_compiler_rtti_exceptions,
3302 [-fno-rtti -fno-exceptions], [],
3303 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3304 fi
3305 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3306 [Compiler flag to turn off builtin functions])
3307 ])# _LT_COMPILER_NO_RTTI
3308
3309
3310 # _LT_CMD_GLOBAL_SYMBOLS
3311 # ----------------------
3312 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3313 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3314 AC_REQUIRE([AC_PROG_CC])dnl
3315 AC_REQUIRE([LT_PATH_NM])dnl
3316 AC_REQUIRE([LT_PATH_LD])dnl
3317 m4_require([_LT_DECL_SED])dnl
3318 m4_require([_LT_DECL_EGREP])dnl
3319 m4_require([_LT_TAG_COMPILER])dnl
3320
3321 # Check for command to grab the raw symbol name followed by C symbol from nm.
3322 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3323 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3324 [
3325 # These are sane defaults that work on at least a few old systems.
3326 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3327
3328 # Character class describing NM global symbol codes.
3329 symcode='[[BCDEGRST]]'
3330
3331 # Regexp to match symbols that can be accessed directly from C.
3332 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3333
3334 # Define system-specific variables.
3335 case $host_os in
3336 aix*)
3337 symcode='[[BCDT]]'
3338 ;;
3339 cygwin* | mingw* | pw32* | cegcc*)
3340 symcode='[[ABCDGISTW]]'
3341 ;;
3342 hpux*)
3343 if test "$host_cpu" = ia64; then
3344 symcode='[[ABCDEGRST]]'
3345 fi
3346 ;;
3347 irix* | nonstopux*)
3348 symcode='[[BCDEGRST]]'
3349 ;;
3350 osf*)
3351 symcode='[[BCDEGQRST]]'
3352 ;;
3353 solaris*)
3354 symcode='[[BDRT]]'
3355 ;;
3356 sco3.2v5*)
3357 symcode='[[DT]]'
3358 ;;
3359 sysv4.2uw2*)
3360 symcode='[[DT]]'
3361 ;;
3362 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3363 symcode='[[ABDT]]'
3364 ;;
3365 sysv4)
3366 symcode='[[DFNSTU]]'
3367 ;;
3368 esac
3369
3370 # If we're using GNU nm, then use its standard symbol codes.
3371 case `$NM -V 2>&1` in
3372 *GNU* | *'with BFD'*)
3373 symcode='[[ABCDGIRSTW]]' ;;
3374 esac
3375
3376 # Transform an extracted symbol line into a proper C declaration.
3377 # Some systems (esp. on ia64) link data and code symbols differently,
3378 # so use this general approach.
3379 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3380
3381 # Transform an extracted symbol line into symbol name and symbol address
3382 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3383 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3384
3385 # Handle CRLF in mingw tool chain
3386 opt_cr=
3387 case $build_os in
3388 mingw*)
3389 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3390 ;;
3391 esac
3392
3393 # Try without a prefix underscore, then with it.
3394 for ac_symprfx in "" "_"; do
3395
3396 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3397 symxfrm="\\1 $ac_symprfx\\2 \\2"
3398
3399 # Write the raw and C identifiers.
3400 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3401 # Fake it for dumpbin and say T for any non-static function
3402 # and D for any global variable.
3403 # Also find C++ and __fastcall symbols from MSVC++,
3404 # which start with @ or ?.
3405 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3406 " {last_section=section; section=\$ 3};"\
3407 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3408 " \$ 0!~/External *\|/{next};"\
3409 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3410 " {if(hide[section]) next};"\
3411 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3412 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3413 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3414 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3415 " ' prfx=^$ac_symprfx]"
3416 else
3417 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3418 fi
3419
3420 # Check to see that the pipe works correctly.
3421 pipe_works=no
3422
3423 rm -f conftest*
3424 cat > conftest.$ac_ext <<_LT_EOF
3425 #ifdef __cplusplus
3426 extern "C" {
3427 #endif
3428 char nm_test_var;
3429 void nm_test_func(void);
3430 void nm_test_func(void){}
3431 #ifdef __cplusplus
3432 }
3433 #endif
3434 int main(){nm_test_var='a';nm_test_func();return(0);}
3435 _LT_EOF
3436
3437 if AC_TRY_EVAL(ac_compile); then
3438 # Now try to grab the symbols.
3439 nlist=conftest.nm
3440 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3441 # Try sorting and uniquifying the output.
3442 if sort "$nlist" | uniq > "$nlist"T; then
3443 mv -f "$nlist"T "$nlist"
3444 else
3445 rm -f "$nlist"T
3446 fi
3447
3448 # Make sure that we snagged all the symbols we need.
3449 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3450 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3451 cat <<_LT_EOF > conftest.$ac_ext
3452 #ifdef __cplusplus
3453 extern "C" {
3454 #endif
3455
3456 _LT_EOF
3457 # Now generate the symbol file.
3458 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3459
3460 cat <<_LT_EOF >> conftest.$ac_ext
3461
3462 /* The mapping between symbol names and symbols. */
3463 const struct {
3464 const char *name;
3465 void *address;
3466 }
3467 lt__PROGRAM__LTX_preloaded_symbols[[]] =
3468 {
3469 { "@PROGRAM@", (void *) 0 },
3470 _LT_EOF
3471 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3472 cat <<\_LT_EOF >> conftest.$ac_ext
3473 {0, (void *) 0}
3474 };
3475
3476 /* This works around a problem in FreeBSD linker */
3477 #ifdef FREEBSD_WORKAROUND
3478 static const void *lt_preloaded_setup() {
3479 return lt__PROGRAM__LTX_preloaded_symbols;
3480 }
3481 #endif
3482
3483 #ifdef __cplusplus
3484 }
3485 #endif
3486 _LT_EOF
3487 # Now try linking the two files.
3488 mv conftest.$ac_objext conftstm.$ac_objext
3489 lt_save_LIBS="$LIBS"
3490 lt_save_CFLAGS="$CFLAGS"
3491 LIBS="conftstm.$ac_objext"
3492 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3493 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3494 pipe_works=yes
3495 fi
3496 LIBS="$lt_save_LIBS"
3497 CFLAGS="$lt_save_CFLAGS"
3498 else
3499 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3500 fi
3501 else
3502 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3503 fi
3504 else
3505 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3506 fi
3507 else
3508 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3509 cat conftest.$ac_ext >&5
3510 fi
3511 rm -rf conftest* conftst*
3512
3513 # Do not use the global_symbol_pipe unless it works.
3514 if test "$pipe_works" = yes; then
3515 break
3516 else
3517 lt_cv_sys_global_symbol_pipe=
3518 fi
3519 done
3520 ])
3521 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3522 lt_cv_sys_global_symbol_to_cdecl=
3523 fi
3524 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3525 AC_MSG_RESULT(failed)
3526 else
3527 AC_MSG_RESULT(ok)
3528 fi
3529
3530 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3531 [Take the output of nm and produce a listing of raw symbols and C names])
3532 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3533 [Transform the output of nm in a proper C declaration])
3534 _LT_DECL([global_symbol_to_c_name_address],
3535 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3536 [Transform the output of nm in a C name address pair])
3537 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3538 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3539 [Transform the output of nm in a C name address pair when lib prefix is needed])
3540 ]) # _LT_CMD_GLOBAL_SYMBOLS
3541
3542
3543 # _LT_COMPILER_PIC([TAGNAME])
3544 # ---------------------------
3545 m4_defun([_LT_COMPILER_PIC],
3546 [m4_require([_LT_TAG_COMPILER])dnl
3547 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
3548 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3549 _LT_TAGVAR(lt_prog_compiler_static, $1)=
3550
3551 AC_MSG_CHECKING([for $compiler option to produce PIC])
3552 m4_if([$1], [CXX], [
3553 # C++ specific cases for pic, static, wl, etc.
3554 if test "$GXX" = yes; then
3555 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3556 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3557
3558 case $host_os in
3559 aix*)
3560 # All AIX code is PIC.
3561 if test "$host_cpu" = ia64; then
3562 # AIX 5 now supports IA64 processor
3563 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3564 fi
3565 ;;
3566
3567 amigaos*)
3568 case $host_cpu in
3569 powerpc)
3570 # see comment about AmigaOS4 .so support
3571 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3572 ;;
3573 m68k)
3574 # FIXME: we need at least 68020 code to build shared libraries, but
3575 # adding the `-m68020' flag to GCC prevents building anything better,
3576 # like `-m68040'.
3577 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3578 ;;
3579 esac
3580 ;;
3581
3582 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3583 # PIC is the default for these OSes.
3584 ;;
3585 mingw* | cygwin* | os2* | pw32* | cegcc*)
3586 # This hack is so that the source file can tell whether it is being
3587 # built for inclusion in a dll (and should export symbols for example).
3588 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3589 # (--disable-auto-import) libraries
3590 m4_if([$1], [GCJ], [],
3591 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3592 ;;
3593 darwin* | rhapsody*)
3594 # PIC is the default on this platform
3595 # Common symbols not allowed in MH_DYLIB files
3596 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3597 ;;
3598 *djgpp*)
3599 # DJGPP does not support shared libraries at all
3600 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3601 ;;
3602 interix[[3-9]]*)
3603 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3604 # Instead, we relocate shared libraries at runtime.
3605 ;;
3606 sysv4*MP*)
3607 if test -d /usr/nec; then
3608 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3609 fi
3610 ;;
3611 hpux*)
3612 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3613 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3614 # sets the default TLS model and affects inlining.
3615 case $host_cpu in
3616 hppa*64*)
3617 ;;
3618 *)
3619 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3620 ;;
3621 esac
3622 ;;
3623 *qnx* | *nto*)
3624 # QNX uses GNU C++, but need to define -shared option too, otherwise
3625 # it will coredump.
3626 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3627 ;;
3628 *)
3629 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3630 ;;
3631 esac
3632 else
3633 case $host_os in
3634 aix[[4-9]]*)
3635 # All AIX code is PIC.
3636 if test "$host_cpu" = ia64; then
3637 # AIX 5 now supports IA64 processor
3638 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3639 else
3640 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3641 fi
3642 ;;
3643 chorus*)
3644 case $cc_basename in
3645 cxch68*)
3646 # Green Hills C++ Compiler
3647 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
3648 ;;
3649 esac
3650 ;;
3651 dgux*)
3652 case $cc_basename in
3653 ec++*)
3654 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3655 ;;
3656 ghcx*)
3657 # Green Hills C++ Compiler
3658 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3659 ;;
3660 *)
3661 ;;
3662 esac
3663 ;;
3664 freebsd* | dragonfly*)
3665 # FreeBSD uses GNU C++
3666 ;;
3667 hpux9* | hpux10* | hpux11*)
3668 case $cc_basename in
3669 CC*)
3670 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3671 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3672 if test "$host_cpu" != ia64; then
3673 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3674 fi
3675 ;;
3676 aCC*)
3677 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3678 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3679 case $host_cpu in
3680 hppa*64*|ia64*)
3681 # +Z the default
3682 ;;
3683 *)
3684 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3685 ;;
3686 esac
3687 ;;
3688 *)
3689 ;;
3690 esac
3691 ;;
3692 interix*)
3693 # This is c89, which is MS Visual C++ (no shared libs)
3694 # Anyone wants to do a port?
3695 ;;
3696 irix5* | irix6* | nonstopux*)
3697 case $cc_basename in
3698 CC*)
3699 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3700 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3701 # CC pic flag -KPIC is the default.
3702 ;;
3703 *)
3704 ;;
3705 esac
3706 ;;
3707 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3708 case $cc_basename in
3709 KCC*)
3710 # KAI C++ Compiler
3711 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3712 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3713 ;;
3714 ecpc* )
3715 # old Intel C++ for x86_64 which still supported -KPIC.
3716 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3717 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3718 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3719 ;;
3720 icpc* )
3721 # Intel C++, used to be incompatible with GCC.
3722 # ICC 10 doesn't accept -KPIC any more.
3723 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3724 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3725 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3726 ;;
3727 pgCC* | pgcpp*)
3728 # Portland Group C++ compiler
3729 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3730 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3731 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3732 ;;
3733 cxx*)
3734 # Compaq C++
3735 # Make sure the PIC flag is empty. It appears that all Alpha
3736 # Linux and Compaq Tru64 Unix objects are PIC.
3737 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3738 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3739 ;;
3740 xlc* | xlC*)
3741 # IBM XL 8.0 on PPC
3742 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3743 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3744 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3745 ;;
3746 *)
3747 case `$CC -V 2>&1 | sed 5q` in
3748 *Sun\ C*)
3749 # Sun C++ 5.9
3750 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3751 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3752 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3753 ;;
3754 esac
3755 ;;
3756 esac
3757 ;;
3758 lynxos*)
3759 ;;
3760 m88k*)
3761 ;;
3762 mvs*)
3763 case $cc_basename in
3764 cxx*)
3765 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3766 ;;
3767 *)
3768 ;;
3769 esac
3770 ;;
3771 netbsd* | netbsdelf*-gnu)
3772 ;;
3773 *qnx* | *nto*)
3774 # QNX uses GNU C++, but need to define -shared option too, otherwise
3775 # it will coredump.
3776 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3777 ;;
3778 osf3* | osf4* | osf5*)
3779 case $cc_basename in
3780 KCC*)
3781 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3782 ;;
3783 RCC*)
3784 # Rational C++ 2.4.1
3785 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3786 ;;
3787 cxx*)
3788 # Digital/Compaq C++
3789 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3790 # Make sure the PIC flag is empty. It appears that all Alpha
3791 # Linux and Compaq Tru64 Unix objects are PIC.
3792 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3793 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3794 ;;
3795 *)
3796 ;;
3797 esac
3798 ;;
3799 psos*)
3800 ;;
3801 solaris*)
3802 case $cc_basename in
3803 CC*)
3804 # Sun C++ 4.2, 5.x and Centerline C++
3805 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3806 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3807 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3808 ;;
3809 gcx*)
3810 # Green Hills C++ Compiler
3811 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3812 ;;
3813 *)
3814 ;;
3815 esac
3816 ;;
3817 sunos4*)
3818 case $cc_basename in
3819 CC*)
3820 # Sun C++ 4.x
3821 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3822 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3823 ;;
3824 lcc*)
3825 # Lucid
3826 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3827 ;;
3828 *)
3829 ;;
3830 esac
3831 ;;
3832 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3833 case $cc_basename in
3834 CC*)
3835 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3836 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3837 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3838 ;;
3839 esac
3840 ;;
3841 tandem*)
3842 case $cc_basename in
3843 NCC*)
3844 # NonStop-UX NCC 3.20
3845 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3846 ;;
3847 *)
3848 ;;
3849 esac
3850 ;;
3851 vxworks*)
3852 ;;
3853 *)
3854 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3855 ;;
3856 esac
3857 fi
3858 ],
3859 [
3860 if test "$GCC" = yes; then
3861 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3862 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3863
3864 case $host_os in
3865 aix*)
3866 # All AIX code is PIC.
3867 if test "$host_cpu" = ia64; then
3868 # AIX 5 now supports IA64 processor
3869 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3870 fi
3871 ;;
3872
3873 amigaos*)
3874 case $host_cpu in
3875 powerpc)
3876 # see comment about AmigaOS4 .so support
3877 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3878 ;;
3879 m68k)
3880 # FIXME: we need at least 68020 code to build shared libraries, but
3881 # adding the `-m68020' flag to GCC prevents building anything better,
3882 # like `-m68040'.
3883 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3884 ;;
3885 esac
3886 ;;
3887
3888 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3889 # PIC is the default for these OSes.
3890 ;;
3891
3892 mingw* | cygwin* | pw32* | os2* | cegcc*)
3893 # This hack is so that the source file can tell whether it is being
3894 # built for inclusion in a dll (and should export symbols for example).
3895 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3896 # (--disable-auto-import) libraries
3897 m4_if([$1], [GCJ], [],
3898 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3899 ;;
3900
3901 darwin* | rhapsody*)
3902 # PIC is the default on this platform
3903 # Common symbols not allowed in MH_DYLIB files
3904 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3905 ;;
3906
3907 hpux*)
3908 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3909 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3910 # sets the default TLS model and affects inlining.
3911 case $host_cpu in
3912 hppa*64*)
3913 # +Z the default
3914 ;;
3915 *)
3916 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3917 ;;
3918 esac
3919 ;;
3920
3921 interix[[3-9]]*)
3922 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3923 # Instead, we relocate shared libraries at runtime.
3924 ;;
3925
3926 msdosdjgpp*)
3927 # Just because we use GCC doesn't mean we suddenly get shared libraries
3928 # on systems that don't support them.
3929 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3930 enable_shared=no
3931 ;;
3932
3933 *nto* | *qnx*)
3934 # QNX uses GNU C++, but need to define -shared option too, otherwise
3935 # it will coredump.
3936 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3937 ;;
3938
3939 sysv4*MP*)
3940 if test -d /usr/nec; then
3941 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3942 fi
3943 ;;
3944
3945 *)
3946 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3947 ;;
3948 esac
3949 else
3950 # PORTME Check for flag to pass linker flags through the system compiler.
3951 case $host_os in
3952 aix*)
3953 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3954 if test "$host_cpu" = ia64; then
3955 # AIX 5 now supports IA64 processor
3956 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3957 else
3958 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3959 fi
3960 ;;
3961
3962 mingw* | cygwin* | pw32* | os2* | cegcc*)
3963 # This hack is so that the source file can tell whether it is being
3964 # built for inclusion in a dll (and should export symbols for example).
3965 m4_if([$1], [GCJ], [],
3966 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3967 ;;
3968
3969 hpux9* | hpux10* | hpux11*)
3970 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3971 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3972 # not for PA HP-UX.
3973 case $host_cpu in
3974 hppa*64*|ia64*)
3975 # +Z the default
3976 ;;
3977 *)
3978 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3979 ;;
3980 esac
3981 # Is there a better lt_prog_compiler_static that works with the bundled CC?
3982 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3983 ;;
3984
3985 irix5* | irix6* | nonstopux*)
3986 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3987 # PIC (with -KPIC) is the default.
3988 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3989 ;;
3990
3991 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3992 case $cc_basename in
3993 # old Intel for x86_64 which still supported -KPIC.
3994 ecc*)
3995 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3996 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3997 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3998 ;;
3999 # icc used to be incompatible with GCC.
4000 # ICC 10 doesn't accept -KPIC any more.
4001 icc* | ifort*)
4002 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4004 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4005 ;;
4006 # Lahey Fortran 8.1.
4007 lf95*)
4008 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4009 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4010 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4011 ;;
4012 pgcc* | pgf77* | pgf90* | pgf95*)
4013 # Portland Group compilers (*not* the Pentium gcc compiler,
4014 # which looks to be a dead project)
4015 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4017 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4018 ;;
4019 ccc*)
4020 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4021 # All Alpha code is PIC.
4022 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4023 ;;
4024 xl*)
4025 # IBM XL C 8.0/Fortran 10.1 on PPC
4026 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4027 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4028 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4029 ;;
4030 *)
4031 case `$CC -V 2>&1 | sed 5q` in
4032 *Sun\ C*)
4033 # Sun C 5.9
4034 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4035 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4036 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4037 ;;
4038 *Sun\ F*)
4039 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4040 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4041 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4042 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4043 ;;
4044 esac
4045 ;;
4046 esac
4047 ;;
4048
4049 newsos6)
4050 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4051 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4052 ;;
4053
4054 *nto* | *qnx*)
4055 # QNX uses GNU C++, but need to define -shared option too, otherwise
4056 # it will coredump.
4057 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4058 ;;
4059
4060 osf3* | osf4* | osf5*)
4061 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4062 # All OSF/1 code is PIC.
4063 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4064 ;;
4065
4066 rdos*)
4067 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4068 ;;
4069
4070 solaris*)
4071 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4072 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4073 case $cc_basename in
4074 f77* | f90* | f95*)
4075 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4076 *)
4077 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4078 esac
4079 ;;
4080
4081 sunos4*)
4082 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4083 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4084 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4085 ;;
4086
4087 sysv4 | sysv4.2uw2* | sysv4.3*)
4088 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4089 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4090 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4091 ;;
4092
4093 sysv4*MP*)
4094 if test -d /usr/nec ;then
4095 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4096 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4097 fi
4098 ;;
4099
4100 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4101 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4102 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4103 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4104 ;;
4105
4106 unicos*)
4107 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4108 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4109 ;;
4110
4111 uts4*)
4112 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4113 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4114 ;;
4115
4116 *)
4117 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4118 ;;
4119 esac
4120 fi
4121 ])
4122 case $host_os in
4123 # For platforms which do not support PIC, -DPIC is meaningless:
4124 *djgpp*)
4125 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4126 ;;
4127 *)
4128 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4129 ;;
4130 esac
4131 AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4132 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4133 [How to pass a linker flag through the compiler])
4134
4135 #
4136 # Check to make sure the PIC flag actually works.
4137 #
4138 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4139 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4140 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4141 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4142 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4143 "" | " "*) ;;
4144 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4145 esac],
4146 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4147 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4148 fi
4149 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4150 [Additional compiler flags for building library objects])
4151
4152 #
4153 # Check to make sure the static flag actually works.
4154 #
4155 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4156 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4157 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4158 $lt_tmp_static_flag,
4159 [],
4160 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4161 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4162 [Compiler flag to prevent dynamic linking])
4163 ])# _LT_COMPILER_PIC
4164
4165
4166 # _LT_LINKER_SHLIBS([TAGNAME])
4167 # ----------------------------
4168 # See if the linker supports building shared libraries.
4169 m4_defun([_LT_LINKER_SHLIBS],
4170 [AC_REQUIRE([LT_PATH_LD])dnl
4171 AC_REQUIRE([LT_PATH_NM])dnl
4172 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4173 m4_require([_LT_DECL_EGREP])dnl
4174 m4_require([_LT_DECL_SED])dnl
4175 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4176 m4_require([_LT_TAG_COMPILER])dnl
4177 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4178 m4_if([$1], [CXX], [
4179 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4180 case $host_os in
4181 aix[[4-9]]*)
4182 # If we're using GNU nm, then we don't want the "-C" option.
4183 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4184 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4185 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4186 else
4187 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4188 fi
4189 ;;
4190 pw32*)
4191 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4192 ;;
4193 cygwin* | mingw* | cegcc*)
4194 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4195 ;;
4196 linux* | k*bsd*-gnu)
4197 _LT_TAGVAR(link_all_deplibs, $1)=no
4198 ;;
4199 *)
4200 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4201 ;;
4202 esac
4203 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4204 ], [
4205 runpath_var=
4206 _LT_TAGVAR(allow_undefined_flag, $1)=
4207 _LT_TAGVAR(always_export_symbols, $1)=no
4208 _LT_TAGVAR(archive_cmds, $1)=
4209 _LT_TAGVAR(archive_expsym_cmds, $1)=
4210 _LT_TAGVAR(compiler_needs_object, $1)=no
4211 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4212 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4213 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4214 _LT_TAGVAR(hardcode_automatic, $1)=no
4215 _LT_TAGVAR(hardcode_direct, $1)=no
4216 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4217 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4218 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4219 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4220 _LT_TAGVAR(hardcode_minus_L, $1)=no
4221 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4222 _LT_TAGVAR(inherit_rpath, $1)=no
4223 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4224 _LT_TAGVAR(module_cmds, $1)=
4225 _LT_TAGVAR(module_expsym_cmds, $1)=
4226 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4227 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4228 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4229 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4230 # include_expsyms should be a list of space-separated symbols to be *always*
4231 # included in the symbol list
4232 _LT_TAGVAR(include_expsyms, $1)=
4233 # exclude_expsyms can be an extended regexp of symbols to exclude
4234 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4235 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4236 # as well as any symbol that contains `d'.
4237 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4238 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4239 # platforms (ab)use it in PIC code, but their linkers get confused if
4240 # the symbol is explicitly referenced. Since portable code cannot
4241 # rely on this symbol name, it's probably fine to never include it in
4242 # preloaded symbol tables.
4243 # Exclude shared library initialization/finalization symbols.
4244 dnl Note also adjust exclude_expsyms for C++ above.
4245 extract_expsyms_cmds=
4246
4247 case $host_os in
4248 cygwin* | mingw* | pw32* | cegcc*)
4249 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4250 # When not using gcc, we currently assume that we are using
4251 # Microsoft Visual C++.
4252 if test "$GCC" != yes; then
4253 with_gnu_ld=no
4254 fi
4255 ;;
4256 interix*)
4257 # we just hope/assume this is gcc and not c89 (= MSVC++)
4258 with_gnu_ld=yes
4259 ;;
4260 openbsd*)
4261 with_gnu_ld=no
4262 ;;
4263 linux* | k*bsd*-gnu)
4264 _LT_TAGVAR(link_all_deplibs, $1)=no
4265 ;;
4266 esac
4267
4268 _LT_TAGVAR(ld_shlibs, $1)=yes
4269 if test "$with_gnu_ld" = yes; then
4270 # If archive_cmds runs LD, not CC, wlarc should be empty
4271 wlarc='${wl}'
4272
4273 # Set some defaults for GNU ld with shared library support. These
4274 # are reset later if shared libraries are not supported. Putting them
4275 # here allows them to be overridden if necessary.
4276 runpath_var=LD_RUN_PATH
4277 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4278 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4279 # ancient GNU ld didn't support --whole-archive et. al.
4280 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4281 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4282 else
4283 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4284 fi
4285 supports_anon_versioning=no
4286 case `$LD -v 2>&1` in
4287 *GNU\ gold*) supports_anon_versioning=yes ;;
4288 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4289 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4290 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4291 *\ 2.11.*) ;; # other 2.11 versions
4292 *) supports_anon_versioning=yes ;;
4293 esac
4294
4295 # See if GNU ld supports shared libraries.
4296 case $host_os in
4297 aix[[3-9]]*)
4298 # On AIX/PPC, the GNU linker is very broken
4299 if test "$host_cpu" != ia64; then
4300 _LT_TAGVAR(ld_shlibs, $1)=no
4301 cat <<_LT_EOF 1>&2
4302
4303 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
4304 *** to be unable to reliably create shared libraries on AIX.
4305 *** Therefore, libtool is disabling shared libraries support. If you
4306 *** really care for shared libraries, you may want to modify your PATH
4307 *** so that a non-GNU linker is found, and then restart.
4308
4309 _LT_EOF
4310 fi
4311 ;;
4312
4313 amigaos*)
4314 case $host_cpu in
4315 powerpc)
4316 # see comment about AmigaOS4 .so support
4317 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4318 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4319 ;;
4320 m68k)
4321 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4322 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4323 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4324 ;;
4325 esac
4326 ;;
4327
4328 beos*)
4329 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4330 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4331 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4332 # support --undefined. This deserves some investigation. FIXME
4333 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334 else
4335 _LT_TAGVAR(ld_shlibs, $1)=no
4336 fi
4337 ;;
4338
4339 cygwin* | mingw* | pw32* | cegcc*)
4340 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4341 # as there is no search path for DLLs.
4342 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4343 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4344 _LT_TAGVAR(always_export_symbols, $1)=no
4345 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4346 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
4347
4348 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4349 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4350 # If the export-symbols file already is a .def file (1st line
4351 # is EXPORTS), use it as is; otherwise, prepend...
4352 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4353 cp $export_symbols $output_objdir/$soname.def;
4354 else
4355 echo EXPORTS > $output_objdir/$soname.def;
4356 cat $export_symbols >> $output_objdir/$soname.def;
4357 fi~
4358 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4359 else
4360 _LT_TAGVAR(ld_shlibs, $1)=no
4361 fi
4362 ;;
4363
4364 interix[[3-9]]*)
4365 _LT_TAGVAR(hardcode_direct, $1)=no
4366 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4367 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4368 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4369 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4370 # Instead, shared libraries are loaded at an image base (0x10000000 by
4371 # default) and relocated if they conflict, which is a slow very memory
4372 # consuming and fragmenting process. To avoid this, we pick a random,
4373 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4374 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4375 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4376 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4377 ;;
4378
4379 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4380 tmp_diet=no
4381 if test "$host_os" = linux-dietlibc; then
4382 case $cc_basename in
4383 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
4384 esac
4385 fi
4386 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4387 && test "$tmp_diet" = no
4388 then
4389 tmp_addflag=
4390 tmp_sharedflag='-shared'
4391 case $cc_basename,$host_cpu in
4392 pgcc*) # Portland Group C compiler
4393 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4394 tmp_addflag=' $pic_flag'
4395 ;;
4396 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
4397 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4398 tmp_addflag=' $pic_flag -Mnomain' ;;
4399 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
4400 tmp_addflag=' -i_dynamic' ;;
4401 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
4402 tmp_addflag=' -i_dynamic -nofor_main' ;;
4403 ifc* | ifort*) # Intel Fortran compiler
4404 tmp_addflag=' -nofor_main' ;;
4405 lf95*) # Lahey Fortran 8.1
4406 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4407 tmp_sharedflag='--shared' ;;
4408 xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4409 tmp_sharedflag='-qmkshrobj'
4410 tmp_addflag= ;;
4411 esac
4412 case `$CC -V 2>&1 | sed 5q` in
4413 *Sun\ C*) # Sun C 5.9
4414 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4415 _LT_TAGVAR(compiler_needs_object, $1)=yes
4416 tmp_sharedflag='-G' ;;
4417 *Sun\ F*) # Sun Fortran 8.3
4418 tmp_sharedflag='-G' ;;
4419 esac
4420 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4421
4422 if test "x$supports_anon_versioning" = xyes; then
4423 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4424 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4425 echo "local: *; };" >> $output_objdir/$libname.ver~
4426 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4427 fi
4428
4429 case $cc_basename in
4430 xlf*)
4431 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4432 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4433 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4434 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4435 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4436 if test "x$supports_anon_versioning" = xyes; then
4437 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4438 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4439 echo "local: *; };" >> $output_objdir/$libname.ver~
4440 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4441 fi
4442 ;;
4443 esac
4444 else
4445 _LT_TAGVAR(ld_shlibs, $1)=no
4446 fi
4447 ;;
4448
4449 netbsd* | netbsdelf*-gnu)
4450 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452 wlarc=
4453 else
4454 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4455 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4456 fi
4457 ;;
4458
4459 solaris*)
4460 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4461 _LT_TAGVAR(ld_shlibs, $1)=no
4462 cat <<_LT_EOF 1>&2
4463
4464 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
4465 *** create shared libraries on Solaris systems. Therefore, libtool
4466 *** is disabling shared libraries support. We urge you to upgrade GNU
4467 *** binutils to release 2.9.1 or newer. Another option is to modify
4468 *** your PATH or compiler configuration so that the native linker is
4469 *** used, and then restart.
4470
4471 _LT_EOF
4472 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4473 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4474 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4475 else
4476 _LT_TAGVAR(ld_shlibs, $1)=no
4477 fi
4478 ;;
4479
4480 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4481 case `$LD -v 2>&1` in
4482 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4483 _LT_TAGVAR(ld_shlibs, $1)=no
4484 cat <<_LT_EOF 1>&2
4485
4486 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4487 *** reliably create shared libraries on SCO systems. Therefore, libtool
4488 *** is disabling shared libraries support. We urge you to upgrade GNU
4489 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
4490 *** your PATH or compiler configuration so that the native linker is
4491 *** used, and then restart.
4492
4493 _LT_EOF
4494 ;;
4495 *)
4496 # For security reasons, it is highly recommended that you always
4497 # use absolute paths for naming shared libraries, and exclude the
4498 # DT_RUNPATH tag from executables and libraries. But doing so
4499 # requires that you compile everything twice, which is a pain.
4500 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4501 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4502 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4503 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4504 else
4505 _LT_TAGVAR(ld_shlibs, $1)=no
4506 fi
4507 ;;
4508 esac
4509 ;;
4510
4511 sunos4*)
4512 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4513 wlarc=
4514 _LT_TAGVAR(hardcode_direct, $1)=yes
4515 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4516 ;;
4517
4518 *)
4519 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4520 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4522 else
4523 _LT_TAGVAR(ld_shlibs, $1)=no
4524 fi
4525 ;;
4526 esac
4527
4528 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4529 runpath_var=
4530 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4531 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4532 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4533 fi
4534 else
4535 # PORTME fill in a description of your system's linker (not GNU ld)
4536 case $host_os in
4537 aix3*)
4538 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4539 _LT_TAGVAR(always_export_symbols, $1)=yes
4540 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
4541 # Note: this linker hardcodes the directories in LIBPATH if there
4542 # are no directories specified by -L.
4543 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4544 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4545 # Neither direct hardcoding nor static linking is supported with a
4546 # broken collect2.
4547 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4548 fi
4549 ;;
4550
4551 aix[[4-9]]*)
4552 if test "$host_cpu" = ia64; then
4553 # On IA64, the linker does run time linking by default, so we don't
4554 # have to do anything special.
4555 aix_use_runtimelinking=no
4556 exp_sym_flag='-Bexport'
4557 no_entry_flag=""
4558 else
4559 # If we're using GNU nm, then we don't want the "-C" option.
4560 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4561 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4563 else
4564 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4565 fi
4566 aix_use_runtimelinking=no
4567
4568 # Test if we are trying to use run time linking or normal
4569 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4570 # need to do runtime linking.
4571 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4572 for ld_flag in $LDFLAGS; do
4573 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4574 aix_use_runtimelinking=yes
4575 break
4576 fi
4577 done
4578 ;;
4579 esac
4580
4581 exp_sym_flag='-bexport'
4582 no_entry_flag='-bnoentry'
4583 fi
4584
4585 # When large executables or shared objects are built, AIX ld can
4586 # have problems creating the table of contents. If linking a library
4587 # or program results in "error TOC overflow" add -mminimal-toc to
4588 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
4589 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590
4591 _LT_TAGVAR(archive_cmds, $1)=''
4592 _LT_TAGVAR(hardcode_direct, $1)=yes
4593 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4594 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4595 _LT_TAGVAR(link_all_deplibs, $1)=yes
4596 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4597
4598 if test "$GCC" = yes; then
4599 case $host_os in aix4.[[012]]|aix4.[[012]].*)
4600 # We only want to do this on AIX 4.2 and lower, the check
4601 # below for broken collect2 doesn't work under 4.3+
4602 collect2name=`${CC} -print-prog-name=collect2`
4603 if test -f "$collect2name" &&
4604 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4605 then
4606 # We have reworked collect2
4607 :
4608 else
4609 # We have old collect2
4610 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4611 # It fails to find uninstalled libraries when the uninstalled
4612 # path is not listed in the libpath. Setting hardcode_minus_L
4613 # to unsupported forces relinking
4614 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4615 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4616 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4617 fi
4618 ;;
4619 esac
4620 shared_flag='-shared'
4621 if test "$aix_use_runtimelinking" = yes; then
4622 shared_flag="$shared_flag "'${wl}-G'
4623 fi
4624 _LT_TAGVAR(link_all_deplibs, $1)=no
4625 else
4626 # not using gcc
4627 if test "$host_cpu" = ia64; then
4628 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4629 # chokes on -Wl,-G. The following line is correct:
4630 shared_flag='-G'
4631 else
4632 if test "$aix_use_runtimelinking" = yes; then
4633 shared_flag='${wl}-G'
4634 else
4635 shared_flag='${wl}-bM:SRE'
4636 fi
4637 fi
4638 fi
4639
4640 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4641 # It seems that -bexpall does not export symbols beginning with
4642 # underscore (_), so it is better to generate a list of symbols to export.
4643 _LT_TAGVAR(always_export_symbols, $1)=yes
4644 if test "$aix_use_runtimelinking" = yes; then
4645 # Warning - without using the other runtime loading flags (-brtl),
4646 # -berok will link without error, but may produce a broken library.
4647 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4648 # Determine the default libpath from the value encoded in an
4649 # empty executable.
4650 _LT_SYS_MODULE_PATH_AIX
4651 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4652 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4653 else
4654 if test "$host_cpu" = ia64; then
4655 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4656 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4657 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
4658 else
4659 # Determine the default libpath from the value encoded in an
4660 # empty executable.
4661 _LT_SYS_MODULE_PATH_AIX
4662 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4663 # Warning - without using the other run time loading flags,
4664 # -berok will link without error, but may produce a broken library.
4665 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4666 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4667 # Exported symbols can be pulled into shared objects from archives
4668 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4669 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4670 # This is similar to how AIX traditionally builds its shared libraries.
4671 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
4672 fi
4673 fi
4674 ;;
4675
4676 amigaos*)
4677 case $host_cpu in
4678 powerpc)
4679 # see comment about AmigaOS4 .so support
4680 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4681 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4682 ;;
4683 m68k)
4684 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4685 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4686 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4687 ;;
4688 esac
4689 ;;
4690
4691 bsdi[[45]]*)
4692 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4693 ;;
4694
4695 cygwin* | mingw* | pw32* | cegcc*)
4696 # When not using gcc, we currently assume that we are using
4697 # Microsoft Visual C++.
4698 # hardcode_libdir_flag_spec is actually meaningless, as there is
4699 # no search path for DLLs.
4700 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4701 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4702 # Tell ltmain to make .lib files, not .a files.
4703 libext=lib
4704 # Tell ltmain to make .dll files, not .so files.
4705 shrext_cmds=".dll"
4706 # FIXME: Setting linknames here is a bad hack.
4707 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4708 # The linker will automatically build a .lib file if we build a DLL.
4709 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4710 # FIXME: Should let the user specify the lib program.
4711 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4712 _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4713 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4714 ;;
4715
4716 darwin* | rhapsody*)
4717 _LT_DARWIN_LINKER_FEATURES($1)
4718 ;;
4719
4720 dgux*)
4721 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4722 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4723 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4724 ;;
4725
4726 freebsd1*)
4727 _LT_TAGVAR(ld_shlibs, $1)=no
4728 ;;
4729
4730 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4731 # support. Future versions do this automatically, but an explicit c++rt0.o
4732 # does not break anything, and helps significantly (at the cost of a little
4733 # extra space).
4734 freebsd2.2*)
4735 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4736 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4737 _LT_TAGVAR(hardcode_direct, $1)=yes
4738 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4739 ;;
4740
4741 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4742 freebsd2*)
4743 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4744 _LT_TAGVAR(hardcode_direct, $1)=yes
4745 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4746 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4747 ;;
4748
4749 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4750 freebsd* | dragonfly*)
4751 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4752 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4753 _LT_TAGVAR(hardcode_direct, $1)=yes
4754 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4755 ;;
4756
4757 hpux9*)
4758 if test "$GCC" = yes; then
4759 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4760 else
4761 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4762 fi
4763 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4764 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4765 _LT_TAGVAR(hardcode_direct, $1)=yes
4766
4767 # hardcode_minus_L: Not really in the search PATH,
4768 # but as the default location of the library.
4769 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4770 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4771 ;;
4772
4773 hpux10*)
4774 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4775 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4776 else
4777 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4778 fi
4779 if test "$with_gnu_ld" = no; then
4780 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4781 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4782 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4783 _LT_TAGVAR(hardcode_direct, $1)=yes
4784 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4785 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4786 # hardcode_minus_L: Not really in the search PATH,
4787 # but as the default location of the library.
4788 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4789 fi
4790 ;;
4791
4792 hpux11*)
4793 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4794 case $host_cpu in
4795 hppa*64*)
4796 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4797 ;;
4798 ia64*)
4799 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4800 ;;
4801 *)
4802 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4803 ;;
4804 esac
4805 else
4806 case $host_cpu in
4807 hppa*64*)
4808 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4809 ;;
4810 ia64*)
4811 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4812 ;;
4813 *)
4814 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4815 ;;
4816 esac
4817 fi
4818 if test "$with_gnu_ld" = no; then
4819 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4820 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4821
4822 case $host_cpu in
4823 hppa*64*|ia64*)
4824 _LT_TAGVAR(hardcode_direct, $1)=no
4825 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4826 ;;
4827 *)
4828 _LT_TAGVAR(hardcode_direct, $1)=yes
4829 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4830 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4831
4832 # hardcode_minus_L: Not really in the search PATH,
4833 # but as the default location of the library.
4834 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4835 ;;
4836 esac
4837 fi
4838 ;;
4839
4840 irix5* | irix6* | nonstopux*)
4841 if test "$GCC" = yes; then
4842 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4843 # Try to use the -exported_symbol ld option, if it does not
4844 # work, assume that -exports_file does not work either and
4845 # implicitly export all symbols.
4846 save_LDFLAGS="$LDFLAGS"
4847 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4848 AC_LINK_IFELSE(int foo(void) {},
4849 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4850 )
4851 LDFLAGS="$save_LDFLAGS"
4852 else
4853 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4854 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4855 fi
4856 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4857 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4858 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4859 _LT_TAGVAR(inherit_rpath, $1)=yes
4860 _LT_TAGVAR(link_all_deplibs, $1)=yes
4861 ;;
4862
4863 netbsd* | netbsdelf*-gnu)
4864 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4865 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
4866 else
4867 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
4868 fi
4869 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4870 _LT_TAGVAR(hardcode_direct, $1)=yes
4871 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4872 ;;
4873
4874 newsos6)
4875 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4876 _LT_TAGVAR(hardcode_direct, $1)=yes
4877 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4878 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4879 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4880 ;;
4881
4882 *nto* | *qnx*)
4883 ;;
4884
4885 openbsd*)
4886 if test -f /usr/libexec/ld.so; then
4887 _LT_TAGVAR(hardcode_direct, $1)=yes
4888 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4889 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4890 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4891 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4892 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4893 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4894 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4895 else
4896 case $host_os in
4897 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4898 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4899 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4900 ;;
4901 *)
4902 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4903 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4904 ;;
4905 esac
4906 fi
4907 else
4908 _LT_TAGVAR(ld_shlibs, $1)=no
4909 fi
4910 ;;
4911
4912 os2*)
4913 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4914 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4915 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4916 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
4917 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4918 ;;
4919
4920 osf3*)
4921 if test "$GCC" = yes; then
4922 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4923 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4924 else
4925 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4926 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4927 fi
4928 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4929 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4930 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4931 ;;
4932
4933 osf4* | osf5*) # as osf3* with the addition of -msym flag
4934 if test "$GCC" = yes; then
4935 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4936 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4937 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4938 else
4939 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4940 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4941 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
4942 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4943
4944 # Both c and cxx compiler support -rpath directly
4945 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4946 fi
4947 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4948 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4949 ;;
4950
4951 solaris*)
4952 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4953 if test "$GCC" = yes; then
4954 wlarc='${wl}'
4955 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4956 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4957 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4958 else
4959 case `$CC -V 2>&1` in
4960 *"Compilers 5.0"*)
4961 wlarc=''
4962 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4963 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4964 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4965 ;;
4966 *)
4967 wlarc='${wl}'
4968 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4969 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4970 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4971 ;;
4972 esac
4973 fi
4974 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4975 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4976 case $host_os in
4977 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4978 *)
4979 # The compiler driver will combine and reorder linker options,
4980 # but understands `-z linker_flag'. GCC discards it without `$wl',
4981 # but is careful enough not to reorder.
4982 # Supported since Solaris 2.6 (maybe 2.5.1?)
4983 if test "$GCC" = yes; then
4984 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4985 else
4986 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4987 fi
4988 ;;
4989 esac
4990 _LT_TAGVAR(link_all_deplibs, $1)=yes
4991 ;;
4992
4993 sunos4*)
4994 if test "x$host_vendor" = xsequent; then
4995 # Use $CC to link under sequent, because it throws in some extra .o
4996 # files that make .init and .fini sections work.
4997 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4998 else
4999 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5000 fi
5001 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5002 _LT_TAGVAR(hardcode_direct, $1)=yes
5003 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5004 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5005 ;;
5006
5007 sysv4)
5008 case $host_vendor in
5009 sni)
5010 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5011 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5012 ;;
5013 siemens)
5014 ## LD is ld it makes a PLAMLIB
5015 ## CC just makes a GrossModule.
5016 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5017 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5018 _LT_TAGVAR(hardcode_direct, $1)=no
5019 ;;
5020 motorola)
5021 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5022 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5023 ;;
5024 esac
5025 runpath_var='LD_RUN_PATH'
5026 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5027 ;;
5028
5029 sysv4.3*)
5030 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5031 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5032 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5033 ;;
5034
5035 sysv4*MP*)
5036 if test -d /usr/nec; then
5037 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5038 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5039 runpath_var=LD_RUN_PATH
5040 hardcode_runpath_var=yes
5041 _LT_TAGVAR(ld_shlibs, $1)=yes
5042 fi
5043 ;;
5044
5045 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5046 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5047 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5048 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5049 runpath_var='LD_RUN_PATH'
5050
5051 if test "$GCC" = yes; then
5052 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5053 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5054 else
5055 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5056 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5057 fi
5058 ;;
5059
5060 sysv5* | sco3.2v5* | sco5v6*)
5061 # Note: We can NOT use -z defs as we might desire, because we do not
5062 # link with -lc, and that would cause any symbols used from libc to
5063 # always be unresolved, which means just about no library would
5064 # ever link correctly. If we're not using GNU ld we use -z text
5065 # though, which does catch some bad symbols but isn't as heavy-handed
5066 # as -z defs.
5067 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5068 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5069 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5070 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5071 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5072 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5073 _LT_TAGVAR(link_all_deplibs, $1)=yes
5074 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5075 runpath_var='LD_RUN_PATH'
5076
5077 if test "$GCC" = yes; then
5078 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5079 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5080 else
5081 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5082 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5083 fi
5084 ;;
5085
5086 uts4*)
5087 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5088 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5089 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5090 ;;
5091
5092 *)
5093 _LT_TAGVAR(ld_shlibs, $1)=no
5094 ;;
5095 esac
5096
5097 if test x$host_vendor = xsni; then
5098 case $host in
5099 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5100 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5101 ;;
5102 esac
5103 fi
5104 fi
5105 ])
5106 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5107 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5108
5109 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5110
5111 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5112 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5113 _LT_DECL([], [extract_expsyms_cmds], [2],
5114 [The commands to extract the exported symbol list from a shared archive])
5115
5116 #
5117 # Do we need to explicitly link libc?
5118 #
5119 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5120 x|xyes)
5121 # Assume -lc should be added
5122 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5123
5124 if test "$enable_shared" = yes && test "$GCC" = yes; then
5125 case $_LT_TAGVAR(archive_cmds, $1) in
5126 *'~'*)
5127 # FIXME: we may have to deal with multi-command sequences.
5128 ;;
5129 '$CC '*)
5130 # Test whether the compiler implicitly links with -lc since on some
5131 # systems, -lgcc has to come before -lc. If gcc already passes -lc
5132 # to ld, don't add -lc before -lgcc.
5133 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5134 $RM conftest*
5135 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5136
5137 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5138 soname=conftest
5139 lib=conftest
5140 libobjs=conftest.$ac_objext
5141 deplibs=
5142 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5143 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5144 compiler_flags=-v
5145 linker_flags=-v
5146 verstring=
5147 output_objdir=.
5148 libname=conftest
5149 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5150 _LT_TAGVAR(allow_undefined_flag, $1)=
5151 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5152 then
5153 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5154 else
5155 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5156 fi
5157 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5158 else
5159 cat conftest.err 1>&5
5160 fi
5161 $RM conftest*
5162 AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5163 ;;
5164 esac
5165 fi
5166 ;;
5167 esac
5168
5169 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5170 [Whether or not to add -lc for building shared libraries])
5171 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5172 [enable_shared_with_static_runtimes], [0],
5173 [Whether or not to disallow shared libs when runtime libs are static])
5174 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5175 [Compiler flag to allow reflexive dlopens])
5176 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
5177 [Compiler flag to generate shared objects directly from archives])
5178 _LT_TAGDECL([], [compiler_needs_object], [1],
5179 [Whether the compiler copes with passing no objects directly])
5180 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5181 [Create an old-style archive from a shared archive])
5182 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5183 [Create a temporary old-style archive to link instead of a shared archive])
5184 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5185 _LT_TAGDECL([], [archive_expsym_cmds], [2])
5186 _LT_TAGDECL([], [module_cmds], [2],
5187 [Commands used to build a loadable module if different from building
5188 a shared archive.])
5189 _LT_TAGDECL([], [module_expsym_cmds], [2])
5190 _LT_TAGDECL([], [with_gnu_ld], [1],
5191 [Whether we are building with GNU ld or not])
5192 _LT_TAGDECL([], [allow_undefined_flag], [1],
5193 [Flag that allows shared libraries with undefined symbols to be built])
5194 _LT_TAGDECL([], [no_undefined_flag], [1],
5195 [Flag that enforces no undefined symbols])
5196 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5197 [Flag to hardcode $libdir into a binary during linking.
5198 This must work even if $libdir does not exist])
5199 _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5200 [[If ld is used when linking, flag to hardcode $libdir into a binary
5201 during linking. This must work even if $libdir does not exist]])
5202 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
5203 [Whether we need a single "-rpath" flag with a separated argument])
5204 _LT_TAGDECL([], [hardcode_direct], [0],
5205 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5206 DIR into the resulting binary])
5207 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
5208 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5209 DIR into the resulting binary and the resulting library dependency is
5210 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5211 library is relocated])
5212 _LT_TAGDECL([], [hardcode_minus_L], [0],
5213 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5214 into the resulting binary])
5215 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5216 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5217 into the resulting binary])
5218 _LT_TAGDECL([], [hardcode_automatic], [0],
5219 [Set to "yes" if building a shared library automatically hardcodes DIR
5220 into the library and all subsequent libraries and executables linked
5221 against it])
5222 _LT_TAGDECL([], [inherit_rpath], [0],
5223 [Set to yes if linker adds runtime paths of dependent libraries
5224 to runtime path list])
5225 _LT_TAGDECL([], [link_all_deplibs], [0],
5226 [Whether libtool must link a program against all its dependency libraries])
5227 _LT_TAGDECL([], [fix_srcfile_path], [1],
5228 [Fix the shell variable $srcfile for the compiler])
5229 _LT_TAGDECL([], [always_export_symbols], [0],
5230 [Set to "yes" if exported symbols are required])
5231 _LT_TAGDECL([], [export_symbols_cmds], [2],
5232 [The commands to list exported symbols])
5233 _LT_TAGDECL([], [exclude_expsyms], [1],
5234 [Symbols that should not be listed in the preloaded symbols])
5235 _LT_TAGDECL([], [include_expsyms], [1],
5236 [Symbols that must always be exported])
5237 _LT_TAGDECL([], [prelink_cmds], [2],
5238 [Commands necessary for linking programs (against libraries) with templates])
5239 _LT_TAGDECL([], [file_list_spec], [1],
5240 [Specify filename containing input files])
5241 dnl FIXME: Not yet implemented
5242 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5243 dnl [Compiler flag to generate thread safe objects])
5244 ])# _LT_LINKER_SHLIBS
5245
5246
5247 # _LT_LANG_C_CONFIG([TAG])
5248 # ------------------------
5249 # Ensure that the configuration variables for a C compiler are suitably
5250 # defined. These variables are subsequently used by _LT_CONFIG to write
5251 # the compiler configuration to `libtool'.
5252 m4_defun([_LT_LANG_C_CONFIG],
5253 [m4_require([_LT_DECL_EGREP])dnl
5254 lt_save_CC="$CC"
5255 AC_LANG_PUSH(C)
5256
5257 # Source file extension for C test sources.
5258 ac_ext=c
5259
5260 # Object file extension for compiled C test sources.
5261 objext=o
5262 _LT_TAGVAR(objext, $1)=$objext
5263
5264 # Code to be used in simple compile tests
5265 lt_simple_compile_test_code="int some_variable = 0;"
5266
5267 # Code to be used in simple link tests
5268 lt_simple_link_test_code='int main(){return(0);}'
5269
5270 _LT_TAG_COMPILER
5271 # Save the default compiler, since it gets overwritten when the other
5272 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5273 compiler_DEFAULT=$CC
5274
5275 # save warnings/boilerplate of simple test code
5276 _LT_COMPILER_BOILERPLATE
5277 _LT_LINKER_BOILERPLATE
5278
5279 ## CAVEAT EMPTOR:
5280 ## There is no encapsulation within the following macros, do not change
5281 ## the running order or otherwise move them around unless you know exactly
5282 ## what you are doing...
5283 if test -n "$compiler"; then
5284 _LT_COMPILER_NO_RTTI($1)
5285 _LT_COMPILER_PIC($1)
5286 _LT_COMPILER_C_O($1)
5287 _LT_COMPILER_FILE_LOCKS($1)
5288 _LT_LINKER_SHLIBS($1)
5289 _LT_SYS_DYNAMIC_LINKER($1)
5290 _LT_LINKER_HARDCODE_LIBPATH($1)
5291 LT_SYS_DLOPEN_SELF
5292 _LT_CMD_STRIPLIB
5293
5294 # Report which library types will actually be built
5295 AC_MSG_CHECKING([if libtool supports shared libraries])
5296 AC_MSG_RESULT([$can_build_shared])
5297
5298 AC_MSG_CHECKING([whether to build shared libraries])
5299 test "$can_build_shared" = "no" && enable_shared=no
5300
5301 # On AIX, shared libraries and static libraries use the same namespace, and
5302 # are all built from PIC.
5303 case $host_os in
5304 aix3*)
5305 test "$enable_shared" = yes && enable_static=no
5306 if test -n "$RANLIB"; then
5307 archive_cmds="$archive_cmds~\$RANLIB \$lib"
5308 postinstall_cmds='$RANLIB $lib'
5309 fi
5310 ;;
5311
5312 aix[[4-9]]*)
5313 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5314 test "$enable_shared" = yes && enable_static=no
5315 fi
5316 ;;
5317 esac
5318 AC_MSG_RESULT([$enable_shared])
5319
5320 AC_MSG_CHECKING([whether to build static libraries])
5321 # Make sure either enable_shared or enable_static is yes.
5322 test "$enable_shared" = yes || enable_static=yes
5323 AC_MSG_RESULT([$enable_static])
5324
5325 _LT_CONFIG($1)
5326 fi
5327 AC_LANG_POP
5328 CC="$lt_save_CC"
5329 ])# _LT_LANG_C_CONFIG
5330
5331
5332 # _LT_PROG_CXX
5333 # ------------
5334 # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5335 # compiler, we have our own version here.
5336 m4_defun([_LT_PROG_CXX],
5337 [
5338 pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5339 AC_PROG_CXX
5340 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5341 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5342 (test "X$CXX" != "Xg++"))) ; then
5343 AC_PROG_CXXCPP
5344 else
5345 _lt_caught_CXX_error=yes
5346 fi
5347 popdef([AC_MSG_ERROR])
5348 ])# _LT_PROG_CXX
5349
5350 dnl aclocal-1.4 backwards compatibility:
5351 dnl AC_DEFUN([_LT_PROG_CXX], [])
5352
5353
5354 # _LT_LANG_CXX_CONFIG([TAG])
5355 # --------------------------
5356 # Ensure that the configuration variables for a C++ compiler are suitably
5357 # defined. These variables are subsequently used by _LT_CONFIG to write
5358 # the compiler configuration to `libtool'.
5359 m4_defun([_LT_LANG_CXX_CONFIG],
5360 [AC_REQUIRE([_LT_PROG_CXX])dnl
5361 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5362 m4_require([_LT_DECL_EGREP])dnl
5363
5364 AC_LANG_PUSH(C++)
5365 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5366 _LT_TAGVAR(allow_undefined_flag, $1)=
5367 _LT_TAGVAR(always_export_symbols, $1)=no
5368 _LT_TAGVAR(archive_expsym_cmds, $1)=
5369 _LT_TAGVAR(compiler_needs_object, $1)=no
5370 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5371 _LT_TAGVAR(hardcode_direct, $1)=no
5372 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5373 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5374 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5375 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5376 _LT_TAGVAR(hardcode_minus_L, $1)=no
5377 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5378 _LT_TAGVAR(hardcode_automatic, $1)=no
5379 _LT_TAGVAR(inherit_rpath, $1)=no
5380 _LT_TAGVAR(module_cmds, $1)=
5381 _LT_TAGVAR(module_expsym_cmds, $1)=
5382 _LT_TAGVAR(link_all_deplibs, $1)=unknown
5383 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5384 _LT_TAGVAR(no_undefined_flag, $1)=
5385 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5386 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5387
5388 # Source file extension for C++ test sources.
5389 ac_ext=cpp
5390
5391 # Object file extension for compiled C++ test sources.
5392 objext=o
5393 _LT_TAGVAR(objext, $1)=$objext
5394
5395 # No sense in running all these tests if we already determined that
5396 # the CXX compiler isn't working. Some variables (like enable_shared)
5397 # are currently assumed to apply to all compilers on this platform,
5398 # and will be corrupted by setting them based on a non-working compiler.
5399 if test "$_lt_caught_CXX_error" != yes; then
5400 # Code to be used in simple compile tests
5401 lt_simple_compile_test_code="int some_variable = 0;"
5402
5403 # Code to be used in simple link tests
5404 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5405
5406 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5407 _LT_TAG_COMPILER
5408
5409 # save warnings/boilerplate of simple test code
5410 _LT_COMPILER_BOILERPLATE
5411 _LT_LINKER_BOILERPLATE
5412
5413 # Allow CC to be a program name with arguments.
5414 lt_save_CC=$CC
5415 lt_save_LD=$LD
5416 lt_save_GCC=$GCC
5417 GCC=$GXX
5418 lt_save_with_gnu_ld=$with_gnu_ld
5419 lt_save_path_LD=$lt_cv_path_LD
5420 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5421 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5422 else
5423 $as_unset lt_cv_prog_gnu_ld
5424 fi
5425 if test -n "${lt_cv_path_LDCXX+set}"; then
5426 lt_cv_path_LD=$lt_cv_path_LDCXX
5427 else
5428 $as_unset lt_cv_path_LD
5429 fi
5430 test -z "${LDCXX+set}" || LD=$LDCXX
5431 CC=${CXX-"c++"}
5432 compiler=$CC
5433 _LT_TAGVAR(compiler, $1)=$CC
5434 _LT_CC_BASENAME([$compiler])
5435
5436 if test -n "$compiler"; then
5437 # We don't want -fno-exception when compiling C++ code, so set the
5438 # no_builtin_flag separately
5439 if test "$GXX" = yes; then
5440 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5441 else
5442 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5443 fi
5444
5445 if test "$GXX" = yes; then
5446 # Set up default GNU C++ configuration
5447
5448 LT_PATH_LD
5449
5450 # Check if GNU C++ uses GNU ld as the underlying linker, since the
5451 # archiving commands below assume that GNU ld is being used.
5452 if test "$with_gnu_ld" = yes; then
5453 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5454 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5455
5456 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5457 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5458
5459 # If archive_cmds runs LD, not CC, wlarc should be empty
5460 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5461 # investigate it a little bit more. (MM)
5462 wlarc='${wl}'
5463
5464 # ancient GNU ld didn't support --whole-archive et. al.
5465 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5466 $GREP 'no-whole-archive' > /dev/null; then
5467 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5468 else
5469 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5470 fi
5471 else
5472 with_gnu_ld=no
5473 wlarc=
5474
5475 # A generic and very simple default shared library creation
5476 # command for GNU C++ for the case where it uses the native
5477 # linker, instead of GNU ld. If possible, this setting should
5478 # overridden to take advantage of the native linker features on
5479 # the platform it is being used on.
5480 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5481 fi
5482
5483 # Commands to make compiler produce verbose output that lists
5484 # what "hidden" libraries, object files and flags are used when
5485 # linking a shared library.
5486 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5487
5488 else
5489 GXX=no
5490 with_gnu_ld=no
5491 wlarc=
5492 fi
5493
5494 # PORTME: fill in a description of your system's C++ link characteristics
5495 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5496 _LT_TAGVAR(ld_shlibs, $1)=yes
5497 case $host_os in
5498 aix3*)
5499 # FIXME: insert proper C++ library support
5500 _LT_TAGVAR(ld_shlibs, $1)=no
5501 ;;
5502 aix[[4-9]]*)
5503 if test "$host_cpu" = ia64; then
5504 # On IA64, the linker does run time linking by default, so we don't
5505 # have to do anything special.
5506 aix_use_runtimelinking=no
5507 exp_sym_flag='-Bexport'
5508 no_entry_flag=""
5509 else
5510 aix_use_runtimelinking=no
5511
5512 # Test if we are trying to use run time linking or normal
5513 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5514 # need to do runtime linking.
5515 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5516 for ld_flag in $LDFLAGS; do
5517 case $ld_flag in
5518 *-brtl*)
5519 aix_use_runtimelinking=yes
5520 break
5521 ;;
5522 esac
5523 done
5524 ;;
5525 esac
5526
5527 exp_sym_flag='-bexport'
5528 no_entry_flag='-bnoentry'
5529 fi
5530
5531 # When large executables or shared objects are built, AIX ld can
5532 # have problems creating the table of contents. If linking a library
5533 # or program results in "error TOC overflow" add -mminimal-toc to
5534 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5535 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5536
5537 _LT_TAGVAR(archive_cmds, $1)=''
5538 _LT_TAGVAR(hardcode_direct, $1)=yes
5539 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5540 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5541 _LT_TAGVAR(link_all_deplibs, $1)=yes
5542 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5543
5544 if test "$GXX" = yes; then
5545 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5546 # We only want to do this on AIX 4.2 and lower, the check
5547 # below for broken collect2 doesn't work under 4.3+
5548 collect2name=`${CC} -print-prog-name=collect2`
5549 if test -f "$collect2name" &&
5550 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5551 then
5552 # We have reworked collect2
5553 :
5554 else
5555 # We have old collect2
5556 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5557 # It fails to find uninstalled libraries when the uninstalled
5558 # path is not listed in the libpath. Setting hardcode_minus_L
5559 # to unsupported forces relinking
5560 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5561 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5562 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5563 fi
5564 esac
5565 shared_flag='-shared'
5566 if test "$aix_use_runtimelinking" = yes; then
5567 shared_flag="$shared_flag "'${wl}-G'
5568 fi
5569 else
5570 # not using gcc
5571 if test "$host_cpu" = ia64; then
5572 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5573 # chokes on -Wl,-G. The following line is correct:
5574 shared_flag='-G'
5575 else
5576 if test "$aix_use_runtimelinking" = yes; then
5577 shared_flag='${wl}-G'
5578 else
5579 shared_flag='${wl}-bM:SRE'
5580 fi
5581 fi
5582 fi
5583
5584 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5585 # It seems that -bexpall does not export symbols beginning with
5586 # underscore (_), so it is better to generate a list of symbols to
5587 # export.
5588 _LT_TAGVAR(always_export_symbols, $1)=yes
5589 if test "$aix_use_runtimelinking" = yes; then
5590 # Warning - without using the other runtime loading flags (-brtl),
5591 # -berok will link without error, but may produce a broken library.
5592 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5593 # Determine the default libpath from the value encoded in an empty
5594 # executable.
5595 _LT_SYS_MODULE_PATH_AIX
5596 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5597
5598 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5599 else
5600 if test "$host_cpu" = ia64; then
5601 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5602 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5603 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5604 else
5605 # Determine the default libpath from the value encoded in an
5606 # empty executable.
5607 _LT_SYS_MODULE_PATH_AIX
5608 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5609 # Warning - without using the other run time loading flags,
5610 # -berok will link without error, but may produce a broken library.
5611 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5612 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5613 # Exported symbols can be pulled into shared objects from archives
5614 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5615 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5616 # This is similar to how AIX traditionally builds its shared
5617 # libraries.
5618 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5619 fi
5620 fi
5621 ;;
5622
5623 beos*)
5624 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5625 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5626 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5627 # support --undefined. This deserves some investigation. FIXME
5628 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5629 else
5630 _LT_TAGVAR(ld_shlibs, $1)=no
5631 fi
5632 ;;
5633
5634 chorus*)
5635 case $cc_basename in
5636 *)
5637 # FIXME: insert proper C++ library support
5638 _LT_TAGVAR(ld_shlibs, $1)=no
5639 ;;
5640 esac
5641 ;;
5642
5643 cygwin* | mingw* | pw32* | cegcc*)
5644 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5645 # as there is no search path for DLLs.
5646 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5647 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5648 _LT_TAGVAR(always_export_symbols, $1)=no
5649 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5650
5651 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5652 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5653 # If the export-symbols file already is a .def file (1st line
5654 # is EXPORTS), use it as is; otherwise, prepend...
5655 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5656 cp $export_symbols $output_objdir/$soname.def;
5657 else
5658 echo EXPORTS > $output_objdir/$soname.def;
5659 cat $export_symbols >> $output_objdir/$soname.def;
5660 fi~
5661 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5662 else
5663 _LT_TAGVAR(ld_shlibs, $1)=no
5664 fi
5665 ;;
5666 darwin* | rhapsody*)
5667 _LT_DARWIN_LINKER_FEATURES($1)
5668 ;;
5669
5670 dgux*)
5671 case $cc_basename in
5672 ec++*)
5673 # FIXME: insert proper C++ library support
5674 _LT_TAGVAR(ld_shlibs, $1)=no
5675 ;;
5676 ghcx*)
5677 # Green Hills C++ Compiler
5678 # FIXME: insert proper C++ library support
5679 _LT_TAGVAR(ld_shlibs, $1)=no
5680 ;;
5681 *)
5682 # FIXME: insert proper C++ library support
5683 _LT_TAGVAR(ld_shlibs, $1)=no
5684 ;;
5685 esac
5686 ;;
5687
5688 freebsd[[12]]*)
5689 # C++ shared libraries reported to be fairly broken before
5690 # switch to ELF
5691 _LT_TAGVAR(ld_shlibs, $1)=no
5692 ;;
5693
5694 freebsd-elf*)
5695 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5696 ;;
5697
5698 freebsd* | dragonfly*)
5699 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5700 # conventions
5701 _LT_TAGVAR(ld_shlibs, $1)=yes
5702 ;;
5703
5704 gnu*)
5705 ;;
5706
5707 hpux9*)
5708 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5709 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5710 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5711 _LT_TAGVAR(hardcode_direct, $1)=yes
5712 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5713 # but as the default
5714 # location of the library.
5715
5716 case $cc_basename in
5717 CC*)
5718 # FIXME: insert proper C++ library support
5719 _LT_TAGVAR(ld_shlibs, $1)=no
5720 ;;
5721 aCC*)
5722 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5723 # Commands to make compiler produce verbose output that lists
5724 # what "hidden" libraries, object files and flags are used when
5725 # linking a shared library.
5726 #
5727 # There doesn't appear to be a way to prevent this compiler from
5728 # explicitly linking system object files so we need to strip them
5729 # from the output so that they don't get included in the library
5730 # dependencies.
5731 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5732 ;;
5733 *)
5734 if test "$GXX" = yes; then
5735 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5736 else
5737 # FIXME: insert proper C++ library support
5738 _LT_TAGVAR(ld_shlibs, $1)=no
5739 fi
5740 ;;
5741 esac
5742 ;;
5743
5744 hpux10*|hpux11*)
5745 if test $with_gnu_ld = no; then
5746 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5747 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5748
5749 case $host_cpu in
5750 hppa*64*|ia64*)
5751 ;;
5752 *)
5753 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5754 ;;
5755 esac
5756 fi
5757 case $host_cpu in
5758 hppa*64*|ia64*)
5759 _LT_TAGVAR(hardcode_direct, $1)=no
5760 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5761 ;;
5762 *)
5763 _LT_TAGVAR(hardcode_direct, $1)=yes
5764 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5765 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5766 # but as the default
5767 # location of the library.
5768 ;;
5769 esac
5770
5771 case $cc_basename in
5772 CC*)
5773 # FIXME: insert proper C++ library support
5774 _LT_TAGVAR(ld_shlibs, $1)=no
5775 ;;
5776 aCC*)
5777 case $host_cpu in
5778 hppa*64*)
5779 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5780 ;;
5781 ia64*)
5782 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5783 ;;
5784 *)
5785 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5786 ;;
5787 esac
5788 # Commands to make compiler produce verbose output that lists
5789 # what "hidden" libraries, object files and flags are used when
5790 # linking a shared library.
5791 #
5792 # There doesn't appear to be a way to prevent this compiler from
5793 # explicitly linking system object files so we need to strip them
5794 # from the output so that they don't get included in the library
5795 # dependencies.
5796 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5797 ;;
5798 *)
5799 if test "$GXX" = yes; then
5800 if test $with_gnu_ld = no; then
5801 case $host_cpu in
5802 hppa*64*)
5803 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5804 ;;
5805 ia64*)
5806 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5807 ;;
5808 *)
5809 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5810 ;;
5811 esac
5812 fi
5813 else
5814 # FIXME: insert proper C++ library support
5815 _LT_TAGVAR(ld_shlibs, $1)=no
5816 fi
5817 ;;
5818 esac
5819 ;;
5820
5821 interix[[3-9]]*)
5822 _LT_TAGVAR(hardcode_direct, $1)=no
5823 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5824 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5825 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5826 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5827 # Instead, shared libraries are loaded at an image base (0x10000000 by
5828 # default) and relocated if they conflict, which is a slow very memory
5829 # consuming and fragmenting process. To avoid this, we pick a random,
5830 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5831 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5832 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5833 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5834 ;;
5835 irix5* | irix6*)
5836 case $cc_basename in
5837 CC*)
5838 # SGI C++
5839 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5840
5841 # Archives containing C++ object files must be created using
5842 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
5843 # necessary to make sure instantiated templates are included
5844 # in the archive.
5845 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5846 ;;
5847 *)
5848 if test "$GXX" = yes; then
5849 if test "$with_gnu_ld" = no; then
5850 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5851 else
5852 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5853 fi
5854 fi
5855 _LT_TAGVAR(link_all_deplibs, $1)=yes
5856 ;;
5857 esac
5858 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5859 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5860 _LT_TAGVAR(inherit_rpath, $1)=yes
5861 ;;
5862
5863 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5864 case $cc_basename in
5865 KCC*)
5866 # Kuck and Associates, Inc. (KAI) C++ Compiler
5867
5868 # KCC will only create a shared library if the output file
5869 # ends with ".so" (or ".sl" for HP-UX), so rename the library
5870 # to its proper name (with version) after linking.
5871 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
5872 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
5873 # Commands to make compiler produce verbose output that lists
5874 # what "hidden" libraries, object files and flags are used when
5875 # linking a shared library.
5876 #
5877 # There doesn't appear to be a way to prevent this compiler from
5878 # explicitly linking system object files so we need to strip them
5879 # from the output so that they don't get included in the library
5880 # dependencies.
5881 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5882
5883 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5884 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5885
5886 # Archives containing C++ object files must be created using
5887 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5888 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5889 ;;
5890 icpc* | ecpc* )
5891 # Intel C++
5892 with_gnu_ld=yes
5893 # version 8.0 and above of icpc choke on multiply defined symbols
5894 # if we add $predep_objects and $postdep_objects, however 7.1 and
5895 # earlier do not add the objects themselves.
5896 case `$CC -V 2>&1` in
5897 *"Version 7."*)
5898 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5899 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5900 ;;
5901 *) # Version 8.0 or newer
5902 tmp_idyn=
5903 case $host_cpu in
5904 ia64*) tmp_idyn=' -i_dynamic';;
5905 esac
5906 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5907 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5908 ;;
5909 esac
5910 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5911 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5912 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5913 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5914 ;;
5915 pgCC* | pgcpp*)
5916 # Portland Group C++ compiler
5917 case `$CC -V` in
5918 *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5919 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5920 rm -rf $tpldir~
5921 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5922 compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5923 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5924 rm -rf $tpldir~
5925 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5926 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5927 $RANLIB $oldlib'
5928 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5929 rm -rf $tpldir~
5930 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5931 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5932 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5933 rm -rf $tpldir~
5934 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5935 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5936 ;;
5937 *) # Version 6 will use weak symbols
5938 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5939 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5940 ;;
5941 esac
5942
5943 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5944 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5945 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5946 ;;
5947 cxx*)
5948 # Compaq C++
5949 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5950 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
5951
5952 runpath_var=LD_RUN_PATH
5953 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5954 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5955
5956 # Commands to make compiler produce verbose output that lists
5957 # what "hidden" libraries, object files and flags are used when
5958 # linking a shared library.
5959 #
5960 # There doesn't appear to be a way to prevent this compiler from
5961 # explicitly linking system object files so we need to strip them
5962 # from the output so that they don't get included in the library
5963 # dependencies.
5964 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5965 ;;
5966 xl*)
5967 # IBM XL 8.0 on PPC, with GNU ld
5968 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5969 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5970 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5971 if test "x$supports_anon_versioning" = xyes; then
5972 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5973 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5974 echo "local: *; };" >> $output_objdir/$libname.ver~
5975 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5976 fi
5977 ;;
5978 *)
5979 case `$CC -V 2>&1 | sed 5q` in
5980 *Sun\ C*)
5981 # Sun C++ 5.9
5982 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5983 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5984 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
5985 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5986 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5987 _LT_TAGVAR(compiler_needs_object, $1)=yes
5988
5989 # Not sure whether something based on
5990 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5991 # would be better.
5992 output_verbose_link_cmd='echo'
5993
5994 # Archives containing C++ object files must be created using
5995 # "CC -xar", where "CC" is the Sun C++ compiler. This is
5996 # necessary to make sure instantiated templates are included
5997 # in the archive.
5998 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5999 ;;
6000 esac
6001 ;;
6002 esac
6003 ;;
6004
6005 lynxos*)
6006 # FIXME: insert proper C++ library support
6007 _LT_TAGVAR(ld_shlibs, $1)=no
6008 ;;
6009
6010 m88k*)
6011 # FIXME: insert proper C++ library support
6012 _LT_TAGVAR(ld_shlibs, $1)=no
6013 ;;
6014
6015 mvs*)
6016 case $cc_basename in
6017 cxx*)
6018 # FIXME: insert proper C++ library support
6019 _LT_TAGVAR(ld_shlibs, $1)=no
6020 ;;
6021 *)
6022 # FIXME: insert proper C++ library support
6023 _LT_TAGVAR(ld_shlibs, $1)=no
6024 ;;
6025 esac
6026 ;;
6027
6028 netbsd*)
6029 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6030 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6031 wlarc=
6032 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6033 _LT_TAGVAR(hardcode_direct, $1)=yes
6034 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6035 fi
6036 # Workaround some broken pre-1.5 toolchains
6037 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6038 ;;
6039
6040 *nto* | *qnx*)
6041 _LT_TAGVAR(ld_shlibs, $1)=yes
6042 ;;
6043
6044 openbsd2*)
6045 # C++ shared libraries are fairly broken
6046 _LT_TAGVAR(ld_shlibs, $1)=no
6047 ;;
6048
6049 openbsd*)
6050 if test -f /usr/libexec/ld.so; then
6051 _LT_TAGVAR(hardcode_direct, $1)=yes
6052 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6053 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6054 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6055 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6056 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6057 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6058 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6059 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6060 fi
6061 output_verbose_link_cmd=echo
6062 else
6063 _LT_TAGVAR(ld_shlibs, $1)=no
6064 fi
6065 ;;
6066
6067 osf3* | osf4* | osf5*)
6068 case $cc_basename in
6069 KCC*)
6070 # Kuck and Associates, Inc. (KAI) C++ Compiler
6071
6072 # KCC will only create a shared library if the output file
6073 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6074 # to its proper name (with version) after linking.
6075 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6076
6077 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6078 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6079
6080 # Archives containing C++ object files must be created using
6081 # the KAI C++ compiler.
6082 case $host in
6083 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6084 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6085 esac
6086 ;;
6087 RCC*)
6088 # Rational C++ 2.4.1
6089 # FIXME: insert proper C++ library support
6090 _LT_TAGVAR(ld_shlibs, $1)=no
6091 ;;
6092 cxx*)
6093 case $host in
6094 osf3*)
6095 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6096 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6097 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6098 ;;
6099 *)
6100 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6101 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6102 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6103 echo "-hidden">> $lib.exp~
6104 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6105 $RM $lib.exp'
6106 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6107 ;;
6108 esac
6109
6110 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6111
6112 # Commands to make compiler produce verbose output that lists
6113 # what "hidden" libraries, object files and flags are used when
6114 # linking a shared library.
6115 #
6116 # There doesn't appear to be a way to prevent this compiler from
6117 # explicitly linking system object files so we need to strip them
6118 # from the output so that they don't get included in the library
6119 # dependencies.
6120 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6121 ;;
6122 *)
6123 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6124 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6125 case $host in
6126 osf3*)
6127 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6128 ;;
6129 *)
6130 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6131 ;;
6132 esac
6133
6134 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6135 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6136
6137 # Commands to make compiler produce verbose output that lists
6138 # what "hidden" libraries, object files and flags are used when
6139 # linking a shared library.
6140 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6141
6142 else
6143 # FIXME: insert proper C++ library support
6144 _LT_TAGVAR(ld_shlibs, $1)=no
6145 fi
6146 ;;
6147 esac
6148 ;;
6149
6150 psos*)
6151 # FIXME: insert proper C++ library support
6152 _LT_TAGVAR(ld_shlibs, $1)=no
6153 ;;
6154
6155 sunos4*)
6156 case $cc_basename in
6157 CC*)
6158 # Sun C++ 4.x
6159 # FIXME: insert proper C++ library support
6160 _LT_TAGVAR(ld_shlibs, $1)=no
6161 ;;
6162 lcc*)
6163 # Lucid
6164 # FIXME: insert proper C++ library support
6165 _LT_TAGVAR(ld_shlibs, $1)=no
6166 ;;
6167 *)
6168 # FIXME: insert proper C++ library support
6169 _LT_TAGVAR(ld_shlibs, $1)=no
6170 ;;
6171 esac
6172 ;;
6173
6174 solaris*)
6175 case $cc_basename in
6176 CC*)
6177 # Sun C++ 4.2, 5.x and Centerline C++
6178 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6179 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6180 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6181 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6182 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6183
6184 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6185 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6186 case $host_os in
6187 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6188 *)
6189 # The compiler driver will combine and reorder linker options,
6190 # but understands `-z linker_flag'.
6191 # Supported since Solaris 2.6 (maybe 2.5.1?)
6192 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6193 ;;
6194 esac
6195 _LT_TAGVAR(link_all_deplibs, $1)=yes
6196
6197 output_verbose_link_cmd='echo'
6198
6199 # Archives containing C++ object files must be created using
6200 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6201 # necessary to make sure instantiated templates are included
6202 # in the archive.
6203 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6204 ;;
6205 gcx*)
6206 # Green Hills C++ Compiler
6207 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6208
6209 # The C++ compiler must be used to create the archive.
6210 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6211 ;;
6212 *)
6213 # GNU C++ compiler with Solaris linker
6214 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6215 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6216 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6217 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6218 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6219 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6220
6221 # Commands to make compiler produce verbose output that lists
6222 # what "hidden" libraries, object files and flags are used when
6223 # linking a shared library.
6224 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6225 else
6226 # g++ 2.7 appears to require `-G' NOT `-shared' on this
6227 # platform.
6228 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6229 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6230 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6231
6232 # Commands to make compiler produce verbose output that lists
6233 # what "hidden" libraries, object files and flags are used when
6234 # linking a shared library.
6235 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6236 fi
6237
6238 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6239 case $host_os in
6240 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6241 *)
6242 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6243 ;;
6244 esac
6245 fi
6246 ;;
6247 esac
6248 ;;
6249
6250 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6251 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6252 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6253 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6254 runpath_var='LD_RUN_PATH'
6255
6256 case $cc_basename in
6257 CC*)
6258 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6260 ;;
6261 *)
6262 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6263 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6264 ;;
6265 esac
6266 ;;
6267
6268 sysv5* | sco3.2v5* | sco5v6*)
6269 # Note: We can NOT use -z defs as we might desire, because we do not
6270 # link with -lc, and that would cause any symbols used from libc to
6271 # always be unresolved, which means just about no library would
6272 # ever link correctly. If we're not using GNU ld we use -z text
6273 # though, which does catch some bad symbols but isn't as heavy-handed
6274 # as -z defs.
6275 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6276 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6277 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6278 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6279 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6280 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6281 _LT_TAGVAR(link_all_deplibs, $1)=yes
6282 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6283 runpath_var='LD_RUN_PATH'
6284
6285 case $cc_basename in
6286 CC*)
6287 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6289 ;;
6290 *)
6291 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6292 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6293 ;;
6294 esac
6295 ;;
6296
6297 tandem*)
6298 case $cc_basename in
6299 NCC*)
6300 # NonStop-UX NCC 3.20
6301 # FIXME: insert proper C++ library support
6302 _LT_TAGVAR(ld_shlibs, $1)=no
6303 ;;
6304 *)
6305 # FIXME: insert proper C++ library support
6306 _LT_TAGVAR(ld_shlibs, $1)=no
6307 ;;
6308 esac
6309 ;;
6310
6311 vxworks*)
6312 # FIXME: insert proper C++ library support
6313 _LT_TAGVAR(ld_shlibs, $1)=no
6314 ;;
6315
6316 *)
6317 # FIXME: insert proper C++ library support
6318 _LT_TAGVAR(ld_shlibs, $1)=no
6319 ;;
6320 esac
6321
6322 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6323 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6324
6325 _LT_TAGVAR(GCC, $1)="$GXX"
6326 _LT_TAGVAR(LD, $1)="$LD"
6327
6328 ## CAVEAT EMPTOR:
6329 ## There is no encapsulation within the following macros, do not change
6330 ## the running order or otherwise move them around unless you know exactly
6331 ## what you are doing...
6332 _LT_SYS_HIDDEN_LIBDEPS($1)
6333 _LT_COMPILER_PIC($1)
6334 _LT_COMPILER_C_O($1)
6335 _LT_COMPILER_FILE_LOCKS($1)
6336 _LT_LINKER_SHLIBS($1)
6337 _LT_SYS_DYNAMIC_LINKER($1)
6338 _LT_LINKER_HARDCODE_LIBPATH($1)
6339
6340 _LT_CONFIG($1)
6341 fi # test -n "$compiler"
6342
6343 CC=$lt_save_CC
6344 LDCXX=$LD
6345 LD=$lt_save_LD
6346 GCC=$lt_save_GCC
6347 with_gnu_ld=$lt_save_with_gnu_ld
6348 lt_cv_path_LDCXX=$lt_cv_path_LD
6349 lt_cv_path_LD=$lt_save_path_LD
6350 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6351 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6352 fi # test "$_lt_caught_CXX_error" != yes
6353
6354 AC_LANG_POP
6355 ])# _LT_LANG_CXX_CONFIG
6356
6357
6358 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6359 # ---------------------------------
6360 # Figure out "hidden" library dependencies from verbose
6361 # compiler output when linking a shared library.
6362 # Parse the compiler output and extract the necessary
6363 # objects, libraries and library flags.
6364 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6365 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6366 # Dependencies to place before and after the object being linked:
6367 _LT_TAGVAR(predep_objects, $1)=
6368 _LT_TAGVAR(postdep_objects, $1)=
6369 _LT_TAGVAR(predeps, $1)=
6370 _LT_TAGVAR(postdeps, $1)=
6371 _LT_TAGVAR(compiler_lib_search_path, $1)=
6372
6373 dnl we can't use the lt_simple_compile_test_code here,
6374 dnl because it contains code intended for an executable,
6375 dnl not a library. It's possible we should let each
6376 dnl tag define a new lt_????_link_test_code variable,
6377 dnl but it's only used here...
6378 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6379 int a;
6380 void foo (void) { a = 0; }
6381 _LT_EOF
6382 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6383 class Foo
6384 {
6385 public:
6386 Foo (void) { a = 0; }
6387 private:
6388 int a;
6389 };
6390 _LT_EOF
6391 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6392 subroutine foo
6393 implicit none
6394 integer*4 a
6395 a=0
6396 return
6397 end
6398 _LT_EOF
6399 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6400 subroutine foo
6401 implicit none
6402 integer a
6403 a=0
6404 return
6405 end
6406 _LT_EOF
6407 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6408 public class foo {
6409 private int a;
6410 public void bar (void) {
6411 a = 0;
6412 }
6413 };
6414 _LT_EOF
6415 ])
6416 dnl Parse the compiler output and extract the necessary
6417 dnl objects, libraries and library flags.
6418 if AC_TRY_EVAL(ac_compile); then
6419 # Parse the compiler output and extract the necessary
6420 # objects, libraries and library flags.
6421
6422 # Sentinel used to keep track of whether or not we are before
6423 # the conftest object file.
6424 pre_test_object_deps_done=no
6425
6426 for p in `eval "$output_verbose_link_cmd"`; do
6427 case $p in
6428
6429 -L* | -R* | -l*)
6430 # Some compilers place space between "-{L,R}" and the path.
6431 # Remove the space.
6432 if test $p = "-L" ||
6433 test $p = "-R"; then
6434 prev=$p
6435 continue
6436 else
6437 prev=
6438 fi
6439
6440 if test "$pre_test_object_deps_done" = no; then
6441 case $p in
6442 -L* | -R*)
6443 # Internal compiler library paths should come after those
6444 # provided the user. The postdeps already come after the
6445 # user supplied libs so there is no need to process them.
6446 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6447 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6448 else
6449 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6450 fi
6451 ;;
6452 # The "-l" case would never come before the object being
6453 # linked, so don't bother handling this case.
6454 esac
6455 else
6456 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6457 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6458 else
6459 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6460 fi
6461 fi
6462 ;;
6463
6464 *.$objext)
6465 # This assumes that the test object file only shows up
6466 # once in the compiler output.
6467 if test "$p" = "conftest.$objext"; then
6468 pre_test_object_deps_done=yes
6469 continue
6470 fi
6471
6472 if test "$pre_test_object_deps_done" = no; then
6473 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6474 _LT_TAGVAR(predep_objects, $1)="$p"
6475 else
6476 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6477 fi
6478 else
6479 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6480 _LT_TAGVAR(postdep_objects, $1)="$p"
6481 else
6482 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6483 fi
6484 fi
6485 ;;
6486
6487 *) ;; # Ignore the rest.
6488
6489 esac
6490 done
6491
6492 # Clean up.
6493 rm -f a.out a.exe
6494 else
6495 echo "libtool.m4: error: problem compiling $1 test program"
6496 fi
6497
6498 $RM -f confest.$objext
6499
6500 # PORTME: override above test on systems where it is broken
6501 m4_if([$1], [CXX],
6502 [case $host_os in
6503 interix[[3-9]]*)
6504 # Interix 3.5 installs completely hosed .la files for C++, so rather than
6505 # hack all around it, let's just trust "g++" to DTRT.
6506 _LT_TAGVAR(predep_objects,$1)=
6507 _LT_TAGVAR(postdep_objects,$1)=
6508 _LT_TAGVAR(postdeps,$1)=
6509 ;;
6510
6511 linux*)
6512 case `$CC -V 2>&1 | sed 5q` in
6513 *Sun\ C*)
6514 # Sun C++ 5.9
6515
6516 # The more standards-conforming stlport4 library is
6517 # incompatible with the Cstd library. Avoid specifying
6518 # it if it's in CXXFLAGS. Ignore libCrun as
6519 # -library=stlport4 depends on it.
6520 case " $CXX $CXXFLAGS " in
6521 *" -library=stlport4 "*)
6522 solaris_use_stlport4=yes
6523 ;;
6524 esac
6525
6526 if test "$solaris_use_stlport4" != yes; then
6527 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6528 fi
6529 ;;
6530 esac
6531 ;;
6532
6533 solaris*)
6534 case $cc_basename in
6535 CC*)
6536 # The more standards-conforming stlport4 library is
6537 # incompatible with the Cstd library. Avoid specifying
6538 # it if it's in CXXFLAGS. Ignore libCrun as
6539 # -library=stlport4 depends on it.
6540 case " $CXX $CXXFLAGS " in
6541 *" -library=stlport4 "*)
6542 solaris_use_stlport4=yes
6543 ;;
6544 esac
6545
6546 # Adding this requires a known-good setup of shared libraries for
6547 # Sun compiler versions before 5.6, else PIC objects from an old
6548 # archive will be linked into the output, leading to subtle bugs.
6549 if test "$solaris_use_stlport4" != yes; then
6550 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6551 fi
6552 ;;
6553 esac
6554 ;;
6555 esac
6556 ])
6557
6558 case " $_LT_TAGVAR(postdeps, $1) " in
6559 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6560 esac
6561 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6562 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6563 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6564 fi
6565 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6566 [The directories searched by this compiler when creating a shared library])
6567 _LT_TAGDECL([], [predep_objects], [1],
6568 [Dependencies to place before and after the objects being linked to
6569 create a shared library])
6570 _LT_TAGDECL([], [postdep_objects], [1])
6571 _LT_TAGDECL([], [predeps], [1])
6572 _LT_TAGDECL([], [postdeps], [1])
6573 _LT_TAGDECL([], [compiler_lib_search_path], [1],
6574 [The library search path used internally by the compiler when linking
6575 a shared library])
6576 ])# _LT_SYS_HIDDEN_LIBDEPS
6577
6578
6579 # _LT_PROG_F77
6580 # ------------
6581 # Since AC_PROG_F77 is broken, in that it returns the empty string
6582 # if there is no fortran compiler, we have our own version here.
6583 m4_defun([_LT_PROG_F77],
6584 [
6585 pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6586 AC_PROG_F77
6587 if test -z "$F77" || test "X$F77" = "Xno"; then
6588 _lt_disable_F77=yes
6589 fi
6590 popdef([AC_MSG_ERROR])
6591 ])# _LT_PROG_F77
6592
6593 dnl aclocal-1.4 backwards compatibility:
6594 dnl AC_DEFUN([_LT_PROG_F77], [])
6595
6596
6597 # _LT_LANG_F77_CONFIG([TAG])
6598 # --------------------------
6599 # Ensure that the configuration variables for a Fortran 77 compiler are
6600 # suitably defined. These variables are subsequently used by _LT_CONFIG
6601 # to write the compiler configuration to `libtool'.
6602 m4_defun([_LT_LANG_F77_CONFIG],
6603 [AC_REQUIRE([_LT_PROG_F77])dnl
6604 AC_LANG_PUSH(Fortran 77)
6605
6606 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6607 _LT_TAGVAR(allow_undefined_flag, $1)=
6608 _LT_TAGVAR(always_export_symbols, $1)=no
6609 _LT_TAGVAR(archive_expsym_cmds, $1)=
6610 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6611 _LT_TAGVAR(hardcode_direct, $1)=no
6612 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6613 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6614 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6615 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6616 _LT_TAGVAR(hardcode_minus_L, $1)=no
6617 _LT_TAGVAR(hardcode_automatic, $1)=no
6618 _LT_TAGVAR(inherit_rpath, $1)=no
6619 _LT_TAGVAR(module_cmds, $1)=
6620 _LT_TAGVAR(module_expsym_cmds, $1)=
6621 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6622 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6623 _LT_TAGVAR(no_undefined_flag, $1)=
6624 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6625 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6626
6627 # Source file extension for f77 test sources.
6628 ac_ext=f
6629
6630 # Object file extension for compiled f77 test sources.
6631 objext=o
6632 _LT_TAGVAR(objext, $1)=$objext
6633
6634 # No sense in running all these tests if we already determined that
6635 # the F77 compiler isn't working. Some variables (like enable_shared)
6636 # are currently assumed to apply to all compilers on this platform,
6637 # and will be corrupted by setting them based on a non-working compiler.
6638 if test "$_lt_disable_F77" != yes; then
6639 # Code to be used in simple compile tests
6640 lt_simple_compile_test_code="\
6641 subroutine t
6642 return
6643 end
6644 "
6645
6646 # Code to be used in simple link tests
6647 lt_simple_link_test_code="\
6648 program t
6649 end
6650 "
6651
6652 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6653 _LT_TAG_COMPILER
6654
6655 # save warnings/boilerplate of simple test code
6656 _LT_COMPILER_BOILERPLATE
6657 _LT_LINKER_BOILERPLATE
6658
6659 # Allow CC to be a program name with arguments.
6660 lt_save_CC="$CC"
6661 lt_save_GCC=$GCC
6662 CC=${F77-"f77"}
6663 compiler=$CC
6664 _LT_TAGVAR(compiler, $1)=$CC
6665 _LT_CC_BASENAME([$compiler])
6666 GCC=$G77
6667 if test -n "$compiler"; then
6668 AC_MSG_CHECKING([if libtool supports shared libraries])
6669 AC_MSG_RESULT([$can_build_shared])
6670
6671 AC_MSG_CHECKING([whether to build shared libraries])
6672 test "$can_build_shared" = "no" && enable_shared=no
6673
6674 # On AIX, shared libraries and static libraries use the same namespace, and
6675 # are all built from PIC.
6676 case $host_os in
6677 aix3*)
6678 test "$enable_shared" = yes && enable_static=no
6679 if test -n "$RANLIB"; then
6680 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6681 postinstall_cmds='$RANLIB $lib'
6682 fi
6683 ;;
6684 aix[[4-9]]*)
6685 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6686 test "$enable_shared" = yes && enable_static=no
6687 fi
6688 ;;
6689 esac
6690 AC_MSG_RESULT([$enable_shared])
6691
6692 AC_MSG_CHECKING([whether to build static libraries])
6693 # Make sure either enable_shared or enable_static is yes.
6694 test "$enable_shared" = yes || enable_static=yes
6695 AC_MSG_RESULT([$enable_static])
6696
6697 _LT_TAGVAR(GCC, $1)="$G77"
6698 _LT_TAGVAR(LD, $1)="$LD"
6699
6700 ## CAVEAT EMPTOR:
6701 ## There is no encapsulation within the following macros, do not change
6702 ## the running order or otherwise move them around unless you know exactly
6703 ## what you are doing...
6704 _LT_COMPILER_PIC($1)
6705 _LT_COMPILER_C_O($1)
6706 _LT_COMPILER_FILE_LOCKS($1)
6707 _LT_LINKER_SHLIBS($1)
6708 _LT_SYS_DYNAMIC_LINKER($1)
6709 _LT_LINKER_HARDCODE_LIBPATH($1)
6710
6711 _LT_CONFIG($1)
6712 fi # test -n "$compiler"
6713
6714 GCC=$lt_save_GCC
6715 CC="$lt_save_CC"
6716 fi # test "$_lt_disable_F77" != yes
6717
6718 AC_LANG_POP
6719 ])# _LT_LANG_F77_CONFIG
6720
6721
6722 # _LT_PROG_FC
6723 # -----------
6724 # Since AC_PROG_FC is broken, in that it returns the empty string
6725 # if there is no fortran compiler, we have our own version here.
6726 m4_defun([_LT_PROG_FC],
6727 [
6728 pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6729 AC_PROG_FC
6730 if test -z "$FC" || test "X$FC" = "Xno"; then
6731 _lt_disable_FC=yes
6732 fi
6733 popdef([AC_MSG_ERROR])
6734 ])# _LT_PROG_FC
6735
6736 dnl aclocal-1.4 backwards compatibility:
6737 dnl AC_DEFUN([_LT_PROG_FC], [])
6738
6739
6740 # _LT_LANG_FC_CONFIG([TAG])
6741 # -------------------------
6742 # Ensure that the configuration variables for a Fortran compiler are
6743 # suitably defined. These variables are subsequently used by _LT_CONFIG
6744 # to write the compiler configuration to `libtool'.
6745 m4_defun([_LT_LANG_FC_CONFIG],
6746 [AC_REQUIRE([_LT_PROG_FC])dnl
6747 AC_LANG_PUSH(Fortran)
6748
6749 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6750 _LT_TAGVAR(allow_undefined_flag, $1)=
6751 _LT_TAGVAR(always_export_symbols, $1)=no
6752 _LT_TAGVAR(archive_expsym_cmds, $1)=
6753 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6754 _LT_TAGVAR(hardcode_direct, $1)=no
6755 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6756 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6757 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6758 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6759 _LT_TAGVAR(hardcode_minus_L, $1)=no
6760 _LT_TAGVAR(hardcode_automatic, $1)=no
6761 _LT_TAGVAR(inherit_rpath, $1)=no
6762 _LT_TAGVAR(module_cmds, $1)=
6763 _LT_TAGVAR(module_expsym_cmds, $1)=
6764 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6765 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6766 _LT_TAGVAR(no_undefined_flag, $1)=
6767 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6768 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6769
6770 # Source file extension for fc test sources.
6771 ac_ext=${ac_fc_srcext-f}
6772
6773 # Object file extension for compiled fc test sources.
6774 objext=o
6775 _LT_TAGVAR(objext, $1)=$objext
6776
6777 # No sense in running all these tests if we already determined that
6778 # the FC compiler isn't working. Some variables (like enable_shared)
6779 # are currently assumed to apply to all compilers on this platform,
6780 # and will be corrupted by setting them based on a non-working compiler.
6781 if test "$_lt_disable_FC" != yes; then
6782 # Code to be used in simple compile tests
6783 lt_simple_compile_test_code="\
6784 subroutine t
6785 return
6786 end
6787 "
6788
6789 # Code to be used in simple link tests
6790 lt_simple_link_test_code="\
6791 program t
6792 end
6793 "
6794
6795 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6796 _LT_TAG_COMPILER
6797
6798 # save warnings/boilerplate of simple test code
6799 _LT_COMPILER_BOILERPLATE
6800 _LT_LINKER_BOILERPLATE
6801
6802 # Allow CC to be a program name with arguments.
6803 lt_save_CC="$CC"
6804 lt_save_GCC=$GCC
6805 CC=${FC-"f95"}
6806 compiler=$CC
6807 GCC=$ac_cv_fc_compiler_gnu
6808
6809 _LT_TAGVAR(compiler, $1)=$CC
6810 _LT_CC_BASENAME([$compiler])
6811
6812 if test -n "$compiler"; then
6813 AC_MSG_CHECKING([if libtool supports shared libraries])
6814 AC_MSG_RESULT([$can_build_shared])
6815
6816 AC_MSG_CHECKING([whether to build shared libraries])
6817 test "$can_build_shared" = "no" && enable_shared=no
6818
6819 # On AIX, shared libraries and static libraries use the same namespace, and
6820 # are all built from PIC.
6821 case $host_os in
6822 aix3*)
6823 test "$enable_shared" = yes && enable_static=no
6824 if test -n "$RANLIB"; then
6825 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6826 postinstall_cmds='$RANLIB $lib'
6827 fi
6828 ;;
6829 aix[[4-9]]*)
6830 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6831 test "$enable_shared" = yes && enable_static=no
6832 fi
6833 ;;
6834 esac
6835 AC_MSG_RESULT([$enable_shared])
6836
6837 AC_MSG_CHECKING([whether to build static libraries])
6838 # Make sure either enable_shared or enable_static is yes.
6839 test "$enable_shared" = yes || enable_static=yes
6840 AC_MSG_RESULT([$enable_static])
6841
6842 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6843 _LT_TAGVAR(LD, $1)="$LD"
6844
6845 ## CAVEAT EMPTOR:
6846 ## There is no encapsulation within the following macros, do not change
6847 ## the running order or otherwise move them around unless you know exactly
6848 ## what you are doing...
6849 _LT_SYS_HIDDEN_LIBDEPS($1)
6850 _LT_COMPILER_PIC($1)
6851 _LT_COMPILER_C_O($1)
6852 _LT_COMPILER_FILE_LOCKS($1)
6853 _LT_LINKER_SHLIBS($1)
6854 _LT_SYS_DYNAMIC_LINKER($1)
6855 _LT_LINKER_HARDCODE_LIBPATH($1)
6856
6857 _LT_CONFIG($1)
6858 fi # test -n "$compiler"
6859
6860 GCC=$lt_save_GCC
6861 CC="$lt_save_CC"
6862 fi # test "$_lt_disable_FC" != yes
6863
6864 AC_LANG_POP
6865 ])# _LT_LANG_FC_CONFIG
6866
6867
6868 # _LT_LANG_GCJ_CONFIG([TAG])
6869 # --------------------------
6870 # Ensure that the configuration variables for the GNU Java Compiler compiler
6871 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6872 # to write the compiler configuration to `libtool'.
6873 m4_defun([_LT_LANG_GCJ_CONFIG],
6874 [AC_REQUIRE([LT_PROG_GCJ])dnl
6875 AC_LANG_SAVE
6876
6877 # Source file extension for Java test sources.
6878 ac_ext=java
6879
6880 # Object file extension for compiled Java test sources.
6881 objext=o
6882 _LT_TAGVAR(objext, $1)=$objext
6883
6884 # Code to be used in simple compile tests
6885 lt_simple_compile_test_code="class foo {}"
6886
6887 # Code to be used in simple link tests
6888 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6889
6890 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6891 _LT_TAG_COMPILER
6892
6893 # save warnings/boilerplate of simple test code
6894 _LT_COMPILER_BOILERPLATE
6895 _LT_LINKER_BOILERPLATE
6896
6897 # Allow CC to be a program name with arguments.
6898 lt_save_CC="$CC"
6899 lt_save_GCC=$GCC
6900 GCC=yes
6901 CC=${GCJ-"gcj"}
6902 compiler=$CC
6903 _LT_TAGVAR(compiler, $1)=$CC
6904 _LT_TAGVAR(LD, $1)="$LD"
6905 _LT_CC_BASENAME([$compiler])
6906
6907 # GCJ did not exist at the time GCC didn't implicitly link libc in.
6908 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6909
6910 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6911
6912 ## CAVEAT EMPTOR:
6913 ## There is no encapsulation within the following macros, do not change
6914 ## the running order or otherwise move them around unless you know exactly
6915 ## what you are doing...
6916 if test -n "$compiler"; then
6917 _LT_COMPILER_NO_RTTI($1)
6918 _LT_COMPILER_PIC($1)
6919 _LT_COMPILER_C_O($1)
6920 _LT_COMPILER_FILE_LOCKS($1)
6921 _LT_LINKER_SHLIBS($1)
6922 _LT_LINKER_HARDCODE_LIBPATH($1)
6923
6924 _LT_CONFIG($1)
6925 fi
6926
6927 AC_LANG_RESTORE
6928
6929 GCC=$lt_save_GCC
6930 CC="$lt_save_CC"
6931 ])# _LT_LANG_GCJ_CONFIG
6932
6933
6934 # _LT_LANG_RC_CONFIG([TAG])
6935 # -------------------------
6936 # Ensure that the configuration variables for the Windows resource compiler
6937 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6938 # to write the compiler configuration to `libtool'.
6939 m4_defun([_LT_LANG_RC_CONFIG],
6940 [AC_REQUIRE([LT_PROG_RC])dnl
6941 AC_LANG_SAVE
6942
6943 # Source file extension for RC test sources.
6944 ac_ext=rc
6945
6946 # Object file extension for compiled RC test sources.
6947 objext=o
6948 _LT_TAGVAR(objext, $1)=$objext
6949
6950 # Code to be used in simple compile tests
6951 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6952
6953 # Code to be used in simple link tests
6954 lt_simple_link_test_code="$lt_simple_compile_test_code"
6955
6956 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6957 _LT_TAG_COMPILER
6958
6959 # save warnings/boilerplate of simple test code
6960 _LT_COMPILER_BOILERPLATE
6961 _LT_LINKER_BOILERPLATE
6962
6963 # Allow CC to be a program name with arguments.
6964 lt_save_CC="$CC"
6965 lt_save_GCC=$GCC
6966 GCC=
6967 CC=${RC-"windres"}
6968 compiler=$CC
6969 _LT_TAGVAR(compiler, $1)=$CC
6970 _LT_CC_BASENAME([$compiler])
6971 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6972
6973 if test -n "$compiler"; then
6974 :
6975 _LT_CONFIG($1)
6976 fi
6977
6978 GCC=$lt_save_GCC
6979 AC_LANG_RESTORE
6980 CC="$lt_save_CC"
6981 ])# _LT_LANG_RC_CONFIG
6982
6983
6984 # LT_PROG_GCJ
6985 # -----------
6986 AC_DEFUN([LT_PROG_GCJ],
6987 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6988 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6989 [AC_CHECK_TOOL(GCJ, gcj,)
6990 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6991 AC_SUBST(GCJFLAGS)])])[]dnl
6992 ])
6993
6994 # Old name:
6995 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6996 dnl aclocal-1.4 backwards compatibility:
6997 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6998
6999
7000 # LT_PROG_RC
7001 # ----------
7002 AC_DEFUN([LT_PROG_RC],
7003 [AC_CHECK_TOOL(RC, windres,)
7004 ])
7005
7006 # Old name:
7007 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7008 dnl aclocal-1.4 backwards compatibility:
7009 dnl AC_DEFUN([LT_AC_PROG_RC], [])
7010
7011
7012 # _LT_DECL_EGREP
7013 # --------------
7014 # If we don't have a new enough Autoconf to choose the best grep
7015 # available, choose the one first in the user's PATH.
7016 m4_defun([_LT_DECL_EGREP],
7017 [AC_REQUIRE([AC_PROG_EGREP])dnl
7018 AC_REQUIRE([AC_PROG_FGREP])dnl
7019 test -z "$GREP" && GREP=grep
7020 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7021 _LT_DECL([], [EGREP], [1], [An ERE matcher])
7022 _LT_DECL([], [FGREP], [1], [A literal string matcher])
7023 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7024 AC_SUBST([GREP])
7025 ])
7026
7027
7028 # _LT_DECL_OBJDUMP
7029 # --------------
7030 # If we don't have a new enough Autoconf to choose the best objdump
7031 # available, choose the one first in the user's PATH.
7032 m4_defun([_LT_DECL_OBJDUMP],
7033 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
7034 test -z "$OBJDUMP" && OBJDUMP=objdump
7035 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7036 AC_SUBST([OBJDUMP])
7037 ])
7038
7039
7040 # _LT_DECL_SED
7041 # ------------
7042 # Check for a fully-functional sed program, that truncates
7043 # as few characters as possible. Prefer GNU sed if found.
7044 m4_defun([_LT_DECL_SED],
7045 [AC_PROG_SED
7046 test -z "$SED" && SED=sed
7047 Xsed="$SED -e 1s/^X//"
7048 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7049 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7050 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7051 ])# _LT_DECL_SED
7052
7053 m4_ifndef([AC_PROG_SED], [
7054 ############################################################
7055 # NOTE: This macro has been submitted for inclusion into #
7056 # GNU Autoconf as AC_PROG_SED. When it is available in #
7057 # a released version of Autoconf we should remove this #
7058 # macro and use it instead. #
7059 ############################################################
7060
7061 m4_defun([AC_PROG_SED],
7062 [AC_MSG_CHECKING([for a sed that does not truncate output])
7063 AC_CACHE_VAL(lt_cv_path_SED,
7064 [# Loop through the user's path and test for sed and gsed.
7065 # Then use that list of sed's as ones to test for truncation.
7066 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7067 for as_dir in $PATH
7068 do
7069 IFS=$as_save_IFS
7070 test -z "$as_dir" && as_dir=.
7071 for lt_ac_prog in sed gsed; do
7072 for ac_exec_ext in '' $ac_executable_extensions; do
7073 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7074 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7075 fi
7076 done
7077 done
7078 done
7079 IFS=$as_save_IFS
7080 lt_ac_max=0
7081 lt_ac_count=0
7082 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
7083 # along with /bin/sed that truncates output.
7084 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7085 test ! -f $lt_ac_sed && continue
7086 cat /dev/null > conftest.in
7087 lt_ac_count=0
7088 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7089 # Check for GNU sed and select it if it is found.
7090 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7091 lt_cv_path_SED=$lt_ac_sed
7092 break
7093 fi
7094 while true; do
7095 cat conftest.in conftest.in >conftest.tmp
7096 mv conftest.tmp conftest.in
7097 cp conftest.in conftest.nl
7098 echo >>conftest.nl
7099 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7100 cmp -s conftest.out conftest.nl || break
7101 # 10000 chars as input seems more than enough
7102 test $lt_ac_count -gt 10 && break
7103 lt_ac_count=`expr $lt_ac_count + 1`
7104 if test $lt_ac_count -gt $lt_ac_max; then
7105 lt_ac_max=$lt_ac_count
7106 lt_cv_path_SED=$lt_ac_sed
7107 fi
7108 done
7109 done
7110 ])
7111 SED=$lt_cv_path_SED
7112 AC_SUBST([SED])
7113 AC_MSG_RESULT([$SED])
7114 ])#AC_PROG_SED
7115 ])#m4_ifndef
7116
7117 # Old name:
7118 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7119 dnl aclocal-1.4 backwards compatibility:
7120 dnl AC_DEFUN([LT_AC_PROG_SED], [])
7121
7122
7123 # _LT_CHECK_SHELL_FEATURES
7124 # ------------------------
7125 # Find out whether the shell is Bourne or XSI compatible,
7126 # or has some other useful features.
7127 m4_defun([_LT_CHECK_SHELL_FEATURES],
7128 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7129 # Try some XSI features
7130 xsi_shell=no
7131 ( _lt_dummy="a/b/c"
7132 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7133 = c,a/b,, \
7134 && eval 'test $(( 1 + 1 )) -eq 2 \
7135 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7136 && xsi_shell=yes
7137 AC_MSG_RESULT([$xsi_shell])
7138 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7139
7140 AC_MSG_CHECKING([whether the shell understands "+="])
7141 lt_shell_append=no
7142 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7143 >/dev/null 2>&1 \
7144 && lt_shell_append=yes
7145 AC_MSG_RESULT([$lt_shell_append])
7146 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7147
7148 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7149 lt_unset=unset
7150 else
7151 lt_unset=false
7152 fi
7153 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7154
7155 # test EBCDIC or ASCII
7156 case `echo X|tr X '\101'` in
7157 A) # ASCII based system
7158 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7159 lt_SP2NL='tr \040 \012'
7160 lt_NL2SP='tr \015\012 \040\040'
7161 ;;
7162 *) # EBCDIC based system
7163 lt_SP2NL='tr \100 \n'
7164 lt_NL2SP='tr \r\n \100\100'
7165 ;;
7166 esac
7167 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7168 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7169 ])# _LT_CHECK_SHELL_FEATURES
7170
7171
7172 # _LT_PROG_XSI_SHELLFNS
7173 # ---------------------
7174 # Bourne and XSI compatible variants of some useful shell functions.
7175 m4_defun([_LT_PROG_XSI_SHELLFNS],
7176 [case $xsi_shell in
7177 yes)
7178 cat << \_LT_EOF >> "$cfgfile"
7179
7180 # func_dirname file append nondir_replacement
7181 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7182 # otherwise set result to NONDIR_REPLACEMENT.
7183 func_dirname ()
7184 {
7185 case ${1} in
7186 */*) func_dirname_result="${1%/*}${2}" ;;
7187 * ) func_dirname_result="${3}" ;;
7188 esac
7189 }
7190
7191 # func_basename file
7192 func_basename ()
7193 {
7194 func_basename_result="${1##*/}"
7195 }
7196
7197 # func_dirname_and_basename file append nondir_replacement
7198 # perform func_basename and func_dirname in a single function
7199 # call:
7200 # dirname: Compute the dirname of FILE. If nonempty,
7201 # add APPEND to the result, otherwise set result
7202 # to NONDIR_REPLACEMENT.
7203 # value returned in "$func_dirname_result"
7204 # basename: Compute filename of FILE.
7205 # value retuned in "$func_basename_result"
7206 # Implementation must be kept synchronized with func_dirname
7207 # and func_basename. For efficiency, we do not delegate to
7208 # those functions but instead duplicate the functionality here.
7209 func_dirname_and_basename ()
7210 {
7211 case ${1} in
7212 */*) func_dirname_result="${1%/*}${2}" ;;
7213 * ) func_dirname_result="${3}" ;;
7214 esac
7215 func_basename_result="${1##*/}"
7216 }
7217
7218 # func_stripname prefix suffix name
7219 # strip PREFIX and SUFFIX off of NAME.
7220 # PREFIX and SUFFIX must not contain globbing or regex special
7221 # characters, hashes, percent signs, but SUFFIX may contain a leading
7222 # dot (in which case that matches only a dot).
7223 func_stripname ()
7224 {
7225 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7226 # positional parameters, so assign one to ordinary parameter first.
7227 func_stripname_result=${3}
7228 func_stripname_result=${func_stripname_result#"${1}"}
7229 func_stripname_result=${func_stripname_result%"${2}"}
7230 }
7231
7232 # func_opt_split
7233 func_opt_split ()
7234 {
7235 func_opt_split_opt=${1%%=*}
7236 func_opt_split_arg=${1#*=}
7237 }
7238
7239 # func_lo2o object
7240 func_lo2o ()
7241 {
7242 case ${1} in
7243 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7244 *) func_lo2o_result=${1} ;;
7245 esac
7246 }
7247
7248 # func_xform libobj-or-source
7249 func_xform ()
7250 {
7251 func_xform_result=${1%.*}.lo
7252 }
7253
7254 # func_arith arithmetic-term...
7255 func_arith ()
7256 {
7257 func_arith_result=$(( $[*] ))
7258 }
7259
7260 # func_len string
7261 # STRING may not start with a hyphen.
7262 func_len ()
7263 {
7264 func_len_result=${#1}
7265 }
7266
7267 _LT_EOF
7268 ;;
7269 *) # Bourne compatible functions.
7270 cat << \_LT_EOF >> "$cfgfile"
7271
7272 # func_dirname file append nondir_replacement
7273 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7274 # otherwise set result to NONDIR_REPLACEMENT.
7275 func_dirname ()
7276 {
7277 # Extract subdirectory from the argument.
7278 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7279 if test "X$func_dirname_result" = "X${1}"; then
7280 func_dirname_result="${3}"
7281 else
7282 func_dirname_result="$func_dirname_result${2}"
7283 fi
7284 }
7285
7286 # func_basename file
7287 func_basename ()
7288 {
7289 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7290 }
7291
7292 dnl func_dirname_and_basename
7293 dnl A portable version of this function is already defined in general.m4sh
7294 dnl so there is no need for it here.
7295
7296 # func_stripname prefix suffix name
7297 # strip PREFIX and SUFFIX off of NAME.
7298 # PREFIX and SUFFIX must not contain globbing or regex special
7299 # characters, hashes, percent signs, but SUFFIX may contain a leading
7300 # dot (in which case that matches only a dot).
7301 # func_strip_suffix prefix name
7302 func_stripname ()
7303 {
7304 case ${2} in
7305 .*) func_stripname_result=`$ECHO "X${3}" \
7306 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7307 *) func_stripname_result=`$ECHO "X${3}" \
7308 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7309 esac
7310 }
7311
7312 # sed scripts:
7313 my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7314 my_sed_long_arg='1s/^-[[^=]]*=//'
7315
7316 # func_opt_split
7317 func_opt_split ()
7318 {
7319 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7320 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7321 }
7322
7323 # func_lo2o object
7324 func_lo2o ()
7325 {
7326 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7327 }
7328
7329 # func_xform libobj-or-source
7330 func_xform ()
7331 {
7332 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7333 }
7334
7335 # func_arith arithmetic-term...
7336 func_arith ()
7337 {
7338 func_arith_result=`expr "$[@]"`
7339 }
7340
7341 # func_len string
7342 # STRING may not start with a hyphen.
7343 func_len ()
7344 {
7345 func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7346 }
7347
7348 _LT_EOF
7349 esac
7350
7351 case $lt_shell_append in
7352 yes)
7353 cat << \_LT_EOF >> "$cfgfile"
7354
7355 # func_append var value
7356 # Append VALUE to the end of shell variable VAR.
7357 func_append ()
7358 {
7359 eval "$[1]+=\$[2]"
7360 }
7361 _LT_EOF
7362 ;;
7363 *)
7364 cat << \_LT_EOF >> "$cfgfile"
7365
7366 # func_append var value
7367 # Append VALUE to the end of shell variable VAR.
7368 func_append ()
7369 {
7370 eval "$[1]=\$$[1]\$[2]"
7371 }
7372
7373 _LT_EOF
7374 ;;
7375 esac
7376 ])
+0
-368
m4/ltoptions.m4 less more
0 # Helper functions for option handling. -*- Autoconf -*-
1 #
2 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
3 # Written by Gary V. Vaughan, 2004
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # serial 6 ltoptions.m4
10
11 # This is to help aclocal find these macros, as it can't see m4_define.
12 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
13
14
15 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
16 # ------------------------------------------
17 m4_define([_LT_MANGLE_OPTION],
18 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
19
20
21 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
22 # ---------------------------------------
23 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
24 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
25 # saved as a flag.
26 m4_define([_LT_SET_OPTION],
27 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
28 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
29 _LT_MANGLE_DEFUN([$1], [$2]),
30 [m4_warning([Unknown $1 option `$2'])])[]dnl
31 ])
32
33
34 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
35 # ------------------------------------------------------------
36 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
37 m4_define([_LT_IF_OPTION],
38 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
39
40
41 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
42 # -------------------------------------------------------
43 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
44 # are set.
45 m4_define([_LT_UNLESS_OPTIONS],
46 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
47 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
48 [m4_define([$0_found])])])[]dnl
49 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
50 ])[]dnl
51 ])
52
53
54 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
55 # ----------------------------------------
56 # OPTION-LIST is a space-separated list of Libtool options associated
57 # with MACRO-NAME. If any OPTION has a matching handler declared with
58 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
59 # the unknown option and exit.
60 m4_defun([_LT_SET_OPTIONS],
61 [# Set options
62 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
63 [_LT_SET_OPTION([$1], _LT_Option)])
64
65 m4_if([$1],[LT_INIT],[
66 dnl
67 dnl Simply set some default values (i.e off) if boolean options were not
68 dnl specified:
69 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
70 ])
71 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
72 ])
73 dnl
74 dnl If no reference was made to various pairs of opposing options, then
75 dnl we run the default mode handler for the pair. For example, if neither
76 dnl `shared' nor `disable-shared' was passed, we enable building of shared
77 dnl archives by default:
78 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
79 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
81 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
82 [_LT_ENABLE_FAST_INSTALL])
83 ])
84 ])# _LT_SET_OPTIONS
85
86
87 ## --------------------------------- ##
88 ## Macros to handle LT_INIT options. ##
89 ## --------------------------------- ##
90
91 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
92 # -----------------------------------------
93 m4_define([_LT_MANGLE_DEFUN],
94 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
95
96
97 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
98 # -----------------------------------------------
99 m4_define([LT_OPTION_DEFINE],
100 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
101 ])# LT_OPTION_DEFINE
102
103
104 # dlopen
105 # ------
106 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
107 ])
108
109 AU_DEFUN([AC_LIBTOOL_DLOPEN],
110 [_LT_SET_OPTION([LT_INIT], [dlopen])
111 AC_DIAGNOSE([obsolete],
112 [$0: Remove this warning and the call to _LT_SET_OPTION when you
113 put the `dlopen' option into LT_INIT's first parameter.])
114 ])
115
116 dnl aclocal-1.4 backwards compatibility:
117 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
118
119
120 # win32-dll
121 # ---------
122 # Declare package support for building win32 dll's.
123 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
124 [enable_win32_dll=yes
125
126 case $host in
127 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
128 AC_CHECK_TOOL(AS, as, false)
129 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
130 AC_CHECK_TOOL(OBJDUMP, objdump, false)
131 ;;
132 esac
133
134 test -z "$AS" && AS=as
135 _LT_DECL([], [AS], [0], [Assembler program])dnl
136
137 test -z "$DLLTOOL" && DLLTOOL=dlltool
138 _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
139
140 test -z "$OBJDUMP" && OBJDUMP=objdump
141 _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
142 ])# win32-dll
143
144 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
145 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
146 _LT_SET_OPTION([LT_INIT], [win32-dll])
147 AC_DIAGNOSE([obsolete],
148 [$0: Remove this warning and the call to _LT_SET_OPTION when you
149 put the `win32-dll' option into LT_INIT's first parameter.])
150 ])
151
152 dnl aclocal-1.4 backwards compatibility:
153 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
154
155
156 # _LT_ENABLE_SHARED([DEFAULT])
157 # ----------------------------
158 # implement the --enable-shared flag, and supports the `shared' and
159 # `disable-shared' LT_INIT options.
160 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
161 m4_define([_LT_ENABLE_SHARED],
162 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
163 AC_ARG_ENABLE([shared],
164 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
165 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
166 [p=${PACKAGE-default}
167 case $enableval in
168 yes) enable_shared=yes ;;
169 no) enable_shared=no ;;
170 *)
171 enable_shared=no
172 # Look at the argument we got. We use all the common list separators.
173 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
174 for pkg in $enableval; do
175 IFS="$lt_save_ifs"
176 if test "X$pkg" = "X$p"; then
177 enable_shared=yes
178 fi
179 done
180 IFS="$lt_save_ifs"
181 ;;
182 esac],
183 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
184
185 _LT_DECL([build_libtool_libs], [enable_shared], [0],
186 [Whether or not to build shared libraries])
187 ])# _LT_ENABLE_SHARED
188
189 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
190 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
191
192 # Old names:
193 AC_DEFUN([AC_ENABLE_SHARED],
194 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
195 ])
196
197 AC_DEFUN([AC_DISABLE_SHARED],
198 [_LT_SET_OPTION([LT_INIT], [disable-shared])
199 ])
200
201 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
202 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
203
204 dnl aclocal-1.4 backwards compatibility:
205 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
206 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
207
208
209
210 # _LT_ENABLE_STATIC([DEFAULT])
211 # ----------------------------
212 # implement the --enable-static flag, and support the `static' and
213 # `disable-static' LT_INIT options.
214 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
215 m4_define([_LT_ENABLE_STATIC],
216 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
217 AC_ARG_ENABLE([static],
218 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
219 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
220 [p=${PACKAGE-default}
221 case $enableval in
222 yes) enable_static=yes ;;
223 no) enable_static=no ;;
224 *)
225 enable_static=no
226 # Look at the argument we got. We use all the common list separators.
227 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
228 for pkg in $enableval; do
229 IFS="$lt_save_ifs"
230 if test "X$pkg" = "X$p"; then
231 enable_static=yes
232 fi
233 done
234 IFS="$lt_save_ifs"
235 ;;
236 esac],
237 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
238
239 _LT_DECL([build_old_libs], [enable_static], [0],
240 [Whether or not to build static libraries])
241 ])# _LT_ENABLE_STATIC
242
243 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
244 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
245
246 # Old names:
247 AC_DEFUN([AC_ENABLE_STATIC],
248 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
249 ])
250
251 AC_DEFUN([AC_DISABLE_STATIC],
252 [_LT_SET_OPTION([LT_INIT], [disable-static])
253 ])
254
255 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
256 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
257
258 dnl aclocal-1.4 backwards compatibility:
259 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
260 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
261
262
263
264 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
265 # ----------------------------------
266 # implement the --enable-fast-install flag, and support the `fast-install'
267 # and `disable-fast-install' LT_INIT options.
268 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
269 m4_define([_LT_ENABLE_FAST_INSTALL],
270 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
271 AC_ARG_ENABLE([fast-install],
272 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
273 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
274 [p=${PACKAGE-default}
275 case $enableval in
276 yes) enable_fast_install=yes ;;
277 no) enable_fast_install=no ;;
278 *)
279 enable_fast_install=no
280 # Look at the argument we got. We use all the common list separators.
281 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
282 for pkg in $enableval; do
283 IFS="$lt_save_ifs"
284 if test "X$pkg" = "X$p"; then
285 enable_fast_install=yes
286 fi
287 done
288 IFS="$lt_save_ifs"
289 ;;
290 esac],
291 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
292
293 _LT_DECL([fast_install], [enable_fast_install], [0],
294 [Whether or not to optimize for fast installation])dnl
295 ])# _LT_ENABLE_FAST_INSTALL
296
297 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
298 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
299
300 # Old names:
301 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
302 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
303 AC_DIAGNOSE([obsolete],
304 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
305 the `fast-install' option into LT_INIT's first parameter.])
306 ])
307
308 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
309 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
310 AC_DIAGNOSE([obsolete],
311 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
312 the `disable-fast-install' option into LT_INIT's first parameter.])
313 ])
314
315 dnl aclocal-1.4 backwards compatibility:
316 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
317 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
318
319
320 # _LT_WITH_PIC([MODE])
321 # --------------------
322 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
323 # LT_INIT options.
324 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
325 m4_define([_LT_WITH_PIC],
326 [AC_ARG_WITH([pic],
327 [AS_HELP_STRING([--with-pic],
328 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
329 [pic_mode="$withval"],
330 [pic_mode=default])
331
332 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
333
334 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
335 ])# _LT_WITH_PIC
336
337 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
338 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
339
340 # Old name:
341 AU_DEFUN([AC_LIBTOOL_PICMODE],
342 [_LT_SET_OPTION([LT_INIT], [pic-only])
343 AC_DIAGNOSE([obsolete],
344 [$0: Remove this warning and the call to _LT_SET_OPTION when you
345 put the `pic-only' option into LT_INIT's first parameter.])
346 ])
347
348 dnl aclocal-1.4 backwards compatibility:
349 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
350
351 ## ----------------- ##
352 ## LTDL_INIT Options ##
353 ## ----------------- ##
354
355 m4_define([_LTDL_MODE], [])
356 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
357 [m4_define([_LTDL_MODE], [nonrecursive])])
358 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
359 [m4_define([_LTDL_MODE], [recursive])])
360 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
361 [m4_define([_LTDL_MODE], [subproject])])
362
363 m4_define([_LTDL_TYPE], [])
364 LT_OPTION_DEFINE([LTDL_INIT], [installable],
365 [m4_define([_LTDL_TYPE], [installable])])
366 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
367 [m4_define([_LTDL_TYPE], [convenience])])
+0
-123
m4/ltsugar.m4 less more
0 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
3 # Written by Gary V. Vaughan, 2004
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # serial 6 ltsugar.m4
10
11 # This is to help aclocal find these macros, as it can't see m4_define.
12 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
13
14
15 # lt_join(SEP, ARG1, [ARG2...])
16 # -----------------------------
17 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
18 # associated separator.
19 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
20 # versions in m4sugar had bugs.
21 m4_define([lt_join],
22 [m4_if([$#], [1], [],
23 [$#], [2], [[$2]],
24 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
25 m4_define([_lt_join],
26 [m4_if([$#$2], [2], [],
27 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
28
29
30 # lt_car(LIST)
31 # lt_cdr(LIST)
32 # ------------
33 # Manipulate m4 lists.
34 # These macros are necessary as long as will still need to support
35 # Autoconf-2.59 which quotes differently.
36 m4_define([lt_car], [[$1]])
37 m4_define([lt_cdr],
38 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
39 [$#], 1, [],
40 [m4_dquote(m4_shift($@))])])
41 m4_define([lt_unquote], $1)
42
43
44 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
45 # ------------------------------------------
46 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
47 # Note that neither SEPARATOR nor STRING are expanded; they are appended
48 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
49 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
50 # than defined and empty).
51 #
52 # This macro is needed until we can rely on Autoconf 2.62, since earlier
53 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
54 m4_define([lt_append],
55 [m4_define([$1],
56 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
57
58
59
60 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
61 # ----------------------------------------------------------
62 # Produce a SEP delimited list of all paired combinations of elements of
63 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
64 # has the form PREFIXmINFIXSUFFIXn.
65 # Needed until we can rely on m4_combine added in Autoconf 2.62.
66 m4_define([lt_combine],
67 [m4_if(m4_eval([$# > 3]), [1],
68 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
69 [[m4_foreach([_Lt_prefix], [$2],
70 [m4_foreach([_Lt_suffix],
71 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
72 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
73
74
75 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
76 # -----------------------------------------------------------------------
77 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
78 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
79 m4_define([lt_if_append_uniq],
80 [m4_ifdef([$1],
81 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
82 [lt_append([$1], [$2], [$3])$4],
83 [$5])],
84 [lt_append([$1], [$2], [$3])$4])])
85
86
87 # lt_dict_add(DICT, KEY, VALUE)
88 # -----------------------------
89 m4_define([lt_dict_add],
90 [m4_define([$1($2)], [$3])])
91
92
93 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
94 # --------------------------------------------
95 m4_define([lt_dict_add_subkey],
96 [m4_define([$1($2:$3)], [$4])])
97
98
99 # lt_dict_fetch(DICT, KEY, [SUBKEY])
100 # ----------------------------------
101 m4_define([lt_dict_fetch],
102 [m4_ifval([$3],
103 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
104 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
105
106
107 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
108 # -----------------------------------------------------------------
109 m4_define([lt_if_dict_fetch],
110 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
111 [$5],
112 [$6])])
113
114
115 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
116 # --------------------------------------------------------------
117 m4_define([lt_dict_filter],
118 [m4_if([$5], [], [],
119 [lt_join(m4_quote(m4_default([$4], [[, ]])),
120 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
121 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
122 ])
+0
-23
m4/ltversion.m4 less more
0 # ltversion.m4 -- version numbers -*- Autoconf -*-
1 #
2 # Copyright (C) 2004 Free Software Foundation, Inc.
3 # Written by Scott James Remnant, 2004
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # Generated from ltversion.in.
10
11 # serial 3017 ltversion.m4
12 # This file is part of GNU Libtool
13
14 m4_define([LT_PACKAGE_VERSION], [2.2.6b])
15 m4_define([LT_PACKAGE_REVISION], [1.3017])
16
17 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.2.6b'
19 macro_revision='1.3017'
20 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
21 _LT_DECL(, macro_revision, 0)
22 ])
+0
-92
m4/lt~obsolete.m4 less more
0 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
3 # Written by Scott James Remnant, 2004.
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # serial 4 lt~obsolete.m4
10
11 # These exist entirely to fool aclocal when bootstrapping libtool.
12 #
13 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
14 # which have later been changed to m4_define as they aren't part of the
15 # exported API, or moved to Autoconf or Automake where they belong.
16 #
17 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
18 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
19 # using a macro with the same name in our local m4/libtool.m4 it'll
20 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
21 # and doesn't know about Autoconf macros at all.)
22 #
23 # So we provide this file, which has a silly filename so it's always
24 # included after everything else. This provides aclocal with the
25 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
26 # because those macros already exist, or will be overwritten later.
27 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
28 #
29 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
30 # Yes, that means every name once taken will need to remain here until
31 # we give up compatibility with versions before 1.7, at which point
32 # we need to keep only those names which we still refer to.
33
34 # This is to help aclocal find these macros, as it can't see m4_define.
35 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
36
37 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
38 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
39 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
40 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
41 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
42 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
43 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
44 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
45 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
46 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
47 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
48 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
49 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
50 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
51 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
52 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
53 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
54 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
55 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
56 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
57 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
58 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
59 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
60 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
61 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
62 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
63 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
64 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
65 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
66 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
67 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
68 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
69 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
70 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
71 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
72 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
73 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
74 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
75 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
76 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
77 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
78 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
79 m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
80 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
81 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
82 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
83 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
84 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
85 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
87 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
88 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
89 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
91 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
0 AM_CPPFLAGS = $(MCP_CFLAGS) $(ERROR_CFLAGS)
1
2 pluginsdir = $(MISSION_CONTROL_PLUGINS_DIR)
3 plugins_LTLIBRARIES = mcp-account-manager-ring.la
4
5 mcp_account_manager_ring_la_SOURCES = \
6 mission-control-plugin.c \
7 mcp-account-manager-ring.h \
8 mcp-account-manager-ring.c
9
10 mcp_account_manager_ring_la_LIBADD = $(MCP_LIBS)
11 mcp_account_manager_ring_la_LDFLAGS = -shared -module -avoid-version
12
0 /*
1 * Copyright (C) 2012 Jolla Ltd.
2 * Contact: John Brooks <john.brooks@jollamobile.com>
3 *
4 * Based on Empathy ubuntu-online-accounts:
5 * Copyright (C) 2012 Collabora Ltd.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "config.h"
22 #include "mcp-account-manager-ring.h"
23 #include <string.h>
24
25 #define PLUGIN_NAME "ring-account"
26 #define PLUGIN_PRIORITY (MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT - 10)
27 #define PLUGIN_DESCRIPTION "Provide account for telepathy-ring"
28 #define PLUGIN_PROVIDER "im.telepathy.Account.Storage.Ring"
29
30 static void account_storage_iface_init(McpAccountStorageIface *iface);
31
32 G_DEFINE_TYPE_WITH_CODE (McpAccountManagerRing, mcp_account_manager_ring,
33 G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE,
34 account_storage_iface_init));
35
36 struct _McpAccountManagerRingPrivate
37 {
38 gchar *account_name;
39 GHashTable *params;
40 };
41
42 static void mcp_account_manager_ring_dispose(GObject *object)
43 {
44 McpAccountManagerRing *self = (McpAccountManagerRing*) object;
45
46 g_hash_table_unref(self->priv->params);
47
48 G_OBJECT_CLASS (mcp_account_manager_ring_parent_class)->dispose(object);
49 }
50
51 static void mcp_account_manager_ring_init(McpAccountManagerRing *self)
52 {
53 g_debug("MC Ring account plugin initialized");
54
55 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self, MCP_TYPE_ACCOUNT_MANAGER_RING,
56 McpAccountManagerRingPrivate);
57 self->priv->account_name = "ring/tel/account0";
58 self->priv->params = g_hash_table_new(g_str_hash, g_str_equal);
59 g_hash_table_insert(self->priv->params, g_strdup("manager"), g_strdup("ring"));
60 g_hash_table_insert(self->priv->params, g_strdup("protocol"), g_strdup("tel"));
61 g_hash_table_insert(self->priv->params, g_strdup("DisplayName"), g_strdup("Cellular"));
62 g_hash_table_insert(self->priv->params, g_strdup("Enabled"), g_strdup("true"));
63 g_hash_table_insert(self->priv->params, g_strdup("ConnectAutomatically"), g_strdup("true"));
64 g_hash_table_insert(self->priv->params, g_strdup("always_dispatch"), g_strdup("true"));
65 }
66
67 static void mcp_account_manager_ring_class_init(McpAccountManagerRingClass *klass)
68 {
69 GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
70 gobject_class->dispose = mcp_account_manager_ring_dispose;
71
72 g_type_class_add_private(gobject_class, sizeof(McpAccountManagerRingPrivate));
73 }
74
75 static GList *account_manager_ring_list(const McpAccountStorage *storage, const McpAccountManager *am)
76 {
77 McpAccountManagerRing *self = (McpAccountManagerRing*) storage;
78 GList *accounts = NULL;
79 g_debug("%s", G_STRFUNC);
80 accounts = g_list_prepend(accounts, g_strdup(self->priv->account_name));
81 return accounts;
82 }
83
84 static gboolean account_manager_ring_get(const McpAccountStorage *storage, const McpAccountManager *am,
85 const gchar *account_name, const gchar *key)
86 {
87 McpAccountManagerRing *self = (McpAccountManagerRing*) storage;
88
89 if (strcmp(account_name, self->priv->account_name))
90 return FALSE;
91
92 if (key == NULL) {
93 GHashTableIter iter;
94 gpointer itkey, value;
95 g_hash_table_iter_init(&iter, self->priv->params);
96 while (g_hash_table_iter_next(&iter, &itkey, &value)) {
97 g_debug("%s: %s, %s %s", G_STRFUNC, account_name, (char*)itkey, (char*)value);
98 mcp_account_manager_set_value(am, account_name, itkey, value);
99 }
100 } else {
101 gchar *value = g_hash_table_lookup(self->priv->params, key);
102 g_debug("%s: %s, %s %s", G_STRFUNC, account_name, (char*)key, (char*)value);
103 mcp_account_manager_set_value(am, account_name, key, value);
104 }
105
106 return TRUE;
107 }
108
109 static gboolean account_manager_ring_set(const McpAccountStorage *storage, const McpAccountManager *am,
110 const gchar *account_name, const gchar *key, const gchar *val)
111 {
112 return FALSE;
113 }
114
115 static gchar *account_manager_ring_create(const McpAccountStorage *storage, const McpAccountManager *am,
116 const gchar *cm_name, const gchar *protocol_name, GHashTable *params, GError **error)
117 {
118 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Ring account manager cannot create accounts");
119 return NULL;
120 }
121
122 static gboolean account_manager_ring_delete(const McpAccountStorage *storage, const McpAccountManager *am,
123 const gchar *account_name, const gchar *key)
124 {
125 g_debug("%s: %s, %s", G_STRFUNC, account_name, key);
126 return FALSE;
127 }
128
129 static gboolean account_manager_ring_commit(const McpAccountStorage *storage, const McpAccountManager *am)
130 {
131 g_debug("%s", G_STRFUNC);
132 return FALSE;
133 }
134
135 static void account_manager_ring_get_identifier(const McpAccountStorage *storage, const gchar *account_name,
136 GValue *identifier)
137 {
138 McpAccountManagerRing *self = (McpAccountManagerRing*) storage;
139
140 if (strcmp(account_name, self->priv->account_name))
141 return;
142
143 g_debug("%s: %s", G_STRFUNC, account_name);
144 g_value_init(identifier, G_TYPE_UINT);
145 g_value_set_uint(identifier, 0);
146 }
147
148 static guint account_manager_ring_get_restrictions(const McpAccountStorage *storage, const gchar *account_name)
149 {
150 McpAccountManagerRing *self = (McpAccountManagerRing*) storage;
151
152 if (strcmp(account_name, self->priv->account_name))
153 return G_MAXUINT;
154
155 return TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS |
156 TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED |
157 TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PRESENCE |
158 TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_SERVICE;
159 }
160
161 static void account_storage_iface_init(McpAccountStorageIface *iface)
162 {
163 mcp_account_storage_iface_set_name(iface, PLUGIN_NAME);
164 mcp_account_storage_iface_set_desc(iface, PLUGIN_DESCRIPTION);
165 mcp_account_storage_iface_set_priority(iface, PLUGIN_PRIORITY);
166 mcp_account_storage_iface_set_provider(iface, PLUGIN_PROVIDER);
167
168 #define IMPLEMENT(x) mcp_account_storage_iface_implement_##x(iface, account_manager_ring_##x)
169 IMPLEMENT (get);
170 IMPLEMENT (list);
171 IMPLEMENT (set);
172 IMPLEMENT (create);
173 IMPLEMENT (delete);
174 IMPLEMENT (commit);
175 IMPLEMENT (get_identifier);
176 IMPLEMENT (get_restrictions);
177 #undef IMPLEMENT
178 }
179
180 McpAccountManagerRing *mcp_account_manager_ring_new(void)
181 {
182 return g_object_new(MCP_TYPE_ACCOUNT_MANAGER_RING, NULL);
183 }
184
0 #ifndef __MCP_ACCOUNT_MANAGER_RING_H__
1 #define __MCP_ACCOUNT_MANAGER_RING_H__
2
3 #include <mission-control-plugins/mission-control-plugins.h>
4
5 G_BEGIN_DECLS
6
7 #define MCP_TYPE_ACCOUNT_MANAGER_RING \
8 (mcp_account_manager_ring_get_type ())
9 #define MCP_ACCOUNT_MANAGER_RING(o) \
10 (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_MANAGER_RING, \
11 McpAccountManagerUoa))
12
13 #define MCP_ACCOUNT_MANAGER_RING_CLASS(k) \
14 (G_TYPE_CHECK_CLASS_CAST((k), MCP_TYPE_ACCOUNT_MANAGER_RING, \
15 McpAccountManagerRingClass))
16
17 #define MCP_IS_ACCOUNT_MANAGER_RING(o) \
18 (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_MANAGER_RING))
19
20 #define MCP_IS_ACCOUNT_MANAGER_RING_CLASS(k) \
21 (G_TYPE_CHECK_CLASS_TYPE ((k), MCP_TYPE_ACCOUNT_MANAGER_RING))
22
23 #define MCP_ACCOUNT_MANAGER_RING_GET_CLASS(o) \
24 (G_TYPE_INSTANCE_GET_CLASS ((o), MCP_TYPE_ACCOUNT_MANAGER_RING, \
25 McpAccountManagerRingClass))
26
27 typedef struct _McpAccountManagerRingPrivate McpAccountManagerRingPrivate;
28
29 typedef struct {
30 GObject parent;
31
32 McpAccountManagerRingPrivate *priv;
33 } _McpAccountManagerRing;
34
35 typedef struct {
36 GObjectClass parent_class;
37 } _McpAccountManagerRingClass;
38
39 typedef _McpAccountManagerRing McpAccountManagerRing;
40 typedef _McpAccountManagerRingClass McpAccountManagerRingClass;
41
42 GType mcp_account_manager_ring_get_type (void) G_GNUC_CONST;
43
44 McpAccountManagerRing *mcp_account_manager_ring_new (void);
45
46 G_END_DECLS
47
48 #endif
0 /*
1 * Copyright (C) 2012 Jolla Ltd.
2 * Contact: John Brooks <john.brooks@jollamobile.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <mission-control-plugins/mission-control-plugins.h>
19 #include "mcp-account-manager-ring.h"
20
21 GObject *
22 mcp_plugin_ref_nth_object (guint n)
23 {
24 static void *plugin_0 = NULL;
25
26 switch (n)
27 {
28 case 0:
29 if (plugin_0 == NULL)
30 plugin_0 = g_object_new (MCP_TYPE_ACCOUNT_MANAGER_RING, NULL);
31 else
32 g_object_ref (plugin_0);
33
34 return plugin_0;
35
36 default:
37 return NULL;
38 }
39 }
40
+0
-376
missing less more
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
6 # 2008, 2009 Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 if test $# -eq 0; then
28 echo 1>&2 "Try \`$0 --help' for more information"
29 exit 1
30 fi
31
32 run=:
33 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
34 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
35
36 # In the cases where this matters, `missing' is being run in the
37 # srcdir already.
38 if test -f configure.ac; then
39 configure_ac=configure.ac
40 else
41 configure_ac=configure.in
42 fi
43
44 msg="missing on your system"
45
46 case $1 in
47 --run)
48 # Try to run requested program, and just exit if it succeeds.
49 run=
50 shift
51 "$@" && exit 0
52 # Exit code 63 means version mismatch. This often happens
53 # when the user try to use an ancient version of a tool on
54 # a file that requires a minimum version. In this case we
55 # we should proceed has if the program had been absent, or
56 # if --run hadn't been passed.
57 if test $? = 63; then
58 run=:
59 msg="probably too old"
60 fi
61 ;;
62
63 -h|--h|--he|--hel|--help)
64 echo "\
65 $0 [OPTION]... PROGRAM [ARGUMENT]...
66
67 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
68 error status if there is no known handling for PROGRAM.
69
70 Options:
71 -h, --help display this help and exit
72 -v, --version output version information and exit
73 --run try to run the given command, and emulate it if it fails
74
75 Supported PROGRAM values:
76 aclocal touch file \`aclocal.m4'
77 autoconf touch file \`configure'
78 autoheader touch file \`config.h.in'
79 autom4te touch the output file, or create a stub one
80 automake touch all \`Makefile.in' files
81 bison create \`y.tab.[ch]', if possible, from existing .[ch]
82 flex create \`lex.yy.c', if possible, from existing .c
83 help2man touch the output file
84 lex create \`lex.yy.c', if possible, from existing .c
85 makeinfo touch the output file
86 tar try tar, gnutar, gtar, then tar without non-portable flags
87 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
88
89 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
90 \`g' are ignored when checking the name.
91
92 Send bug reports to <bug-automake@gnu.org>."
93 exit $?
94 ;;
95
96 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
97 echo "missing $scriptversion (GNU Automake)"
98 exit $?
99 ;;
100
101 -*)
102 echo 1>&2 "$0: Unknown \`$1' option"
103 echo 1>&2 "Try \`$0 --help' for more information"
104 exit 1
105 ;;
106
107 esac
108
109 # normalize program name to check for.
110 program=`echo "$1" | sed '
111 s/^gnu-//; t
112 s/^gnu//; t
113 s/^g//; t'`
114
115 # Now exit if we have it, but it failed. Also exit now if we
116 # don't have it and --version was passed (most likely to detect
117 # the program). This is about non-GNU programs, so use $1 not
118 # $program.
119 case $1 in
120 lex*|yacc*)
121 # Not GNU programs, they don't have --version.
122 ;;
123
124 tar*)
125 if test -n "$run"; then
126 echo 1>&2 "ERROR: \`tar' requires --run"
127 exit 1
128 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
129 exit 1
130 fi
131 ;;
132
133 *)
134 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
135 # We have it, but it failed.
136 exit 1
137 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
138 # Could not run --version or --help. This is probably someone
139 # running `$TOOL --version' or `$TOOL --help' to check whether
140 # $TOOL exists and not knowing $TOOL uses missing.
141 exit 1
142 fi
143 ;;
144 esac
145
146 # If it does not exist, or fails to run (possibly an outdated version),
147 # try to emulate it.
148 case $program in
149 aclocal*)
150 echo 1>&2 "\
151 WARNING: \`$1' is $msg. You should only need it if
152 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
153 to install the \`Automake' and \`Perl' packages. Grab them from
154 any GNU archive site."
155 touch aclocal.m4
156 ;;
157
158 autoconf*)
159 echo 1>&2 "\
160 WARNING: \`$1' is $msg. You should only need it if
161 you modified \`${configure_ac}'. You might want to install the
162 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
163 archive site."
164 touch configure
165 ;;
166
167 autoheader*)
168 echo 1>&2 "\
169 WARNING: \`$1' is $msg. You should only need it if
170 you modified \`acconfig.h' or \`${configure_ac}'. You might want
171 to install the \`Autoconf' and \`GNU m4' packages. Grab them
172 from any GNU archive site."
173 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
174 test -z "$files" && files="config.h"
175 touch_files=
176 for f in $files; do
177 case $f in
178 *:*) touch_files="$touch_files "`echo "$f" |
179 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
180 *) touch_files="$touch_files $f.in";;
181 esac
182 done
183 touch $touch_files
184 ;;
185
186 automake*)
187 echo 1>&2 "\
188 WARNING: \`$1' is $msg. You should only need it if
189 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
190 You might want to install the \`Automake' and \`Perl' packages.
191 Grab them from any GNU archive site."
192 find . -type f -name Makefile.am -print |
193 sed 's/\.am$/.in/' |
194 while read f; do touch "$f"; done
195 ;;
196
197 autom4te*)
198 echo 1>&2 "\
199 WARNING: \`$1' is needed, but is $msg.
200 You might have modified some files without having the
201 proper tools for further handling them.
202 You can get \`$1' as part of \`Autoconf' from any GNU
203 archive site."
204
205 file=`echo "$*" | sed -n "$sed_output"`
206 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
207 if test -f "$file"; then
208 touch $file
209 else
210 test -z "$file" || exec >$file
211 echo "#! /bin/sh"
212 echo "# Created by GNU Automake missing as a replacement of"
213 echo "# $ $@"
214 echo "exit 0"
215 chmod +x $file
216 exit 1
217 fi
218 ;;
219
220 bison*|yacc*)
221 echo 1>&2 "\
222 WARNING: \`$1' $msg. You should only need it if
223 you modified a \`.y' file. You may need the \`Bison' package
224 in order for those modifications to take effect. You can get
225 \`Bison' from any GNU archive site."
226 rm -f y.tab.c y.tab.h
227 if test $# -ne 1; then
228 eval LASTARG="\${$#}"
229 case $LASTARG in
230 *.y)
231 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
232 if test -f "$SRCFILE"; then
233 cp "$SRCFILE" y.tab.c
234 fi
235 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
236 if test -f "$SRCFILE"; then
237 cp "$SRCFILE" y.tab.h
238 fi
239 ;;
240 esac
241 fi
242 if test ! -f y.tab.h; then
243 echo >y.tab.h
244 fi
245 if test ! -f y.tab.c; then
246 echo 'main() { return 0; }' >y.tab.c
247 fi
248 ;;
249
250 lex*|flex*)
251 echo 1>&2 "\
252 WARNING: \`$1' is $msg. You should only need it if
253 you modified a \`.l' file. You may need the \`Flex' package
254 in order for those modifications to take effect. You can get
255 \`Flex' from any GNU archive site."
256 rm -f lex.yy.c
257 if test $# -ne 1; then
258 eval LASTARG="\${$#}"
259 case $LASTARG in
260 *.l)
261 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
262 if test -f "$SRCFILE"; then
263 cp "$SRCFILE" lex.yy.c
264 fi
265 ;;
266 esac
267 fi
268 if test ! -f lex.yy.c; then
269 echo 'main() { return 0; }' >lex.yy.c
270 fi
271 ;;
272
273 help2man*)
274 echo 1>&2 "\
275 WARNING: \`$1' is $msg. You should only need it if
276 you modified a dependency of a manual page. You may need the
277 \`Help2man' package in order for those modifications to take
278 effect. You can get \`Help2man' from any GNU archive site."
279
280 file=`echo "$*" | sed -n "$sed_output"`
281 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
282 if test -f "$file"; then
283 touch $file
284 else
285 test -z "$file" || exec >$file
286 echo ".ab help2man is required to generate this page"
287 exit $?
288 fi
289 ;;
290
291 makeinfo*)
292 echo 1>&2 "\
293 WARNING: \`$1' is $msg. You should only need it if
294 you modified a \`.texi' or \`.texinfo' file, or any other file
295 indirectly affecting the aspect of the manual. The spurious
296 call might also be the consequence of using a buggy \`make' (AIX,
297 DU, IRIX). You might want to install the \`Texinfo' package or
298 the \`GNU make' package. Grab either from any GNU archive site."
299 # The file to touch is that specified with -o ...
300 file=`echo "$*" | sed -n "$sed_output"`
301 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
302 if test -z "$file"; then
303 # ... or it is the one specified with @setfilename ...
304 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
305 file=`sed -n '
306 /^@setfilename/{
307 s/.* \([^ ]*\) *$/\1/
308 p
309 q
310 }' $infile`
311 # ... or it is derived from the source name (dir/f.texi becomes f.info)
312 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
313 fi
314 # If the file does not exist, the user really needs makeinfo;
315 # let's fail without touching anything.
316 test -f $file || exit 1
317 touch $file
318 ;;
319
320 tar*)
321 shift
322
323 # We have already tried tar in the generic part.
324 # Look for gnutar/gtar before invocation to avoid ugly error
325 # messages.
326 if (gnutar --version > /dev/null 2>&1); then
327 gnutar "$@" && exit 0
328 fi
329 if (gtar --version > /dev/null 2>&1); then
330 gtar "$@" && exit 0
331 fi
332 firstarg="$1"
333 if shift; then
334 case $firstarg in
335 *o*)
336 firstarg=`echo "$firstarg" | sed s/o//`
337 tar "$firstarg" "$@" && exit 0
338 ;;
339 esac
340 case $firstarg in
341 *h*)
342 firstarg=`echo "$firstarg" | sed s/h//`
343 tar "$firstarg" "$@" && exit 0
344 ;;
345 esac
346 fi
347
348 echo 1>&2 "\
349 WARNING: I can't seem to be able to run \`tar' with the given arguments.
350 You may want to install GNU tar or Free paxutils, or check the
351 command line arguments."
352 exit 1
353 ;;
354
355 *)
356 echo 1>&2 "\
357 WARNING: \`$1' is needed, and is $msg.
358 You might have modified some files without having the
359 proper tools for further handling them. Check the \`README' file,
360 it often tells you about the needed prerequisites for installing
361 this package. You may also peek at any GNU archive site, in case
362 some other package would contain this missing \`$1' program."
363 exit 1
364 ;;
365 esac
366
367 exit 0
368
369 # Local variables:
370 # eval: (add-hook 'write-file-hooks 'time-stamp)
371 # time-stamp-start: "scriptversion="
372 # time-stamp-format: "%:y-%02m-%02d.%02H"
373 # time-stamp-time-zone: "UTC"
374 # time-stamp-end: "; # UTC"
375 # End:
1515
1616 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/modem
1717
18 AM_LDFLAGS =
18 AM_LDFLAGS = -static
1919
2020 LIBADD = @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ @UUID_LIBS@
2121
4343
4444 libmodem_glib_la_SOURCES += call-service.c call.c tones.c
4545
46 modem_HEADERS += sms.h
46 modem_HEADERS += sms.h sms-message.h sms-history.h
4747
48 libmodem_glib_la_SOURCES += sms-service.c
48 libmodem_glib_la_SOURCES += sms-service.c sms-message.c sms-history.c
4949
5050 modem_HEADERS += sim.h
5151
5252 libmodem_glib_la_SOURCES += sim-service.c
53
54 modem_HEADERS += radio-settings.h
55
56 libmodem_glib_la_SOURCES += radio-settings.c
5357
5458 # ----------------------------------------------------------------------
5559
7579 # -----------------------------------------------------------------------------
7680
7781 # include Makefile-tests.am
78
79 noinst_LTLIBRARIES += libtest-modem-sms.la
80
81 libtest_modem_sms_la_SOURCES = \
82 $(nodist_libmodem_sms_glib_la_SOURCES)
83
84 libtest_modem_sms_la_LIBADD = libmodem-glib.la
+0
-833
modem/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 #
18 # Makefile.am for modem libraries
19 #
20 # Copyright (C) 2007 Nokia Corporation
21 # Contact: Pekka Pessi <first.surname@nokia.com>
22 # See file COPYING.
23 #
24
25
26 VPATH = @srcdir@
27 pkgdatadir = $(datadir)/@PACKAGE@
28 pkgincludedir = $(includedir)/@PACKAGE@
29 pkglibdir = $(libdir)/@PACKAGE@
30 pkglibexecdir = $(libexecdir)/@PACKAGE@
31 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
32 install_sh_DATA = $(install_sh) -c -m 644
33 install_sh_PROGRAM = $(install_sh) -c
34 install_sh_SCRIPT = $(install_sh) -c
35 INSTALL_HEADER = $(INSTALL_DATA)
36 transform = $(program_transform_name)
37 NORMAL_INSTALL = :
38 PRE_INSTALL = :
39 POST_INSTALL = :
40 NORMAL_UNINSTALL = :
41 PRE_UNINSTALL = :
42 POST_UNINSTALL = :
43 build_triplet = @build@
44 host_triplet = @host@
45 subdir = modem
46 DIST_COMMON = $(modem_HEADERS) $(srcdir)/Makefile.am \
47 $(srcdir)/Makefile.in
48 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
49 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
53 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55 mkinstalldirs = $(install_sh) -d
56 CONFIG_HEADER = $(top_builddir)/config.h
57 CONFIG_CLEAN_FILES =
58 CONFIG_CLEAN_VPATH_FILES =
59 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
60 am__vpath_adj = case $$p in \
61 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
62 *) f=$$p;; \
63 esac;
64 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
65 am__install_max = 40
66 am__nobase_strip_setup = \
67 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
68 am__nobase_strip = \
69 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
70 am__nobase_list = $(am__nobase_strip_setup); \
71 for p in $$list; do echo "$$p $$p"; done | \
72 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
73 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
74 if (++n[$$2] == $(am__install_max)) \
75 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
76 END { for (dir in files) print dir, files[dir] }'
77 am__base_list = \
78 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
79 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
80 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(modemdir)"
81 LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
82 am__DEPENDENCIES_1 =
83 libmodem_glib_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
84 am_libmodem_glib_la_OBJECTS = request.lo ofono.lo errors.lo oface.lo \
85 service.lo modem.lo debug.lo call-service.lo call.lo tones.lo \
86 sms-service.lo sim-service.lo
87 am__objects_1 = signals-marshal.lo
88 nodist_libmodem_glib_la_OBJECTS = $(am__objects_1)
89 libmodem_glib_la_OBJECTS = $(am_libmodem_glib_la_OBJECTS) \
90 $(nodist_libmodem_glib_la_OBJECTS)
91 AM_V_lt = $(am__v_lt_$(V))
92 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
93 am__v_lt_0 = --silent
94 libtest_modem_sms_la_DEPENDENCIES = libmodem-glib.la
95 am_libtest_modem_sms_la_OBJECTS =
96 libtest_modem_sms_la_OBJECTS = $(am_libtest_modem_sms_la_OBJECTS)
97 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
98 depcomp = $(SHELL) $(top_srcdir)/depcomp
99 am__depfiles_maybe = depfiles
100 am__mv = mv -f
101 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
102 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
103 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
104 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
105 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
106 $(AM_CFLAGS) $(CFLAGS)
107 AM_V_CC = $(am__v_CC_$(V))
108 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
109 am__v_CC_0 = @echo " CC " $@;
110 AM_V_at = $(am__v_at_$(V))
111 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
112 am__v_at_0 = @
113 CCLD = $(CC)
114 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
115 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
116 $(AM_LDFLAGS) $(LDFLAGS) -o $@
117 AM_V_CCLD = $(am__v_CCLD_$(V))
118 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
119 am__v_CCLD_0 = @echo " CCLD " $@;
120 AM_V_GEN = $(am__v_GEN_$(V))
121 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
122 am__v_GEN_0 = @echo " GEN " $@;
123 SOURCES = $(libmodem_glib_la_SOURCES) \
124 $(nodist_libmodem_glib_la_SOURCES) \
125 $(libtest_modem_sms_la_SOURCES)
126 DIST_SOURCES = $(libmodem_glib_la_SOURCES) \
127 $(libtest_modem_sms_la_SOURCES)
128 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
129 html-recursive info-recursive install-data-recursive \
130 install-dvi-recursive install-exec-recursive \
131 install-html-recursive install-info-recursive \
132 install-pdf-recursive install-ps-recursive install-recursive \
133 installcheck-recursive installdirs-recursive pdf-recursive \
134 ps-recursive uninstall-recursive
135 HEADERS = $(modem_HEADERS)
136 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
137 distclean-recursive maintainer-clean-recursive
138 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
139 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
140 distdir
141 ETAGS = etags
142 CTAGS = ctags
143 DIST_SUBDIRS = $(SUBDIRS)
144 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
145 am__relativize = \
146 dir0=`pwd`; \
147 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
148 sed_rest='s,^[^/]*/*,,'; \
149 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
150 sed_butlast='s,/*[^/]*$$,,'; \
151 while test -n "$$dir1"; do \
152 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
153 if test "$$first" != "."; then \
154 if test "$$first" = ".."; then \
155 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
156 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
157 else \
158 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
159 if test "$$first2" = "$$first"; then \
160 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
161 else \
162 dir2="../$$dir2"; \
163 fi; \
164 dir0="$$dir0"/"$$first"; \
165 fi; \
166 fi; \
167 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
168 done; \
169 reldir="$$dir2"
170 ACLOCAL = @ACLOCAL@
171 AMTAR = @AMTAR@
172 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
173 AR = @AR@
174 AUTOCONF = @AUTOCONF@
175 AUTOHEADER = @AUTOHEADER@
176 AUTOMAKE = @AUTOMAKE@
177 AWK = @AWK@
178 CC = @CC@
179 CCDEPMODE = @CCDEPMODE@
180 CFLAGS = @CFLAGS@
181 CHECK_CFLAGS = @CHECK_CFLAGS@
182 CHECK_LIBS = @CHECK_LIBS@
183 CPP = @CPP@
184 CPPFLAGS = @CPPFLAGS@
185 CYGPATH_W = @CYGPATH_W@
186 DATADIR = @DATADIR@
187 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
188 DBUS_CFLAGS = @DBUS_CFLAGS@
189 DBUS_LIBS = @DBUS_LIBS@
190 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
191 DEFS = @DEFS@
192 DEPDIR = @DEPDIR@
193 DSYMUTIL = @DSYMUTIL@
194 DUMPBIN = @DUMPBIN@
195 ECHO_C = @ECHO_C@
196 ECHO_N = @ECHO_N@
197 ECHO_T = @ECHO_T@
198 EGREP = @EGREP@
199 ERROR_CFLAGS = @ERROR_CFLAGS@
200 EXEEXT = @EXEEXT@
201 FGREP = @FGREP@
202 GLIB_CFLAGS = @GLIB_CFLAGS@
203 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
204 GLIB_LIBS = @GLIB_LIBS@
205 GREP = @GREP@
206 INSTALL = @INSTALL@
207 INSTALL_DATA = @INSTALL_DATA@
208 INSTALL_PROGRAM = @INSTALL_PROGRAM@
209 INSTALL_SCRIPT = @INSTALL_SCRIPT@
210 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
211 LD = @LD@
212 LDFLAGS = @LDFLAGS@
213 LIBOBJS = @LIBOBJS@
214 LIBS = @LIBS@
215 LIBTOOL = @LIBTOOL@
216 LIPO = @LIPO@
217 LN_S = @LN_S@
218 LTLIBOBJS = @LTLIBOBJS@
219 MAINT = @MAINT@
220 MAKEINFO = @MAKEINFO@
221 MKDIR_P = @MKDIR_P@
222 NM = @NM@
223 NMEDIT = @NMEDIT@
224 OBJDUMP = @OBJDUMP@
225 OBJEXT = @OBJEXT@
226 OTOOL = @OTOOL@
227 OTOOL64 = @OTOOL64@
228 PACKAGE = @PACKAGE@
229 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
230 PACKAGE_NAME = @PACKAGE_NAME@
231 PACKAGE_STRING = @PACKAGE_STRING@
232 PACKAGE_TARNAME = @PACKAGE_TARNAME@
233 PACKAGE_URL = @PACKAGE_URL@
234 PACKAGE_VERSION = @PACKAGE_VERSION@
235 PATH_SEPARATOR = @PATH_SEPARATOR@
236 PKG_CONFIG = @PKG_CONFIG@
237 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
238 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
239 PYTHON = @PYTHON@
240 RANLIB = @RANLIB@
241 SED = @SED@
242 SET_MAKE = @SET_MAKE@
243 SHELL = @SHELL@
244 STRIP = @STRIP@
245 TP_CFLAGS = @TP_CFLAGS@
246 TP_LIBS = @TP_LIBS@
247 UUID_CFLAGS = @UUID_CFLAGS@
248 UUID_LIBS = @UUID_LIBS@
249 VERSION = @VERSION@
250 XSLTPROC = @XSLTPROC@
251 abs_builddir = @abs_builddir@
252 abs_srcdir = @abs_srcdir@
253 abs_top_builddir = @abs_top_builddir@
254 abs_top_srcdir = @abs_top_srcdir@
255 ac_ct_CC = @ac_ct_CC@
256 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
257 am__include = @am__include@
258 am__leading_dot = @am__leading_dot@
259 am__quote = @am__quote@
260 am__tar = @am__tar@
261 am__untar = @am__untar@
262 bindir = @bindir@
263 build = @build@
264 build_alias = @build_alias@
265 build_cpu = @build_cpu@
266 build_os = @build_os@
267 build_vendor = @build_vendor@
268 builddir = @builddir@
269 datadir = @datadir@
270 datarootdir = @datarootdir@
271 docdir = @docdir@
272 dvidir = @dvidir@
273 exec_prefix = @exec_prefix@
274 host = @host@
275 host_alias = @host_alias@
276 host_cpu = @host_cpu@
277 host_os = @host_os@
278 host_vendor = @host_vendor@
279 htmldir = @htmldir@
280 includedir = @includedir@
281 includemodemdir = @includemodemdir@
282 includesmsdir = @includesmsdir@
283 infodir = @infodir@
284 install_sh = @install_sh@
285 libdir = @libdir@
286 libexecdir = @libexecdir@
287 localedir = @localedir@
288 localstatedir = @localstatedir@
289 lt_ECHO = @lt_ECHO@
290 mandir = @mandir@
291 mkdir_p = @mkdir_p@
292 oldincludedir = @oldincludedir@
293 pdfdir = @pdfdir@
294 prefix = @prefix@
295 program_transform_name = @program_transform_name@
296 psdir = @psdir@
297 sbindir = @sbindir@
298 sharedstatedir = @sharedstatedir@
299 srcdir = @srcdir@
300 sysconfdir = @sysconfdir@
301 target_alias = @target_alias@
302 testdir = @testdir@
303 top_build_prefix = @top_build_prefix@
304 top_builddir = @top_builddir@
305 top_srcdir = @top_srcdir@
306 SUBDIRS = . tests
307
308 # -----------------------------------------------------------------------------
309 # Headers and libraries
310 AM_CFLAGS = $(ERROR_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ @TP_CFLAGS@ \
311 @UUID_CFLAGS@
312
313 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/modem
314 AM_LDFLAGS =
315 LIBADD = @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ @UUID_LIBS@
316
317 # Build targets
318 lib_LTLIBRARIES = \
319 libmodem-glib.la
320
321
322 # -----------------------------------------------------------------------------
323
324 #pkgconfigdir = $(libdir)/pkgconfig
325 #pkgconfig_DATA = modem.pc
326
327 # -----------------------------------------------------------------------------
328
329 # include Makefile-tests.am
330 noinst_LTLIBRARIES = libtest-modem-sms.la
331 modemdir = ${includemodemdir}/modem
332 modem_HEADERS = request.h errors.h call.h tones.h sms.h sim.h
333 libmodem_glib_la_SOURCES = request.c request-private.h ofono.h ofono.c \
334 errors.c oface.h oface.c service.c service.h modem.c modem.h \
335 debug.h debug.c call-service.c call.c tones.c sms-service.c \
336 sim-service.c
337 nodist_libmodem_glib_la_SOURCES = $(BUILT_SOURCES)
338 libmodem_glib_la_LIBADD = ${LIBADD}
339
340 # ----------------------------------------------------------------------
341 EXTRA_DIST = signals-marshal.list
342 BUILT_SOURCES = \
343 signals-marshal.h \
344 signals-marshal.c
345
346 CLEANFILES = ${BUILT_SOURCES}
347 libtest_modem_sms_la_SOURCES = \
348 $(nodist_libmodem_sms_glib_la_SOURCES)
349
350 libtest_modem_sms_la_LIBADD = libmodem-glib.la
351 all: $(BUILT_SOURCES)
352 $(MAKE) $(AM_MAKEFLAGS) all-recursive
353
354 .SUFFIXES:
355 .SUFFIXES: .c .lo .o .obj
356 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
357 @for dep in $?; do \
358 case '$(am__configure_deps)' in \
359 *$$dep*) \
360 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
361 && { if test -f $@; then exit 0; else break; fi; }; \
362 exit 1;; \
363 esac; \
364 done; \
365 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modem/Makefile'; \
366 $(am__cd) $(top_srcdir) && \
367 $(AUTOMAKE) --foreign modem/Makefile
368 .PRECIOUS: Makefile
369 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
370 @case '$?' in \
371 *config.status*) \
372 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
373 *) \
374 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
375 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
376 esac;
377
378 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
379 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
380
381 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
382 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
383 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385 $(am__aclocal_m4_deps):
386 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
387 @$(NORMAL_INSTALL)
388 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
389 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
390 list2=; for p in $$list; do \
391 if test -f $$p; then \
392 list2="$$list2 $$p"; \
393 else :; fi; \
394 done; \
395 test -z "$$list2" || { \
396 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
397 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
398 }
399
400 uninstall-libLTLIBRARIES:
401 @$(NORMAL_UNINSTALL)
402 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
403 for p in $$list; do \
404 $(am__strip_dir) \
405 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
406 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
407 done
408
409 clean-libLTLIBRARIES:
410 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
411 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
412 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
413 test "$$dir" != "$$p" || dir=.; \
414 echo "rm -f \"$${dir}/so_locations\""; \
415 rm -f "$${dir}/so_locations"; \
416 done
417
418 clean-noinstLTLIBRARIES:
419 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
420 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
421 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
422 test "$$dir" != "$$p" || dir=.; \
423 echo "rm -f \"$${dir}/so_locations\""; \
424 rm -f "$${dir}/so_locations"; \
425 done
426 libmodem-glib.la: $(libmodem_glib_la_OBJECTS) $(libmodem_glib_la_DEPENDENCIES)
427 $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libmodem_glib_la_OBJECTS) $(libmodem_glib_la_LIBADD) $(LIBS)
428 libtest-modem-sms.la: $(libtest_modem_sms_la_OBJECTS) $(libtest_modem_sms_la_DEPENDENCIES)
429 $(AM_V_CCLD)$(LINK) $(libtest_modem_sms_la_OBJECTS) $(libtest_modem_sms_la_LIBADD) $(LIBS)
430
431 mostlyclean-compile:
432 -rm -f *.$(OBJEXT)
433
434 distclean-compile:
435 -rm -f *.tab.c
436
437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-service.Plo@am__quote@
438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call.Plo@am__quote@
439 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@
440 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Plo@am__quote@
441 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem.Plo@am__quote@
442 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oface.Plo@am__quote@
443 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ofono.Plo@am__quote@
444 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Plo@am__quote@
445 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@
446 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals-marshal.Plo@am__quote@
447 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sim-service.Plo@am__quote@
448 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sms-service.Plo@am__quote@
449 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tones.Plo@am__quote@
450
451 .c.o:
452 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
453 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
454 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
455 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
456 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
457 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
458
459 .c.obj:
460 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
461 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
462 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
463 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
464 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
465 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
466
467 .c.lo:
468 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
469 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
470 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
471 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
472 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
473 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
474
475 mostlyclean-libtool:
476 -rm -f *.lo
477
478 clean-libtool:
479 -rm -rf .libs _libs
480 install-modemHEADERS: $(modem_HEADERS)
481 @$(NORMAL_INSTALL)
482 test -z "$(modemdir)" || $(MKDIR_P) "$(DESTDIR)$(modemdir)"
483 @list='$(modem_HEADERS)'; test -n "$(modemdir)" || list=; \
484 for p in $$list; do \
485 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
486 echo "$$d$$p"; \
487 done | $(am__base_list) | \
488 while read files; do \
489 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(modemdir)'"; \
490 $(INSTALL_HEADER) $$files "$(DESTDIR)$(modemdir)" || exit $$?; \
491 done
492
493 uninstall-modemHEADERS:
494 @$(NORMAL_UNINSTALL)
495 @list='$(modem_HEADERS)'; test -n "$(modemdir)" || list=; \
496 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
497 test -n "$$files" || exit 0; \
498 echo " ( cd '$(DESTDIR)$(modemdir)' && rm -f" $$files ")"; \
499 cd "$(DESTDIR)$(modemdir)" && rm -f $$files
500
501 # This directory's subdirectories are mostly independent; you can cd
502 # into them and run `make' without going through this Makefile.
503 # To change the values of `make' variables: instead of editing Makefiles,
504 # (1) if the variable is set in `config.status', edit `config.status'
505 # (which will cause the Makefiles to be regenerated when you run `make');
506 # (2) otherwise, pass the desired values on the `make' command line.
507 $(RECURSIVE_TARGETS):
508 @fail= failcom='exit 1'; \
509 for f in x $$MAKEFLAGS; do \
510 case $$f in \
511 *=* | --[!k]*);; \
512 *k*) failcom='fail=yes';; \
513 esac; \
514 done; \
515 dot_seen=no; \
516 target=`echo $@ | sed s/-recursive//`; \
517 list='$(SUBDIRS)'; for subdir in $$list; do \
518 echo "Making $$target in $$subdir"; \
519 if test "$$subdir" = "."; then \
520 dot_seen=yes; \
521 local_target="$$target-am"; \
522 else \
523 local_target="$$target"; \
524 fi; \
525 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
526 || eval $$failcom; \
527 done; \
528 if test "$$dot_seen" = "no"; then \
529 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
530 fi; test -z "$$fail"
531
532 $(RECURSIVE_CLEAN_TARGETS):
533 @fail= failcom='exit 1'; \
534 for f in x $$MAKEFLAGS; do \
535 case $$f in \
536 *=* | --[!k]*);; \
537 *k*) failcom='fail=yes';; \
538 esac; \
539 done; \
540 dot_seen=no; \
541 case "$@" in \
542 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
543 *) list='$(SUBDIRS)' ;; \
544 esac; \
545 rev=''; for subdir in $$list; do \
546 if test "$$subdir" = "."; then :; else \
547 rev="$$subdir $$rev"; \
548 fi; \
549 done; \
550 rev="$$rev ."; \
551 target=`echo $@ | sed s/-recursive//`; \
552 for subdir in $$rev; do \
553 echo "Making $$target in $$subdir"; \
554 if test "$$subdir" = "."; then \
555 local_target="$$target-am"; \
556 else \
557 local_target="$$target"; \
558 fi; \
559 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
560 || eval $$failcom; \
561 done && test -z "$$fail"
562 tags-recursive:
563 list='$(SUBDIRS)'; for subdir in $$list; do \
564 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
565 done
566 ctags-recursive:
567 list='$(SUBDIRS)'; for subdir in $$list; do \
568 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
569 done
570
571 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
572 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
573 unique=`for i in $$list; do \
574 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
575 done | \
576 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
577 END { if (nonempty) { for (i in files) print i; }; }'`; \
578 mkid -fID $$unique
579 tags: TAGS
580
581 TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
582 $(TAGS_FILES) $(LISP)
583 set x; \
584 here=`pwd`; \
585 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
586 include_option=--etags-include; \
587 empty_fix=.; \
588 else \
589 include_option=--include; \
590 empty_fix=; \
591 fi; \
592 list='$(SUBDIRS)'; for subdir in $$list; do \
593 if test "$$subdir" = .; then :; else \
594 test ! -f $$subdir/TAGS || \
595 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
596 fi; \
597 done; \
598 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
599 unique=`for i in $$list; do \
600 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
601 done | \
602 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
603 END { if (nonempty) { for (i in files) print i; }; }'`; \
604 shift; \
605 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
606 test -n "$$unique" || unique=$$empty_fix; \
607 if test $$# -gt 0; then \
608 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
609 "$$@" $$unique; \
610 else \
611 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
612 $$unique; \
613 fi; \
614 fi
615 ctags: CTAGS
616 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
617 $(TAGS_FILES) $(LISP)
618 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
619 unique=`for i in $$list; do \
620 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
621 done | \
622 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
623 END { if (nonempty) { for (i in files) print i; }; }'`; \
624 test -z "$(CTAGS_ARGS)$$unique" \
625 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
626 $$unique
627
628 GTAGS:
629 here=`$(am__cd) $(top_builddir) && pwd` \
630 && $(am__cd) $(top_srcdir) \
631 && gtags -i $(GTAGS_ARGS) "$$here"
632
633 distclean-tags:
634 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
635
636 distdir: $(DISTFILES)
637 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
638 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
639 list='$(DISTFILES)'; \
640 dist_files=`for file in $$list; do echo $$file; done | \
641 sed -e "s|^$$srcdirstrip/||;t" \
642 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
643 case $$dist_files in \
644 */*) $(MKDIR_P) `echo "$$dist_files" | \
645 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
646 sort -u` ;; \
647 esac; \
648 for file in $$dist_files; do \
649 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
650 if test -d $$d/$$file; then \
651 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
652 if test -d "$(distdir)/$$file"; then \
653 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
654 fi; \
655 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
656 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
657 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
658 fi; \
659 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
660 else \
661 test -f "$(distdir)/$$file" \
662 || cp -p $$d/$$file "$(distdir)/$$file" \
663 || exit 1; \
664 fi; \
665 done
666 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
667 if test "$$subdir" = .; then :; else \
668 test -d "$(distdir)/$$subdir" \
669 || $(MKDIR_P) "$(distdir)/$$subdir" \
670 || exit 1; \
671 fi; \
672 done
673 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
674 if test "$$subdir" = .; then :; else \
675 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
676 $(am__relativize); \
677 new_distdir=$$reldir; \
678 dir1=$$subdir; dir2="$(top_distdir)"; \
679 $(am__relativize); \
680 new_top_distdir=$$reldir; \
681 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
682 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
683 ($(am__cd) $$subdir && \
684 $(MAKE) $(AM_MAKEFLAGS) \
685 top_distdir="$$new_top_distdir" \
686 distdir="$$new_distdir" \
687 am__remove_distdir=: \
688 am__skip_length_check=: \
689 am__skip_mode_fix=: \
690 distdir) \
691 || exit 1; \
692 fi; \
693 done
694 check-am: all-am
695 check: $(BUILT_SOURCES)
696 $(MAKE) $(AM_MAKEFLAGS) check-recursive
697 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
698 installdirs: installdirs-recursive
699 installdirs-am:
700 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(modemdir)"; do \
701 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
702 done
703 install: $(BUILT_SOURCES)
704 $(MAKE) $(AM_MAKEFLAGS) install-recursive
705 install-exec: install-exec-recursive
706 install-data: install-data-recursive
707 uninstall: uninstall-recursive
708
709 install-am: all-am
710 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
711
712 installcheck: installcheck-recursive
713 install-strip:
714 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
715 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
716 `test -z '$(STRIP)' || \
717 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
718 mostlyclean-generic:
719
720 clean-generic:
721 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
722
723 distclean-generic:
724 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
725 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
726
727 maintainer-clean-generic:
728 @echo "This command is intended for maintainers to use"
729 @echo "it deletes files that may require special tools to rebuild."
730 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
731 clean: clean-recursive
732
733 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
734 clean-noinstLTLIBRARIES mostlyclean-am
735
736 distclean: distclean-recursive
737 -rm -rf ./$(DEPDIR)
738 -rm -f Makefile
739 distclean-am: clean-am distclean-compile distclean-generic \
740 distclean-tags
741
742 dvi: dvi-recursive
743
744 dvi-am:
745
746 html: html-recursive
747
748 html-am:
749
750 info: info-recursive
751
752 info-am:
753
754 install-data-am: install-modemHEADERS
755
756 install-dvi: install-dvi-recursive
757
758 install-dvi-am:
759
760 install-exec-am: install-libLTLIBRARIES
761
762 install-html: install-html-recursive
763
764 install-html-am:
765
766 install-info: install-info-recursive
767
768 install-info-am:
769
770 install-man:
771
772 install-pdf: install-pdf-recursive
773
774 install-pdf-am:
775
776 install-ps: install-ps-recursive
777
778 install-ps-am:
779
780 installcheck-am:
781
782 maintainer-clean: maintainer-clean-recursive
783 -rm -rf ./$(DEPDIR)
784 -rm -f Makefile
785 maintainer-clean-am: distclean-am maintainer-clean-generic
786
787 mostlyclean: mostlyclean-recursive
788
789 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
790 mostlyclean-libtool
791
792 pdf: pdf-recursive
793
794 pdf-am:
795
796 ps: ps-recursive
797
798 ps-am:
799
800 uninstall-am: uninstall-libLTLIBRARIES uninstall-modemHEADERS
801
802 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
803 ctags-recursive install install-am install-strip \
804 tags-recursive
805
806 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
807 all all-am check check-am clean clean-generic \
808 clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
809 ctags ctags-recursive distclean distclean-compile \
810 distclean-generic distclean-libtool distclean-tags distdir dvi \
811 dvi-am html html-am info info-am install install-am \
812 install-data install-data-am install-dvi install-dvi-am \
813 install-exec install-exec-am install-html install-html-am \
814 install-info install-info-am install-libLTLIBRARIES \
815 install-man install-modemHEADERS install-pdf install-pdf-am \
816 install-ps install-ps-am install-strip installcheck \
817 installcheck-am installdirs installdirs-am maintainer-clean \
818 maintainer-clean-generic mostlyclean mostlyclean-compile \
819 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
820 tags tags-recursive uninstall uninstall-am \
821 uninstall-libLTLIBRARIES uninstall-modemHEADERS
822
823
824 signals-marshal.c: ${srcdir}/signals-marshal.list
825 $(AM_V_GEN)glib-genmarshal --body --prefix=_modem__marshal $< >$@
826
827 signals-marshal.h: ${srcdir}/signals-marshal.list
828 $(AM_V_GEN)glib-genmarshal --header --prefix=_modem__marshal $< >$@
829
830 # Tell versions [3.59,3.63) of GNU make to not export all variables.
831 # Otherwise a system limit (for SysV at least) may be exceeded.
832 .NOEXPORT:
00 /*
11 * modem/call-service.c - Interface towards oFono VoiceCallManager
22 *
3 * Copyright (C) 2008 Nokia Corporation
3 * Copyright (C) 2008,2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
55 * @author Lassi Syrjala <first.surname@nokia.com>
6 * @author Kai Vehmanen <first.surname@nokia.com>
7 * Copyright (C) 2014 Jolla Ltd
68 *
79 * This work is free software; you can redistribute it and/or
810 * modify it under the terms of the GNU Lesser General Public
1921 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2022 */
2123
22 #define MODEM_DEBUG_FLAG MODEM_SERVICE_CALL
24 #define MODEM_DEBUG_FLAG MODEM_LOG_CALL
2325
2426 #include "modem/debug.h"
2527
4244
4345 G_DEFINE_TYPE (ModemCallService, modem_call_service, MODEM_TYPE_OFACE);
4446
47 #define VOICECALL_AGENT_PATH "/voicecallagent"
48 #define VOICECALL_AGENT_IFACE "org.ofono.VoiceCallAgent"
49
4550 /* Properties */
4651 enum
4752 {
4853 PROP_NONE,
4954 PROP_EMERGENCY_NUMBERS,
55 PROP_ALERT_TONE_NEEDED,
5056 LAST_PROPERTY
5157 };
5258
5561 {
5662 SIGNAL_INCOMING,
5763 SIGNAL_CREATED,
58 SIGNAL_USER_CONNECTION,
5964 SIGNAL_REMOVED,
6065 N_SIGNALS
6166 };
7479
7580 struct {
7681 ModemCall *instance;
77 ModemCallConference *conference;
7882 } conference;
7983
8084 char **emergency_numbers;
8185
86 gchar *forwarded;
87
8288 ModemCall *active, *hold;
8389
84 unsigned user_connection:1; /* Do we have in-band connection? */
90 /* Do we have in-band connection? */
91 DBusGProxy *call_agent_proxy;
92 gboolean call_agent_registered;
93 gboolean alert_tone_needed;
8594
8695 unsigned signals :1;
8796 unsigned :0;
103112
104113 static ModemRequestCallNotify modem_call_conference_request_reply;
105114
106 #if nomore
107 static void on_user_connection (DBusGProxy *proxy,
108 gboolean attached,
109 ModemCallService *self);
110 #endif
111
112115 static void on_modem_call_state (ModemCall *, ModemCallState,
113116 ModemCallService *);
117
118 static DBusHandlerResult modem_call_agent_dbus_message_handler(
119 DBusConnection *, DBusMessage *, void *);
120
121 static void modem_call_agent_register(ModemCallService *);
122
123 static void modem_call_agent_register_reply (DBusGProxy *,
124 DBusGProxyCall *, void *);
125
126 static void modem_call_agent_unregister(DBusConnection *, void *);
127
128 static DBusObjectPathVTable modem_call_agent_table = {
129 .unregister_function = modem_call_agent_unregister,
130 .message_function = modem_call_agent_dbus_message_handler,
131 };
114132
115133 /* ---------------------------------------------------------------------- */
116134
147165 g_queue_init (self->priv->dialing.created);
148166
149167 self->priv->instances = g_hash_table_new_full (
150 g_str_hash, g_str_equal, g_free, g_object_unref);
168 g_str_hash, g_str_equal, NULL, g_object_unref);
169
170 self->priv->forwarded = NULL;
171 self->priv->call_agent_proxy = NULL;
172 self->priv->call_agent_registered = FALSE;
173 self->priv->alert_tone_needed = FALSE;
151174 }
152175
153176 static void
162185 {
163186 case PROP_EMERGENCY_NUMBERS:
164187 g_value_set_boxed (value, modem_call_get_emergency_numbers (self));
188 break;
189
190 case PROP_ALERT_TONE_NEEDED:
191 g_value_set_boolean(value, self->priv->alert_tone_needed);
165192 break;
166193
167194 default:
189216 g_strfreev (old);
190217 break;
191218
219 case PROP_ALERT_TONE_NEEDED:
220 priv->alert_tone_needed = g_value_get_boolean (value);
221 break;
222
192223 default:
193224 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
194225 break;
213244 ModemCallService *self = MODEM_CALL_SERVICE (object);
214245 ModemCallServicePrivate *priv = self->priv;
215246
247 if (priv->forwarded)
248 {
249 g_free(priv->forwarded);
250 priv->forwarded = NULL;
251 }
252
216253 g_strfreev (priv->emergency_numbers), priv->emergency_numbers = NULL;
217254
218255 g_hash_table_destroy (priv->instances);
232269
233270 static void on_manager_call_removed (DBusGProxy *proxy,
234271 char const *path,
272 gpointer user_data);
273
274 static void on_manager_call_forwarded (DBusGProxy *proxy,
275 char const *type,
235276 gpointer user_data);
236277
237278 static char const *
278319
279320 ModemCallService *self = MODEM_CALL_SERVICE (_self);
280321 ModemCallServicePrivate *priv = self->priv;
322 DBusGProxy *proxy = DBUS_PROXY (_self);
281323
282324 if (!priv->signals)
283325 {
284 DBusGProxy *proxy = DBUS_PROXY (_self);
285
286326 priv->signals = TRUE;
287327
288328 #define CONNECT(p, handler, name, signature...) \
295335 CONNECT (proxy, on_manager_call_removed, "CallRemoved",
296336 DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
297337
338 CONNECT (proxy, on_manager_call_forwarded, "Forwarded",
339 G_TYPE_STRING, G_TYPE_INVALID);
340
298341 #undef CONNECT
299342 }
300343
303346 modem_oface_add_connect_request (_self,
304347 modem_oface_request_managed (_self, "GetCalls",
305348 reply_to_call_manager_get_calls, NULL));
349
350 modem_call_agent_register(self);
306351 }
307352
308353
331376 G_CALLBACK (on_manager_call_added), self);
332377 dbus_g_proxy_disconnect_signal (DBUS_PROXY (self), "CallRemoved",
333378 G_CALLBACK (on_manager_call_removed), self);
379 dbus_g_proxy_disconnect_signal (DBUS_PROXY (self), "Forwarded",
380 G_CALLBACK (on_manager_call_forwarded), self);
334381 }
335382
336383 for (g_hash_table_iter_init (iter, priv->instances);
364411 object_class->dispose = modem_call_service_dispose;
365412 object_class->finalize = modem_call_service_finalize;
366413
414 oface_class->ofono_interface = MODEM_OFACE_CALL_MANAGER;
367415 oface_class->property_mapper = modem_call_service_property_mapper;
368416 oface_class->connect = modem_call_service_connect;
369417 oface_class->disconnect = modem_call_service_disconnect;
374422 "Emergency Numbers",
375423 "List of emergency numbers obtained from modem",
376424 G_TYPE_STRV,
425 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
426 G_PARAM_STATIC_STRINGS));
427
428 g_object_class_install_property (object_class, PROP_ALERT_TONE_NEEDED,
429 g_param_spec_boolean ("alert-tone-needed",
430 "Alert Tone needed",
431 "True if the network cannot send in-band alerting tone",
432 FALSE, /* default assumption: user connection is OK */
377433 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
378434 G_PARAM_STATIC_STRINGS));
379435
405461 G_TYPE_NONE, 1,
406462 MODEM_TYPE_CALL);
407463
408 signals[SIGNAL_USER_CONNECTION] =
409 g_signal_new ("user-connection", G_OBJECT_CLASS_TYPE (klass),
410 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
411 0,
412 NULL, NULL,
413 g_cclosure_marshal_VOID__BOOLEAN,
414 G_TYPE_NONE, 1,
415 G_TYPE_BOOLEAN);
416
417464 DEBUG ("leave");
418465 }
419466
435482
436483 object_path = modem_call_get_path (instance);
437484
438 g_hash_table_insert (priv->instances, g_strdup (object_path), instance);
485 g_hash_table_insert (priv->instances, (gpointer) object_path, instance);
439486 }
440487
441488 static void
447494 if (!instance)
448495 return;
449496
450 g_hash_table_remove (priv->instances, modem_call_get_path (instance));
497 g_hash_table_steal (priv->instances, modem_call_get_path (instance));
451498
452499 g_signal_handlers_disconnect_by_func (instance, on_modem_call_state, self);
453500
454501 g_signal_emit (self, signals[SIGNAL_REMOVED], 0, instance);
455502
456503 modem_oface_disconnect (MODEM_OFACE (instance));
504
505 g_object_unref (instance);
457506 }
458507
459508 static ModemCall *
468517 gchar const *remote;
469518 ModemCallState state;
470519 gboolean incoming = FALSE, originating = FALSE;
471 DBusGProxy *proxy;
472520 ModemCall *ci;
473521
474522 DEBUG ("path %s", object_path);
519567 return NULL;
520568 }
521569
522 proxy = modem_ofono_proxy (object_path, OFONO_IFACE_CALL);
523
524570 ci = g_object_new (MODEM_TYPE_CALL,
525 "dbus-proxy", proxy,
571 "object-path", object_path,
526572 "call-service", self,
527573 "state", state,
528574 "terminating", !originating,
537583 DEBUG ("emit \"incoming\" (\"%s\" (%p), \"%s\")",
538584 modem_call_get_name (ci), ci, remote);
539585 g_signal_emit (self, signals[SIGNAL_INCOMING], 0, ci, remote);
586 if (priv->forwarded && !strcmp(priv->forwarded, "incoming"))
587 {
588 g_signal_emit_by_name (ci, "forwarded");
589 }
540590 }
541591 else if (g_queue_is_empty (priv->dialing.queue))
542592 {
543593 DEBUG ("emit \"created\" (\"%s\" (%p), \"%s\")",
544594 modem_call_get_name (ci), ci, remote);
545595 g_signal_emit (self, signals[SIGNAL_CREATED], 0, ci, remote);
596 if (priv->forwarded && !strcmp(priv->forwarded, "outgoing"))
597 {
598 g_signal_emit_by_name (ci, "forwarded");
599 }
546600 }
547601 else {
548602 g_queue_push_tail (priv->dialing.created, ci);
549603 }
604
605 if (priv->forwarded)
606 {
607 g_free(priv->forwarded);
608 priv->forwarded = NULL;
609 }
550610
551611 return ci;
552612 }
558618 {
559619 ModemCallServicePrivate *priv = self->priv;
560620 ModemCall *ci;
561 DBusGProxy *proxy;
562621
563622 ci = g_hash_table_lookup (priv->instances, object_path);
564623 if (ci)
571630 return ci;
572631 }
573632
574 proxy = modem_ofono_proxy (object_path, OFONO_IFACE_CALL);
575
576633 ci = g_object_new (MODEM_TYPE_CALL,
577 "dbus-proxy", proxy,
634 "object-path", object_path,
578635 "call-service", self,
579636 "remote", remote,
580637 "state", MODEM_CALL_STATE_DIALING,
591648 /* ---------------------------------------------------------------------- */
592649 /* ModemCallService interface */
593650
594 #if 0
595 static void
596 refresh_conference_memberships (ModemCallService *self,
597 GPtrArray *members)
598 {
599 guint i;
600 char const *path;
601 ModemCall *ci;
602 GList *instances;
603
604 instances = g_hash_table_get_values (self->priv->instances);
605
606 for (i = 0; i < members->len; i++)
607 {
608 path = g_ptr_array_index (members, i);
609
610 ci = g_hash_table_lookup (self->priv->instances, path);
611 if (ci != NULL)
612 {
613 if (!modem_call_is_member (ci))
614 g_object_set (ci, "member", TRUE, NULL);
615
616 instances = g_list_remove (instances, ci);
617 }
618 }
619
620 /* The remaining instances aren't members */
621 while (instances)
622 {
623 ci = instances->data;
624
625 if (modem_call_is_member (ci))
626 g_object_set (ci, "member", FALSE, NULL);
627
628 instances = g_list_delete_link (instances, instances);
629 }
630 }
631 #endif
632
633651 static void
634652 on_manager_call_added (DBusGProxy *proxy,
635653 char const *path,
660678 }
661679 }
662680
681 static void
682 on_manager_call_forwarded (DBusGProxy *proxy,
683 char const *type,
684 gpointer user_data)
685 {
686 DEBUG ("%s", type);
687
688 ModemCallService *self = MODEM_CALL_SERVICE (user_data);
689 ModemCall *ci = NULL;
690 GHashTableIter iter[1];
691
692 g_hash_table_iter_init (iter, self->priv->instances);
693 while (g_hash_table_iter_next (iter, NULL, (gpointer)&ci))
694 {
695 ModemCallState state;
696 g_object_get (ci, "state", &state, NULL);
697
698 if (state == MODEM_CALL_STATE_INCOMING && strcmp(type, "incoming") == 0)
699 {
700 break;
701 }
702 else if (state == MODEM_CALL_STATE_DIALING && strcmp(type, "outgoing") == 0)
703 {
704 break;
705 }
706 }
707
708 if (ci)
709 {
710 g_signal_emit_by_name (ci, "forwarded");
711 }
712 else
713 {
714 self->priv->forwarded = g_strdup(type);
715 }
716 }
717
663718 void
664719 modem_call_service_resume (ModemCallService *self)
665720 {
666721 GHashTableIter iter[1];
667 ModemCall *membercall = NULL;
668722 ModemCall *ci;
669 #if nomore
670 ModemCallConference *mcc;
671 #endif
672723
673724 DEBUG ("enter");
674725 RETURN_IF_NOT_VALID (self);
683734 while (g_hash_table_iter_next (iter, NULL, (gpointer)&ci))
684735 {
685736 char *remote;
686 gboolean terminating = FALSE, member = FALSE;
737 gboolean terminating = FALSE;
687738 ModemCallState state;
688739
689740 g_object_get (ci,
690741 "state", &state,
691 "member", &member,
692742 "remote", &remote,
693743 "terminating", &terminating,
694744 NULL);
695
696 if (member)
697 membercall = ci;
698745
699746 if (state != MODEM_CALL_STATE_DISCONNECTED &&
700747 state != MODEM_CALL_STATE_INVALID)
705752 * since we cannot rely on the call state here. */
706753 if (terminating)
707754 {
708 modem_message (MODEM_SERVICE_CALL,
755 modem_message (MODEM_LOG_CALL,
709756 "incoming [with state %s] call from \"%s\"",
710757 modem_call_get_state_name (state), remote);
711758 DEBUG ("emit \"incoming\"(%s (%p), %s)",
713760 g_signal_emit (self, signals[SIGNAL_INCOMING], 0, ci, remote);
714761 }
715762 else {
716 modem_message (MODEM_SERVICE_CALL,
763 modem_message (MODEM_LOG_CALL,
717764 "created [with state %s] call to \"%s\"",
718765 modem_call_get_state_name (state), remote);
719766 DEBUG ("emit \"created\"(%s (%p), %s)",
726773
727774 g_free (remote);
728775 }
729
730 #if nomore
731 mcc = self->priv->conference.conference;
732
733 for (i = 0; i < MODEM_MAX_CALLS; i++)
734 {
735 ModemCall *ci = self->priv->instances[i].instance;
736 gboolean member = FALSE;
737
738 g_object_get (ci, "member", &member, NULL);
739
740 if (!member)
741 continue;
742
743 g_signal_emit_by_name (mcc, "joined", ci);
744 }
745
746 g_signal_emit_by_name (mcc, "state",
747 modem_call_get_state (MODEM_CALL (mcc)), 0, 0);
748 #endif
749776 }
750777
751778 /* ---------------------------------------------------------------------- */
868895
869896 /* ---------------------------------------------------------------------- */
870897
871 #if nomore
872 static void
873 on_user_connection (DBusGProxy *proxy,
874 gboolean attached,
875 ModemCallService *self)
876 {
877 DEBUG ("(%p, %d, %p): enter", proxy, attached, self);
878
879 MODEM_CALL_SERVICE (self)->priv->user_connection = attached;
880
881 g_signal_emit (self, signals[SIGNAL_USER_CONNECTION], 0,
882 attached);
883 }
884 #endif
885
886898 static void request_notify_cancel (gpointer data);
887899
888900 ModemRequest *
902914 g_return_val_if_fail (destination != NULL, NULL);
903915 g_return_val_if_fail (callback != NULL, NULL);
904916
905 modem_message (MODEM_SERVICE_CALL,
917 modem_message (MODEM_LOG_CALL,
906918 "trying to create call to \"%s\"",
907919 destination);
908920
972984
973985 if (ci)
974986 {
975 DEBUG ("%s: instance %s (%p)", OFONO_IFACE_CALL_MANAGER ".Dial",
987 DEBUG ("%s: instance %s (%p)", MODEM_OFACE_CALL_MANAGER ".Dial",
976988 object_path, (void *)ci);
977989
978 modem_message (MODEM_SERVICE_CALL,
990 modem_message (MODEM_LOG_CALL,
979991 "call create request to \"%s\" successful",
980992 destination);
981993 }
983995 {
984996 char ebuffer[32];
985997
986 modem_message (MODEM_SERVICE_CALL,
998 modem_message (MODEM_LOG_CALL,
987999 "call create request to \"%s\" failed: %s.%s: %s",
9881000 destination,
9891001 modem_error_domain_prefix (error->domain),
9901002 modem_error_name (error, ebuffer, sizeof ebuffer),
9911003 error->message);
9921004
993 DEBUG ("%s: " GERROR_MSG_FMT, OFONO_IFACE_CALL_MANAGER ".Dial",
1005 DEBUG ("%s: " GERROR_MSG_FMT, MODEM_OFACE_CALL_MANAGER ".Dial",
9941006 GERROR_MSG_CODE (error));
9951007 }
9961008
10321044 ModemCallService *self)
10331045 {
10341046 ModemCallServicePrivate *priv;
1047 #if nomore
10351048 gboolean releasing = FALSE;
1049 #endif
10361050
10371051 RETURN_IF_NOT_VALID (self);
10381052
10551069 break;
10561070
10571071 case MODEM_CALL_STATE_DISCONNECTED:
1072 #if nomore
10581073 releasing = TRUE;
1074 #endif
10591075 /* FALLTHROUGH */
10601076 case MODEM_CALL_STATE_INVALID:
10611077 if (priv->active == ci)
10951111
10961112 gboolean mpty = MODEM_IS_CALL_CONFERENCE (ci);
10971113
1098 modem_message (MODEM_SERVICE_CALL,
1114 modem_message (MODEM_LOG_CALL,
10991115 "%s %s %s%s%s %s.%s: %s",
11001116 what,
11011117 mpty ? "conference"
11571173 ci = g_hash_table_lookup (self->priv->instances, path);
11581174 if (ci != NULL)
11591175 {
1160 g_object_set (ci, "member", TRUE, NULL);
1176 g_object_set (ci, "multiparty", TRUE, NULL);
11611177 }
11621178 }
11631179
11711187 g_clear_error (&error);
11721188 }
11731189
1190 static void
1191 modem_call_service_noparams_request_reply (DBusGProxy *proxy,
1192 DBusGProxyCall *call,
1193 void *_request)
1194 {
1195 ModemRequest *request = _request;
1196 ModemCallService *self = modem_request_object (request);
1197 ModemCallServiceReply *callback = modem_request_callback (request);
1198 gpointer user_data = modem_request_user_data (request);
1199 GError *error = NULL;
1200
1201 DEBUG ("enter");
1202
1203 if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID))
1204 ;
1205 else
1206 modem_error_fix (&error);
1207
1208 if (callback)
1209 callback (self, request, error, user_data);
1210
1211 g_clear_error (&error);
1212 }
1213
1214 ModemRequest *
1215 modem_call_request_hangup_conference (ModemCallService *self,
1216 ModemCallServiceReply *callback,
1217 gpointer user_data)
1218 {
1219 RETURN_NULL_IF_NOT_VALID (self);
1220
1221 return modem_request (MODEM_CALL_SERVICE (self), DBUS_PROXY (self),
1222 "HangupMultiparty",
1223 modem_call_service_noparams_request_reply,
1224 G_CALLBACK (callback), user_data,
1225 G_TYPE_INVALID);
1226 }
11741227
11751228 ModemCall *
11761229 modem_call_service_get_call (ModemCallService *self, char const *object_path)
11781231 ModemCallServicePrivate *priv = self->priv;
11791232
11801233 return g_hash_table_lookup (priv->instances, object_path);
1234 }
1235
1236 /**
1237 * modem_call_service_swap_calls
1238 * @self ModemCallService object
1239 *
1240 * Swaps active and held calls. 0 or more active calls become
1241 * held, and 0 or more held calls become active.
1242 */
1243 ModemRequest *
1244 modem_call_service_swap_calls (ModemCallService *self,
1245 ModemCallServiceReply callback,
1246 gpointer user_data)
1247 {
1248 RETURN_NULL_IF_NOT_VALID (self);
1249
1250 DEBUG ("%s.%s", MODEM_OFACE_CALL_MANAGER, "SwapCalls");
1251
1252 return modem_request (MODEM_CALL_SERVICE (self), DBUS_PROXY (self),
1253 "SwapCalls", modem_call_service_noparams_request_reply,
1254 G_CALLBACK (callback), user_data,
1255 G_TYPE_INVALID);
11811256 }
11821257
11831258 /**
12111286 return (ModemCall **)g_ptr_array_free (calls, FALSE);
12121287 }
12131288
1214 ModemCallConference *
1215 modem_call_service_get_conference (ModemCallService *self)
1216 {
1217 return MODEM_IS_CALL_SERVICE (self)
1218 ? self->priv->conference.conference
1219 : NULL;
1220 }
1221
12221289 /* ------------------------------------------------------------------------- */
12231290
12241291 static char const *
13421409 if (address[nan])
13431410 *return_dialstring = g_strdup (address + nan);
13441411 }
1412 /* ---------------------------------------------------------------------- */
1413 /* Voice Call Agent interface */
1414 static DBusHandlerResult modem_call_agent_generic_dbus_message(
1415 DBusConnection *conn, DBusMessage *msg)
1416 {
1417 DBusMessage *reply;
1418
1419 reply = dbus_message_new_method_return(msg);
1420 if (!reply)
1421 return DBUS_HANDLER_RESULT_NEED_MEMORY;
1422
1423 dbus_connection_send(conn, reply, NULL);
1424 dbus_message_unref(reply);
1425
1426 return DBUS_HANDLER_RESULT_HANDLED;
1427 }
1428
1429 static DBusHandlerResult modem_call_agent_dbus_message_handler(
1430 DBusConnection *conn,
1431 DBusMessage *msg, void *user_data)
1432 {
1433 const char *method = dbus_message_get_member(msg);
1434 const char *iface = dbus_message_get_interface(msg);
1435
1436 if (strcmp(VOICECALL_AGENT_IFACE, iface) != 0)
1437 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
1438
1439 if (strcmp("Release", method) == 0)
1440 {
1441 /* Nothing to do */
1442 return modem_call_agent_generic_dbus_message(conn, msg);
1443 }
1444 else if (strcmp("RingbackTone", method) == 0)
1445 {
1446 ModemCallService *self = user_data;
1447 dbus_bool_t playTone = 0;
1448 DBusMessageIter iter;
1449 dbus_message_iter_init(msg, &iter);
1450 if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN)
1451 {
1452 dbus_message_iter_get_basic(&iter, &playTone);
1453 }
1454 else
1455 {
1456 DEBUG ("Invalid arguments received, ignore");
1457 }
1458
1459 if (self->priv->alert_tone_needed != playTone)
1460 {
1461 DEBUG("'alert needed' changed from %d to %d",
1462 self->priv->alert_tone_needed, playTone);
1463 }
1464
1465 self->priv->alert_tone_needed = playTone;
1466
1467 return modem_call_agent_generic_dbus_message(conn, msg);
1468 }
1469
1470 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
1471 }
1472
1473 /* Register as oFono voicecall agent, in order to receive
1474 * requests for playing local tones */
1475 static void
1476 modem_call_agent_register(ModemCallService *self)
1477 {
1478
1479 self->priv->call_agent_proxy =
1480 dbus_g_proxy_new_for_name(dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL),
1481 VOICECALL_AGENT_IFACE,
1482 VOICECALL_AGENT_PATH,
1483 VOICECALL_AGENT_IFACE);
1484
1485 if (!self->priv->call_agent_proxy)
1486 {
1487 DEBUG("Error in creating call agent proxy");
1488 return;
1489 }
1490
1491 ModemRequest *agent_request = modem_request_begin (self, DBUS_PROXY (self),
1492 "RegisterVoicecallAgent", modem_call_agent_register_reply,
1493 NULL, self,
1494 DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (
1495 self->priv->call_agent_proxy),
1496 G_TYPE_INVALID);
1497
1498 if (!agent_request)
1499 {
1500 DEBUG("Error in registering call agent");
1501 return;
1502 }
1503 }
1504
1505 static void
1506 modem_call_agent_register_reply (DBusGProxy *proxy,
1507 DBusGProxyCall *call,
1508 void *_request)
1509 {
1510 ModemRequest *request = _request;
1511 gpointer user_data = modem_request_user_data (request);
1512 ModemCallService *self = user_data;
1513 GError *error = NULL;
1514
1515 if (!dbus_g_proxy_end_call (proxy, call, &error,
1516 G_TYPE_INVALID))
1517 {
1518 modem_error_fix (&error);
1519 DEBUG("Error while registering agent: %s",error->message);
1520 return;
1521 }
1522
1523 if (!dbus_connection_register_object_path(
1524 dbus_bus_get (DBUS_BUS_SYSTEM, NULL),
1525 VOICECALL_AGENT_PATH,
1526 &modem_call_agent_table,
1527 self))
1528 {
1529 DEBUG("Error while registering object");
1530 return;
1531 }
1532
1533 self->priv->call_agent_registered = TRUE;
1534 DEBUG("Call agent registered.");
1535 }
1536
1537 static void modem_call_agent_unregister(DBusConnection *connection, void *user_data)
1538 {
1539 ModemCallService *self = user_data;
1540 self->priv->alert_tone_needed = FALSE;
1541
1542 if (!self->priv->call_agent_proxy)
1543 {
1544 return;
1545 }
1546
1547 if (self->priv->call_agent_registered)
1548 {
1549 dbus_connection_unregister_object_path(
1550 dbus_bus_get (DBUS_BUS_SYSTEM, NULL),
1551 VOICECALL_AGENT_PATH);
1552 self->priv->call_agent_registered = FALSE;
1553 }
1554
1555 dbus_g_proxy_call_no_reply(DBUS_PROXY (self), "UnregisterVoicecallAgent",
1556 DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (
1557 self->priv->call_agent_proxy),
1558 G_TYPE_INVALID);
1559
1560 g_object_unref(self->priv->call_agent_proxy);
1561 self->priv->call_agent_proxy = NULL;
1562 DEBUG("Call agent unregistered.");
1563 }
33 * Copyright (C) 2008 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
55 * @author Lassi Syrjala <first.surname@nokia.com>
6 * Copyright (C) 2013 Jolla Ltd
67 *
78 * This work is free software; you can redistribute it and/or
89 * modify it under the terms of the GNU Lesser General Public
1920 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2021 */
2122
22 #define MODEM_DEBUG_FLAG MODEM_SERVICE_CALL
23 #include "config.h"
24
25 #define MODEM_DEBUG_FLAG MODEM_LOG_CALL
2326
2427 #include "modem/debug.h"
2528 #include "modem/errors.h"
4952 gchar *state_str;
5053 gchar *remote;
5154 gchar *emergency;
55 gchar *start_time;
5256
5357 unsigned char state;
5458 unsigned char causetype, cause;
5660 unsigned originating:1;
5761 unsigned terminating:1;
5862 unsigned onhold:1;
59 unsigned member:1;
63 unsigned multiparty:1;
6064 unsigned :0;
6165 };
6266
7377 PROP_TERMINATING,
7478 PROP_EMERGENCY,
7579 PROP_ONHOLD,
76 PROP_MEMBER,
80 PROP_MULTIPARTY,
7781 PROP_REMOTE,
82 PROP_START_TIME,
7883 LAST_PROPERTY
7984 };
8085
8388 {
8489 SIGNAL_STATE,
8590 SIGNAL_WAITING,
86 SIGNAL_MULTIPARTY,
8791 SIGNAL_EMERGENCY,
8892 SIGNAL_TERMINATED,
8993 SIGNAL_ON_HOLD,
100104
101105 static void on_notify_ofono_state (ModemCall *, GParamSpec *, gpointer);
102106 static void reply_to_instance_request (DBusGProxy *, DBusGProxyCall *, void *);
107 static void on_disconnect_reason (DBusGProxy *, char const *, gpointer);
108 static void on_propertychanged (DBusGProxy *, char const *, GValue *, gpointer);
103109
104110 #if nomore /* Ofono does not provide this information */
105111 static void on_on_hold (DBusGProxy *, gboolean onhold, ModemCall*);
106112 static void on_forwarded (DBusGProxy *, ModemCall *);
107113 static void on_waiting (DBusGProxy *proxy, ModemCall *);
108 static void on_multiparty (DBusGProxy *, ModemCall *);
109114 static void on_emergency (DBusGProxy *proxy,
110115 char const *service, ModemCall *);
111116
144149 G_OBJECT_CLASS (modem_call_parent_class)->constructed (object);
145150
146151 DEBUG ("ModemCall for %s on %s",
147 modem_oface_object_path (MODEM_OFACE (object)), OFONO_IFACE_CALL);
152 modem_oface_object_path (MODEM_OFACE (object)), MODEM_OFACE_CALL);
148153 }
149154
150155 static void
165170 priv->service = NULL;
166171 g_free (priv->remote), priv->remote = NULL;
167172 g_free (priv->emergency), priv->emergency = NULL;
173 g_free (priv->start_time), priv->start_time = NULL;
168174
169175 G_OBJECT_CLASS (modem_call_parent_class)->finalize (object);
170176 }
216222 g_value_set_boolean (value, priv->onhold);
217223 break;
218224
219 case PROP_MEMBER:
220 g_value_set_boolean (value, priv->member);
225 case PROP_MULTIPARTY:
226 g_value_set_boolean (value, priv->multiparty);
221227 break;
222228
223229 case PROP_REMOTE:
224230 g_value_set_string (value, priv->remote);
231 break;
232
233 case PROP_START_TIME:
234 g_value_set_string (value, priv->start_time);
225235 break;
226236
227237 default:
286296 priv->onhold = g_value_get_boolean (value);
287297 break;
288298
289 case PROP_MEMBER:
290 priv->member = g_value_get_boolean (value);
299 case PROP_MULTIPARTY:
300 priv->multiparty = g_value_get_boolean (value);
291301 break;
292302
293303 case PROP_REMOTE:
296306 g_free (tbf);
297307 break;
298308
309 case PROP_START_TIME:
310 g_free (priv->start_time);
311 priv->start_time = g_value_dup_string (value);
312 break;
313
299314 default:
300315 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
301316 break;
311326 if (!strcmp (name, "LineIdentification"))
312327 return "remote";
313328 if (!strcmp (name, "Multiparty"))
314 return "member";
329 return "multiparty";
315330 if (!strcmp (name, "State"))
316331 return "ofono-state";
317332 if (!strcmp (name, "StartTime"))
331346 /* CallAdded gives us initial properties */
332347 modem_oface_connect_properties (_self, FALSE);
333348
349 /* Additionally, listen to 'DisconnectReason' signal*/
350 ModemCall *self = MODEM_CALL (_self);
351 DBusGProxy *proxy = modem_oface_dbus_proxy (_self);
352 dbus_g_proxy_add_signal (proxy, "DisconnectReason",
353 G_TYPE_STRING, G_TYPE_INVALID);
354 dbus_g_proxy_connect_signal (proxy, "DisconnectReason",
355 G_CALLBACK (on_disconnect_reason), self, NULL);
356 dbus_g_proxy_add_signal (proxy, "PropertyChanged",
357 G_TYPE_STRING, G_TYPE_INVALID);
358 dbus_g_proxy_connect_signal (proxy, "PropertyChanged",
359 G_CALLBACK (on_propertychanged), self, NULL);
360
334361 g_signal_connect (_self, "notify::ofono-state",
335362 G_CALLBACK(on_notify_ofono_state), _self);
336363 }
368395 object_class->get_property = modem_call_get_property;
369396 object_class->set_property = modem_call_set_property;
370397
398 oface_class->ofono_interface = MODEM_OFACE_CALL;
371399 oface_class->property_mapper = modem_call_property_mapper;
372400 oface_class->connect = modem_call_connect;
373401 oface_class->connected = modem_call_connected;
413441 g_param_spec_uint ("causetype",
414442 "Call cause type",
415443 "Source of the latest state transition",
416 0, MODEM_CALL_CAUSE_TYPE_UNKNOWN, 0,
444 0, MODEM_CALL_CAUSE_TYPE_REMOTE, 0,
417445 G_PARAM_READWRITE |
418446 G_PARAM_STATIC_STRINGS));
419447
449477 G_PARAM_READWRITE |
450478 G_PARAM_STATIC_STRINGS));
451479
452 g_object_class_install_property (object_class, PROP_MEMBER,
453 g_param_spec_boolean ("member",
454 "Conference Member",
480 g_object_class_install_property (object_class, PROP_MULTIPARTY,
481 g_param_spec_boolean ("multiparty",
482 "Multiparty Membership",
455483 "This instance is a member of a conference call",
456484 FALSE,
457485 G_PARAM_READWRITE |
461489 g_param_spec_string ("remote",
462490 "Remote Party Address",
463491 "Address of remote party associated with this call",
492 NULL,
493 G_PARAM_READWRITE |
494 G_PARAM_STATIC_STRINGS));
495
496 g_object_class_install_property (object_class, PROP_START_TIME,
497 g_param_spec_string ("start-time",
498 "Start Time",
499 "The time the call started",
464500 NULL,
465501 G_PARAM_READWRITE |
466502 G_PARAM_STATIC_STRINGS));
474510 G_TYPE_NONE, 1,
475511 G_TYPE_UINT);
476512
513 /* XXX: not implemented */
477514 call_signals[SIGNAL_WAITING] =
478515 g_signal_new ("waiting", G_OBJECT_CLASS_TYPE (klass),
479516 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
482519 g_cclosure_marshal_VOID__VOID,
483520 G_TYPE_NONE, 0);
484521
485 call_signals[SIGNAL_MULTIPARTY] =
486 g_signal_new ("multiparty", G_OBJECT_CLASS_TYPE (klass),
487 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
488 0,
489 NULL, NULL,
490 g_cclosure_marshal_VOID__VOID,
491 G_TYPE_NONE, 0);
492
522 /* XXX: not implemented */
493523 call_signals[SIGNAL_EMERGENCY] =
494524 g_signal_new ("emergency", G_OBJECT_CLASS_TYPE (klass),
495525 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
499529 G_TYPE_NONE, 1,
500530 G_TYPE_STRING);
501531
532 /* XXX: not implemented */
502533 call_signals[SIGNAL_TERMINATED] =
503534 g_signal_new ("terminated", G_OBJECT_CLASS_TYPE (klass),
504535 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
516547 G_TYPE_NONE, 1,
517548 G_TYPE_BOOLEAN);
518549
550 /* XXX: not implemented */
519551 call_signals[SIGNAL_FORWARDED] =
520552 g_signal_new ("forwarded", G_OBJECT_CLASS_TYPE (klass),
521553 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
524556 g_cclosure_marshal_VOID__VOID,
525557 G_TYPE_NONE, 0);
526558
559 /* XXX: not implemented */
527560 call_signals[SIGNAL_DIALSTRING] =
528561 g_signal_new ("dialstring", G_OBJECT_CLASS_TYPE (klass),
529562 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
533566 G_TYPE_NONE, 1,
534567 G_TYPE_STRING);
535568
569 /* XXX: not implemented */
536570 call_signals[SIGNAL_DTMF_TONE] =
537571 g_signal_new ("dtmf-tone", G_OBJECT_CLASS_TYPE (klass),
538572 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
636670 gboolean
637671 modem_call_is_member (ModemCall const *self)
638672 {
639 return MODEM_IS_CALL (self) && self->priv->member;
673 return MODEM_IS_CALL (self) && self->priv->multiparty;
640674 }
641675
642676 gboolean
688722 return MODEM_CALL_STATE_INVALID;
689723 }
690724
725 ModemCallState
726 modem_call_cause_type_from_ofono_disconnect_reason (const char *reason)
727 {
728 if (G_UNLIKELY (!reason))
729 return MODEM_CALL_CAUSE_TYPE_UNKNOWN;
730 else if (!strcmp (reason, "network"))
731 return MODEM_CALL_CAUSE_TYPE_NETWORK;
732 else if (!strcmp (reason, "local"))
733 return MODEM_CALL_CAUSE_TYPE_LOCAL;
734 else if (!strcmp (reason, "remote"))
735 return MODEM_CALL_CAUSE_TYPE_REMOTE;
736
737 return MODEM_CALL_CAUSE_TYPE_UNKNOWN;
738 }
739
691740 static void
692741 on_notify_ofono_state (ModemCall *self,
693742 GParamSpec *pspec,
747796 "originating", FALSE,
748797 "terminating", FALSE,
749798 "onhold", FALSE,
750 "member", FALSE,
799 "multiparty", FALSE,
751800 NULL);
752801 break;
753802 }
785834 "originating", FALSE,
786835 "terminating", FALSE,
787836 "onhold", FALSE,
788 "member", FALSE,
837 "multiparty", FALSE,
789838 NULL);
790839 }
791840 }
802851
803852 if (self->priv->state != MODEM_CALL_STATE_WAITING)
804853 {
805 DEBUG ("%s.%s (%s)", OFONO_IFACE_CALL, "Answer",
854 DEBUG ("%s.%s (%s)", MODEM_OFACE_CALL, "Answer",
806855 modem_call_get_path (self));
807856 return modem_request (MODEM_CALL (self),
808857 modem_oface_dbus_proxy (MODEM_OFACE (self)),
811860 G_TYPE_INVALID);
812861 }
813862 else {
814 DEBUG ("%s.%s (%s)", OFONO_IFACE_CALL_MANAGER, "HoldAndAnswer",
863 DEBUG ("%s.%s (%s)", MODEM_OFACE_CALL_MANAGER, "HoldAndAnswer",
815864 modem_call_get_path (self));
816865 return modem_request (MODEM_CALL (self),
817866 modem_oface_dbus_proxy (MODEM_OFACE (self->priv->service)),
826875 ModemCallReply callback,
827876 gpointer user_data)
828877 {
829 DEBUG ("%s.%s (%s)", OFONO_IFACE_CALL, "Hangup", modem_call_get_path (self));
878 DEBUG ("%s.%s (%s)", MODEM_OFACE_CALL, "Hangup", modem_call_get_path (self));
830879 RETURN_NULL_IF_NOT_VALID (self);
831880
832881 return modem_request (MODEM_CALL (self),
836885 G_TYPE_INVALID);
837886 }
838887
888 static void
889 reply_to_private_chat_request (DBusGProxy *proxy,
890 DBusGProxyCall *call,
891 void *_request)
892 {
893 DEBUG ("enter");
894
895 GPtrArray *paths;
896 ModemRequest *request = _request;
897 ModemCall *self = modem_request_object (request);
898 ModemCallReply *callback = modem_request_callback (request);
899 gpointer user_data = modem_request_user_data (request);
900 GError *error = NULL;
901
902 if (dbus_g_proxy_end_call (proxy, call, &error,
903 MODEM_TYPE_ARRAY_OF_PATHS, &paths,
904 G_TYPE_INVALID))
905 {
906 guint i;
907 char const *path;
908
909 for (i = 0; i < paths->len; i++)
910 {
911 path = g_ptr_array_index (paths, i);
912 DEBUG("Calls in conf after split %u/%u: %s\n",
913 i + 1, paths->len, path);
914 }
915 /* XXX: should this list be passed to the client as well? */
916 }
917 else {
918 modem_error_fix (&error);
919 }
920
921 callback (self, request, error, user_data);
922 g_clear_error (&error);
923 }
839924
840925 ModemRequest *
841926 modem_call_request_split (ModemCall *self,
842927 ModemCallReply callback,
843928 gpointer user_data)
844929 {
845 DEBUG ("%s.%s (%s)", OFONO_IFACE_CALL_MANAGER, "PrivateChat",
930 DEBUG ("%s.%s (%s)", MODEM_OFACE_CALL_MANAGER, "PrivateChat",
846931 modem_call_get_path (self));
847932 RETURN_NULL_IF_NOT_VALID (self);
848933
849934 return modem_request (MODEM_CALL (self),
850935 modem_oface_dbus_proxy (MODEM_OFACE (self->priv->service)),
851 "PrivateChat", reply_to_instance_request,
936 "PrivateChat", reply_to_private_chat_request,
852937 G_CALLBACK (callback), user_data,
853938 DBUS_TYPE_G_OBJECT_PATH, modem_call_get_path (self),
854939 G_TYPE_INVALID);
860945 ModemCallReply callback,
861946 gpointer user_data)
862947 {
863 /* XXX: */
864 (void)hold;
865
866 DEBUG ("%s.%s", OFONO_IFACE_CALL_MANAGER, "SwapCalls");
948 ModemCallPrivate *priv = self->priv;
949
950 DEBUG ("");
951
867952 RETURN_NULL_IF_NOT_VALID (self);
953
954 if (!((priv->state == MODEM_CALL_STATE_HELD && !hold) ||
955 (priv->state == MODEM_CALL_STATE_ACTIVE && hold)))
956 {
957 DEBUG ("invalid hold request %d in %s state\n",
958 hold, priv->state_str);
959 return NULL;
960 }
961
962 DEBUG ("%s.%s", MODEM_OFACE_CALL_MANAGER, "SwapCalls");
868963
869964 return modem_request (MODEM_CALL (self),
870965 modem_oface_dbus_proxy (MODEM_OFACE (self->priv->service)),
900995 gboolean
901996 modem_call_can_join (ModemCall const *self)
902997 {
903 #if 0
904 if (!self || MODEM_IS_CALL_CONFERENCE (self))
998 if (!self)
905999 return FALSE;
906 #endif
9071000
9081001 return (self->priv->state == MODEM_CALL_STATE_ACTIVE ||
9091002 self->priv->state == MODEM_CALL_STATE_HELD);
10271120
10281121 g_clear_error (&error);
10291122 }
1030
1031 #if 0
1032 /* ---------------------------------------------------------------------- */
1033 /*
1034 * ModemCallConference - Interface towards Ofono Multiparty calls
1035 */
1036
1037 /* Signals */
1038 enum
1039 {
1040 SIGNAL_JOINED,
1041 SIGNAL_LEFT,
1042 N_CONFERENCE_SIGNALS
1043 };
1044
1045 static guint conference_signals[N_CONFERENCE_SIGNALS];
1046
1047 G_DEFINE_TYPE (ModemCallConference, modem_call_conference, MODEM_TYPE_CALL);
1048
1049 struct _ModemCallConferencePrivate
1050 {
1051 GHashTable *members;
1052 unsigned dispose_has_run:1, :0;
1053 };
1054
1055 static void
1056 modem_call_conference_constructed (GObject *object)
1057 {
1058 if (G_OBJECT_CLASS (modem_call_conference_parent_class)->constructed)
1059 G_OBJECT_CLASS (modem_call_conference_parent_class)->constructed (object);
1060 }
1061
1062 static void
1063 modem_call_conference_init (ModemCallConference *self)
1064 {
1065 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (
1066 self, MODEM_TYPE_CALL_CONFERENCE, ModemCallConferencePrivate);
1067 }
1068
1069 static void
1070 modem_call_conference_dispose (GObject *object)
1071 {
1072 ModemCallConference *self = MODEM_CALL_CONFERENCE (object);
1073 ModemCallConferencePrivate *priv = self->priv;
1074
1075 if (priv->dispose_has_run)
1076 return;
1077 priv->dispose_has_run = TRUE;
1078
1079 if (G_OBJECT_CLASS (modem_call_conference_parent_class)->dispose)
1080 G_OBJECT_CLASS (modem_call_conference_parent_class)->dispose (object);
1081 }
1082
1083 static void
1084 modem_call_conference_finalize (GObject *object)
1085 {
1086 if (G_OBJECT_CLASS (modem_call_conference_parent_class)->finalize)
1087 G_OBJECT_CLASS (modem_call_conference_parent_class)->finalize (object);
1088 }
1089
1090 static void
1091 modem_call_conference_class_init (ModemCallConferenceClass *klass)
1092 {
1093 GObjectClass *object_class = G_OBJECT_CLASS (klass);
1094
1095 g_type_class_add_private (klass, sizeof (ModemCallConferencePrivate));
1096
1097 object_class->constructed = modem_call_conference_constructed;
1098 object_class->dispose = modem_call_conference_dispose;
1099 object_class->finalize = modem_call_conference_finalize;
1100
1101 /* Properties */
1102 conference_signals[SIGNAL_JOINED] =
1103 g_signal_new ("joined", G_OBJECT_CLASS_TYPE (klass),
1104 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
1105 0,
1106 NULL, NULL,
1107 g_cclosure_marshal_VOID__OBJECT,
1108 G_TYPE_NONE, 1,
1109 MODEM_TYPE_CALL);
1110
1111 conference_signals[SIGNAL_LEFT] =
1112 g_signal_new ("left", G_OBJECT_CLASS_TYPE (klass),
1113 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
1114 0,
1115 NULL, NULL,
1116 g_cclosure_marshal_VOID__OBJECT,
1117 G_TYPE_NONE, 1,
1118 MODEM_TYPE_CALL);
1119 }
1120
1121 #endif
11221123
11231124 GError *
11241125 modem_call_new_error (guint causetype, guint cause, char const *prefixed)
13561357
13571358 return TONES_EVENT_SPECIAL_INFORMATION;
13581359 }
1360
1361
1362 static void
1363 on_disconnect_reason (DBusGProxy *proxy,
1364 char const *reason,
1365 gpointer user_data)
1366 {
1367 ModemCall *self = MODEM_CALL(user_data);
1368 ModemCallCauseType causetype =
1369 modem_call_cause_type_from_ofono_disconnect_reason(reason);
1370
1371 guint cause = MODEM_CALL_ERROR_RELEASE_BY_USER;
1372 if (causetype == MODEM_CALL_CAUSE_TYPE_NETWORK) {
1373 /*
1374 * TODO: Get the exact disconnect cause from modem
1375 * (not possible with current oFono API)
1376 */
1377 cause = MODEM_CALL_NET_ERROR_NETW_OUT_OF_ORDER;
1378 }
1379
1380 /* Save the disconnect reason; a state signal will follow shortly */
1381 g_object_set (self, "cause", cause, NULL);
1382 g_object_set (self, "causetype", causetype, NULL);
1383 }
1384
1385 static void
1386 on_propertychanged (DBusGProxy *proxy,
1387 char const *property,
1388 GValue *value,
1389 gpointer user_data)
1390 {
1391 ModemCall *self = MODEM_CALL(user_data);
1392
1393 if (!strcmp (property, "RemoteHeld")) {
1394 g_signal_emit (self, call_signals[SIGNAL_ON_HOLD], 0, g_value_get_boolean (value));
1395 }
1396 }
1397
9797 #define MODEM_CALL_GET_CLASS(obj) \
9898 (G_TYPE_INSTANCE_GET_CLASS ((obj), MODEM_TYPE_CALL, ModemCallClass))
9999
100 typedef struct _ModemCallConference ModemCallConference;
101 typedef struct _ModemCallConferenceClass ModemCallConferenceClass;
102 typedef struct _ModemCallConferencePrivate ModemCallConferencePrivate;
103
104 struct _ModemCallConferenceClass
105 {
106 ModemCallClass parent_class;
107 };
108
109 struct _ModemCallConference
110 {
111 ModemCall parent;
112 ModemCallConferencePrivate *priv;
113 };
114
115 GType modem_call_conference_get_type (void);
116
117 /* TYPE MACROS */
118 #define MODEM_TYPE_CALL_CONFERENCE \
119 (modem_call_conference_get_type ())
120 #define MODEM_CALL_CONFERENCE(obj) \
121 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
122 MODEM_TYPE_CALL_CONFERENCE, ModemCallConference))
123 #define MODEM_CALL_CONFERENCE_CLASS(klass) \
124 (G_TYPE_CHECK_CLASS_CAST ((klass), \
125 MODEM_TYPE_CALL_CONFERENCE, ModemCallConferenceClass))
126 #define MODEM_IS_CALL_CONFERENCE(obj) \
127 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEM_TYPE_CALL_CONFERENCE))
128 #define MODEM_IS_CALL_CONFERENCE_CLASS(klass) \
129 (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEM_TYPE_CALL_CONFERENCE))
130 #define MODEM_CALL_CONFERENCE_GET_CLASS(obj) \
131 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
132 MODEM_TYPE_CALL_CONFERENCE, ModemCallConferenceClass))
100 /* ------------------------------------------------------------------------- */
101
102 #define MODEM_OFACE_CALL_MANAGER "org.ofono.VoiceCallManager"
103 #define MODEM_OFACE_CALL "org.ofono.VoiceCall"
133104
134105 /**
135106 * Call properties
201172
202173 ModemCall *modem_call_service_get_call (ModemCallService *, char const *);
203174 ModemCall **modem_call_service_get_calls (ModemCallService *);
204 ModemCallConference *modem_call_service_get_conference (ModemCallService *);
205175
206176 typedef void ModemCallRequestDialReply (ModemCallService *,
207177 ModemRequest *,
219189 ModemCallServiceReply *callback,
220190 gpointer user_data);
221191
192 ModemRequest *modem_call_request_hangup_conference (ModemCallService *,
193 ModemCallServiceReply *callback,
194 gpointer user_data);
195
196 ModemRequest *modem_call_service_swap_calls (ModemCallService *self,
197 ModemCallServiceReply callback,
198 gpointer user_data);
199
222200 char const *modem_call_get_name (ModemCall const *);
223201 char const *modem_call_get_path (ModemCall const *);
224202 gboolean modem_call_has_path (ModemCall const *, char const *object_path);
2525
2626 #include "modem/debug.h"
2727
28 static ModemDebugFlags modem_debug_flags = 0;
28 static ModemLogFlags modem_debug_flags = 0;
2929
3030 static const GDebugKey modem_debug_keys[] = {
31 { "dbus", MODEM_SERVICE_DBUS },
32 { "call", MODEM_SERVICE_CALL },
33 { "tones", MODEM_SERVICE_TONES },
34 { "sms", MODEM_SERVICE_SMS },
35 { "sim", MODEM_SERVICE_SIM },
36 { "modem", MODEM_SERVICE_MODEM }
31 { "dbus", MODEM_LOG_DBUS },
32 { "modem", MODEM_LOG_MODEM },
33 { "call", MODEM_LOG_CALL },
34 { "sms", MODEM_LOG_SMS },
35 { "sim", MODEM_LOG_SIM },
36 { "audio", MODEM_LOG_AUDIO },
37 { "radio", MODEM_LOG_RADIO },
38 { "settings", MODEM_LOG_SETTINGS },
39 { "gprs", MODEM_LOG_GPRS },
40 { "cdma", MODEM_LOG_CDMA },
3741 };
3842
3943 void
7781 char const *
7882 modem_debug_domain(int flag)
7983 {
80 if (flag == MODEM_SERVICE_CALL)
81 return "Modem-Call";
82 else if (flag == MODEM_SERVICE_TONES)
83 return "Modem-Tones";
84 else if (flag == MODEM_SERVICE_SMS)
85 return "Modem-SMS";
86 else if (flag == MODEM_SERVICE_SIM)
87 return "Modem-SIM";
88 else
89 return "Modem";
84 if (flag & MODEM_LOG_CDMA)
85 return "modem-cdma";
86 if (flag & MODEM_LOG_CALL)
87 return "modem-call";
88 if (flag & MODEM_LOG_SMS)
89 return "modem-sms";
90 if (flag & MODEM_LOG_SIM)
91 return "modem-sim";
92 if (flag & MODEM_LOG_AUDIO)
93 return "modem-audio";
94 if (flag & MODEM_LOG_RADIO)
95 return "modem-radio";
96 if (flag & MODEM_LOG_SETTINGS)
97 return "modem-settings";
98 if (flag & MODEM_LOG_GPRS)
99 return "modem-gprs";
100
101 return "modem";
90102 }
91103
92104
2929
3030 typedef enum
3131 {
32 MODEM_SERVICE_DBUS = 1 << 0,
33 MODEM_SERVICE_CALL = 1 << 1,
34 MODEM_SERVICE_TONES = 1 << 2,
35 MODEM_SERVICE_SMS = 1 << 3,
36 MODEM_SERVICE_SIM = 1 << 4,
37 MODEM_SERVICE_MODEM = 1 << 5,
38 } ModemDebugFlags;
32 MODEM_LOG_DBUS = 1 << 0,
33 MODEM_LOG_MODEM = 1 << 1,
34 MODEM_LOG_CALL = 1 << 2,
35 MODEM_LOG_AUDIO = 1 << 3,
36 MODEM_LOG_SMS = 1 << 4,
37 MODEM_LOG_SIM = 1 << 5,
38 MODEM_LOG_RADIO = 1 << 6,
39 MODEM_LOG_SETTINGS = 1 << 7,
40 MODEM_LOG_GPRS = 1 << 8,
41 MODEM_LOG_CDMA = 1 << 9,
42 } ModemLogFlags;
3943
4044 gboolean modem_debug_flag_is_set(int flag);
4145 void modem_debug_set_flags(int flag);
6064 modem_debug(MODEM_DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
6165
6266 #define DEBUG_DBUS(format, ...) \
63 modem_debug(MODEM_SERVICE_DBUS, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
67 modem_debug(MODEM_LOG_DBUS, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
6468
6569 #define DEBUGGING modem_debug_flag_is_set(MODEM_DEBUG_FLAG)
6670
2121
2222 #include "config.h"
2323
24 #define MODEM_DEBUG_FLAG MODEM_SERVICE_DBUS
24 #define MODEM_DEBUG_FLAG MODEM_LOG_DBUS
2525 #include <modem/debug.h>
2626
2727 #include <modem/errors.h>
2222
2323 #include "config.h"
2424
25 #define MODEM_DEBUG_FLAG MODEM_SERVICE_MODEM
25 #define MODEM_DEBUG_FLAG MODEM_LOG_MODEM
2626
2727 #include "debug.h"
2828
364364 object_class->get_property = modem_get_property;
365365 object_class->set_property = modem_set_property;
366366
367 oface_class->ofono_interface = MODEM_OFACE_MODEM;
367368 oface_class->property_mapper = modem_property_mapper;
368369 oface_class->connect = modem_connect;
369370 oface_class->disconnect = modem_disconnect;
712713 gboolean
713714 modem_supports_sim (Modem const *self)
714715 {
715 return modem_get_interface (self, OFONO_IFACE_SIM) != NULL;
716 return modem_get_interface (self, MODEM_OFACE_SIM) != NULL;
716717 }
717718
718719 gboolean
719720 modem_supports_call (Modem const *self)
720721 {
721 return modem_get_interface (self, OFONO_IFACE_CALL_MANAGER) != NULL;
722 return modem_get_interface (self, MODEM_OFACE_CALL_MANAGER) != NULL;
722723 }
723724
724725 gboolean
725726 modem_supports_sms (Modem const *self)
726727 {
727 return modem_get_interface (self, OFONO_IFACE_SMS) != NULL;
728 return modem_get_interface (self, MODEM_OFACE_SMS) != NULL;
728729 }
729730
730731 gboolean
737738 g_return_val_if_fail (MODEM_IS_MODEM (self), FALSE);
738739 g_return_val_if_fail (imsi != NULL, FALSE);
739740
740 sim = (ModemSIMService *)modem_get_interface (self, OFONO_IFACE_SIM);
741 sim = (ModemSIMService *)modem_get_interface (self, MODEM_OFACE_SIM);
741742 if (sim == NULL)
742743 return FALSE;
743744
5757
5858 /* ---------------------------------------------------------------------- */
5959
60 #define MODEM_OFACE_MODEM "org.ofono.Modem"
61
6062 char const *modem_get_modem_path (Modem const *self);
6163
6264 gboolean modem_is_powered (Modem const *self);
6365 gboolean modem_is_online (Modem const *self);
6466 gboolean modem_has_interface (Modem const *self, char const *interface);
6567
68 ModemOface *modem_get_interface (Modem const *self, char const *interface);
6669 ModemOface **modem_list_interfaces (Modem const *self);
6770
6871 gboolean modem_supports_sim (Modem const *self);
2222
2323 #include "config.h"
2424
25 #define MODEM_DEBUG_FLAG MODEM_SERVICE_MODEM
25 #define MODEM_DEBUG_FLAG MODEM_LOG_MODEM
2626
2727 #include "debug.h"
2828
5151 enum
5252 {
5353 PROP_NONE,
54 PROP_DBUS_PROXY,
5554 PROP_INTERFACE,
5655 PROP_OBJECT_PATH,
5756 LAST_PROPERTY
8382 /* ------------------------------------------------------------------------ */
8483 /* Local functions */
8584
85 static void modem_oface_set_object_path (ModemOface *self, char const *path);
8686 static void on_property_changed (DBusGProxy *,
8787 char const *, GValue const *, gpointer);
8888
110110
111111 switch (property_id)
112112 {
113 case PROP_DBUS_PROXY:
114 g_value_set_object (value, priv->proxy);
115 break;
116
117113 case PROP_INTERFACE:
118114 g_value_set_string (value, dbus_g_proxy_get_interface (priv->proxy));
119115 break;
138134
139135 switch (property_id)
140136 {
141 case PROP_DBUS_PROXY:
142 self->priv->proxy = g_value_get_object (value);
143 g_object_ref (self->priv->proxy);
137 case PROP_OBJECT_PATH:
138 modem_oface_set_object_path (self, g_value_get_string (value));
144139 break;
145140
146141 default:
212207 g_type_class_add_private (klass, sizeof (ModemOfacePrivate));
213208
214209 /* Properties */
215 g_object_class_install_property (object_class, PROP_DBUS_PROXY,
216 g_param_spec_object ("dbus-proxy",
217 "D-Bus proxy",
218 "The D-Bus Proxy for the interface",
219 DBUS_TYPE_G_PROXY,
220 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
221 G_PARAM_STATIC_STRINGS));
222
223210 g_object_class_install_property (object_class, PROP_INTERFACE,
224211 g_param_spec_string ("interface",
225212 "Interface name",
233220 "Modem object path",
234221 "D-Bus object path used to identify the modem",
235222 "/", /* default value */
236 G_PARAM_READABLE |
223 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
237224 G_PARAM_STATIC_STRINGS));
238225
239226 /* Signals to emit */
247234 }
248235
249236 /* ------------------------------------------------------------------------- */
237 /* ModemOface factory */
238
239 static DBusGConnection *
240 modem_oface_get_bus (void)
241 {
242 static DBusGConnection *bus = NULL;
243
244 if (G_UNLIKELY (bus == NULL))
245 bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
246
247 return bus;
248 }
249
250 static void
251 modem_oface_set_object_path (ModemOface *self,
252 char const *object_path)
253 {
254 DBusGConnection *bus = modem_oface_get_bus ();
255 char const *interface = MODEM_OFACE_GET_CLASS (self)->ofono_interface;
256
257 self->priv->proxy =
258 dbus_g_proxy_new_for_name (bus, OFONO_BUS_NAME, object_path, interface);
259 }
260
261 static GHashTable *modem_oface_types;
262
263 char const *
264 modem_oface_get_interface_name_by_type (GType type)
265 {
266 ModemOfaceClass *klass;
267 char const *interface = NULL;
268
269 g_return_val_if_fail (G_TYPE_IS_OBJECT (type), NULL);
270
271 klass = g_type_class_peek_static (type);
272 if (klass)
273 {
274 g_return_val_if_fail (MODEM_IS_OFACE_CLASS (klass), NULL);
275 interface = klass->ofono_interface;
276 }
277 else
278 {
279 klass = g_type_class_ref (type);
280
281 if (MODEM_IS_OFACE_CLASS (klass))
282 interface = klass->ofono_interface;
283 else
284 (void) MODEM_OFACE_CLASS (klass);
285
286 g_type_class_unref (klass);
287 }
288
289 return interface;
290 }
291
292 GType
293 modem_oface_get_type_by_interface_name (char const *interface)
294 {
295 gpointer type = g_hash_table_lookup (modem_oface_types, interface);
296
297 if (type != NULL)
298 return (GType) type;
299
300 return G_TYPE_INVALID;
301 }
302
303 void
304 modem_oface_register_type (GType type)
305 {
306 static gsize once = 0;
307 gpointer interface;
308
309 if (g_once_init_enter (&once))
310 {
311 modem_oface_types = g_hash_table_new_full (g_str_hash, g_str_equal,
312 NULL, NULL);
313 g_once_init_leave (&once, 1);
314 }
315
316 interface = (gpointer) modem_oface_get_interface_name_by_type (type);
317
318 g_return_if_fail (interface);
319
320 g_hash_table_insert (modem_oface_types, interface, (gpointer)type);
321 }
322
323
324 ModemOface *
325 modem_oface_new (char const *interface, char const *object_path)
326 {
327 GType type = modem_oface_get_type_by_interface_name (interface);
328
329 if (type != G_TYPE_INVALID)
330 {
331 return g_object_new (type, "object-path", object_path, NULL);
332 }
333 else
334 {
335 return NULL;
336 }
337 }
338
339 /* ------------------------------------------------------------------------- */
250340 /* Connecting API */
251341
252342 static gboolean modem_oface_set_connected (ModemOface *, gboolean connected);
3535 {
3636 GObjectClass parent_class;
3737
38 char const *ofono_interface;
3839 /** Called when start connecting */
3940 void (*connect)(ModemOface *);
4041 /** Called when got connected */
8283
8384 /* ---------------------------------------------------------------------- */
8485
85 GType modem_oface_type (char const *interface);
86 void modem_oface_register_type (GType type);
87
88 char const *modem_oface_get_interface_name_by_type (GType type);
89
90 GType modem_oface_get_type_by_interface_name (char const *interface);
8691
8792 ModemOface *modem_oface_new (char const *interface, char const *object_path);
8893
2020
2121 #include "config.h"
2222
23 #define MODEM_DEBUG_FLAG MODEM_SERVICE_MODEM
23 #define MODEM_DEBUG_FLAG MODEM_LOG_MODEM
2424 #include "modem/debug.h"
2525
2626 #include "modem/ofono.h"
7979 return type;
8080 }
8181
82 GQuark
83 modem_ofono_iface_quark_sim (void)
84 {
85 static gsize quark = 0;
86
87 if (g_once_init_enter (&quark))
88 {
89 GQuark q = g_quark_from_static_string (OFONO_IFACE_SIM);
90 g_once_init_leave (&quark, q);
91 }
92
93 return quark;
94 }
95
96 GQuark
97 modem_ofono_iface_quark_call_manager (void)
98 {
99 static gsize quark = 0;
100
101 if (g_once_init_enter (&quark))
102 {
103 GQuark q = g_quark_from_static_string (OFONO_IFACE_CALL_MANAGER);
104 g_once_init_leave (&quark, q);
105 }
106
107 return quark;
108 }
109
110 GQuark
111 modem_ofono_iface_quark_sms (void)
112 {
113 static gsize quark = 0;
114
115 if (g_once_init_enter (&quark))
116 {
117 GQuark q = g_quark_from_static_string (OFONO_IFACE_SMS);
118 g_once_init_leave (&quark, q);
119 }
120
121 return quark;
122 }
123
124 void
125 modem_ofono_init_quarks (void)
126 {
127 modem_ofono_iface_quark_sim ();
128 modem_ofono_iface_quark_call_manager ();
129 modem_ofono_iface_quark_sms ();
130 }
131
132 static DBusGConnection *
133 modem_ofono_get_bus (void)
134 {
135 static DBusGConnection *bus = NULL;
136
137 if (G_UNLIKELY (bus == NULL))
138 bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
139
140 return bus;
141 }
142
14382 void
14483 modem_ofono_debug_managed (char const *name,
14584 char const *object_path,
15998 g_free (s);
16099 }
161100 }
162
163 /* ---------------------------------------------------------------------- */
164
165 DBusGProxy *
166 modem_ofono_proxy (char const *object_path, char const *interface)
167 {
168 return dbus_g_proxy_new_for_name (modem_ofono_get_bus (),
169 OFONO_BUS_NAME,
170 object_path,
171 interface);
172 }
3333 /* D-Bus name of the Ofono service */
3434 #define OFONO_BUS_NAME "org.ofono"
3535
36 /* Interfaces */
37 #define OFONO_IFACE_MANAGER "org.ofono.Manager"
38 #define OFONO_IFACE_MODEM "org.ofono.Modem"
39
40 /* Interfaces per modem */
41 #define OFONO_IFACE_SIM "org.ofono.SimManager"
42 #define OFONO_IFACE_CALL_MANAGER "org.ofono.VoiceCallManager"
43 #define OFONO_IFACE_CALL "org.ofono.VoiceCall"
44 #define OFONO_IFACE_SMS "org.ofono.MessageManager"
45
4636 /* Quarks for mandatory modem interfaces */
47 #define OFONO_IFACE_QUARK_SIM modem_ofono_iface_quark_sim ()
48 #define OFONO_IFACE_QUARK_CALL_MANAGER modem_ofono_iface_quark_call_manager ()
49 #define OFONO_IFACE_QUARK_SMS modem_ofono_iface_quark_sms ()
5037
5138 /* D-Bus type a{sv} for Ofono properties */
5239 #define MODEM_TYPE_DBUS_DICT modem_type_dbus_dict ()
6047 GType modem_type_dbus_dict (void);
6148 GType modem_type_dbus_ao (void);
6249 GType modem_type_dbus_managed_array (void);
63 GQuark modem_ofono_iface_quark_sim (void);
64 GQuark modem_ofono_iface_quark_call_manager (void);
65 GQuark modem_ofono_iface_quark_sms (void);
66 void modem_ofono_init_quarks (void);
67
68 DBusGProxy *modem_ofono_proxy (char const *object_path, char const *interface);
6950
7051 void modem_ofono_debug_managed (char const *name,
7152 char const *object_path,
0 /*
1 * modem/radio-settings.c - ModemRadioSettings class
2 *
3 * Copyright (C) 2011 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #define MODEM_DEBUG_FLAG MODEM_LOG_RADIO
24
25 #include "debug.h"
26
27 #include "modem/radio-settings.h"
28 #include "modem/request-private.h"
29 #include "modem/errors.h"
30 #include "modem/ofono.h"
31
32 #include <dbus/dbus-glib.h>
33
34 #include "signals-marshal.h"
35
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <assert.h>
40 #include <unistd.h>
41 #include <sys/types.h>
42 #include <signal.h>
43
44 /* ------------------------------------------------------------------------ */
45
46 G_DEFINE_TYPE (ModemRadioSettings, modem_radio_settings, MODEM_TYPE_OFACE);
47
48 /* Properties */
49 enum
50 {
51 PROP_NONE,
52 PROP_TECH_PREF,
53 PROP_GSM_BAND,
54 PROP_UMTS_BAND,
55 PROP_FAST_DORMANCY,
56 LAST_PROPERTY
57 };
58
59 /* private data */
60 struct _ModemRadioSettingsPrivate
61 {
62 char *tech_pref;
63 char *gsm_band;
64 char *umts_band;
65 gboolean fast_dormancy;
66
67 unsigned dispose_has_run:1, connected:1, signals:1, disconnected:1;
68 unsigned connection_error:1;
69 unsigned :0;
70 };
71
72 /* ------------------------------------------------------------------------ */
73
74 static void
75 modem_radio_settings_init (ModemRadioSettings *self)
76 {
77 DEBUG ("enter");
78
79 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
80 MODEM_TYPE_RADIO_SETTINGS, ModemRadioSettingsPrivate);
81 }
82
83 static void
84 modem_radio_settings_get_property (GObject *object,
85 guint property_id,
86 GValue *value,
87 GParamSpec *pspec)
88 {
89 ModemRadioSettings *self = MODEM_RADIO_SETTINGS (object);
90 ModemRadioSettingsPrivate *priv = self->priv;
91
92 switch (property_id)
93 {
94 case PROP_TECH_PREF:
95 g_value_set_string (value, priv->tech_pref);
96 break;
97
98 case PROP_GSM_BAND:
99 g_value_set_string (value, priv->gsm_band);
100 break;
101
102 case PROP_UMTS_BAND:
103 g_value_set_string (value, priv->umts_band);
104 break;
105
106 case PROP_FAST_DORMANCY:
107 g_value_set_boolean (value, priv->fast_dormancy);
108 break;
109
110 default:
111 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
112 break;
113 }
114 }
115
116 static void
117 modem_radio_settings_set_property (GObject *object,
118 guint property_id,
119 const GValue *value,
120 GParamSpec *pspec)
121 {
122 ModemRadioSettings *self = MODEM_RADIO_SETTINGS (object);
123 ModemRadioSettingsPrivate *priv = self->priv;
124
125 switch (property_id)
126 {
127 case PROP_TECH_PREF:
128 g_free (priv->tech_pref);
129 priv->tech_pref = g_value_dup_string (value);
130 break;
131
132 case PROP_GSM_BAND:
133 g_free (priv->gsm_band);
134 priv->gsm_band = g_value_dup_string (value);
135 break;
136
137 case PROP_UMTS_BAND:
138 g_free (priv->umts_band);
139 priv->umts_band = g_value_dup_string (value);
140 break;
141
142 case PROP_FAST_DORMANCY:
143 priv->fast_dormancy = g_value_get_boolean (value);
144 break;
145
146 default:
147 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
148 break;
149 }
150 }
151
152 static void
153 modem_radio_settings_constructed (GObject *object)
154 {
155 if (G_OBJECT_CLASS (modem_radio_settings_parent_class)->constructed)
156 G_OBJECT_CLASS (modem_radio_settings_parent_class)->constructed (object);
157 }
158
159 static void
160 modem_radio_settings_dispose (GObject *object)
161 {
162 if (G_OBJECT_CLASS (modem_radio_settings_parent_class)->dispose)
163 G_OBJECT_CLASS (modem_radio_settings_parent_class)->dispose (object);
164 }
165
166 static void
167 modem_radio_settings_finalize (GObject *object)
168 {
169 ModemRadioSettings *self = MODEM_RADIO_SETTINGS (object);
170 ModemRadioSettingsPrivate *priv = self->priv;
171
172 DEBUG ("enter");
173
174 /* Free any data held directly by the object here */
175 g_free (priv->tech_pref);
176 g_free (priv->gsm_band);
177 g_free (priv->umts_band);
178
179 G_OBJECT_CLASS (modem_radio_settings_parent_class)->finalize (object);
180 }
181
182 /* ------------------------------------------------------------------------- */
183 /* ModemOface interface */
184
185 static char const *
186 modem_radio_settings_property_mapper (char const *name)
187 {
188 if (!strcmp (name, "TechnologyPreference"))
189 return "technology-preference";
190 if (!strcmp(name, "GsmBand"))
191 return "gsm-band";
192 if (!strcmp (name, "UmtsBand"))
193 return "umts-band";
194 if (!strcmp (name, "FastDormancy"))
195 return "fast-dormancy";
196 return NULL;
197 }
198
199 static void
200 modem_radio_settings_connect (ModemOface *_self)
201 {
202 DEBUG ("(%p): enter", _self);
203
204 modem_oface_connect_properties (_self, TRUE);
205 }
206
207 static void
208 modem_radio_settings_connected (ModemOface *_self)
209 {
210 DEBUG ("(%p): enter", _self);
211 }
212
213 static void
214 modem_radio_settings_disconnect (ModemOface *_self)
215 {
216 DEBUG ("(%p): enter", _self);
217
218 modem_oface_disconnect_properties (_self);
219 }
220
221 static void
222 modem_radio_settings_class_init (ModemRadioSettingsClass *klass)
223 {
224 GObjectClass *object_class = G_OBJECT_CLASS (klass);
225 ModemOfaceClass *oface_class = MODEM_OFACE_CLASS (klass);
226
227 DEBUG ("enter");
228
229 object_class->get_property = modem_radio_settings_get_property;
230 object_class->set_property = modem_radio_settings_set_property;
231 object_class->constructed = modem_radio_settings_constructed;
232 object_class->dispose = modem_radio_settings_dispose;
233 object_class->finalize = modem_radio_settings_finalize;
234
235 oface_class->ofono_interface = MODEM_OFACE_RADIO_SETTINGS;
236 oface_class->property_mapper = modem_radio_settings_property_mapper;
237 oface_class->connect = modem_radio_settings_connect;
238 oface_class->connected = modem_radio_settings_connected;
239 oface_class->disconnect = modem_radio_settings_disconnect;
240
241 /* Properties */
242 g_object_class_install_property (object_class, PROP_TECH_PREF,
243 g_param_spec_string ("technology-preference",
244 "TechnologyPreference",
245 "The current radio access selection mode, also known "
246 "as network preference.",
247 "", /* default value */
248 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
249 G_PARAM_STATIC_STRINGS));
250
251 g_object_class_install_property (object_class, PROP_GSM_BAND,
252 g_param_spec_string ("gsm-band",
253 "GsmBand",
254 "Frequency band in which the modem is allowed to "
255 "operate when using \"gsm\" mode. Setting this property "
256 "has an imediate effect on modem only if "
257 "TechnologyPreference is set to \"gsm\" or \"any\". "
258 "Otherwise the value is kept and applied whenever modem "
259 "uses this mode.",
260 "", /* default value */
261 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
262 G_PARAM_STATIC_STRINGS));
263
264 g_object_class_install_property (object_class, PROP_UMTS_BAND,
265 g_param_spec_string ("umts-band",
266 "UmtsBand",
267 "Frequency band in which the modem is allowed to "
268 "operate when using \"umts\" mode. Setting this property "
269 "has an imediate effect on modem only if "
270 "TechnologyPreference is set to \"umts\" or \"any\". "
271 "Otherwise the value is kept and applied whenever modem "
272 "uses this mode.",
273 "", /* default value */
274 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
275 G_PARAM_STATIC_STRINGS));
276
277 g_object_class_install_property (object_class, PROP_FAST_DORMANCY,
278 g_param_spec_boolean ("fast-dormancy",
279 "FastDormancy",
280 "This property will enable or disable the fast "
281 "dormancy feature in the modem. Fast dormancy "
282 "refers to a modem feature that allows the "
283 "modem to quickly release radio resources after "
284 "a burst of data transfer has ended. Normally, "
285 "radio resources are released by the network "
286 "after a timeout configured by the network. "
287 "Fast dormancy allows the modem to release the "
288 "radio resources more quickly.",
289 FALSE, /* default value */
290 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
291 G_PARAM_STATIC_STRINGS));
292
293 g_type_class_add_private (klass, sizeof (ModemRadioSettingsPrivate));
294
295 modem_error_domain_prefix (0); /* Init errors */
296 }
0 /*
1 * modem/radio-settings.h - oFono RadiSettings interface
2 *
3 * Copyright (C) 2011 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef _MODEM_RADIO_SETTINGS_H_
22 #define _MODEM_RADIO_SETTINGS_H_
23
24 #include <glib-object.h>
25 #include <modem/request.h>
26 #include <modem/oface.h>
27
28 G_BEGIN_DECLS
29
30 #define MODEM_OFACE_RADIO_SETTINGS "org.ofono.RadioSettings"
31
32 typedef struct _ModemRadioSettings ModemRadioSettings;
33 typedef struct _ModemRadioSettingsClass ModemRadioSettingsClass;
34 typedef struct _ModemRadioSettingsPrivate ModemRadioSettingsPrivate;
35
36 struct _ModemRadioSettingsClass
37 {
38 ModemOfaceClass parent_class;
39 };
40
41 struct _ModemRadioSettings
42 {
43 ModemOface parent;
44 ModemRadioSettingsPrivate *priv;
45 };
46
47 GType modem_radio_settings_get_type (void);
48
49 /* TYPE MACROS */
50 #define MODEM_TYPE_RADIO_SETTINGS \
51 (modem_radio_settings_get_type ())
52 #define MODEM_RADIO_SETTINGS(obj) \
53 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
54 MODEM_TYPE_RADIO_SETTINGS, ModemRadioSettings))
55 #define MODEM_RADIO_SETTINGS_CLASS(klass) \
56 (G_TYPE_CHECK_CLASS_CAST ((klass), \
57 MODEM_TYPE_RADIO_SETTINGS, ModemRadioSettingsClass))
58 #define MODEM_IS_RADIO_SETTINGS(obj) \
59 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEM_TYPE_RADIO_SETTINGS))
60 #define MODEM_IS_RADIO_SETTINGS_CLASS(klass) \
61 (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEM_TYPE_RADIO_SETTINGS))
62 #define MODEM_RADIO_SETTINGS_GET_CLASS(obj) \
63 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
64 MODEM_TYPE_RADIO_SETTINGS, ModemRadioSettingsClass))
65
66 /* ---------------------------------------------------------------------- */
67
68 G_END_DECLS
69
70 #endif /* #ifndef _MODEM_RADIO_SETTINGS_H_*/
2020
2121 #include "config.h"
2222
23 #define MODEM_DEBUG_FLAG MODEM_SERVICE_MODEM
23 #define MODEM_DEBUG_FLAG MODEM_LOG_MODEM
2424
2525 #include "debug.h"
2626
226226 dbus_bus_add_match (bus,
227227 "type='signal',"
228228 "sender='org.ofono',"
229 "interface='org.ofono.MessageManager',"
230 "member='StatusReport'",
231 NULL);
232 dbus_bus_add_match (bus,
233 "type='signal',"
234 "sender='org.ofono',"
229235 "interface='org.ofono.VoiceCallManager',"
230236 "member='PropertyChanged'",
231237 NULL);
284290 object_class->dispose = modem_service_dispose;
285291 object_class->finalize = modem_service_finalize;
286292
293 oface_class->ofono_interface = MODEM_OFACE_MANAGER;
287294 oface_class->connect = modem_service_connect;
288295 oface_class->disconnect = modem_service_disconnect;
289296
344351 DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
345352
346353 modem_error_domain_prefix (0); /* Init errors */
347
348 modem_ofono_init_quarks ();
349354 }
350355
351356 /* ------------------------------------------------------------------------ */
352357 /* modem_service interface */
353358
354359 /* -------------------------------------------------------------------------- */
355 /* ModemOface factory */
356
357 static GHashTable *modem_oface_types;
358
359 void
360 modem_service_register_oface (char const *interface,
361 GType type)
362 {
363 static gsize once = 0;
364
365 if (g_once_init_enter (&once))
366 {
367 modem_oface_types = g_hash_table_new_full (g_str_hash, g_str_equal,
368 g_free, NULL);
369 g_once_init_leave (&once, 1);
370 }
371
372 g_hash_table_insert (modem_oface_types, g_strdup (interface), (gpointer)type);
373 }
374
375
376 GType
377 modem_oface_type (char const *interface)
378 {
379 gpointer type = g_hash_table_lookup (modem_oface_types, interface);
380
381 if (type != NULL)
382 return (GType) type;
383
384 return G_TYPE_INVALID;
385 }
386
387 ModemOface *
388 modem_oface_new (char const *interface, char const *object_path)
389 {
390 GType type;
391 DBusGProxy *proxy;
392
393 type = modem_oface_type (interface);
394 if (type == G_TYPE_INVALID)
395 {
396 return NULL;
397 }
398
399 proxy = modem_ofono_proxy (object_path, interface);
400
401 DEBUG("proxy %p for interface %s, type %d", proxy, interface, type);
402
403 if (proxy == NULL)
404 {
405 return NULL;
406 }
407
408 return g_object_new (type, "dbus-proxy", proxy, NULL);
409 }
410360
411361 ModemService *modem_service (void)
412362 {
413363 static ModemService *service;
414364
415365 if (!service) {
416 service = g_object_new (MODEM_TYPE_SERVICE,
417 "dbus-proxy", modem_ofono_proxy("/", OFONO_IFACE_MANAGER),
418 NULL);
419
420 #define REG(iface, type) modem_service_register_oface (iface, type)
421
422 REG (OFONO_IFACE_MODEM, MODEM_TYPE_MODEM);
423 REG (OFONO_IFACE_SIM, MODEM_TYPE_SIM_SERVICE);
424 REG (OFONO_IFACE_SMS, MODEM_TYPE_SMS_SERVICE);
425 REG (OFONO_IFACE_CALL_MANAGER, MODEM_TYPE_CALL_SERVICE);
426
427 #undef REG
366 modem_oface_register_type (MODEM_TYPE_SERVICE);
367 modem_oface_register_type (MODEM_TYPE_MODEM);
368
369 service = MODEM_SERVICE (modem_oface_new (MODEM_OFACE_MANAGER, "/"));
428370 }
429371
430372 return service;
556498 return;
557499 }
558500
559 modem = MODEM_MODEM (modem_oface_new (OFONO_IFACE_MODEM, object_path));
501 modem = MODEM_MODEM (modem_oface_new (MODEM_OFACE_MODEM, object_path));
560502 if (modem == NULL)
561503 {
562504 DEBUG ("Cannot create modem object %s", object_path);
6565
6666 /* ---------------------------------------------------------------------- */
6767
68 #define MODEM_OFACE_MANAGER "org.ofono.Manager"
69
6870 ModemService *modem_service(void);
6971
7072 void modem_service_refresh (ModemService *self);
2121
2222 #include "config.h"
2323
24 #define MODEM_DEBUG_FLAG MODEM_SERVICE_SIM
24 #define MODEM_DEBUG_FLAG MODEM_LOG_SIM
2525
2626 #include "debug.h"
2727
258258 object_class->dispose = modem_sim_service_dispose;
259259 object_class->finalize = modem_sim_service_finalize;
260260
261 oface_class->ofono_interface = MODEM_OFACE_SIM;
261262 oface_class->property_mapper = modem_sim_service_property_mapper;
262263 oface_class->connect = modem_sim_service_connect;
263264 oface_class->connected = modem_sim_service_connected;
6262 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
6363 MODEM_TYPE_SIM_SERVICE, ModemSIMServiceClass))
6464
65 /* ---------------------------------------------------------------------- */
66
67 #define MODEM_OFACE_SIM "org.ofono.SimManager"
68
6569 enum _ModemSIMState
6670 {
6771 MODEM_SIM_STATE_UNKNOWN = 0,
7680 MODEM_SIM_STATE_REJECTED,
7781 LAST_MODEM_SIM_STATE
7882 };
79
80 /* ---------------------------------------------------------------------- */
8183
8284 typedef void ModemSIMStringReply (ModemSIMService *self,
8385 ModemRequest *request,
0 /*
1 * modem/sms-history.c - oFono SMS History interface
2 *
3 * Copyright (C) 2013 Jolla Ltd
4 *
5 * This work is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This work is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this work; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include "config.h"
21
22 #define MODEM_DEBUG_FLAG MODEM_LOG_SMS
23
24 #include "debug.h"
25
26 #include "modem/sms-history.h"
27 #include "modem/sms.h"
28 #include "modem/ofono.h"
29 #include "modem/modem.h"
30 #include "modem/service.h"
31
32 #include <dbus/dbus-glib.h>
33 #include "signals-marshal.h"
34
35 /* ------------------------------------------------------------------------ */
36
37 G_DEFINE_TYPE (ModemSmsHistory, modem_sms_history, MODEM_TYPE_OFACE);
38
39 /* ------------------------------------------------------------------------ */
40
41 static void
42 modem_sms_history_init (ModemSmsHistory *self)
43 {
44 DEBUG ("enter");
45 }
46
47 static void
48 modem_sms_history_constructed (GObject *object)
49 {
50 if (G_OBJECT_CLASS (modem_sms_history_parent_class)->constructed)
51 G_OBJECT_CLASS (modem_sms_history_parent_class)->constructed (object);
52 }
53
54 static void
55 modem_sms_history_dispose (GObject *object)
56 {
57 if (G_OBJECT_CLASS (modem_sms_history_parent_class)->dispose)
58 G_OBJECT_CLASS (modem_sms_history_parent_class)->dispose (object);
59 }
60
61 static void
62 modem_sms_history_finalize (GObject *object)
63 {
64 DEBUG ("enter");
65 }
66
67 static void on_sms_history_status_report (DBusGProxy *proxy,
68 char const *token,
69 GHashTable *dict,
70 gpointer user_data)
71 {
72 ModemSmsHistory *self = MODEM_SMS_HISTORY(user_data);
73 ModemService *modemService = modem_service();
74 if (!modemService)
75 return;
76
77 Modem *modem = modem_service_find_by_path (modemService, dbus_g_proxy_get_path(proxy));
78 if (!modem)
79 return;
80
81 ModemSMSService *smsService = MODEM_SMS_SERVICE(modem_get_interface (modem, MODEM_OFACE_SMS));
82 if (!smsService)
83 return;
84
85 on_manager_message_status_report(proxy, token, dict, smsService);
86 }
87
88 /* ------------------------------------------------------------------------- */
89 /* ModemOface interface */
90
91 static void
92 modem_sms_history_connect (ModemOface *_self)
93 {
94 DEBUG ("(%p): enter", _self);
95
96 ModemSmsHistory *self = MODEM_SMS_HISTORY (_self);
97 DBusGProxy *proxy = modem_oface_dbus_proxy (_self);
98 dbus_g_proxy_add_signal (proxy, "StatusReport",
99 G_TYPE_STRING, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
100 dbus_g_proxy_connect_signal (proxy, "StatusReport",
101 G_CALLBACK (on_sms_history_status_report), self, NULL);
102 }
103
104 static void
105 modem_sms_history_connected (ModemOface *_self)
106 {
107 DEBUG ("(%p): enter", _self);
108 }
109
110 static void
111 modem_sms_history_disconnect (ModemOface *_self)
112 {
113 DEBUG ("(%p): enter", _self);
114 DBusGProxy *proxy = modem_oface_dbus_proxy (_self);
115 ModemSmsHistory *self = MODEM_SMS_HISTORY (_self);
116 dbus_g_proxy_disconnect_signal (proxy, "StatusReport",
117 G_CALLBACK (on_sms_history_status_report), self);
118 }
119
120 static void
121 modem_sms_history_class_init (ModemSmsHistoryClass *klass)
122 {
123 GObjectClass *object_class = G_OBJECT_CLASS (klass);
124 ModemOfaceClass *oface_class = MODEM_OFACE_CLASS (klass);
125
126 DEBUG ("enter");
127
128 object_class->constructed = modem_sms_history_constructed;
129 object_class->dispose = modem_sms_history_dispose;
130 object_class->finalize = modem_sms_history_finalize;
131
132 oface_class->ofono_interface = MODEM_OFACE_SMS_HISTORY;
133 oface_class->connect = modem_sms_history_connect;
134 oface_class->connected = modem_sms_history_connected;
135 oface_class->disconnect = modem_sms_history_disconnect;
136
137 modem_error_domain_prefix (0); /* Init errors */
138 }
139
140
0 /*
1 * modem/sms-history.h - oFono SMS History interface
2 *
3 * Copyright (C) 2013 Jolla Ltd
4 *
5 * This work is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This work is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this work; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef _MODEM_SMS_HISTORY_H_
21 #define _MODEM_SMS_HISTORY_H_
22
23 #include <glib-object.h>
24 #include <modem/oface.h>
25
26 G_BEGIN_DECLS
27
28 #define MODEM_OFACE_SMS_HISTORY "org.ofono.SmsHistory"
29
30 typedef struct _ModemSmsHistory ModemSmsHistory;
31 typedef struct _ModemSmsHistoryClass ModemSmsHistoryClass;
32
33 struct _ModemSmsHistoryClass
34 {
35 ModemOfaceClass parent_class;
36 };
37
38 struct _ModemSmsHistory
39 {
40 ModemOface parent;
41 };
42
43 GType modem_sms_history_get_type (void);
44
45 /* TYPE MACROS */
46 #define MODEM_TYPE_SMS_HISTORY \
47 (modem_sms_history_get_type ())
48 #define MODEM_SMS_HISTORY(obj) \
49 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
50 MODEM_TYPE_SMS_HISTORY, ModemSmsHistory))
51 #define MODEM_SMS_HISTORY_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_CAST ((klass), \
53 MODEM_TYPE_SMS_HISTORY, ModemSmsHistoryClass))
54 #define MODEM_IS_SMS_HISTORY(obj) \
55 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MODEM_TYPE_SMS_HISTORY))
56 #define MODEM_IS_SMS_HISTORY_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_TYPE ((klass), MODEM_TYPE_SMS_HISTORY))
58 #define MODEM_SMS_HISTORY_GET_CLASS(obj) \
59 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
60 MODEM_TYPE_SMS_HISTORY, ModemSmsHistoryClass))
61
62 /* ---------------------------------------------------------------------- */
63
64 G_END_DECLS
65
66 #endif /* #ifndef _MODEM_SMS_HISTORY_H_*/
0 /*
1 * modem/sms-message.c - ModemSMSMessage class
2 *
3 * Copyright (C) 2013 Jolla Ltd
4 *
5 * This work is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This work is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this work; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include "config.h"
21
22 #define MODEM_DEBUG_FLAG MODEM_LOG_SMS
23
24 #include "debug.h"
25
26 #include "modem/sms-message.h"
27 #include "modem/sms.h"
28 #include "modem/request-private.h"
29 #include "modem/errors.h"
30
31 #include "modem/ofono.h"
32
33 #include <dbus/dbus-glib.h>
34 #include <dbus/dbus-glib-lowlevel.h>
35
36 #include <telepathy-glib/errors.h>
37
38 #include "signals-marshal.h"
39
40 #include <uuid/uuid.h>
41
42 #include <stdio.h>
43 #include <stdlib.h>
44 #include <string.h>
45 #include <assert.h>
46
47 #define MODEM_OFACE_SMS_MESSAGE "org.ofono.Message"
48
49 /* ---------------------------------------------------------------------- */
50
51 G_DEFINE_TYPE (ModemSMSMessage, modem_sms_message, G_TYPE_OBJECT);
52
53 /* Forward declarations */
54 static void on_message_property_changed (DBusGProxy *, char const *, GValue *,
55 gpointer);
56
57 static void
58 modem_sms_message_init (ModemSMSMessage *self)
59 {
60 self->destination = NULL;
61 self->message_token = NULL;
62 self->message_proxy = NULL;
63 self->message_service = NULL;
64 self->status_report_requested = FALSE;
65 }
66
67 /* ------------------------------------------------------------------------- */
68 enum {
69 PROP_0,
70 PROP_DESTINATION,
71 PROP_TOKEN,
72 PROP_PROXY,
73 PROP_SERVICE,
74 PROP_SRR,
75 N_PROPERTIES
76 };
77
78 static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
79
80 static void
81 modem_sms_message_get_property (GObject *object,
82 guint property_id,
83 GValue *value,
84 GParamSpec *pspec)
85 {
86 ModemSMSMessage *self = MODEM_SMS_MESSAGE (object);
87
88 switch (property_id)
89 {
90 case PROP_DESTINATION:
91 g_value_set_string (value, self->destination);
92 break;
93 case PROP_TOKEN:
94 g_value_set_string (value, self->message_token);
95 break;
96 case PROP_PROXY:
97 g_value_set_pointer (value, self->message_proxy);
98 break;
99 case PROP_SERVICE:
100 g_value_set_pointer (value, self->message_service);
101 break;
102 case PROP_SRR:
103 g_value_set_boolean (value, self->status_report_requested);
104 break;
105 default:
106 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
107 break;
108 }
109 }
110
111 static void
112 modem_sms_message_set_property (GObject *object,
113 guint property_id,
114 const GValue *value,
115 GParamSpec *pspec)
116 {
117 ModemSMSMessage *self = MODEM_SMS_MESSAGE (object);
118 gpointer old;
119
120 switch (property_id)
121 {
122 case PROP_DESTINATION:
123 old = self->destination;
124 self->destination = g_value_dup_string (value);
125 g_free (old);
126 break;
127 case PROP_TOKEN:
128 old = self->message_token;
129 self->message_token = g_value_dup_string (value);
130 g_free (old);
131 break;
132 case PROP_PROXY:
133 self->message_proxy = g_value_get_pointer (value);
134 break;
135 case PROP_SERVICE:
136 self->message_service = g_value_get_pointer (value);
137 break;
138 case PROP_SRR:
139 self->status_report_requested = g_value_get_boolean (value);
140 break;
141 default:
142 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
143 break;
144 }
145 }
146
147 static void
148 modem_sms_message_finalize (GObject *object)
149 {
150 ModemSMSMessage *self = MODEM_SMS_MESSAGE (object);
151 g_free (self->destination);
152 g_free (self->message_token);
153 g_object_unref (self->message_proxy);
154 G_OBJECT_CLASS (modem_sms_message_parent_class)->finalize (object);
155 }
156
157 static void
158 modem_sms_message_constructed (GObject *object)
159 {
160 ModemSMSMessage *self = MODEM_SMS_MESSAGE (object);
161
162 if (!self->destination || !self->message_token
163 || !self->message_service)
164 {
165 DEBUG("This message object needs destination, token and service");
166 return;
167 }
168
169 /* Listen to this org.ofono.Message object's state changes */
170 DBusGConnection *bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
171 if (!bus)
172 return;
173 self->message_proxy = dbus_g_proxy_new_for_name (bus, OFONO_BUS_NAME,
174 self->message_token, MODEM_OFACE_SMS_MESSAGE);
175 if (!self->message_proxy)
176 return;
177 dbus_g_proxy_add_signal (self->message_proxy, "PropertyChanged", G_TYPE_STRING,
178 G_TYPE_VALUE, G_TYPE_INVALID);
179 dbus_g_proxy_connect_signal (self->message_proxy, "PropertyChanged",
180 G_CALLBACK (on_message_property_changed), self, NULL);
181
182 }
183
184 static void
185 modem_sms_message_class_init (ModemSMSMessageClass *klass)
186 {
187 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
188 gobject_class->get_property = modem_sms_message_get_property;
189 gobject_class->set_property = modem_sms_message_set_property;
190 gobject_class->constructed = modem_sms_message_constructed;
191 gobject_class->finalize = modem_sms_message_finalize;
192
193 obj_properties[PROP_DESTINATION] =
194 g_param_spec_string ("destination",
195 "Destination",
196 "MO SMS Destination",
197 NULL, /* default value */
198 G_PARAM_READWRITE | G_PARAM_CONSTRUCT );
199
200 obj_properties[PROP_TOKEN] =
201 g_param_spec_string ("message_token",
202 "Token",
203 "MO SMS Message Token",
204 NULL, /* default value */
205 G_PARAM_READWRITE | G_PARAM_CONSTRUCT );
206
207 obj_properties[PROP_PROXY] =
208 g_param_spec_pointer ("message_proxy",
209 "D-Bus proxy",
210 "MO SMS D-Bus proxy",
211 G_PARAM_READWRITE | G_PARAM_CONSTRUCT );
212
213 obj_properties[PROP_SERVICE] =
214 g_param_spec_pointer ("message_service",
215 "SMS Service",
216 "SMS Service",
217 G_PARAM_READWRITE | G_PARAM_CONSTRUCT );
218
219 obj_properties[PROP_SRR] =
220 g_param_spec_boolean ("status_report_requested",
221 "SRR",
222 "MO SMS Status Report Requested",
223 FALSE, /* default value */
224 G_PARAM_READWRITE | G_PARAM_CONSTRUCT );
225
226 g_object_class_install_properties (gobject_class,
227 N_PROPERTIES,
228 obj_properties);
229
230 }
231
232 static void
233 on_message_property_changed (DBusGProxy *proxy,
234 char const *property,
235 GValue *value,
236 gpointer user_data)
237 {
238 ModemSMSMessage *self = MODEM_SMS_MESSAGE (user_data);
239 if (strcmp (property, "State") == 0){
240 const char *state = g_value_get_string (value);
241 if (strcmp (state, "sent") == 0){
242 modem_sms_emit_outgoing(self->message_service,
243 self->destination, dbus_g_proxy_get_path(proxy));
244 }
245 if (strcmp (state, "failed") == 0){
246 GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Unspecified SMS error" };
247 modem_sms_emit_error(self->message_service,
248 self->destination, dbus_g_proxy_get_path(proxy), error);
249 }
250 }
251 }
252
0 /*
1 * modem/sms-message.h - ModemSMSMessage class
2 *
3 * Copyright (C) 2013 Jolla Ltd
4 *
5 * This work is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This work is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this work; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef _MODEM_SMS_MESSAGE_H_
21 #define _MODEM_SMS_MESSAGE_H_
22
23 #include <glib-object.h>
24 #include <dbus/dbus-glib.h>
25 #include <modem/sms.h>
26
27 G_BEGIN_DECLS
28
29 typedef struct _ModemSMSMessage ModemSMSMessage;
30 typedef struct _ModemSMSMessageClass ModemSMSMessageClass;
31
32 struct _ModemSMSMessageClass
33 {
34 GObjectClass parent_class;
35 };
36
37 struct _ModemSMSMessage
38 {
39 GObject parent;
40
41 /* Properties */
42 char *destination;
43 char *message_token;
44 ModemSMSService *message_service;
45 gboolean status_report_requested;
46
47 /* Internal */
48 DBusGProxy *message_proxy;
49
50 };
51
52
53 GType modem_sms_message_get_type (void);
54
55 /* TYPE MACROS */
56 #define MODEM_TYPE_SMS_MESSAGE (modem_sms_message_get_type ())
57 #define MODEM_SMS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
58 MODEM_TYPE_SMS_MESSAGE, ModemSMSMessage))
59
60
61 G_END_DECLS
62
63 #endif /* #ifndef _MODEM_SMS_MESSAGE_H_*/
33 * Copyright (C) 2008-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
55 * @author Lassi Syrjala <first.surname@nokia.com>
6 * Copyright (C) 2013-2014 Jolla Ltd
67 *
78 * This work is free software; you can redistribute it and/or
89 * modify it under the terms of the GNU Lesser General Public
2122
2223 #include "config.h"
2324
24 #define MODEM_DEBUG_FLAG MODEM_SERVICE_SMS
25 #define MODEM_DEBUG_FLAG MODEM_LOG_SMS
2526
2627 #include "debug.h"
2728
2829 #include "modem/sms.h"
30 #include "modem/sms-message.h"
31 #include "modem/sms-history.h"
2932 #include "modem/request-private.h"
3033 #include "modem/errors.h"
3134
35 #if nomore
3236 #include "sms-glib/deliver.h"
3337 #include "sms-glib/status-report.h"
38 #endif
3439
3540 #include "modem/ofono.h"
3641
5358 /* Signals we emit */
5459 enum
5560 {
56 SIGNAL_DELIVER,
61 SIGNAL_INCOMING_MESSAGE,
62 SIGNAL_IMMEDIATE_MESSAGE,
5763 SIGNAL_OUTGOING_COMPLETE,
5864 SIGNAL_OUTGOING_ERROR,
5965 SIGNAL_STATUS_REPORT,
66 #if nomore
67 SIGNAL_DELIVER,
68 #endif
6069 N_SIGNALS
6170 };
6271
7079 PROP_SMSC,
7180 PROP_VALIDITY_PERIOD,
7281 PROP_REDUCED_CHARSET,
82 PROP_USE_DELIVERY_REPORTS,
7383 LAST_PROPERTY
7484 };
7585
8191 char *smsc;
8292 guint validity_period;
8393
94 #if nomore
8495 char **content_types;
8596
8697 GHashTable *received;
98 #endif
99
100 /* A list of pending MO SMS waiting for a send status
101 and - if requested - a status report */
102 GHashTable *pending_outgoing;
87103
88104 unsigned reduced_charset:1;
89 unsigned loopback:1;
90105 unsigned signals:1, :0;
106 gboolean use_delivery_reports;
91107 };
92108
93109 /* ------------------------------------------------------------------------ */
94110
111 #if nomore
95112 static void modem_sms_incoming_deliver (ModemSMSService *self,
96113 SMSGDeliver *deliver);
114 #endif
115
97116 static void on_incoming_message (DBusGProxy *, char const *, GHashTable *, gpointer);
98 static void on_manager_message_added (DBusGProxy *, char const *, GHashTable *,
99 gpointer);
117 static void on_immediate_message (DBusGProxy *, char const *, GHashTable *, gpointer);
100118 static void on_manager_message_removed (DBusGProxy *, char const *, gpointer);
119 static void add_pending_message (char const *, GHashTable *, gpointer);
101120
102121 /* ------------------------------------------------------------------------ */
103122 /* GObject interface */
110129 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
111130 MODEM_TYPE_SMS_SERVICE, ModemSMSServicePrivate);
112131
132 #if nomore
113133 self->priv->received = g_hash_table_new_full (g_str_hash, g_str_equal,
114134 NULL, /* Message object stored in hash owns the key */
115135 g_object_unref);
136 #endif
137
138 self->priv->pending_outgoing = g_hash_table_new_full (g_str_hash, g_str_equal,
139 NULL, /* Message object stored in hash owns the key */
140 g_object_unref);
141
116142 }
117143
118144 static void
126152
127153 switch (property_id)
128154 {
155 #if nomore
129156 case PROP_CONTENT_TYPES:
130157 g_value_set_boxed (value, priv->content_types);
131158 break;
159 #endif
132160
133161 case PROP_SMSC:
134162 g_value_set_string (value, priv->smsc);
140168
141169 case PROP_REDUCED_CHARSET:
142170 g_value_set_boolean (value, priv->reduced_charset);
171 break;
172
173 case PROP_USE_DELIVERY_REPORTS:
174 g_value_set_boolean (value, priv->use_delivery_reports);
143175 break;
144176
145177 default:
160192
161193 switch (property_id)
162194 {
195 #if nomore
163196 case PROP_CONTENT_TYPES:
164197 old = priv->content_types;
165198 priv->content_types = g_value_dup_boxed (value);
166199 if (old) g_boxed_free (G_TYPE_STRV, old);
167200 break;
201 #endif
168202
169203 case PROP_SMSC:
170204 old = priv->smsc;
180214 priv->reduced_charset = g_value_get_boolean (value);
181215 break;
182216
217 case PROP_USE_DELIVERY_REPORTS:
218 priv->use_delivery_reports = g_value_get_boolean (value);
219 break;
220
183221 default:
184222 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
185223 break;
214252 /* Free any data held directly by the object here */
215253 g_free (priv->smsc);
216254
255 #if nomore
217256 if (priv->content_types)
218257 g_boxed_free (G_TYPE_STRV, priv->content_types);
219258
220259 if (priv->received)
221260 g_hash_table_destroy (priv->received);
261 #endif
262
263 g_hash_table_destroy (priv->pending_outgoing);
222264
223265 G_OBJECT_CLASS (modem_sms_service_parent_class)->finalize (object);
224266 }
234276 modem_sms_service_property_mapper (char const *name)
235277 {
236278 if (!strcmp (name, "UseDeliveryReports"))
237 return NULL;
279 return "use-delivery-reports";
238280 if (!strcmp (name, "ServiceCenterAddress"))
239281 return "service-centre";
240282 if (!strcmp (name, "Bearer"))
260302 dbus_g_proxy_add_signal (proxy, (name), ##signature); \
261303 dbus_g_proxy_connect_signal (proxy, (name), G_CALLBACK (handler), self, NULL)
262304
263 /* XXX: SMS class 0. Does Ofono actually need a separate
264 * signal for them instead of providing the class in the
265 * properties dict? */
266 CONNECT (on_incoming_message, "ImmediateMessage",
305 CONNECT (on_immediate_message, "ImmediateMessage",
267306 G_TYPE_STRING, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
268307
269308 CONNECT (on_incoming_message, "IncomingMessage",
270309 G_TYPE_STRING, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
271310
272 CONNECT (on_manager_message_added, "MessageAdded",
273 DBUS_TYPE_G_OBJECT_PATH, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
274
275 CONNECT (on_manager_message_added, "MessageRemoved",
276 DBUS_TYPE_G_OBJECT_PATH, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
311 CONNECT (on_manager_message_removed, "MessageRemoved",
312 DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
313
314 CONNECT (on_manager_message_status_report, "StatusReport",
315 G_TYPE_STRING, MODEM_TYPE_DBUS_DICT, G_TYPE_INVALID);
277316 }
278317
279318 modem_oface_connect_properties (_self, TRUE);
280319
320 /* read pending MO SMS from oFono's TX queue */
281321 modem_oface_add_connect_request (_self,
282322 modem_oface_request_managed (_self, "GetMessages",
283323 reply_to_sms_manager_get_messages, NULL));
304344 char const *path = g_value_get_boxed (va->values + 0);
305345 GHashTable *properties = g_value_get_boxed (va->values + 1);
306346
307 on_manager_message_added (NULL, path, properties, self);
347 add_pending_message (path, properties, self);
308348 }
309349 }
310350
319359 ModemSMSService *self = MODEM_SMS_SERVICE (_self);
320360 ModemSMSServicePrivate *priv = self->priv;
321361 time_t now = time (NULL);
362
363 priv->connected = now;
364
365 #if nomore
322366 GHashTableIter i[1];
323367 gpointer key, value;
324368
325 priv->connected = now;
326
327369 for (g_hash_table_iter_init (i, priv->received);
328370 g_hash_table_iter_next (i, &key, &value);)
329371 {
330372 g_object_set (value, "time-delivered", (guint64)now, NULL);
331373 }
374 #endif
332375 }
333376
334377 static void
344387 {
345388 priv->signals = FALSE;
346389
390 dbus_g_proxy_disconnect_signal (proxy, "ImmediateMessage",
391 G_CALLBACK (on_immediate_message), self);
347392 dbus_g_proxy_disconnect_signal (proxy, "IncomingMessage",
348393 G_CALLBACK (on_incoming_message), self);
349 dbus_g_proxy_disconnect_signal (proxy, "ImmediateMessage",
350 G_CALLBACK (on_incoming_message), self);
351 dbus_g_proxy_disconnect_signal (proxy, "MessageAdded",
352 G_CALLBACK (on_manager_message_added), self);
353394 dbus_g_proxy_disconnect_signal (proxy, "MessageRemoved",
354395 G_CALLBACK (on_manager_message_removed), self);
355 }
356
396 dbus_g_proxy_disconnect_signal (proxy, "StatusReport",
397 G_CALLBACK (on_manager_message_status_report), self);
398 }
399
400 #if nomore
357401 g_hash_table_remove_all (priv->received);
402 #endif
358403
359404 modem_oface_disconnect_properties (_self);
360405 }
374419 object_class->dispose = modem_sms_service_dispose;
375420 object_class->finalize = modem_sms_service_finalize;
376421
422 oface_class->ofono_interface = MODEM_OFACE_SMS;
377423 oface_class->property_mapper = modem_sms_service_property_mapper;
378424 oface_class->connect = modem_sms_service_connect;
379425 oface_class->connected = modem_sms_service_connected;
380426 oface_class->disconnect = modem_sms_service_disconnect;
381427
428 #if nomore
382429 g_object_class_install_property (object_class, PROP_CONTENT_TYPES,
383430 g_param_spec_boxed ("content-types",
384431 "Content types used",
386433 G_TYPE_STRV,
387434 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
388435 G_PARAM_STATIC_STRINGS));
436 #endif
389437
390438 g_object_class_install_property (object_class, PROP_SMSC,
391439 g_param_spec_string ("service-centre",
416464 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
417465 G_PARAM_STATIC_STRINGS));
418466
467 g_object_class_install_property (object_class, PROP_USE_DELIVERY_REPORTS,
468 g_param_spec_boolean ("use-delivery-reports",
469 "Use Delivery Reports",
470 "Use Delivery Reports",
471 FALSE, /* default value */
472 G_PARAM_READWRITE | G_PARAM_CONSTRUCT ));
473
474 signals[SIGNAL_IMMEDIATE_MESSAGE] =
475 g_signal_new ("immediate-message",
476 G_OBJECT_CLASS_TYPE (klass),
477 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
478 0,
479 NULL, NULL,
480 _modem__marshal_VOID__STRING_BOXED,
481 G_TYPE_NONE, 2,
482 G_TYPE_STRING, G_TYPE_HASH_TABLE);
483
484 signals[SIGNAL_INCOMING_MESSAGE] =
485 g_signal_new ("incoming-message",
486 G_OBJECT_CLASS_TYPE (klass),
487 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
488 0,
489 NULL, NULL,
490 _modem__marshal_VOID__STRING_BOXED,
491 G_TYPE_NONE, 2,
492 G_TYPE_STRING, G_TYPE_HASH_TABLE);
493
494 signals[SIGNAL_OUTGOING_COMPLETE] =
495 g_signal_new ("outgoing-complete",
496 G_OBJECT_CLASS_TYPE (klass),
497 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
498 0,
499 NULL, NULL,
500 _modem__marshal_VOID__STRING_STRING,
501 G_TYPE_NONE, 2,
502 G_TYPE_STRING, G_TYPE_STRING);
503
504 signals[SIGNAL_OUTGOING_ERROR] =
505 g_signal_new ("outgoing-error",
506 G_OBJECT_CLASS_TYPE (klass),
507 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
508 0,
509 NULL, NULL,
510 _modem__marshal_VOID__STRING_STRING_POINTER,
511 G_TYPE_NONE, 3,
512 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
513
514 signals[SIGNAL_STATUS_REPORT] =
515 g_signal_new ("state-report",
516 G_OBJECT_CLASS_TYPE (klass),
517 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
518 0,
519 NULL, NULL,
520 NULL,
521 G_TYPE_NONE, 3,
522 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
523
524 #if nomore
419525 signals[SIGNAL_DELIVER] =
420526 g_signal_new ("deliver",
421527 G_OBJECT_CLASS_TYPE (klass),
426532 G_TYPE_NONE, 1,
427533 G_TYPE_OBJECT);
428534
429 signals[SIGNAL_OUTGOING_COMPLETE] =
430 g_signal_new ("outgoing-complete",
431 G_OBJECT_CLASS_TYPE (klass),
432 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
433 0,
434 NULL, NULL,
435 _modem__marshal_VOID__STRING_STRING,
436 G_TYPE_NONE, 2,
437 G_TYPE_STRING, G_TYPE_STRING);
438
439 signals[SIGNAL_OUTGOING_ERROR] =
440 g_signal_new ("outgoing-error",
441 G_OBJECT_CLASS_TYPE (klass),
442 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
443 0,
444 NULL, NULL,
445 _modem__marshal_VOID__STRING_STRING_POINTER,
446 G_TYPE_NONE, 3,
447 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
448
449 signals[SIGNAL_STATUS_REPORT] =
450 g_signal_new ("state-report",
451 G_OBJECT_CLASS_TYPE (klass),
452 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
453 0,
454 NULL, NULL,
455 g_cclosure_marshal_VOID__OBJECT,
456 G_TYPE_NONE, 1,
457 G_TYPE_OBJECT);
535 #endif
458536
459537 g_type_class_add_private (klass, sizeof (ModemSMSServicePrivate));
538
539 modem_oface_register_type(MODEM_TYPE_SMS_HISTORY);
540
460541 }
461542
462543 /* ---------------------------------------------------------------------- */
463544 /* Signal connection helpers */
464545
546 #if nomore
465547 gulong
466548 modem_sms_connect_to_connected (ModemSMSService *self,
467549 ModemSMSConnectedHandler *handler,
477559 {
478560 return g_signal_connect (self, "deliver", G_CALLBACK (handler), data);
479561 }
562 #endif
563
564 gulong
565 modem_sms_connect_to_incoming_message (ModemSMSService *self,
566 ModemSMSMessageHandler *handler,
567 gpointer data)
568 {
569 return g_signal_connect (self, "incoming-message",
570 G_CALLBACK (handler), data);
571 }
572
573 gulong
574 modem_sms_connect_to_immediate_message (ModemSMSService *self,
575 ModemSMSMessageHandler *handler,
576 gpointer data)
577 {
578 return g_signal_connect (self, "immediate-message",
579 G_CALLBACK (handler), data);
580 }
581
582 gulong
583 modem_sms_connect_to_outgoing_complete (ModemSMSService *self,
584 ModemSMSMessageHandler *handler,
585 gpointer data)
586 {
587 return g_signal_connect (self, "outgoing-complete",
588 G_CALLBACK (handler), data);
589 }
590
591 gulong
592 modem_sms_connect_to_outgoing_error (ModemSMSService *self,
593 ModemSMSMessageHandler *handler,
594 gpointer data)
595 {
596 return g_signal_connect (self, "outgoing-error",
597 G_CALLBACK (handler), data);
598 }
599
600 gulong
601 modem_sms_connect_to_status_report (ModemSMSService *self,
602 ModemSMSMessageHandler *handler,
603 gpointer data)
604 {
605 return g_signal_connect (self, "state-report",
606 G_CALLBACK (handler), data);
607 }
480608
481609 /* ------------------------------------------------------------------------- */
482610 /* modem_sms_service interface */
490618 return 0;
491619 }
492620
621 gint64
622 modem_sms_parse_time (gchar const *s)
623 {
624 GTimeVal val;
625 if (g_time_val_from_iso8601(s, &val))
626 return val.tv_sec;
627 else
628 return 0;
629 }
630
631
493632 /* ------------------------------------------------------------------------- */
494633
495634 static void
496 on_manager_message_added (DBusGProxy *proxy,
497 char const *path,
498 GHashTable *properties,
499 gpointer user_data)
635 on_manager_message_removed (DBusGProxy *proxy,
636 char const *token,
637 gpointer user_data)
500638 {
501639 ModemSMSService *self = MODEM_SMS_SERVICE (user_data);
502640
503 DEBUG ("%s", path);
504
505 (void)self;
506 }
507
508 static void
509 on_manager_message_removed (DBusGProxy *proxy,
510 char const *path,
511 gpointer user_data)
641 DEBUG ("%s", token);
642 gpointer obj = g_hash_table_lookup (self->priv->pending_outgoing,
643 (gpointer)token);
644
645 if (!obj)
646 {
647 DEBUG("No pending message with token %s, ignore", token);
648 return;
649 }
650
651 ModemSMSMessage *message = MODEM_SMS_MESSAGE(obj);
652 GValue srr = G_VALUE_INIT;
653 g_value_init (&srr, G_TYPE_BOOLEAN);
654 g_object_get_property(obj, "status_report_requested", &srr);
655 if (!g_value_get_boolean(&srr))
656 {
657 /* No status report requested, remove message now from pending list */
658 g_hash_table_remove (self->priv->pending_outgoing, (gpointer)token);
659 g_object_unref (message);
660 }
661 }
662
663 void
664 on_manager_message_status_report (DBusGProxy *proxy,
665 char const *token,
666 GHashTable *dict,
667 gpointer user_data)
512668 {
513669 ModemSMSService *self = MODEM_SMS_SERVICE (user_data);
514
515 DEBUG ("%s", path);
516
517 (void)self;
518 }
519
520 /* FIXME: something for Ofono... */
521 static char *
522 modem_sms_generate_token (void)
523 {
524 char *token;
525 uuid_t uu;
526
527 token = g_new (gchar, 37);
528 uuid_generate_random (uu);
529 uuid_unparse_lower (uu, token);
530
531 return token;
670 gpointer value;
671 int delivered = 0;
672 value = g_hash_table_lookup (dict, "Delivered");
673 if (value)
674 {
675 delivered = g_value_get_boolean(value);
676 }
677 DEBUG ("Received status report for message %s, delivery success: %d",
678 token, delivered);
679
680 gpointer obj = g_hash_table_lookup (self->priv->pending_outgoing,
681 (gpointer)token);
682 if (!obj)
683 {
684 DEBUG("No pending message with token %s, ignore", token);
685 return;
686 }
687
688 ModemSMSMessage *message = MODEM_SMS_MESSAGE(obj);
689 GValue srr = G_VALUE_INIT;
690 g_value_init (&srr, G_TYPE_BOOLEAN);
691 g_object_get_property(obj, "status_report_requested", &srr);
692 if (!g_value_get_boolean(&srr))
693 {
694 DEBUG("Status report not requested for message with token %s, ignore",
695 token);
696 return;
697 }
698
699 GValue destination = G_VALUE_INIT;
700 const char* dest_string;
701 g_value_init (&destination, G_TYPE_STRING);
702 g_object_get_property(obj, "destination", &destination);
703 dest_string = g_value_get_string(&destination);
704 g_signal_emit (self, signals[SIGNAL_STATUS_REPORT], 0, dest_string,
705 token, delivered);
706
707 g_hash_table_remove (self->priv->pending_outgoing, (gpointer)token);
708 g_object_unref (message);
532709 }
533710
534711 static void
546723 g_free (s);
547724 }
548725 }
726
727 static void
728 add_pending_message (char const *message_path,
729 GHashTable *properties,
730 gpointer user_data)
731 {
732 ModemSMSService *self = MODEM_SMS_SERVICE (user_data);
733
734 DEBUG ("%s", message_path);
735 /*
736 * Some fields are not known when reading from oFono's TX queue. Use a
737 * destination address that is valid but unlikely to match an existing
738 * one, and don't wait for status reports.
739 */
740 gpointer message_object = g_object_new( MODEM_TYPE_SMS_MESSAGE,
741 "destination", "00000000000000000000",
742 "message_token", message_path,
743 "message_service", self,
744 "status_report_requested", FALSE,
745 NULL );
746
747 g_hash_table_insert (self->priv->pending_outgoing, (gpointer)message_path,
748 g_object_ref (message_object));
749 }
750
751 #if nomore
549752
550753 static void
551754 on_incoming_message (DBusGProxy *proxy,
553756 GHashTable *dict,
554757 gpointer _self)
555758 {
556 /* FIXME: ofono does not provide this */
557759 char const *smsc = "1234567";
558760 char const *type = "text/plain";
559 char const *mwi_type = "";
560761 char const *originator = "";
561762
562763 char *token;
574775 originator = g_value_get_string (value);
575776
576777 token = modem_sms_generate_token ();
778
577779 d = sms_g_deliver_incoming (message, token, originator,
578 smsc, type, mwi_type, &error);
780 smsc, type, NULL, &error);
579781
580782 if (!d)
581783 {
582 modem_message (MODEM_SERVICE_SMS,
784 modem_message (MODEM_LOG_SMS,
583785 "deserializing SMS-DELIVER \"%s\" failed: "
584786 GERROR_MSG_FMT, token, GERROR_MSG_CODE (error));
585787 g_clear_error (&error);
591793
592794 g_free (token);
593795 }
796
797 #endif
594798
595799 /* ------------------------------------------------------------------------- */
596800
639843 /* ---------------------------------------------------------------------- */
640844 /* Message deliver */
641845
846 #if nomore
642847 static void
643848 modem_sms_incoming_deliver (ModemSMSService *self, SMSGDeliver *deliver)
644849 {
677882 g_signal_emit (self, signals[SIGNAL_DELIVER], 0, deliver);
678883 }
679884
680 #if nomore
681885 static void
682886 modem_sms_incoming_status_report (ModemSMSService *self,
683887 SMSGStatusReport *sr)
696900 g_signal_emit (self, signals[SIGNAL_STATUS_REPORT], 0, sr);
697901 }
698902 #endif
903
904 static void
905 on_immediate_message (DBusGProxy *proxy,
906 char const *message,
907 GHashTable *dict,
908 gpointer _self)
909 {
910 ModemSMSService *self = MODEM_SMS_SERVICE (_self);
911 ModemSMSServicePrivate *priv = self->priv;
912
913 if (!priv->connected)
914 return;
915
916 DEBUG ("immediate = \"%50s\"%s", message, strlen (message) > 50 ? "..." : "");
917 dump_message_dict (dict);
918
919 g_signal_emit (self, signals[SIGNAL_IMMEDIATE_MESSAGE], 0,
920 message, dict);
921 }
922
923 static void
924 on_incoming_message (DBusGProxy *proxy,
925 char const *message,
926 GHashTable *dict,
927 gpointer _self)
928 {
929 ModemSMSService *self = MODEM_SMS_SERVICE (_self);
930 ModemSMSServicePrivate *priv = self->priv;
931
932 if (!priv->connected)
933 return;
934
935 DEBUG ("incoming = \"%50s\"%s", message, strlen (message) > 50 ? "..." : "");
936 dump_message_dict (dict);
937
938 g_signal_emit (self, signals[SIGNAL_INCOMING_MESSAGE], 0,
939 message, dict);
940 }
941
699942
700943 /* ---------------------------------------------------------------------- */
701944 /* Sending */
716959 if (dbus_g_proxy_end_call (proxy, call, &error,
717960 DBUS_TYPE_G_OBJECT_PATH, &message_path,
718961 G_TYPE_INVALID))
719 {
720 char const *destination;
721
722 destination = modem_request_get_data (request, "destination");
723 }
962 {
963 char const *destination;
964 destination = modem_request_get_data (request, "destination");
965
966 GValue srr = G_VALUE_INIT;
967 g_value_init (&srr, G_TYPE_BOOLEAN);
968 g_object_get_property(self, "use-delivery-reports", &srr);
969 gboolean srr_bool = g_value_get_boolean(&srr);
970 DEBUG("Status report requested for this message: %d", srr_bool);
971
972 gpointer message_object = g_object_new( MODEM_TYPE_SMS_MESSAGE,
973 "destination", destination,
974 "message_token", message_path,
975 "message_service", self,
976 "status_report_requested", srr_bool,
977 NULL );
978
979 g_hash_table_insert (self->priv->pending_outgoing, (gpointer)message_path,
980 g_object_ref (message_object));
981
982 }
724983
725984 callback (self, request, message_path, error, user_data);
726985
734993 {
735994 ModemRequest *request;
736995
737 DEBUG (OFONO_IFACE_SMS ".SendMessage (%s,%s)", to, message);
996 DEBUG (MODEM_OFACE_SMS ".SendMessage (%s,%s)", to, message);
738997
739998 request = modem_request (self,
740999 modem_oface_dbus_proxy (MODEM_OFACE (self)),
7501009 return request;
7511010 }
7521011
753 /* ---------------------------------------------------------------------- */
754 /* Handler interface */
755
756 /* ---------------------------------------------------------------------- */
757 /* Error handling */
1012 static gchar const *
1013 _modem_sms_is_valid_address (gchar const *address)
1014 {
1015 size_t len;
1016
1017 if (address == NULL)
1018 return "NULL";
1019
1020 if (address[0] == '+')
1021 {
1022 address++;
1023 }
1024
1025 len = strspn (address, "0123456789");
1026
1027 if (address[len])
1028 return "invalid character";
1029
1030 if (len == 0)
1031 return "too short";
1032
1033 if (len > 20)
1034 return "too long";
1035
1036 return NULL;
1037 }
1038
1039 /** Return TRUE if @a address is a valid SMS address.
1040 *
1041 * A valid SMS address is a phone number with at most 20 digits either in
1042 * national or in international format (starting with +).
1043 *
1044 * @param address - ISDN address of address
1045 *
1046 * @retval TRUE - address is a valid SMS address
1047 * @retval FALSE - address is NULL, does not contain valid phone number, or it
1048 * is too long.
1049 */
1050 gboolean
1051 modem_sms_is_valid_address (gchar const *address)
1052 {
1053 return !_modem_sms_is_valid_address (address);
1054 }
1055
1056 /** Validate a SMS address @a address.
1057 *
1058 * A valid SMS address is a phone number with at most 20 digits either
1059 * in national or in international format (starting with +).
1060 *
1061 * @param address - ISDN address of address
1062 * @param error - return value for GError describing the validation error
1063 *
1064 * @retval TRUE - address is a valid SMS address
1065 * @retval FALSE - address is NULL, does not contain valid phone number, or it
1066 * is too long.
1067 */
1068 gboolean
1069 modem_sms_validate_address (gchar const *address, GError **error)
1070 {
1071 gchar const *reason = _modem_sms_is_valid_address (address);
1072
1073 if (reason)
1074 g_set_error (error, MODEM_SMS_ERRORS, MODEM_SMS_ERROR_INVALID_PARAMETER,
1075 "Invalid SMS address \"%s\": %s", address, reason);
1076
1077 return !reason;
1078 }
1079
1080 void modem_sms_emit_outgoing(ModemSMSService *self, char *address, char *path){
1081 g_signal_emit (self, signals[SIGNAL_OUTGOING_COMPLETE], 0, address, path);
1082 }
1083
1084 void modem_sms_emit_error(ModemSMSService *self, char *address, char *path, GError error){
1085 g_signal_emit (self, signals[SIGNAL_OUTGOING_ERROR], 0, address, path, &error);
1086 }
2323
2424 #include <glib-object.h>
2525
26 #if nomore
27 #include <sms-glib/deliver.h>
28 #include <sms-glib/status-report.h>
29 #include <sms-glib/submit.h>
30 #endif
31
32 #include <modem/request.h>
33 #include <modem/oface.h>
34
2635 G_BEGIN_DECLS
2736
2837 typedef struct _ModemSMSService ModemSMSService;
2938 typedef struct _ModemSMSServiceClass ModemSMSServiceClass;
3039 typedef struct _ModemSMSServicePrivate ModemSMSServicePrivate;
31
32 G_END_DECLS
33
34 #include <sms-glib/deliver.h>
35 #include <sms-glib/status-report.h>
36 #include <sms-glib/submit.h>
37 #include <modem/request.h>
38 #include <modem/oface.h>
39
40 G_BEGIN_DECLS
4140
4241 struct _ModemSMSServiceClass
4342 {
6867
6968 /* ---------------------------------------------------------------------- */
7069
70 #define MODEM_OFACE_SMS "org.ofono.MessageManager"
71
72 #if nomore
7173 typedef void ModemSMSConnectedHandler (ModemSMSService *, gpointer);
7274 typedef void ModemSMSDeliverHandler (ModemSMSService *,
7375 SMSGDeliver *, gpointer);
76 #endif
77
78 typedef void ModemSMSMessageHandler (ModemSMSService *self,
79 gchar const *message,
80 GHashTable *info,
81 gpointer user_data);
7482
7583 typedef void ModemSMSServiceReply (ModemSMSService *self,
7684 ModemRequest *request,
8593
8694 /* ---------------------------------------------------------------------- */
8795
96 #if nomore
8897 char const *modem_sms_service_property_name_by_ofono_name (char const *);
8998
9099 gulong modem_sms_connect_to_connected (ModemSMSService *self,
94103 gulong modem_sms_connect_to_deliver (ModemSMSService *self,
95104 ModemSMSDeliverHandler *user_function,
96105 gpointer user_data);
106 #endif
107
108 gulong modem_sms_connect_to_incoming_message (ModemSMSService *self,
109 ModemSMSMessageHandler *handler,
110 gpointer data);
111
112 gulong modem_sms_connect_to_immediate_message (ModemSMSService *self,
113 ModemSMSMessageHandler *handler,
114 gpointer data);
97115
98116 guint64 modem_sms_service_time_connected (ModemSMSService const *self);
117
118 gint64 modem_sms_parse_time (gchar const *);
119
120 void modem_sms_emit_outgoing(ModemSMSService *self, char *address, char *path);
121 void modem_sms_emit_error(ModemSMSService *self, char *address, char *path,
122 GError error);
123
124 void on_manager_message_status_report (DBusGProxy *, char const *, GHashTable *,
125 gpointer);
99126
100127 /* ---------------------------------------------------------------------- */
101128
116143
117144 /* ---------------------------------------------------------------------- */
118145
146 gboolean modem_sms_is_valid_address (gchar const *address);
147 gboolean modem_sms_validate_address (gchar const *address, GError **error);
148
119149 G_END_DECLS
120150
121151 #endif /* #ifndef _MODEM_SMS_SERVICE_H_*/
1818
1919 test_modem_LDADD = \
2020 ../libmodem-glib.la \
21 ../../sms-glib/libsms-glib.la \
2221 ../../tests/libtestcommon.la \
2322 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
2423 @CHECK_LIBS@
+0
-679
modem/tests/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 TESTS = test-modem$(EXEEXT)
37 test_PROGRAMS = $(am__EXEEXT_1)
38 subdir = modem/tests
39 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
42 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
43 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
44 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
45 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
46 $(ACLOCAL_M4)
47 mkinstalldirs = $(install_sh) -d
48 CONFIG_HEADER = $(top_builddir)/config.h
49 CONFIG_CLEAN_FILES =
50 CONFIG_CLEAN_VPATH_FILES =
51 am__EXEEXT_1 = test-modem$(EXEEXT)
52 am__installdirs = "$(DESTDIR)$(testdir)"
53 PROGRAMS = $(test_PROGRAMS)
54 am_test_modem_OBJECTS = test-modem.$(OBJEXT) \
55 test-modem-call-service.$(OBJEXT) test-modem-call.$(OBJEXT) \
56 test-modem-tones.$(OBJEXT) test-sim.$(OBJEXT) \
57 test-modem-request.$(OBJEXT) base.$(OBJEXT) derived.$(OBJEXT)
58 test_modem_OBJECTS = $(am_test_modem_OBJECTS)
59 test_modem_DEPENDENCIES = ../libmodem-glib.la \
60 ../../sms-glib/libsms-glib.la ../../tests/libtestcommon.la
61 AM_V_lt = $(am__v_lt_$(V))
62 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
63 am__v_lt_0 = --silent
64 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
65 depcomp = $(SHELL) $(top_srcdir)/depcomp
66 am__depfiles_maybe = depfiles
67 am__mv = mv -f
68 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
69 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
70 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
71 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
72 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
73 $(AM_CFLAGS) $(CFLAGS)
74 AM_V_CC = $(am__v_CC_$(V))
75 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
76 am__v_CC_0 = @echo " CC " $@;
77 AM_V_at = $(am__v_at_$(V))
78 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
79 am__v_at_0 = @
80 CCLD = $(CC)
81 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
82 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
83 $(AM_LDFLAGS) $(LDFLAGS) -o $@
84 AM_V_CCLD = $(am__v_CCLD_$(V))
85 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
86 am__v_CCLD_0 = @echo " CCLD " $@;
87 AM_V_GEN = $(am__v_GEN_$(V))
88 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
89 am__v_GEN_0 = @echo " GEN " $@;
90 SOURCES = $(test_modem_SOURCES)
91 DIST_SOURCES = $(test_modem_SOURCES)
92 ETAGS = etags
93 CTAGS = ctags
94 am__tty_colors = \
95 red=; grn=; lgn=; blu=; std=
96 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
97 ACLOCAL = @ACLOCAL@
98 AMTAR = @AMTAR@
99 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
100 AR = @AR@
101 AUTOCONF = @AUTOCONF@
102 AUTOHEADER = @AUTOHEADER@
103 AUTOMAKE = @AUTOMAKE@
104 AWK = @AWK@
105 CC = @CC@
106 CCDEPMODE = @CCDEPMODE@
107 CFLAGS = @CFLAGS@
108 CHECK_CFLAGS = @CHECK_CFLAGS@
109 CHECK_LIBS = @CHECK_LIBS@
110 CPP = @CPP@
111 CPPFLAGS = @CPPFLAGS@
112 CYGPATH_W = @CYGPATH_W@
113 DATADIR = @DATADIR@
114 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
115 DBUS_CFLAGS = @DBUS_CFLAGS@
116 DBUS_LIBS = @DBUS_LIBS@
117 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
118 DEFS = @DEFS@
119 DEPDIR = @DEPDIR@
120 DSYMUTIL = @DSYMUTIL@
121 DUMPBIN = @DUMPBIN@
122 ECHO_C = @ECHO_C@
123 ECHO_N = @ECHO_N@
124 ECHO_T = @ECHO_T@
125 EGREP = @EGREP@
126 ERROR_CFLAGS = @ERROR_CFLAGS@
127 EXEEXT = @EXEEXT@
128 FGREP = @FGREP@
129 GLIB_CFLAGS = @GLIB_CFLAGS@
130 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
131 GLIB_LIBS = @GLIB_LIBS@
132 GREP = @GREP@
133 INSTALL = @INSTALL@
134 INSTALL_DATA = @INSTALL_DATA@
135 INSTALL_PROGRAM = @INSTALL_PROGRAM@
136 INSTALL_SCRIPT = @INSTALL_SCRIPT@
137 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
138 LD = @LD@
139 LDFLAGS = @LDFLAGS@
140 LIBOBJS = @LIBOBJS@
141 LIBS = @LIBS@
142 LIBTOOL = @LIBTOOL@
143 LIPO = @LIPO@
144 LN_S = @LN_S@
145 LTLIBOBJS = @LTLIBOBJS@
146 MAINT = @MAINT@
147 MAKEINFO = @MAKEINFO@
148 MKDIR_P = @MKDIR_P@
149 NM = @NM@
150 NMEDIT = @NMEDIT@
151 OBJDUMP = @OBJDUMP@
152 OBJEXT = @OBJEXT@
153 OTOOL = @OTOOL@
154 OTOOL64 = @OTOOL64@
155 PACKAGE = @PACKAGE@
156 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
157 PACKAGE_NAME = @PACKAGE_NAME@
158 PACKAGE_STRING = @PACKAGE_STRING@
159 PACKAGE_TARNAME = @PACKAGE_TARNAME@
160 PACKAGE_URL = @PACKAGE_URL@
161 PACKAGE_VERSION = @PACKAGE_VERSION@
162 PATH_SEPARATOR = @PATH_SEPARATOR@
163 PKG_CONFIG = @PKG_CONFIG@
164 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
165 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
166 PYTHON = @PYTHON@
167 RANLIB = @RANLIB@
168 SED = @SED@
169 SET_MAKE = @SET_MAKE@
170 SHELL = @SHELL@
171 STRIP = @STRIP@
172 TP_CFLAGS = @TP_CFLAGS@
173 TP_LIBS = @TP_LIBS@
174 UUID_CFLAGS = @UUID_CFLAGS@
175 UUID_LIBS = @UUID_LIBS@
176 VERSION = @VERSION@
177 XSLTPROC = @XSLTPROC@
178 abs_builddir = @abs_builddir@
179 abs_srcdir = @abs_srcdir@
180 abs_top_builddir = @abs_top_builddir@
181 abs_top_srcdir = @abs_top_srcdir@
182 ac_ct_CC = @ac_ct_CC@
183 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
184 am__include = @am__include@
185 am__leading_dot = @am__leading_dot@
186 am__quote = @am__quote@
187 am__tar = @am__tar@
188 am__untar = @am__untar@
189 bindir = @bindir@
190 build = @build@
191 build_alias = @build_alias@
192 build_cpu = @build_cpu@
193 build_os = @build_os@
194 build_vendor = @build_vendor@
195 builddir = @builddir@
196 datadir = @datadir@
197 datarootdir = @datarootdir@
198 docdir = @docdir@
199 dvidir = @dvidir@
200 exec_prefix = @exec_prefix@
201 host = @host@
202 host_alias = @host_alias@
203 host_cpu = @host_cpu@
204 host_os = @host_os@
205 host_vendor = @host_vendor@
206 htmldir = @htmldir@
207 includedir = @includedir@
208 includemodemdir = @includemodemdir@
209 includesmsdir = @includesmsdir@
210 infodir = @infodir@
211 install_sh = @install_sh@
212 libdir = @libdir@
213 libexecdir = @libexecdir@
214 localedir = @localedir@
215 localstatedir = @localstatedir@
216 lt_ECHO = @lt_ECHO@
217 mandir = @mandir@
218 mkdir_p = @mkdir_p@
219 oldincludedir = @oldincludedir@
220 pdfdir = @pdfdir@
221 prefix = @prefix@
222 program_transform_name = @program_transform_name@
223 psdir = @psdir@
224 sbindir = @sbindir@
225 sharedstatedir = @sharedstatedir@
226 srcdir = @srcdir@
227 sysconfdir = @sysconfdir@
228 target_alias = @target_alias@
229 testdir = @testdir@
230 top_build_prefix = @top_build_prefix@
231 top_builddir = @top_builddir@
232 top_srcdir = @top_srcdir@
233 AM_CFLAGS = $(ERROR_CFLAGS) \
234 @TP_CFLAGS@ @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CHECK_CFLAGS@
235
236 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests -I$(top_srcdir)/modem -I..
237 test_modem_SOURCES = \
238 test-modem.c test-modem.h \
239 test-modem-call-service.c \
240 test-modem-call.c \
241 test-modem-tones.c \
242 test-sim.c \
243 test-modem-request.c \
244 base.h base.c derived.h derived.c
245
246 # test-modem-sms.c
247 test_modem_LDADD = \
248 ../libmodem-glib.la \
249 ../../sms-glib/libsms-glib.la \
250 ../../tests/libtestcommon.la \
251 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
252 @CHECK_LIBS@
253
254 all: all-am
255
256 .SUFFIXES:
257 .SUFFIXES: .c .lo .o .obj
258 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
259 @for dep in $?; do \
260 case '$(am__configure_deps)' in \
261 *$$dep*) \
262 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
263 && { if test -f $@; then exit 0; else break; fi; }; \
264 exit 1;; \
265 esac; \
266 done; \
267 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modem/tests/Makefile'; \
268 $(am__cd) $(top_srcdir) && \
269 $(AUTOMAKE) --foreign modem/tests/Makefile
270 .PRECIOUS: Makefile
271 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
272 @case '$?' in \
273 *config.status*) \
274 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
275 *) \
276 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
277 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
278 esac;
279
280 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
281 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
282
283 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
284 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
285 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
286 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
287 $(am__aclocal_m4_deps):
288 install-testPROGRAMS: $(test_PROGRAMS)
289 @$(NORMAL_INSTALL)
290 test -z "$(testdir)" || $(MKDIR_P) "$(DESTDIR)$(testdir)"
291 @list='$(test_PROGRAMS)'; test -n "$(testdir)" || list=; \
292 for p in $$list; do echo "$$p $$p"; done | \
293 sed 's/$(EXEEXT)$$//' | \
294 while read p p1; do if test -f $$p || test -f $$p1; \
295 then echo "$$p"; echo "$$p"; else :; fi; \
296 done | \
297 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
298 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
299 sed 'N;N;N;s,\n, ,g' | \
300 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
301 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
302 if ($$2 == $$4) files[d] = files[d] " " $$1; \
303 else { print "f", $$3 "/" $$4, $$1; } } \
304 END { for (d in files) print "f", d, files[d] }' | \
305 while read type dir files; do \
306 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
307 test -z "$$files" || { \
308 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testdir)$$dir'"; \
309 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testdir)$$dir" || exit $$?; \
310 } \
311 ; done
312
313 uninstall-testPROGRAMS:
314 @$(NORMAL_UNINSTALL)
315 @list='$(test_PROGRAMS)'; test -n "$(testdir)" || list=; \
316 files=`for p in $$list; do echo "$$p"; done | \
317 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
318 -e 's/$$/$(EXEEXT)/' `; \
319 test -n "$$list" || exit 0; \
320 echo " ( cd '$(DESTDIR)$(testdir)' && rm -f" $$files ")"; \
321 cd "$(DESTDIR)$(testdir)" && rm -f $$files
322
323 clean-testPROGRAMS:
324 @list='$(test_PROGRAMS)'; test -n "$$list" || exit 0; \
325 echo " rm -f" $$list; \
326 rm -f $$list || exit $$?; \
327 test -n "$(EXEEXT)" || exit 0; \
328 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
329 echo " rm -f" $$list; \
330 rm -f $$list
331 test-modem$(EXEEXT): $(test_modem_OBJECTS) $(test_modem_DEPENDENCIES)
332 @rm -f test-modem$(EXEEXT)
333 $(AM_V_CCLD)$(LINK) $(test_modem_OBJECTS) $(test_modem_LDADD) $(LIBS)
334
335 mostlyclean-compile:
336 -rm -f *.$(OBJEXT)
337
338 distclean-compile:
339 -rm -f *.tab.c
340
341 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base.Po@am__quote@
342 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/derived.Po@am__quote@
343 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-call-service.Po@am__quote@
344 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-call.Po@am__quote@
345 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-request.Po@am__quote@
346 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-tones.Po@am__quote@
347 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem.Po@am__quote@
348 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sim.Po@am__quote@
349
350 .c.o:
351 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
352 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
353 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
354 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
355 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
356 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
357
358 .c.obj:
359 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
360 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
361 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
362 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
363 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
364 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
365
366 .c.lo:
367 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
368 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
369 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
370 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
371 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
372 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
373
374 mostlyclean-libtool:
375 -rm -f *.lo
376
377 clean-libtool:
378 -rm -rf .libs _libs
379
380 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
381 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
382 unique=`for i in $$list; do \
383 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
384 done | \
385 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
386 END { if (nonempty) { for (i in files) print i; }; }'`; \
387 mkid -fID $$unique
388 tags: TAGS
389
390 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
391 $(TAGS_FILES) $(LISP)
392 set x; \
393 here=`pwd`; \
394 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
395 unique=`for i in $$list; do \
396 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
397 done | \
398 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
399 END { if (nonempty) { for (i in files) print i; }; }'`; \
400 shift; \
401 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
402 test -n "$$unique" || unique=$$empty_fix; \
403 if test $$# -gt 0; then \
404 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
405 "$$@" $$unique; \
406 else \
407 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
408 $$unique; \
409 fi; \
410 fi
411 ctags: CTAGS
412 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
413 $(TAGS_FILES) $(LISP)
414 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
415 unique=`for i in $$list; do \
416 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
417 done | \
418 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
419 END { if (nonempty) { for (i in files) print i; }; }'`; \
420 test -z "$(CTAGS_ARGS)$$unique" \
421 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
422 $$unique
423
424 GTAGS:
425 here=`$(am__cd) $(top_builddir) && pwd` \
426 && $(am__cd) $(top_srcdir) \
427 && gtags -i $(GTAGS_ARGS) "$$here"
428
429 distclean-tags:
430 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
431
432 check-TESTS: $(TESTS)
433 @failed=0; all=0; xfail=0; xpass=0; skip=0; \
434 srcdir=$(srcdir); export srcdir; \
435 list=' $(TESTS) '; \
436 $(am__tty_colors); \
437 if test -n "$$list"; then \
438 for tst in $$list; do \
439 if test -f ./$$tst; then dir=./; \
440 elif test -f $$tst; then dir=; \
441 else dir="$(srcdir)/"; fi; \
442 if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
443 all=`expr $$all + 1`; \
444 case " $(XFAIL_TESTS) " in \
445 *[\ \ ]$$tst[\ \ ]*) \
446 xpass=`expr $$xpass + 1`; \
447 failed=`expr $$failed + 1`; \
448 col=$$red; res=XPASS; \
449 ;; \
450 *) \
451 col=$$grn; res=PASS; \
452 ;; \
453 esac; \
454 elif test $$? -ne 77; then \
455 all=`expr $$all + 1`; \
456 case " $(XFAIL_TESTS) " in \
457 *[\ \ ]$$tst[\ \ ]*) \
458 xfail=`expr $$xfail + 1`; \
459 col=$$lgn; res=XFAIL; \
460 ;; \
461 *) \
462 failed=`expr $$failed + 1`; \
463 col=$$red; res=FAIL; \
464 ;; \
465 esac; \
466 else \
467 skip=`expr $$skip + 1`; \
468 col=$$blu; res=SKIP; \
469 fi; \
470 echo "$${col}$$res$${std}: $$tst"; \
471 done; \
472 if test "$$all" -eq 1; then \
473 tests="test"; \
474 All=""; \
475 else \
476 tests="tests"; \
477 All="All "; \
478 fi; \
479 if test "$$failed" -eq 0; then \
480 if test "$$xfail" -eq 0; then \
481 banner="$$All$$all $$tests passed"; \
482 else \
483 if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
484 banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
485 fi; \
486 else \
487 if test "$$xpass" -eq 0; then \
488 banner="$$failed of $$all $$tests failed"; \
489 else \
490 if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
491 banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
492 fi; \
493 fi; \
494 dashes="$$banner"; \
495 skipped=""; \
496 if test "$$skip" -ne 0; then \
497 if test "$$skip" -eq 1; then \
498 skipped="($$skip test was not run)"; \
499 else \
500 skipped="($$skip tests were not run)"; \
501 fi; \
502 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
503 dashes="$$skipped"; \
504 fi; \
505 report=""; \
506 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
507 report="Please report to $(PACKAGE_BUGREPORT)"; \
508 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
509 dashes="$$report"; \
510 fi; \
511 dashes=`echo "$$dashes" | sed s/./=/g`; \
512 if test "$$failed" -eq 0; then \
513 echo "$$grn$$dashes"; \
514 else \
515 echo "$$red$$dashes"; \
516 fi; \
517 echo "$$banner"; \
518 test -z "$$skipped" || echo "$$skipped"; \
519 test -z "$$report" || echo "$$report"; \
520 echo "$$dashes$$std"; \
521 test "$$failed" -eq 0; \
522 else :; fi
523
524 distdir: $(DISTFILES)
525 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
526 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
527 list='$(DISTFILES)'; \
528 dist_files=`for file in $$list; do echo $$file; done | \
529 sed -e "s|^$$srcdirstrip/||;t" \
530 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
531 case $$dist_files in \
532 */*) $(MKDIR_P) `echo "$$dist_files" | \
533 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
534 sort -u` ;; \
535 esac; \
536 for file in $$dist_files; do \
537 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
538 if test -d $$d/$$file; then \
539 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
540 if test -d "$(distdir)/$$file"; then \
541 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
542 fi; \
543 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
544 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
545 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
546 fi; \
547 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
548 else \
549 test -f "$(distdir)/$$file" \
550 || cp -p $$d/$$file "$(distdir)/$$file" \
551 || exit 1; \
552 fi; \
553 done
554 check-am: all-am
555 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
556 check: check-am
557 all-am: Makefile $(PROGRAMS)
558 installdirs:
559 for dir in "$(DESTDIR)$(testdir)"; do \
560 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
561 done
562 install: install-am
563 install-exec: install-exec-am
564 install-data: install-data-am
565 uninstall: uninstall-am
566
567 install-am: all-am
568 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
569
570 installcheck: installcheck-am
571 install-strip:
572 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
573 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
574 `test -z '$(STRIP)' || \
575 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
576 mostlyclean-generic:
577
578 clean-generic:
579
580 distclean-generic:
581 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
582 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
583
584 maintainer-clean-generic:
585 @echo "This command is intended for maintainers to use"
586 @echo "it deletes files that may require special tools to rebuild."
587 clean: clean-am
588
589 clean-am: clean-generic clean-libtool clean-testPROGRAMS \
590 mostlyclean-am
591
592 distclean: distclean-am
593 -rm -rf ./$(DEPDIR)
594 -rm -f Makefile
595 distclean-am: clean-am distclean-compile distclean-generic \
596 distclean-tags
597
598 dvi: dvi-am
599
600 dvi-am:
601
602 html: html-am
603
604 html-am:
605
606 info: info-am
607
608 info-am:
609
610 install-data-am: install-testPROGRAMS
611
612 install-dvi: install-dvi-am
613
614 install-dvi-am:
615
616 install-exec-am:
617
618 install-html: install-html-am
619
620 install-html-am:
621
622 install-info: install-info-am
623
624 install-info-am:
625
626 install-man:
627
628 install-pdf: install-pdf-am
629
630 install-pdf-am:
631
632 install-ps: install-ps-am
633
634 install-ps-am:
635
636 installcheck-am:
637
638 maintainer-clean: maintainer-clean-am
639 -rm -rf ./$(DEPDIR)
640 -rm -f Makefile
641 maintainer-clean-am: distclean-am maintainer-clean-generic
642
643 mostlyclean: mostlyclean-am
644
645 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
646 mostlyclean-libtool
647
648 pdf: pdf-am
649
650 pdf-am:
651
652 ps: ps-am
653
654 ps-am:
655
656 uninstall-am: uninstall-testPROGRAMS
657
658 .MAKE: check-am install-am install-strip
659
660 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
661 clean-generic clean-libtool clean-testPROGRAMS ctags distclean \
662 distclean-compile distclean-generic distclean-libtool \
663 distclean-tags distdir dvi dvi-am html html-am info info-am \
664 install install-am install-data install-data-am install-dvi \
665 install-dvi-am install-exec install-exec-am install-html \
666 install-html-am install-info install-info-am install-man \
667 install-pdf install-pdf-am install-ps install-ps-am \
668 install-strip install-testPROGRAMS installcheck \
669 installcheck-am installdirs maintainer-clean \
670 maintainer-clean-generic mostlyclean mostlyclean-compile \
671 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
672 tags uninstall uninstall-am uninstall-testPROGRAMS
673
674 -lpthread
675
676 # Tell versions [3.59,3.63) of GNU make to not export all variables.
677 # Otherwise a system limit (for SysV at least) may be exceeded.
678 .NOEXPORT:
4646
4747 START_TEST(modem_call_properties)
4848 {
49 DBusGProxy *proxy = modem_ofono_proxy("/path", "org.ofono.VoiceCall");
5049 ModemCall *ci = g_object_new(MODEM_TYPE_CALL,
50 "object-path", "/path",
5151 "call-service", NULL,
52 "dbus-proxy", proxy,
5352 NULL);
5453
5554 ModemCallService *client = (gpointer)-1;
56 gpointer dbus_proxy = (gpointer)-1;
5755 char *remote = (gpointer)-1;
5856 char *emergency = (gpointer)-1;
5957 unsigned state = (unsigned)-1;
6260
6361 g_object_get(ci,
6462 "call-service", &client,
65 "dbus-proxy", &dbus_proxy,
6663 "remote", &remote,
6764 "state", &state,
6865 "originating", &originating,
6966 "terminating", &terminating,
7067 "emergency", &emergency,
7168 "onhold", &onhold,
72 "member", &member,
69 "multiparty", &member,
7370 NULL);
7471
7572 fail_if(client == (gpointer)-1);
76 fail_if(dbus_proxy == (gpointer)-1);
7773 fail_if(remote == (gpointer)-1);
7874 fail_if(state == (unsigned)-1);
7975 fail_if(originating == (gboolean)-1);
8379 fail_if(member == (gboolean)-1);
8480
8581 fail_unless(client == NULL);
86 fail_unless(dbus_proxy == proxy);
8782 fail_unless(remote == NULL);
8883 fail_unless(state == MODEM_CALL_STATE_INVALID);
8984 fail_unless(originating == FALSE);
9287 fail_unless(onhold == FALSE);
9388 fail_unless(member == FALSE);
9489
95 g_object_unref(dbus_proxy);
9690 g_free(remote);
9791
9892 #if XXX
10397 "terminating", 0,
10498 "emergency", "urn:service:sos",
10599 "onhold", 1,
106 "member", 1,
100 "multiparty", 1,
107101 NULL);
108102
109103 g_object_get(ci,
113107 "terminating", &terminating,
114108 "emergency", &emergency,
115109 "onhold", &onhold,
116 "member", &member,
110 "multiparty", &member,
117111 NULL);
118112
119113 fail_unless(remote && strcmp(remote, "99001") == 0);
2525 #include "modem/request.c"
2626
2727 #include "modem/ofono.h"
28 #include "modem/service.h"
2829
2930 #include "test-modem.h"
3031 #include <stdio.h>
9798 START_TEST(make_call_request)
9899 {
99100 GObject *object = g_object_new(G_TYPE_OBJECT, NULL);
100 DBusGProxy *proxy = modem_ofono_proxy("/", OFONO_IFACE_MANAGER);
101 DBusGProxy *proxy;
102
103 proxy = dbus_g_proxy_new_for_name (dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL),
104 OFONO_BUS_NAME,
105 "/",
106 MODEM_OFACE_MANAGER);
101107
102108 (void)callback_to_timeout;
103109
220226 START_TEST(notify_in_call_request)
221227 {
222228 GObject *object = g_object_new(G_TYPE_OBJECT, NULL);
223 DBusGProxy *proxy = modem_ofono_proxy("/", OFONO_IFACE_MANAGER);
229 DBusGProxy *proxy;
230
231 proxy = dbus_g_proxy_new_for_name (dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL),
232 OFONO_BUS_NAME,
233 "/",
234 MODEM_OFACE_MANAGER);
224235
225236 g_object_weak_ref(object, weaknotify, &object);
226237 g_object_weak_ref(G_OBJECT(proxy), weaknotify, &proxy);
0 /*
1 * test-modem-sms.c - Test cases for ModemSMSService
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #define MODEM_DEBUG_FLAG (-1)
24 #define _ATFILE_SOURCE (1)
25
26 #include "modem/debug.h"
27 #include <modem/sms.h>
28 #include <modem/errors.h>
29
30 #include <sms-glib/submit.h>
31 #include <sms-glib/deliver.h>
32 #include <sms-glib/errors.h>
33
34 #include <dbus/dbus-glib.h>
35
36 #include "test-modem.h"
37 #include <assert.h>
38 #include <stdio.h>
39 #include <string.h>
40 #include <stdlib.h>
41 #include <sys/types.h>
42 #include <sys/stat.h>
43 #include <dirent.h>
44 #include <unistd.h>
45 #include <signal.h>
46 #include <errno.h>
47
48 gchar const default_smsc[] = "+3584544" "00046";
49 gchar const national_smsc[] = "04544" "00046";
50
51 static GMainLoop *mainloop = NULL;
52 static ModemSMSService *sms_service;
53
54 static struct event {
55 enum {
56 SEND_REPLY = 1,
57 INCOMING,
58 OUTGOING_COMPLETE,
59 OUTGOING_ERROR,
60 STATUS_REPORT,
61 CONNECTED,
62 } reason;
63 gchar *id;
64 gchar *destination;
65 GError *error;
66 SMSGStatusReport *sr;
67 SMSGDeliver *deliver;
68 } events[4 * 256];
69
70 static int reported = 0, steps;
71
72 static guint64 client_connected;
73
74 static void
75 on_connected(ModemSMSService *modem_sms_service,
76 gpointer _self)
77 {
78 memset(&events[reported], 0, sizeof events[reported]);
79 events[reported].reason = CONNECTED;
80 reported++;
81
82 client_connected = modem_sms_service_time_connected(modem_sms_service);
83
84 assert(reported < 1024); /* abort() if not in events */
85 }
86
87 static void
88 on_deliver(ModemSMSService *modem_sms_service,
89 SMSGDeliver *received,
90 gpointer _self)
91 {
92 memset(&events[reported], 0, sizeof events[reported]);
93 events[reported].reason = INCOMING;
94 events[reported].id = g_strdup(sms_g_deliver_get_message_token(received));
95 events[reported].deliver = g_object_ref(received);
96 reported++;
97
98 assert(reported < 1024); /* abort() if not in events */
99 }
100
101 static void send_reply(ModemSMSService *sms_service,
102 ModemRequest *call,
103 gchar const *message_id,
104 GError const *error,
105 gpointer userdata)
106 {
107 (void)sms_service, (void)call;
108 memset(&events[reported], 0, sizeof events[reported]);
109 events[reported].reason = SEND_REPLY;
110 events[reported].id = message_id ? g_strdup(message_id) : NULL;
111 events[reported].error = error ? g_error_copy(error) : NULL;
112 reported++;
113 assert(reported < 1024); /* abort() if not in events */
114 }
115
116 static void
117 on_outgoing_complete(
118 ModemSMSService *sms_service,
119 gchar const *message_id,
120 gchar const *destination,
121 gpointer user_data)
122 {
123 memset(&events[reported], 0, sizeof events[reported]);
124 events[reported].reason = OUTGOING_COMPLETE;
125 events[reported].id = message_id ? g_strdup(message_id) : NULL;
126 events[reported].destination = g_strdup(destination);
127 reported++;
128 assert(reported < 1024); /* abort() if not in events */
129 }
130
131 void
132 on_outgoing_error(
133 ModemSMSService *self,
134 gchar const *message_id,
135 gchar const *destination,
136 GError const *error,
137 gpointer user_data)
138 {
139 memset(&events[reported], 0, sizeof events[reported]);
140 events[reported].reason = OUTGOING_ERROR;
141 events[reported].id = message_id ? g_strdup(message_id) : NULL;
142 events[reported].destination = g_strdup(destination);
143 events[reported].error = g_error_copy(error);
144 reported++;
145 assert(reported < 1024); /* abort() if not in events */
146 }
147
148 void on_status_report(
149 ModemSMSService *self,
150 SMSGStatusReport *status_report,
151 gpointer user_data)
152 {
153 memset(&events[reported], 0, sizeof events[reported]);
154 events[reported].reason = STATUS_REPORT;
155 events[reported].id = g_strdup(sms_g_status_report_get_message_token(status_report));
156 events[reported].sr = g_object_ref(status_report);
157 reported++;
158 assert(reported < 1024); /* abort() if not in events */
159 }
160
161 static void zap_events(void)
162 {
163 guint i;
164
165 for (i = 0; i < reported; i++) {
166 g_free(events[i].id);
167 if (events[i].error) g_error_free(events[i].error);
168 if (events[i].sr) g_object_unref(events[i].sr);
169 if (events[i].deliver) g_object_unref(events[i].deliver);
170 if (events[i].destination) g_free(events[i].destination);
171 }
172
173 reported = 0;
174 }
175
176 static struct {
177 gpointer original;
178 size_t size;
179 guint8 data[16];
180 } quitter;
181
182 static gboolean quit_loop (gpointer pointer)
183 {
184 (void)pointer;
185 if (memcmp(quitter.original, quitter.data, quitter.size)) {
186 g_main_loop_quit (mainloop);
187 return FALSE;
188 }
189 return TRUE;
190 }
191
192 static void run_until(gpointer change, size_t size)
193 {
194 assert(size <= sizeof quitter.data);
195 memcpy(quitter.data, quitter.original = change, quitter.size = size);
196
197 #if 1
198 g_idle_add_full(300,
199 quit_loop,
200 (gpointer)quit_loop,
201 NULL);
202 #else
203 g_timeout_add(20, quit_loop, (gpointer)quit_loop);
204 #endif
205 g_main_loop_run (mainloop);
206 }
207
208 gulong
209 id_connected,
210 id_deliver, id_outgoing_complete,
211 id_outgoing_error, id_status_report;
212
213 char *test_spooldir;
214
215 static void echo_setup(void)
216 {
217 setenv("SMS_LOOPBACK", "1", 1);
218
219 /* sms_g_debug_set_flags(0xffffffff); */
220
221 g_type_init();
222 (void)dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
223 mainloop = g_main_loop_new (NULL, FALSE);
224
225 char *spooldir, *expect =
226 g_strdup_printf("/tmp/test-modem-sms-%u/srr/spool", (unsigned)getpid());
227
228 sms_service = g_object_new(MODEM_TYPE_SMS_SERVICE,
229 "srr-spool-directory", expect,
230 NULL);
231
232 g_object_get(sms_service, "srr-spool-directory", &spooldir, NULL);
233
234 fail_if(strcmp(spooldir, expect));
235 test_spooldir = spooldir;
236 g_free(expect);
237
238 id_deliver =
239 modem_sms_connect_to_deliver(
240 sms_service, on_deliver, events);
241
242 id_outgoing_complete =
243 modem_sms_connect_to_outgoing_complete(
244 sms_service, on_outgoing_complete, events);
245
246 id_outgoing_error =
247 modem_sms_connect_to_outgoing_error(
248 sms_service, on_outgoing_error, events);
249
250 id_status_report =
251 modem_sms_connect_to_status_report(
252 sms_service, on_status_report, events);
253
254 id_connected =
255 modem_sms_connect_to_connected(
256 sms_service, on_connected, events);
257
258 fail_unless(modem_sms_service_connect(sms_service));
259 run_until(&client_connected, sizeof client_connected);
260 fail_unless(modem_sms_service_time_connected(sms_service) != 0);
261 zap_events();
262
263 g_object_unref(sms_service);
264 }
265
266 static void echo_teardown(void)
267 {
268 if (id_connected != 0 &&
269 g_signal_handler_is_connected(sms_service, id_connected))
270 g_signal_handler_disconnect(sms_service, id_connected);
271 id_connected = 0;
272
273 if (id_deliver != 0 &&
274 g_signal_handler_is_connected(sms_service, id_deliver))
275 g_signal_handler_disconnect(sms_service, id_deliver);
276 id_deliver = 0;
277
278 if (id_outgoing_complete != 0 &&
279 g_signal_handler_is_connected(sms_service, id_outgoing_complete))
280 g_signal_handler_disconnect(sms_service, id_outgoing_complete);
281 id_outgoing_complete = 0;
282
283 if (id_outgoing_error != 0 &&
284 g_signal_handler_is_connected(sms_service, id_outgoing_error))
285 g_signal_handler_disconnect(sms_service, id_outgoing_error);
286 id_outgoing_error = 0;
287
288 if (id_status_report != 0 &&
289 g_signal_handler_is_connected(sms_service, id_status_report))
290 g_signal_handler_disconnect(sms_service, id_status_report);
291 id_status_report = 0;
292
293 zap_events();
294
295 if (sms_service)
296 g_object_unref((GObject *)sms_service), sms_service = NULL;
297
298 if (test_spooldir) {
299 DIR *dir = opendir(test_spooldir);
300 struct dirent *d;
301 if (dir) {
302 for (d = readdir(dir); d; d = readdir(dir)) {
303 char *path = g_strdup_printf("%s/%s", test_spooldir, d->d_name);
304 unlink(path);
305 g_free(path);
306 }
307 closedir(dir);
308 }
309
310 char *spooldir = test_spooldir;
311
312 while (spooldir && strcmp(spooldir, "/tmp")) {
313 rmdir(spooldir);
314 char * slash = strrchr(spooldir, '/');
315 if (!slash || slash == spooldir)
316 break;
317 *slash = '\0';
318 }
319
320 g_free(test_spooldir), test_spooldir = NULL;
321 }
322
323 g_main_loop_unref (mainloop), mainloop = NULL;
324 }
325
326 /* ---------------------------------------------------------------------- */
327
328 static
329 void echo_text_message(gchar const *text, gchar const *destination)
330 {
331 SMSGSubmit *sms = sms_g_submit_new();
332 ModemRequest *sending;
333 SMSGDeliver *echo;
334 GError *error = NULL;
335 GPtrArray const *tpdus;
336
337 if (destination == NULL)
338 destination = "045441041099";
339
340 sms_g_submit_set_destination(sms, destination);
341
342 tpdus = sms_g_submit_text(sms, text, &error);
343 fail_unless(tpdus != NULL);
344 fail_unless(error == NULL);
345
346 sending = modem_sms_request_send(sms_service, sms, send_reply, events);
347 fail_unless(sending != NULL);
348
349 g_object_unref(sms), sms = NULL;
350
351 for (steps = 0; reported < 3 && steps < 100; steps++)
352 run_until(&reported, sizeof reported);
353
354 fail_unless(events[0].reason == SEND_REPLY);
355 fail_unless(events[0].id != NULL);
356
357 fail_unless(events[1].reason == OUTGOING_COMPLETE);
358 fail_unless(events[1].id != NULL);
359 fail_if(strcmp(events[1].destination, destination));
360
361 fail_unless(events[2].reason == INCOMING);
362 fail_unless(events[2].id != NULL);
363 fail_unless(events[2].deliver != NULL);
364
365 echo = events[2].deliver;
366
367 fail_if(strcmp(sms_g_deliver_get_originator(echo), destination));
368 fail_if(strcmp(sms_g_deliver_get_text(echo), text));
369 fail_unless(sms_g_deliver_is_text(echo));
370 fail_unless(sms_g_deliver_is_type(echo, "text/plain"));
371 }
372
373 START_TEST(test_modem_sms_echo_text)
374 {
375 echo_text_message("echo text message via loopback", NULL);
376 zap_events();
377 echo_text_message("Diipa daapa with exactly 40 characters.."
378 "Diipa daapa with exactly 40 characters.."
379 "Diipa daapa with exactly 40 characters.."
380 "Diipa daapa with exactly 40 characters",
381 "05055578901234567899");
382 zap_events();
383 #if notyet
384 /* This fails! */
385 echo_text_message("Diipa daapa with exactly 40 characters.."
386 "Diipa daapa with exactly 40 characters.."
387 "Diipa daapa with exactly 40 characters.."
388 "Diipa daapa with exactly 40 characters..",
389 "05055578901234567899");
390 zap_events();
391
392 char text[] =
393 "Diipa daapa with exactly 40 characters.."
394 "Diipa daapa with exactly 40 characters.."
395 "Diipa daapa with exactly 40 characters.."
396 "Diipa daapa with exactly 40 characters.."
397 "Diipa daapa with exactly 40 characters.."
398 "Diipa daapa with exactly 40 characters.."
399 "Diipa daapa with exactly 40 characters.."
400 "Diipa daapa with exactly 40 characters..";
401 int i;
402
403 for (i = sizeof(text); i >= 0; i--) {
404 text[i] = '\0';
405 echo_text_message(text, "05055578901234567899");
406 zap_events();
407 }
408 #endif
409 }
410 END_TEST
411
412 START_TEST(test_modem_sms_echo_empty)
413 {
414 echo_text_message("", NULL);
415 }
416 END_TEST
417
418 START_TEST(test_modem_sms_echo_with_content_type)
419 {
420 SMSGSubmit *sms = sms_g_submit_new_type("text/x-vcard");
421 ModemRequest *sending;
422 SMSGDeliver *echo;
423 GError *error = NULL;
424 GPtrArray const *tpdus;
425 gchar const text[] = "echo text message via loopback";
426
427 sms_g_submit_set_destination(sms, "04544104109");
428
429 tpdus = sms_g_submit_text(sms, text, &error);
430 fail_unless(tpdus != NULL);
431 fail_unless(error == NULL);
432
433 sending = modem_sms_request_send(sms_service, sms, send_reply, events);
434 fail_unless(sending != NULL);
435
436 g_object_unref(sms), sms = NULL;
437
438 for (steps = 0; reported < 3 && steps < 100; steps++)
439 run_until(&reported, sizeof reported);
440
441 fail_unless(events[0].reason == SEND_REPLY);
442 fail_unless(events[0].id != NULL);
443
444 fail_unless(events[1].reason == OUTGOING_COMPLETE);
445 fail_unless(events[1].id != NULL);
446 fail_if(strcmp(events[1].destination, "04544104109"));
447
448 fail_unless(events[2].reason == INCOMING);
449 fail_unless(events[2].id != NULL);
450 fail_unless(events[2].deliver != NULL);
451
452 echo = events[2].deliver;
453
454 fail_if(strcmp(sms_g_deliver_get_originator(echo), "04544104109"));
455 GArray const *binary = sms_g_deliver_get_binary(echo);
456 fail_if(memcmp(text, binary->data, binary->len));
457 fail_unless(sms_g_deliver_is_type(echo, "text/x-vcard"));
458 }
459 END_TEST
460
461 START_TEST(test_modem_sms_echo_binary)
462 {
463 SMSGSubmit *sms = sms_g_submit_new();
464 ModemRequest *sending;
465 SMSGDeliver *echo;
466 GError *error = NULL;
467 GPtrArray const *tpdus;
468 gchar const binary[] = "echo binary message via loopback";
469 GArray bsend[1] = {{ (gpointer)binary, sizeof binary }};
470 GArray *becho;
471 guint sport, dport;
472
473 sms_g_submit_set_destination(sms, "04544104109");
474 sms_g_submit_set_sms_class(sms, 1);
475 sms_g_submit_set_dport(sms, 0xe4);
476 sms_g_submit_set_sport(sms, 243);
477
478 tpdus = sms_g_submit_binary(sms, bsend, &error);
479 fail_unless(tpdus != NULL);
480 fail_unless(error == NULL);
481
482 sending = modem_sms_request_send(sms_service, sms, send_reply, events);
483 fail_unless(sending != NULL);
484
485 g_object_unref(sms), sms = NULL;
486
487 for (steps = 0; reported < 3 && steps < 100; steps++)
488 run_until(&reported, sizeof reported);
489
490 fail_unless(events[0].reason == SEND_REPLY);
491 fail_unless(events[0].id != NULL);
492
493 fail_unless(events[1].reason == OUTGOING_COMPLETE);
494 fail_unless(events[1].id != NULL);
495 fail_if(strcmp(events[1].destination, "04544104109"));
496
497 fail_unless(events[2].reason == INCOMING);
498 fail_unless(events[2].id != NULL);
499 fail_unless(events[2].deliver != NULL);
500
501 echo = events[2].deliver;
502
503 fail_if(strcmp(sms_g_deliver_get_originator(echo), "04544104109"));
504
505 g_object_get(echo,
506 "binary", &becho,
507 "destination-port", &dport,
508 "source-port", &sport,
509 NULL);
510 fail_if(!becho);
511 fail_if(becho->len != sizeof binary);
512 fail_if(memcmp(becho->data, binary, sizeof binary));
513 g_boxed_free(DBUS_TYPE_G_UCHAR_ARRAY, becho);
514 fail_unless(dport == 0xe4);
515 fail_unless(sport == 243);
516
517 fail_unless(sms_g_deliver_is_type(echo, "text/x-vcalendar"));
518
519 }
520 END_TEST
521
522 START_TEST(test_modem_sms_echo_large_binary)
523 {
524 SMSGSubmit *sms = sms_g_submit_new();
525 ModemRequest *sending;
526 SMSGDeliver *echo;
527 GError *error = NULL;
528 GPtrArray const *tpdus;
529 gchar binary[512] = "echo binary message via loopback";
530 GArray bsend[1] = {{ (gpointer)binary, sizeof binary }};
531 GArray *becho;
532 guint sport, dport;
533 guint i;
534
535 for (i = strlen(binary) + 1; i < sizeof binary; i++)
536 binary[i] = (i % 64) + 32;
537
538 sms_g_submit_set_destination(sms, "04544104109");
539 sms_g_submit_set_sms_class(sms, 1);
540 sms_g_submit_set_dport(sms, 226);
541 sms_g_submit_set_sport(sms, 243);
542
543 for (i = 1; i < sizeof binary; i++) {
544 bsend->len = i;
545 tpdus = sms_g_submit_binary(sms, bsend, &error);
546 fail_unless(tpdus != NULL);
547 fail_unless(error == NULL);
548
549 sending = modem_sms_request_send(sms_service, sms, send_reply, events);
550 fail_unless(sending != NULL);
551
552 for (steps = 0; reported < 3 && steps < 1000; steps++)
553 run_until(&reported, sizeof reported);
554
555 fail_unless(events[0].reason == SEND_REPLY);
556 fail_unless(events[0].id != NULL);
557
558 fail_unless(events[1].reason == OUTGOING_COMPLETE);
559 fail_unless(events[1].id != NULL);
560 fail_if(strcmp(events[1].destination, "04544104109"));
561
562 fail_unless(events[2].reason == INCOMING);
563 fail_unless(events[2].id != NULL);
564 fail_unless(events[2].deliver != NULL);
565
566 echo = events[2].deliver;
567
568 fail_if(strcmp(sms_g_deliver_get_originator(echo), "04544104109"));
569
570 g_object_get(echo,
571 "binary", &becho,
572 "destination-port", &dport,
573 "source-port", &sport,
574 NULL);
575 fail_if(!becho);
576 if (becho->len != i) {
577 printf("sent %u bytes, received %u\n", i, becho->len);
578 }
579 fail_if(becho->len != i);
580 fail_if(memcmp(becho->data, binary, i));
581 fail_unless(dport == 226);
582 fail_unless(sport == 243);
583
584 g_boxed_free(DBUS_TYPE_G_UCHAR_ARRAY, becho);
585
586 fail_unless(sms_g_deliver_is_vcard(echo));
587 fail_unless(sms_g_deliver_is_type(echo, "text/x-vcard"));
588
589 zap_events();
590 }
591
592 g_object_unref(sms), sms = NULL;
593 }
594 END_TEST
595
596 START_TEST(test_modem_sms_echo_srr)
597 {
598 char text[] = "wait for status report";
599 char destination[] = "0505556666";
600 SMSGSubmit *sms;
601 ModemRequest *sending;
602 SMSGDeliver *echo;
603 GError *error = NULL;
604 GPtrArray const *tpdus;
605
606 sms = sms_g_submit_new();
607 sms_g_submit_set_destination(sms, destination);
608 g_object_set(sms, "status-report-request", 1, NULL);
609
610 tpdus = sms_g_submit_text(sms, text, &error);
611 fail_unless(tpdus != NULL);
612 fail_unless(error == NULL);
613
614 sending = modem_sms_request_send(sms_service, sms, send_reply, events);
615 fail_unless(sending != NULL);
616
617 g_object_unref(sms), sms = NULL;
618
619 for (steps = 0; reported < 4 && steps < 100; steps++)
620 run_until(&reported, sizeof reported);
621
622 fail_unless(events[0].reason == SEND_REPLY);
623 fail_unless(events[0].id != NULL);
624
625 fail_unless(events[1].reason == OUTGOING_COMPLETE);
626 fail_unless(events[1].id != NULL);
627 fail_if(strcmp(events[1].destination, destination));
628
629 fail_unless(events[2].reason == INCOMING);
630 fail_unless(events[2].id != NULL);
631 fail_unless(events[2].deliver != NULL);
632
633 fail_unless(events[3].reason == STATUS_REPORT);
634
635 echo = events[2].deliver;
636
637 fail_if(strcmp(sms_g_deliver_get_originator(echo), destination));
638 fail_if(strcmp(sms_g_deliver_get_text(echo), text));
639 fail_unless(sms_g_deliver_is_text(echo));
640 fail_unless(sms_g_deliver_is_type(echo, "text/plain"));
641 }
642 END_TEST
643
644 static TCase *
645 echo_tcase(void)
646 {
647 TCase *tc = tcase_create("2 - Loopback tests");
648
649 tcase_add_checked_fixture(tc, echo_setup, echo_teardown);
650
651 {
652 tcase_add_test(tc, test_modem_sms_echo_text);
653 tcase_add_test(tc, test_modem_sms_echo_empty);
654 tcase_add_test(tc, test_modem_sms_echo_with_content_type);
655 tcase_add_test(tc, test_modem_sms_echo_binary);
656 tcase_add_test(tc, test_modem_sms_echo_large_binary);
657 tcase_add_test(tc, test_modem_sms_echo_srr);
658 }
659
660 tcase_set_timeout(tc, 40);
661 return tc;
662 }
663
664 /* ====================================================================== */
665
666 static char *test_content_types[] = { "text/x-vcalendar", NULL };
667
668 static void
669 sms_setup(void)
670 {
671 g_type_init();
672 (void)dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
673 mainloop = g_main_loop_new (NULL, FALSE);
674 }
675
676 static void
677 sms_teardown(void)
678 {
679 g_main_loop_unref(mainloop), mainloop = NULL;
680 }
681
682 START_TEST(sms_service_defaults)
683 {
684 char *spooldir = NULL;
685 char **content_types = NULL;
686 char *smsc = NULL;
687 unsigned validity_period = 0;
688
689 sms_service = g_object_new(MODEM_TYPE_SMS_SERVICE,
690 "content-types", test_content_types,
691 "service-centre", "+0454400046",
692 "validity-period", 300,
693 NULL);
694
695 g_object_get(sms_service,
696 "content-types", &content_types,
697 "service-centre", &smsc,
698 "validity-period", &validity_period,
699 NULL);
700
701 fail_if(content_types == NULL);
702 fail_if(content_types[0] == NULL);
703 fail_if(content_types[1] != NULL);
704 fail_if(strcmp(content_types[0], test_content_types[0]));
705
706 fail_if(smsc == NULL);
707 fail_if(strlen(smsc) == 0);
708 fail_if(strcmp(smsc, "+0454400046") != 0);
709
710 fail_if(validity_period != 300);
711
712 g_strfreev(content_types);
713 g_free(smsc);
714
715 /* Try to set too long validity-period */
716 g_object_set(sms_service, "validity-period", 64 * 7 * 24 * 60 * 60, NULL);
717
718 g_object_get(sms_service, "validity-period", &validity_period, NULL);
719
720 fail_if(validity_period != 300);
721
722 g_object_unref(sms_service);
723
724 sms_service = g_object_new(MODEM_TYPE_SMS_SERVICE, "srr-spool-directory", "", NULL);
725 g_object_get(sms_service, "srr-spool-directory", &spooldir, NULL);
726 fail_if(spooldir != NULL);
727 g_object_run_dispose(G_OBJECT(sms_service));
728 fail_if(modem_sms_service_connect(sms_service));
729 g_object_unref(sms_service);
730 }
731 END_TEST
732
733 static TCase *
734 tcase_for_modem_sms_defaults(void)
735 {
736 TCase *tc = tcase_create("3 - Default values");
737
738 tcase_add_checked_fixture(tc, sms_setup, sms_teardown);
739
740 {
741 tcase_add_test(tc, sms_service_defaults);
742 }
743
744 tcase_set_timeout(tc, 40);
745
746 return tc;
747 }
748
749
750 /* ====================================================================== */
751
752 static void modem_sms_api_init(void)
753 {
754 g_type_init();
755 (void)dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
756 mainloop = g_main_loop_new (NULL, FALSE);
757 }
758
759 static void modem_sms_api_teardown(void)
760 {
761 g_main_loop_unref(mainloop), mainloop = NULL;
762 }
763
764 static int got_sms_connected;
765
766 static void on_sms_connected(ModemSMSService *sms_service,
767 gpointer user_data)
768 {
769 got_sms_connected++;
770 g_main_loop_quit(mainloop);
771 }
772
773 #if notyet
774 GError *reply_error;
775
776 static void reply_to_sms_request(ModemSMSService *self,
777 ModemRequest *request,
778 GError *error,
779 gpointer user_data)
780 {
781 reply_error = g_error_copy(error);
782 g_main_loop_quit(mainloop);
783 }
784 #endif
785
786 START_TEST(modem_sms_api)
787 {
788 char **strv;
789 gpointer p;
790 GError *error;
791
792 fail_if(modem_sms_service_is_connected(NULL));
793 fail_if(modem_sms_service_is_connecting(NULL));
794
795 sms_service = g_object_new(MODEM_TYPE_SMS_SERVICE,
796 "content-types", test_content_types,
797 NULL);
798 error = NULL;
799
800 fail_if(modem_sms_service_time_connected(sms_service) != 0);
801 fail_if(modem_sms_service_is_connected(sms_service));
802 fail_if(modem_sms_service_is_connecting(sms_service));
803
804 strv = modem_sms_list_stored(sms_service);
805 fail_if(strv == NULL);
806 g_strfreev(strv);
807
808 p = modem_sms_get_stored_message(sms_service, "/kuik");
809 fail_if(p != NULL);
810
811 modem_sms_request_expunge(sms_service, "/kuik", NULL, NULL);
812 mark_point();
813
814 g_signal_connect(sms_service, "connected",
815 G_CALLBACK(on_sms_connected),
816 &got_sms_connected);
817
818 fail_unless(modem_sms_service_connect(sms_service));
819 fail_unless(modem_sms_service_is_connecting(sms_service));
820 g_main_loop_run(mainloop);
821 fail_unless(modem_sms_service_is_connected(sms_service));
822
823 g_object_unref(sms_service);
824 }
825 END_TEST
826
827 static TCase *
828 tcase_for_modem_sms_api(void)
829 {
830 TCase *tc = tcase_create("modem-sms-api");
831
832 tcase_add_checked_fixture(tc, modem_sms_api_init, modem_sms_api_teardown);
833
834 {
835 tcase_add_test(tc, modem_sms_api);
836 }
837
838 tcase_set_timeout(tc, 40);
839
840 return tc;
841 }
842
843 /* ====================================================================== */
844 #undef MODEM_DEBUG_FLAG
845
846 #include "modem/sms-service.c"
847
848 static void modem_sms_error_init(void)
849 {
850 g_type_init();
851 (void)dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
852 }
853
854 static void modem_sms_error_teardown(void)
855 {
856 }
857
858 START_TEST(test_modem_sms_errors)
859 {
860 GError *error;
861 guint code;
862
863 for (code = 1000; code <= 1050; code ++) {
864 error = modem_sms_new_error(code, NULL);
865 fail_unless(error != NULL);
866 fail_unless(error->domain == MODEM_SMS_NET_ERRORS);
867 g_error_free(error);
868 }
869
870 for (;code <= 1070; code ++) {
871 error = modem_sms_new_error(code, NULL);
872 fail_unless(error != NULL);
873 fail_unless(error->domain == MODEM_SMS_ERRORS,
874 "libsmserror %u: %s.%s\n", code,
875 g_quark_to_string(error->domain), modem_error_name(error, "???", 0));
876 g_error_free(error);
877 }
878
879 for (;code <= 1082; code ++) {
880 error = modem_sms_new_error(code, NULL);
881 fail_unless(error != NULL);
882 fail_unless(error->domain == MODEM_SMS_ERRORS,
883 "libsmserror %u: %s.%s\n", code,
884 g_quark_to_string(error->domain), modem_error_name(error, "???", 0));
885 g_error_free(error);
886 }
887
888 for (code = 1200; code <= 1208; code ++) {
889 error = modem_sms_new_error(code, NULL);
890 fail_unless(error != NULL);
891 fail_unless(error->domain == MODEM_SIM_ERRORS,
892 "libsmserror %u: %s.%s\n", code,
893 g_quark_to_string(error->domain), modem_error_name(error, "???", 0));
894 g_error_free(error);
895 }
896
897 /* 1210 is duplicate,
898 1211 is unknown generic sms error */
899 for (;code <= 1210; code ++) {
900 error = modem_sms_new_error(code, NULL);
901 fail_unless(error != NULL);
902 if (error->domain != MODEM_SMS_ERRORS)
903 printf("libsmserror %u: %s.%s\n",
904 code, g_quark_to_string(error->domain), modem_error_name(error, "???", 0));
905 fail_unless(error->domain == MODEM_SMS_ERRORS);
906 g_error_free(error);
907 }
908
909 error = modem_sms_new_error(SMS_CAUSE_ROUTING_FAILED, NULL);
910 fail_unless(error != NULL);
911 fail_unless(modem_sms_error_is_temporary(error));
912 g_error_free(error);
913 }
914 END_TEST
915
916
917 START_TEST(test_sms_error_conversion)
918 {
919 GError *error, *dbus, *fixed;
920
921 guint i;
922 char ebuffer[16];
923
924 for (i = 980; i < 1200; i++) {
925 error = modem_sms_new_error(i, "test");
926 fail_unless(error != NULL);
927 fail_if(modem_error_name(error, ebuffer, sizeof ebuffer) == ebuffer);
928 dbus = g_error_new(DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION,
929 "%s%c%s.%s",
930 error->message, '\0',
931 modem_error_domain_prefix(error->domain),
932 modem_error_name(error, ebuffer, sizeof ebuffer));
933 fail_unless(dbus != NULL);
934 fixed = dbus;
935 modem_error_fix(&fixed);
936 fail_if(fixed == dbus);
937 fail_if(fixed->domain != error->domain);
938 fail_if(fixed->code != error->code);
939
940 g_clear_error(&error);
941 g_clear_error(&fixed);
942 }
943 }
944 END_TEST
945
946 static TCase *
947 modem_sms_errors_tcase(void)
948 {
949 TCase *tc = tcase_create("modem-sms-errors");
950
951 tcase_add_checked_fixture(tc, modem_sms_error_init, modem_sms_error_teardown);
952
953 {
954 tcase_add_test(tc, test_modem_sms_errors);
955 tcase_add_test(tc, test_sms_error_conversion);
956 }
957
958 tcase_set_timeout(tc, 5);
959
960 return tc;
961 }
962
963 /* ====================================================================== */
964
965 struct test_cases modem_sms_tcases[] = {
966 DECLARE_TEST_CASE_OFF_BY_DEFAULT(echo_tcase),
967 DECLARE_TEST_CASE_OFF_BY_DEFAULT(tcase_for_modem_sms_defaults),
968 DECLARE_TEST_CASE_OFF_BY_DEFAULT(tcase_for_modem_sms_api),
969 DECLARE_TEST_CASE(modem_sms_errors_tcase),
970 LAST_TEST_CASE
971 };
6868 fail_if(volume != -63);
6969
7070 modem_tones_stop(tones, 0);
71 modem_tones_user_connection(tones, 0);
7271
7372 fail_if(0 > (event = modem_call_event_tone(MODEM_CALL_STATE_ALERTING, 0, 0)));
7473 fail_if(!(playing = modem_tones_start(tones, event, 0)));
1919
2020 #include "config.h"
2121
22 #define MODEM_DEBUG_FLAG MODEM_SERVICE_TONES
22 #define MODEM_DEBUG_FLAG MODEM_LOG_AUDIO
2323
2424 #include "modem/debug.h"
2525 #include "modem/tones.h"
5353
5454 GQueue stop_requests[1];
5555
56 unsigned user_connection:1;
5756 unsigned dispose_has_run:2;
5857 };
5958
187186 DBusGProxyCall *call,
188187 void *_request);
189188
190 static gboolean modem_tones_suppress(int event)
191 {
192 return event < 0 ||
193 (event > TONES_EVENT_DTMF_D && event < TONES_EVENT_RADIO_PATH_ACK);
194 }
195
196189 guint
197190 modem_tones_start_full(ModemTones *self,
198191 int event,
240233
241234 g_timer_start(priv->timer);
242235
243 DEBUG("%scalling StartEventTone(%u, %d, %u) with %u",
244 priv->user_connection ? "not " : "",
236 DEBUG("calling StartEventTone(%u, %d, %u) with %u",
245237 priv->event, priv->evolume, priv->duration, priv->playing);
246238
247 if (!priv->user_connection || !modem_tones_suppress(priv->event)) {
248 dbus_g_proxy_call_no_reply(priv->proxy,
249 "StartEventTone",
250 G_TYPE_UINT, priv->event,
251 G_TYPE_INT, priv->evolume,
252 G_TYPE_UINT, priv->duration,
253 G_TYPE_INVALID);
254 }
239 dbus_g_proxy_call_no_reply(priv->proxy,
240 "StartEventTone",
241 G_TYPE_UINT, priv->event,
242 G_TYPE_INT, priv->evolume,
243 G_TYPE_UINT, priv->duration,
244 G_TYPE_INVALID);
255245
256246 return priv->playing;
257247 }
369359
370360 notify(self, source, data);
371361 }
372
373 void
374 modem_tones_user_connection(ModemTones *self,
375 gboolean user_connection)
376 {
377 ModemTonesPrivate *priv = self->priv;
378
379 user_connection = !!user_connection;
380
381 DEBUG("(%p, %u)", self, user_connection);
382
383 g_return_if_fail(self);
384 g_return_if_fail(!self->priv->dispose_has_run);
385
386 self->priv->user_connection = user_connection;
387
388 if (user_connection) {
389 if (priv->playing)
390 dbus_g_proxy_call_no_reply(priv->proxy,
391 "StopTone",
392 G_TYPE_INVALID);
393 }
394 else {
395 if (priv->playing && priv->duration &&
396 modem_tones_suppress(priv->event)) {
397 double should_have_been_playing = g_timer_elapsed(priv->timer, NULL);
398
399 if (1000.0 * priv->duration > 2 * should_have_been_playing) {
400 dbus_g_proxy_call_no_reply(priv->proxy,
401 "StartEventTone",
402 G_TYPE_UINT, priv->event,
403 G_TYPE_INT, priv->evolume,
404 G_TYPE_UINT, priv->duration - (guint)(should_have_been_playing * 1000.0),
405 G_TYPE_INVALID);
406 }
407 }
408 }
409 }
101101
102102 void modem_tones_stop(ModemTones *, guint source);
103103
104 void modem_tones_user_connection(ModemTones *self, gboolean user_connection);
105
106104 G_END_DECLS
107105
108106 #endif /* #ifndef _MODEM_TONES_H_ */
+0
-400
ring-extensions/Channel_Interface_Conference_DRAFT.xml less more
0 <?xml version="1.0" ?>
1 <node name="/Channel_Interface_Conference"
2 xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
3 <tp:copyright>Copyright © 2009 Collabora Limited</tp:copyright>
4 <tp:copyright>Copyright © 2009 Nokia Corporation</tp:copyright>
5 <tp:license xmlns="http://www.w3.org/1999/xhtml">
6 <p>This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.</p>
10
11 <p>This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.</p>
15
16 <p>You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.</p>
20 </tp:license>
21 <interface
22 name="org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT"
23 tp:causes-havoc="experimental">
24 <tp:added version="0.19.0">(draft 1)</tp:added>
25 <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
26 <tp:requires
27 interface="org.freedesktop.Telepathy.Channel.Interface.Group"/>
28
29 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
30 <p>An interface for multi-user conference channels that can "continue
31 from" one or more individual channels.</p>
32
33 <tp:rationale>
34 <p>This interface addresses freedesktop.org <a
35 href="http://bugs.freedesktop.org/show_bug.cgi?id=24906">bug
36 #24906</a> (GSM-compatible conference calls) and <a
37 href="http://bugs.freedesktop.org/show_bug.cgi?id=24939">bug
38 #24939</a> (upgrading calls and chats to multi-user).
39 See those bugs for rationale and use cases.</p>
40
41 <p>Examples of usage:</p>
42
43 <p>Active and held GSM calls C1, C2 can be merged into a single
44 channel Cn with the Conference interface, by calling
45 <code>CreateChannel({...ChannelType: ...Call,
46 ...<tp:member-ref>InitialChannels</tp:member-ref>: [C1, C2]})</code>
47 which returns Cn.</p>
48
49 <p>An XMPP 1-1 conversation C1 can be continued in a newly created
50 multi-user chatroom Cn by calling
51 <code>CreateChannel({...ChannelType: ...Text,
52 ...<tp:member-ref>InitialChannels</tp:member-ref>: [C1]})</code>
53 which returns Cn.</p>
54
55 <p>An XMPP 1-1 conversation C1 can be continued in a specified
56 multi-user chatroom by calling
57 <code>CreateChannel({...ChannelType: ...Text, ...HandleType: ROOM,
58 ...TargetID: 'telepathy@conf.example.com',
59 ...<tp:member-ref>InitialChannels</tp:member-ref>: [C1]})</code>
60 which returns a Conference channel.</p>
61
62 <p>Either of the XMPP cases could work for Call channels, to
63 upgrade from 1-1 Jingle to multi-user Muji. Any of the XMPP cases
64 could in principle work for link-local XMPP (XEP-0174).</p>
65
66 <p>The underlying switchboard representing an MSN 1-1 conversation C1
67 with a contact X can be moved to a representation as a nameless
68 chatroom, Cn, to which more contacts can be invited, by calling
69 <code>CreateChannel({...ChannelType: ...Text,
70 ...<tp:member-ref>InitialChannels</tp:member-ref>: [C1]})</code>
71 which returns Cn. C1 SHOULD remain open, with no underlying
72 switchboard attached. If X establishes a new switchboard with the
73 local user, C1 SHOULD pick up that switchboard rather than letting
74 it create a new channel.
75 <strong>[FIXME: should it?]</strong>
76 Similarly, if the local user sends a message in C1, then
77 a new switchboard to X should be created and associated with C1.</p>
78
79 <p>XMPP and MSN do not natively have a concept of merging two or more
80 channels C1, C2... into one channel, Cn. However, the GSM-style
81 merging API can be supported on XMPP and MSN, as an API short-cut
82 for upgrading C1 into a conference Cn (which invites the
83 TargetHandle of C1 into Cn), then immediately inviting the
84 TargetHandle of C2, the TargetHandle of C3, etc. into Cn as well.</p>
85
86 <p>With a suitable change of terminology, Skype has behaviour similar
87 to MSN.</p>
88 </tp:rationale>
89
90 <p>The <tp:dbus-ref
91 namespace="org.freedesktop.Telepathy.Channel.Interface"
92 >Group</tp:dbus-ref> MAY have channel-specific handles for participants;
93 clients SHOULD support both Conferences that have channel-specific handles,
94 and those that do not.</p>
95
96 <tp:rationale>
97 <p>In the GSM case, the Conference's Group interface MAY have
98 channel-specific handles, to reflect the fact that the identities of
99 the participants might not be known - it can be possible to know that
100 there is another participant in the Conference, but not know who
101 they are.
102 <strong>[FIXME: fact check from GSM gurus needed]</strong>
103 </p>
104
105 <p>In the XMPP case, the Conference's Group interface SHOULD have
106 channel-specific handles, to reflect the fact that the participants
107 have MUC-specific identities, and the user might also be able to see
108 their global identities, or not.</p>
109
110 <p>In most other cases, including MSN and link-local XMPP, the
111 Conference's Group interface SHOULD NOT have channel-specific
112 handles, since users' identities are always visible.</p>
113 </tp:rationale>
114
115 <p>Connection managers implementing channels with this interface
116 MUST NOT allow the object paths of channels that could be merged
117 into a Conference to be re-used, unless the channel re-using the
118 object path is equivalent to the channel that previously used it.</p>
119
120 <tp:rationale>
121 <p>If you upgrade some channels into a conference, and then close
122 the original channels, <tp:member-ref>InitialChannels</tp:member-ref>
123 (which is immutable) will contain paths to channels which no longer
124 exist. This implies that you should not re-use channel object paths,
125 unless future incarnations of the path are equivalent.</p>
126
127 <p>For instance, on protocols where you can only have
128 zero or one 1-1 text channels with Emily at one time, it would
129 be OK to re-use the same object path for every 1-1 text channel
130 with Emily; but on protocols where this is not true, it would
131 be misleading.</p>
132 </tp:rationale>
133
134 </tp:docstring>
135
136 <property name="Channels" tp:name-for-bindings="Channels"
137 access="read" type="ao">
138 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
139 <p>The individual <tp:dbus-ref
140 namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref>s that
141 are continued by this conference, which have the same <tp:dbus-ref
142 namespace="org.freedesktop.Telepathy.Channel"
143 >ChannelType</tp:dbus-ref> as this one, but with <tp:dbus-ref
144 namespace="org.freedesktop.Telepathy.Channel"
145 >TargetHandleType</tp:dbus-ref> = CONTACT.</p>
146
147 <p>This property MUST NOT be requestable.
148 <strong>[FIXME: or would it be better for this one, and not IC, to be
149 requestable?]</strong>
150 </p>
151
152 <p>Change notification is via the
153 <tp:member-ref>ChannelMerged</tp:member-ref> and
154 <tp:member-ref>ChannelRemoved</tp:member-ref> signals.</p>
155 </tp:docstring>
156 </property>
157
158 <signal name="ChannelMerged" tp:name-for-bindings="Channel_Merged">
159 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
160 <p>Emitted when a new channel is added to the value of
161 <tp:member-ref>Channels</tp:member-ref>.</p>
162 </tp:docstring>
163
164 <arg name="Channel" type="o">
165 <tp:docstring>The channel that was added to
166 <tp:member-ref>Channels</tp:member-ref>.</tp:docstring>
167 </arg>
168 </signal>
169
170 <signal name="ChannelRemoved" tp:name-for-bindings="Channel_Removed">
171 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
172 <p>Emitted when a channel is removed from the value of
173 <tp:member-ref>Channels</tp:member-ref>, either because it closed
174 or because it was split using the <tp:dbus-ref
175 namespace="org.freedesktop.Telepathy.Channel.Interface"
176 >Splittable.DRAFT.Split</tp:dbus-ref> method.</p>
177
178 <p><strong>[FIXME: relative ordering of this vs. Closed? Do we
179 care?]</strong></p>
180 </tp:docstring>
181
182 <arg name="Channel" type="o">
183 <tp:docstring>The channel that was removed from
184 <tp:member-ref>Channels</tp:member-ref>.</tp:docstring>
185 </arg>
186 </signal>
187
188 <property name="InitialChannels" tp:name-for-bindings="Initial_Channels"
189 access="read" type="ao">
190 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
191 <p>The initial value of <tp:member-ref>Channels</tp:member-ref>.</p>
192
193 <p>This property SHOULD be requestable. Omitting it from a request is
194 equivalent to providing it with an empty list as value. Requests
195 where its value has at least two elements SHOULD be expected to
196 succeed on any implementation of this interface.</p>
197
198 <p>Whether a request with 0 or 1 elements in the list will succeed is
199 indicated by <tp:member-ref>SupportsNonMerges</tp:member-ref>.</p>
200
201 <tp:rationale>
202 <p>In GSM, a pair of calls can be merged into a conference. In XMPP
203 and MSN, you can create a new chatroom, or upgrade one 1-1 channel
204 into a chatroom; however, on these protocols, it is also possible
205 to fake GSM-style merging by upgrading the first channel, then
206 inviting the targets of all the other channels into it.</p>
207 </tp:rationale>
208
209 <p>If possible, the <tp:member-ref>Channels</tp:member-ref>' states SHOULD
210 NOT be altered by merging them into a conference. However, depending on
211 the protocol, the Channels MAY be placed in a "frozen" state by placing
212 them in this property's value or by calling
213 <tp:dbus-ref
214 namespace="org.freedesktop.Telepathy.Channel.Interface"
215 >MergeableConference.DRAFT.Merge</tp:dbus-ref> on them.
216 <strong>[FIXME: there's nothing in RequestableChannelClasses yet
217 to say what will happen, see #24906 comment 6]</strong></p>
218
219 <tp:rationale>
220 <p>In Jingle, nothing special will happen to merged calls. UIs MAY
221 automatically place calls on hold before merging them, if that is
222 the desired behaviour; this SHOULD always work. Not doing
223 an implicit hold/unhold seems to preserve least-astonishment.</p>
224
225 <p><strong>[FIXME: check whether ring supports faking Hold on both
226 channels, as it probably should: see #24906 comment 6]</strong>
227 </p>
228
229 <p>In GSM, the calls that are merged go into a state similar to
230 Hold, but they cannot be unheld, only split from the conference
231 call using <tp:dbus-ref namespace="org.freedesktop.Telepathy"
232 >Channel.Interface.Splittable.DRAFT.Split</tp:dbus-ref>.</p>
233 </tp:rationale>
234
235 <p>Depending on the protocol, it might be signalled to remote users
236 that this channel is a continuation of all the requested channels,
237 or that it is only a continuation of the first channel in the
238 list.</p>
239
240 <tp:rationale>
241 <p>In MSN, the conference steals the underlying switchboard (protocol
242 construct) from one of its component channels, so the conference
243 appears to remote users to be a continuation of that channel and no
244 other. The connection manager has to make some arbitrary choice, so
245 we arbitrarily mandate that it SHOULD choose the first channel in
246 the list as the one to continue.</p>
247 </tp:rationale>
248
249 <p>This property is immutable.</p>
250 </tp:docstring>
251 </property>
252
253 <property name="InitialInviteeHandles"
254 tp:name-for-bindings="Initial_Invitee_Handles"
255 access="read" type="au" tp:type="Contact_Handle[]">
256 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
257 <p>A list of additional contacts invited to this conference when it
258 was created.</p>
259
260 <p>This property SHOULD be requestable, and appear in the allowed
261 properties in <tp:dbus-ref
262 namespace="org.freedesktop.Telepathy.Connection.Interface.Requests"
263 >RequestableChannelClasses</tp:dbus-ref>, in all connection
264 managers that can implement its semantics (in practice, this is
265 likely to mean exactly those connection managers where
266 <tp:member-ref>SupportsNonMerges</tp:member-ref> will be true).</p>
267
268 <p>If included in a request, the given contacts are automatically
269 invited into the new channel, as if they had been added with
270 <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface"
271 >Group.AddMembers</tp:dbus-ref>(InitialInviteeHandles,
272 <tp:member-ref>InvitationMessage</tp:member-ref> immediately after
273 the channel was created.</p>
274
275 <tp:rationale>
276 <p>This is a simple convenience API for the common case that a UI
277 upgrades a 1-1 chat to a multi-user chat solely in order to invite
278 someone else to participate.</p>
279 </tp:rationale>
280
281 <p>At most one of InitialInviteeHandles and InitialInviteeIDs may
282 appear in each request.</p>
283
284 <p>If the local user was not the initiator of this channel, the
285 <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface"
286 >Group.SelfHandle</tp:dbus-ref> SHOULD appear in the value of this
287 property, together with any other contacts invited at the same time
288 (if that information is known).</p>
289
290 <p>This property is immutable.</p>
291 </tp:docstring>
292 </property>
293
294 <property name="InitialInviteeIDs"
295 tp:name-for-bindings="Initial_Invitee_IDs"
296 access="read" type="as">
297 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
298 <p>A list of additional contacts invited to this conference when it
299 was created.</p>
300
301 <p>This property SHOULD be requestable, as an alternative to
302 <tp:member-ref>InitialInviteeHandles</tp:member-ref>. Its semantics
303 are the same, except that it takes a list of the string
304 representations of contact handles.</p>
305
306 <p>At most one of InitialInviteeHandles and InitialInviteeIDs may
307 appear in each request.</p>
308
309 <p>When a channel is created, the values of InitialInviteeHandles and
310 InitialInviteeIDs MUST correspond to each other.</p>
311
312 <p>This property is immutable.</p>
313 </tp:docstring>
314 </property>
315
316 <property name="InvitationMessage" tp:name-for-bindings="Invitation_Message"
317 access="read" type="s">
318 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
319 <p>The message that was sent to the
320 <tp:member-ref>InitialInviteeHandles</tp:member-ref> when they were
321 invited.</p>
322
323 <p>This property SHOULD be requestable, and appear in the allowed
324 properties in <tp:dbus-ref
325 namespace="org.freedesktop.Telepathy.Connection.Interface.Requests"
326 >RequestableChannelClasses</tp:dbus-ref>, in protocols where
327 invitations can have an accompanying text message.</p>
328
329 <tp:rationale>
330 <p>This allows invitations with a message to be sent when using
331 <tp:member-ref>InitialInviteeHandles</tp:member-ref> or
332 <tp:member-ref>InitialInviteeIDs</tp:member-ref>.</p>
333 </tp:rationale>
334
335 <p>If the local user was not the initiator of this channel, the
336 message with which they were invited (if any) SHOULD appear in the
337 value of this property.</p>
338
339 <p>This property is immutable.</p>
340 </tp:docstring>
341 </property>
342
343 <property name="SupportsNonMerges"
344 tp:name-for-bindings="Supports_Non_Merges"
345 access="read" type="b">
346 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
347 <p><strong>[FIXME: needs a better name; or perhaps it could be implied
348 by InitialInviteeHandles being requestable in XMPP/MSN but not in
349 GSM?]</strong></p>
350
351 <p>If true, requests with <tp:member-ref>InitialChannels</tp:member-ref>
352 omitted, empty, or one element long should be expected to succeed.</p>
353
354 <p>This property SHOULD appear in <tp:dbus-ref
355 namespace="org.freedesktop.Telepathy.Connection.Interface.Requests"
356 >RequestableChannelClasses</tp:dbus-ref> for
357 conference channels if and only if its value on those channels will
358 be true.</p>
359
360 <tp:rationale>
361 <p>Putting this in <tp:dbus-ref
362 namespace="org.freedesktop.Telepathy.Connection.Interface.Requests"
363 >RequestableChannelClasses</tp:dbus-ref> means clients can find
364 out whether their request will succeed early enough to do
365 something about it.</p>
366
367 <p>In XMPP, you can request a channel of type ROOM without
368 incorporating any 1-1 chats at all - indeed, this is the normal
369 way to do it - or as a continuation of a single 1-1 chat, and then
370 invite other people in later.</p>
371
372 <p>The sense of this property is a bit awkward, but it avoids making it
373 an anti-capability. If the sense were inverted, then its presence in
374 RequestableChannelClasses would imply that the protocol <em>lacks</em>
375 a feature; as it stands, it is additive. (Contrast with
376 <tp:dbus-ref
377 namespace="org.freedesktop.Telepathy.Channel.Type.StreamedMedia"
378 >ImmutableStreams</tp:dbus-ref>, which is the wrong way around for
379 backwards-compatibility reasons.)</p>
380 </tp:rationale>
381
382 <p>If false, <tp:member-ref>InitialChannels</tp:member-ref> SHOULD be
383 supplied in all requests for this channel class, and contain at least
384 two channels. Requests where this requirement is not met SHOULD fail
385 with NotImplemented.
386 </p>
387
388 <tp:rationale>
389 <p>In GSM, you can only make a conference call by merging at least
390 two channels.
391 <strong>[FIXME: the CM could conceivably fake it, but that would be
392 rather nasty]</strong>
393 </p>
394 </tp:rationale>
395 </tp:docstring>
396 </property>
397
398 </interface>
399 </node>
0 ><?xml version="1.0" ?>
1 <node name="/Channel_Interface_Dialstrings" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
2 <tp:copyright>Copyright (C) 2005, 2006 Collabora Limited</tp:copyright>
3 <tp:copyright>Copyright (C) 2005, 2006 Nokia Corporation</tp:copyright>
4 <tp:copyright>Copyright (C) 2006 INdT</tp:copyright>
5 <tp:license xmlns="http://www.w3.org/1999/xhtml">
6 <p>This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.</p>
10
11 <p>This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.</p>
15
16 <p>You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
19 </tp:license>
20 <interface name="com.Nokia.Telepathy.Channel.Interface.Dialstrings">
21 <tp:requires
22 interface="org.freedesktop.Telepathy.Channel.Type.StreamedMedia"/>
23 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
24 An interface that gives a Channel the ability to send dial strings. The
25 dial strings are used mainly for things like 2nd stage dialing or
26 avoiding human interaction with interactive voice response systems (IVR).
27 The syntax of dial string is in common with those defined in <a
28 href="http://www.rfc-editor.org/rfc/rfc4967.txt">RFC4967</a>.
29 </tp:docstring>
30
31 <method name="Send">
32 <arg direction="in" name="DialString" type="s" >
33 <tp:docstring>Dial string.</tp:docstring>
34 </arg>
35 <arg direction="in" name="duration" type="u">
36 <tp:docstring>
37 Desired duration of each tone in milliseconds, or 0 for implementation-specific default .
38 </tp:docstring>
39 </arg>
40 <arg direction="in" name="pause" type="u">
41 <tp:docstring>
42 Desired duration of pause between tones in milliseconds, or 0 for implementation-specific default .
43 </tp:docstring>
44 </arg>
45 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
46 <p>Sends the dial string on the channel.</p>
47
48 <p>The channel will send the dial string using appropriate means,
49 such as RFC 4733 audio events or SIP INFO payload.</p>
50
51 <p>If the dial
52 string is sent as distinct tones, each the tone will take the given
53 duration or the implementation-specific default, if duration 0 is
54 given. </p>
55 </tp:docstring>
56 <tp:possible-errors>
57 <tp:error name="org.freedesktop.Telepathy.Error.NetworkError" />
58 <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
59 <tp:docstring>
60 The given stream ID or dial string was invalid.
61 </tp:docstring>
62 </tp:error>
63 <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
64 <tp:docstring>
65 The requested event is not available on this stream.
66 </tp:docstring>
67 </tp:error>
68 </tp:possible-errors>
69 </method>
70
71 <method name="Cancel">
72 <tp:docstring>
73 Cancel sending the current dial string.
74 </tp:docstring>
75 </method>
76
77 <signal name="Sending">
78 <arg name="DialString" type="s" >
79 <tp:docstring>Dialstring to be sent (optional).</tp:docstring>
80 </arg>
81 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
82 <p>A dial string being sent on this stream. The signal is provided
83 for visual feedback indicating the fact that the channel is
84 currently used to send dialtones and the media input from user is
85 not actually getting through the audio stream. It also serves as a cue for
86 Cancel method.</p>
87 </tp:docstring>
88 </signal>
89
90 <signal name="Stopped">
91 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
92 <p>Sending the dial string on this stream has been stopped. The signal is
93 provided for feedback indicating the fact that the channel is
94 no more used to send dialtones and the media input from user can get
95 get through the stream.</p>
96 </tp:docstring>
97 </signal>
98
99 </interface>
100 </node>
101 <!-- vim:set sw=2 sts=2 et ft=xml: -->
0 <?xml version="1.0" ?>
1 <node name="/Channel_Interface_Messages"
2 xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
3 <tp:copyright>Copyright (C) 2008 Collabora Ltd.</tp:copyright>
4 <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
5 <tp:license xmlns="http://www.w3.org/1999/xhtml">
6 <p>This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.</p>
10
11 <p>This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.</p>
15
16 <p>You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 USA.</p>
20 </tp:license>
21 <interface
22 name="org.freedesktop.Telepathy.Channel.Interface.Messages.DRAFT"
23 tp:causes-havoc="experimental">
24 <tp:requires interface="org.freedesktop.Telepathy.Channel.Type.Text"/>
25 <tp:added version="0.17.5">(draft version, not API-stable)</tp:added>
26
27 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
28 <p>This interface extends the Text interface to support more general
29 messages, including:</p>
30
31 <ul>
32 <li>messages with attachments (like MIME multipart/mixed)</li>
33 <li>groups of alternatives (like MIME multipart/alternative)</li>
34 <li>delivery reports</li>
35 <li>any extra types of message we need in future</li>
36 </ul>
37
38 <p>It also provides a hook for improved sent
39 message status notification, to be used by the DeliveryReporting
40 interface.</p>
41
42 <p>Although this specification supports formatted (rich-text)
43 messages with unformatted alternatives, implementations SHOULD NOT
44 attempt to send formatted messages until the Telepathy specification
45 has also been extended to cover capability discovery for message
46 formatting.</p>
47
48 <tp:rationale>
49 We intend to expose all rich-text messages as XHTML-IM, but on some
50 protocols, formatting is an extremely limited subset of that format
51 (e.g. there are protocols where foreground/background colours, font
52 and size can be set, but only for entire messages).
53 Until we can tell UIs what controls to offer to the user, it's
54 unfriendly to offer the user controls that may have no effect.
55 </tp:rationale>
56
57 <p>If this interface is present, clients that support it SHOULD
58 listen for the MessageSent and MessageReceived signals, and
59 ignore the Sent and Received signal on the Text interface
60 (which are guaranteed to duplicate signals from this interface).</p>
61 </tp:docstring>
62
63 <property name="SupportedContentTypes" type="as" access="read">
64 <tp:docstring>
65 A list of MIME types supported by this channel, with more preferred
66 MIME types appearing earlier in the list. The list MAY include "*/*"
67 to indicate that attachments with arbitrary MIME types can be sent.
68 If the list is empty, this indicates that messages may only include
69 a single "text/plain" part.
70 </tp:docstring>
71 </property>
72
73 <property name="MessagePartSupportFlags" type="u"
74 tp:type="Message_Part_Support_Flags"
75 access="read">
76 <tp:docstring>
77 Flags indicating the level of support for message parts on this
78 channel.
79 </tp:docstring>
80 </property>
81
82 <tp:flags name="Message_Part_Support_Flags"
83 value-prefix="Message_Part_Support_Flag">
84 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
85 <p>Flags indicating the level of support for message parts on this
86 channel. They are designed such that setting more flags always
87 implies that the channel has more capabilities.</p>
88
89 <p>It is assumed that messages containing a textual message body
90 (only), like the messages the Text interface was designed for, are
91 always supported.</p>
92
93 <p>There is no flag indicating support for alternatives. This is
94 because the SendMessage implementation can always accept messages
95 containing alternatives, even if the underlying protocol does not,
96 by deleting all alternatives except the first (most preferred)
97 that is supported.</p>
98
99 <tp:rationale>
100 Each of the flags 1, 2, 4 implies the previous flag, so we could
101 have used a simple enumeration here; however, we've defined
102 the message-part support indicator as a flag set for future
103 expansion.
104 </tp:rationale>
105 </tp:docstring>
106
107 <tp:flag suffix="Data_Only" value="1">
108 <tp:docstring>
109 SendMessage will accept messages containing a single part of any
110 type listed in the SupportedContentTypes property, with no
111 accompanying text.
112 </tp:docstring>
113 </tp:flag>
114 <tp:flag suffix="One_Attachment" value="2">
115 <tp:docstring>
116 SendMessage will accept messages containing a textual message body,
117 plus a single attachment of any type listed in the
118 SupportedContentTypes property. It does not make sense for this
119 flag to be set if Message_Part_Support_Flag_Data_Only is not also set
120 (because the connection manager can trivially provide an empty text
121 part if necessary).
122 </tp:docstring>
123 </tp:flag>
124 <tp:flag suffix="Multiple_Attachments" value="4">
125 <tp:docstring>
126 SendMessage will accept messages containing a textual message body,
127 plus an arbitrary number of attachments of any type listed in the
128 SupportedContentTypes property. It does not make sense for this
129 flag to be set if Message_Part_Support_Flag_One_Attachment is not
130 also set.
131 </tp:docstring>
132 </tp:flag>
133 </tp:flags>
134
135 <tp:mapping name="Message_Part" array-name="Message_Part_List">
136 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
137 <p>Part of a message's content. In practice, this mapping never
138 appears in isolation - messages are represented by a list of
139 <tp:type>Message_Part</tp:type> mappings.</p>
140
141 <p>An example of how a message might
142 look, in a Python-like syntax:</p>
143
144 <pre>
145 [
146 {
147 'message-sender': 42,
148 'message-sent': 1210067943,
149 'message-received': 1210067947,
150 'message-type': 0,
151 'pending-message-id': 437,
152 },
153 { 'alternative': 'main',
154 'type': 'text/html',
155 'content': 'Here is a photo of my cat:&lt;br /&gt;' +
156 '&lt;img src="cid:catphoto" alt="lol!" /&gt;' +
157 '&lt;br /&gt;Isn't it cute?',
158 },
159 { 'alternative': 'main',
160 'type': 'text/plain',
161 'content': 'Here is a photo of my cat:\n[IMG: lol!]\nIsn't it cute?',
162 },
163 { 'identifier': 'catphoto',
164 'type': 'image/jpeg',
165 'size': 101000,
166 'needs-retrieval': True,
167 },
168 ]
169 </pre>
170
171 <div>
172 <p>The first part of the message contains "headers" which refer
173 to the entire message.</p>
174
175 <p>It is an error for a connection manager to put keys referring
176 to the message as a whole in the second or subsequent
177 Message_Part, but clients MUST recover from this error by ignoring
178 these keys in the second and subsequent parts.</p>
179
180 <p>Well-known keys for the message as a whole, and the corresponding
181 value types, include:</p>
182
183 <dl>
184 <!-- FIXME: if needed we could add:
185 <dt>message-identifier (s)</dt>
186 <dd>An opaque, globally-unique identifier for the entire message.
187 This MAY be treated as if it were a MIME Message-ID, e.g. for
188 the mid: and cid: URI schemes. If omitted, there is no suitable
189 identifier.</dd>
190 -->
191
192 <dt>message-sent (u - <tp:type>Unix_Timestamp</tp:type>)</dt>
193 <dd>The time the message was sent (if unavailable, the time
194 it arrived at a central server MAY be used). Omitted if no
195 reasonable approximation is available</dd>
196
197 <dt>message-received (u - <tp:type>Unix_Timestamp</tp:type>)</dt>
198 <dd>The time the message was received locally. SHOULD always
199 be present.</dd>
200
201 <dt>message-sender (u - <tp:type>Contact_Handle</tp:type>)</dt>
202 <dd>The contact who sent the message. If 0 or omitted, the contact
203 who sent the message could not be determined.</dd>
204
205 <dt>message-type (u - <tp:type>Channel_Text_Message_Type</tp:type>)
206 </dt>
207 <dd>The type of message; if omitted,
208 Channel_Text_Message_Type_Normal MUST be assumed. SHOULD
209 be omitted for normal chat messages.</dd>
210
211 <dt>pending-message-id (u - <tp:type>Message_ID</tp:type>)</dt>
212 <dd>The incoming message ID. This MUST NOT be present on outgoing
213 messages. Clients SHOULD NOT store this key - it is only valid
214 for as long as the message remains unacknowledged.</dd>
215
216 <dt>interface (s - <tp:type>DBus_Interface</tp:type>)</dt>
217 <dd>This message is specific to the given interface, which is
218 neither Text nor Messages. It SHOULD be ignored if that
219 interface is not supported. (Note that an 'interface' key
220 can also appear on the second and subsequent parts, where
221 it indicates that that part (only) should be ignored if
222 unsupported.)</dd>
223 </dl>
224 </div>
225
226 <div>
227 <p>The second and subsequent parts contain the message's
228 content, including plain text, formatted text and/or attached
229 files.</p>
230
231 <p>In any group of parts with the same non-empty value for the
232 "alternative" key (which represent alternative versions of the
233 same content), more faithful versions of the intended message MUST
234 come before less faithful versions (note that this order is the
235 opposite of MIME "multipart/alternative" parts). Clients SHOULD
236 display the first alternative that they understand.</p>
237
238 <tp:rationale>
239 Specifying the preference order means that if the underlying
240 protocol doesn't support alternatives, the CM can safely delete
241 everything apart from the first supported alternative when sending
242 messages.
243 </tp:rationale>
244
245 <p>Clients SHOULD present all parts that are not redundant
246 alternatives in the order they appear in this array, possibly
247 excluding parts that are referenced by another displayed part.
248 It is implementation-specific how the parts are presented to the
249 user.</p>
250
251 <tp:rationale>
252 <p>This allows CMs to assume that all parts are actually shown to
253 the user, even if they are not explicitly referenced - we do
254 not yet recommend formatted text, and there is no way for
255 plain text to reference an attachment since it has no concept of
256 markup or references. This also forces clients to do something
257 sensible with messages that consist entirely of "attachments",
258 with no "body" at all.</p>
259
260 <p>For instance, when displaying the above example, a client that
261 understands the HTML part should display the JPEG image once,
262 between the two lines "Here is a photo of my cat:" and
263 "Isn't it cute?"; it may additionally present the image in some
264 way for a second time, after "Isn't it cute?", or may choose
265 not to.</p>
266
267 <p>A client that does not understand HTML, displaying the same
268 message, should display the plain-text part, followed by the JPEG
269 image.</p>
270 </tp:rationale>
271
272 <p>Well-known keys for the second and subsequent parts, and the
273 corresponding value types, include:</p>
274
275 <dl>
276 <dt>identifier (s)</dt>
277 <dd>An opaque identifier for this part.
278 Parts of a message MAY reference other parts by treating
279 this identifier as if it were a MIME Content-ID and using
280 the cid: URI scheme.</dd>
281
282 <dt>alternative (s)</dt>
283 <dd>
284 <p>If present, this part of the message is an alternative for
285 all other parts with the same value for "alternative".
286 Clients SHOULD only display one of them (this is expected to
287 be used for XHTML messages in a future version of this
288 specification).</p>
289
290 <p>If omitted, this part is not an alternative for any other
291 part.</p>
292
293 <p>Parts of a message MAY reference the group of alternatives
294 as a whole (i.e. a reference to whichever of them is chosen)
295 by treating this identifier as if it were the MIME Content-ID
296 of a multipart/alternative part, and using the cid: URI
297 scheme.</p>
298 </dd>
299
300 <dt>type (s)</dt>
301 <dd>
302 <p>The MIME type of this part. See the documentation
303 for ReceivedMessage for notes on the special status of
304 "text/plain" parts.</p>
305
306 <p>Connection managers MUST NOT signal parts without a 'type'
307 key; if a protocol provides no way to determine the MIME type,
308 the connection manager is responsible for guessing it, but
309 MAY fall back to "text/plain" for text and
310 "application/octet-stream" for non-text.</p>
311
312 <p>Clients MUST ignore parts without a 'type' key, which are
313 reserved for future expansion.</p>
314 </dd>
315
316 <dt>lang (s)</dt>
317 <dd>The natural language of this part, identified by a
318 RFC 3066 language tag.
319
320 <tp:rationale>
321 XMPP allows alternative-selection by language as well as
322 by content-type.
323 </tp:rationale>
324 </dd>
325
326 <dt>size (u)</dt>
327 <dd>The size in bytes (if needs-retrieval is true, this MAY be an
328 estimated or approximate size). SHOULD be omitted if 'content'
329 is provided.
330
331 <tp:rationale>
332 There's no point in providing the size if you're already
333 providing all the content.
334 </tp:rationale>
335 </dd>
336
337 <dt>needs-retrieval (b)</dt>
338 <dd>If false or omitted, the connection
339 manager already holds this part in memory. If present and true,
340 this part will be retrieved on demand (like MIME's
341 message/external-body), so clients should expect retrieval to
342 take time; if this specification is later extended to provide a
343 streaming version of GetPendingMessageContent, clients should
344 use it for parts with this flag.</dd>
345
346 <dt>truncated (b)</dt>
347 <dd>The content available via the 'content' key or
348 GetPendingMessageContent has been truncated by the server
349 or connection manager (equivalent to
350 Channel_Text_Message_Flag_Truncated in the Text interface).
351 </dd>
352
353 <dt>content (s or ay)</dt>
354 <dd>The part's content, if it is available and
355 sufficiently small to include here (implies that
356 'needs-retrieval' is false or omitted). Otherwise, omitted.
357 If the part is human-readable text or HTML, the value for this
358 key MUST be a UTF-8 string (D-Bus signature 's').
359 If the part is not text, the value MUST be a byte-array
360 (D-Bus signature 'ay'). If the part is a text-based format
361 that is not the main body of the message (e.g. an iCalendar
362 or an attached XML document), the value SHOULD be a UTF-8 string,
363 transcoding from another charset to UTF-8 if necessary, but
364 MAY be a byte-array (of unspecified character set) if
365 transcoding fails or the source charset is not known.</dd>
366
367 <!-- FIXME: "sufficiently small to include" is not currently
368 defined; we should add some API so clients can tell the
369 CM how large a message it should emit in the signal.-->
370
371 <dt>interface (s - <tp:type>DBus_Interface</tp:type>)</dt>
372 <dd>This part is specific to the given interface, which is
373 neither Text nor Messages. It SHOULD be ignored if that
374 interface is not supported. (Note that an 'interface' key
375 can also appear on the first part, where it indicates that the
376 entire message should be ignored if unsupported.)</dd>
377 </dl>
378
379 <p>It is an error for a connection manager to put these keys
380 in the first <tp:type>Message_Part</tp:type>, but clients MUST be
381 able to recover from this error by ignoring these keys in the
382 first part.</p>
383
384 </div>
385 </tp:docstring>
386
387 <tp:member name="Key" type="s">
388 <tp:docstring>
389 A key, which SHOULD be one of the well-known keys specified, if
390 possible.
391 </tp:docstring>
392 </tp:member>
393
394 <tp:member name="Value" type="v">
395 <tp:docstring>
396 The value corresponding to the given key, which must be of one of
397 the types indicated.
398 </tp:docstring>
399 </tp:member>
400 </tp:mapping>
401
402
403 <tp:simple-type type="s" name="Sent_Message_Token">
404 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
405 <p>An opaque token used to identify sent messages. As a special case,
406 the empty string indicates that there is no particular
407 identification for a message.</p>
408
409 <p>CM implementations SHOULD use an identifier expected to be unique,
410 such as a UUID, if possible.</p>
411
412 <p>Some protocols can only track a limited number of sent messages
413 in a small message-ID space. As a result, clients MUST NOT assume
414 that message tokens will not be re-used, and SHOULD use some
415 reasonable heuristic to assign delivery reports to messages, such
416 as matching on message content or timestamp (if available), or
417 assuming that the delivery report refers to the most recent message
418 with that ID.</p>
419
420 <tp:rationale>
421 <p>This is a hook for the DeliveryReporting interface,
422 to avoid having to introduce a
423 SendMultiPartMessageAndReturnToken method in that interface.</p>
424 </tp:rationale>
425 </tp:docstring>
426 </tp:simple-type>
427
428 <method name="SendMessage">
429 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
430 <p>Submit a message to the server for sending.
431 If this method returns successfully, the message has been submitted
432 to the server and the MessageSent signal is emitted. A corresponding
433 Sent signal on the Text interface MUST also be emitted.</p>
434
435 <p>If this method fails, message submission to the server has failed
436 and no signal on this interface (or the Text interface) is
437 emitted.</p>
438 </tp:docstring>
439
440 <arg direction="in" type="aa{sv}" tp:type="Message_Part[]"
441 name="Message">
442 <tp:docstring>
443 The message content, including any attachments or alternatives
444 </tp:docstring>
445 </arg>
446 <arg direction="in" name="Flags" type="u"
447 tp:type="Message_Sending_Flags">
448 <tp:docstring>
449 Flags affecting how the message is sent.
450 </tp:docstring>
451 </arg>
452
453 <arg direction="out" type="s" tp:type="Sent_Message_Token">
454 <tp:docstring>
455 An opaque token used to match any incoming delivery or failure
456 reports against this message, or an empty string if the message
457 is not readily identifiable.
458 </tp:docstring>
459 </arg>
460
461 <tp:possible-errors>
462 <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
463 <tp:docstring>
464 The requested message is malformed and cannot be sent.
465 </tp:docstring>
466 </tp:error>
467 <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable"/>
468 <tp:error name="org.freedesktop.Telepathy.Error.PermissionDenied"/>
469 <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
470 </tp:possible-errors>
471 </method>
472
473 <tp:flags name="Message_Sending_Flags" value-prefix="Message_Sending_Flag">
474 <tp:docstring>
475 Flags altering the way a message is sent. The "most usual" action
476 should always be to have these flags unset.
477 </tp:docstring>
478
479 <tp:flag suffix="Report_Delivery" value="1">
480 <tp:docstring>
481 Provide a delivery report via the DeliveryReporting interface, if
482 possible, even if this is not the default for this protocol.
483 Ignored if delivery reports are not possible on this protocol.
484
485 <tp:rationale>
486 In some protocols, like XMPP, it is not conventional to request
487 or send delivery notifications.
488 </tp:rationale>
489 </tp:docstring>
490 </tp:flag>
491 </tp:flags>
492
493 <signal name="MessageSent">
494 <tp:docstring>
495 Signals that a message has been submitted for sending. This
496 MUST be emitted exactly once per emission of the Sent signal on the
497 Text interface.
498
499 <tp:rationale>
500 This signal allows a process that is not the caller of
501 SendMessage to log sent messages. The double signal-emission
502 means that clients can safely follow the following rule:
503 if the channel has the Messages interface, listen for
504 Messages.MessageSent only; otherwise, listen for Text.Sent only.
505 </tp:rationale>
506 </tp:docstring>
507
508 <arg type="aa{sv}" tp:type="Message_Part[]" name="Content">
509 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
510 The message content (see <tp:type>Message_Part</tp:type> for full
511 details). If the message that was passed to SendMessage has a
512 formatted text part that the connection manager recognises, but no
513 text/plain alternative, the CM MUST use the formatted text part to
514 generate a text/plain alternative which is also included in this
515 signal argument.
516 </tp:docstring>
517 </arg>
518
519 <arg name="Message_Token" type="s" tp:type="Sent_Message_Token">
520 <tp:docstring>
521 An opaque token used to match any incoming delivery or failure
522 reports against this message, or an empty string if the message
523 is not readily identifiable.
524 </tp:docstring>
525 </arg>
526 </signal>
527
528 <property name="PendingMessages" type="aaa{sv}" access="read"
529 tp:type="Message_Part[][]">
530 <tp:docstring>
531 A list of incoming messages that have neither been acknowledged nor
532 rejected. This list is a superset of the one returned by
533 ListPendingMessages on the Text interface; its items can be removed
534 using AcknowledgePendingMessages on that interface.
535 </tp:docstring>
536 </property>
537
538 <signal name="PendingMessagesRemoved">
539 <tp:docstring>
540 The messages with the given IDs have been removed from the
541 PendingMessages list. Clients SHOULD NOT attempt to acknowledge
542 those messages.
543
544 <tp:rationale>
545 This completes change notification for the PendingMessages property
546 (previously, there was change notification when pending messages
547 were added, but not when they were removed).
548 </tp:rationale>
549 </tp:docstring>
550
551 <arg name="Message_IDs" type="au" tp:type="Message_ID[]">
552 <tp:docstring>
553 The messages that have been removed from the pending message list.
554 </tp:docstring>
555 </arg>
556 </signal>
557
558 <method name="GetPendingMessageContent">
559 <tp:docstring>
560 Retrieve the content of one or more parts of a pending message.
561 Note that this function may take a considerable amount of time
562 to return if the part's 'needs-retrieval' flag is true; consider
563 extending the default D-Bus method call timeout. Additional API is
564 likely to be added in future, to stream large message parts.
565 </tp:docstring>
566
567 <arg name="Message_ID" type="u" tp:type="Message_ID" direction="in">
568 <tp:docstring>
569 The ID of a pending message
570 </tp:docstring>
571 </arg>
572
573 <arg name="Parts" type="au" direction="in">
574 <tp:docstring>
575 The desired entries in the array of message parts, identified by
576 their position. The "headers" part (which is not a valid argument
577 to this method) is considered to be part 0, so the valid part
578 numbers start at 1 (for the second Message_Part).
579 </tp:docstring>
580 </arg>
581
582 <arg name="Content" type="a{uv}" direction="out">
583 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
584 <p>The content of the requested parts. The keys in this mapping
585 are positions in the array of message parts; the values are
586 either of type 's' or 'ay' (UTF-8 text string, or byte array),
587 following the same rules as for the value of the 'content' key in
588 the <tp:type>Message_Part</tp:type> mappings.</p>
589
590 <p>If the one of the requested part numbers was greater than zero
591 but referred to a part that had no content (i.e. it had no 'type'
592 key or no 'content' key), it is simply omitted from this mapping;
593 this is not considered to be an error condition.</p>
594 </tp:docstring>
595 </arg>
596
597 <tp:possible-errors>
598 <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
599 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
600 Either there is no pending message with the given message ID,
601 or one of the part numbers given was 0 or too large.
602 </tp:docstring>
603 </tp:error>
604 <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable"/>
605 <tp:error name="org.freedesktop.Telepathy.Error.PermissionDenied"/>
606 <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
607 </tp:possible-errors>
608 </method>
609
610 <signal name="MessageReceived">
611 <tp:docstring>
612 Signals that a message has been received and added to the pending
613 messages queue. This MUST be emitted exactly once per emission of the
614 Received signal on the Text interface.
615
616 <tp:rationale>
617 The double signal-emission means that clients can safely follow
618 the following rule: if the channel has the Messages interface,
619 listen for Messages.MessageReceived only; otherwise, listen for
620 Text.Received only.
621 </tp:rationale>
622 </tp:docstring>
623
624 <arg type="aa{sv}" tp:type="Message_Part[]" name="Message">
625 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
626 The message content, including any attachments or alternatives
627 </tp:docstring>
628 </arg>
629 </signal>
630
631 </interface>
632 </node>
633 <!-- vim:set sw=2 sts=2 et ft=xml: -->
44 EXT_IFACES = \
55 $(srcdir)/Channel_Future.xml \
66 $(srcdir)/Channel_Interface_Splittable.xml \
7 $(srcdir)/Channel_Interface_Conference_DRAFT.xml \
87 $(srcdir)/Channel_Interface_Mergeable_Conference.xml
98
109 NOT_IFACES = \
+0
-657
ring-extensions/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = ring-extensions
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 LIBRARIES = $(noinst_LIBRARIES)
50 ARFLAGS = cru
51 AM_V_AR = $(am__v_AR_$(V))
52 am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
53 am__v_AR_0 = @echo " AR " $@;
54 AM_V_at = $(am__v_at_$(V))
55 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
56 am__v_at_0 = @
57 libtpextensions_a_AR = $(AR) $(ARFLAGS)
58 libtpextensions_a_LIBADD =
59 am__libtpextensions_a_SOURCES_DIST = ring-extensions.h gtypes.h body.c
60 @HAVE_TP_EXTENSIONS_TRUE@am_libtpextensions_a_OBJECTS = \
61 @HAVE_TP_EXTENSIONS_TRUE@ body.$(OBJEXT)
62 @HAVE_TP_EXTENSIONS_TRUE@nodist_libtpextensions_a_OBJECTS = \
63 @HAVE_TP_EXTENSIONS_TRUE@ signals-marshal.$(OBJEXT) \
64 @HAVE_TP_EXTENSIONS_TRUE@ svc.$(OBJEXT)
65 libtpextensions_a_OBJECTS = $(am_libtpextensions_a_OBJECTS) \
66 $(nodist_libtpextensions_a_OBJECTS)
67 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
68 depcomp = $(SHELL) $(top_srcdir)/depcomp
69 am__depfiles_maybe = depfiles
70 am__mv = mv -f
71 AM_V_lt = $(am__v_lt_$(V))
72 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
73 am__v_lt_0 = --silent
74 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
75 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
76 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
77 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
78 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
79 $(AM_CFLAGS) $(CFLAGS)
80 AM_V_CC = $(am__v_CC_$(V))
81 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
82 am__v_CC_0 = @echo " CC " $@;
83 CCLD = $(CC)
84 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
85 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
86 $(AM_LDFLAGS) $(LDFLAGS) -o $@
87 AM_V_CCLD = $(am__v_CCLD_$(V))
88 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
89 am__v_CCLD_0 = @echo " CCLD " $@;
90 AM_V_GEN = $(am__v_GEN_$(V))
91 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
92 am__v_GEN_0 = @echo " GEN " $@;
93 SOURCES = $(libtpextensions_a_SOURCES) \
94 $(nodist_libtpextensions_a_SOURCES)
95 DIST_SOURCES = $(am__libtpextensions_a_SOURCES_DIST)
96 ETAGS = etags
97 CTAGS = ctags
98 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
99 ACLOCAL = @ACLOCAL@
100 AMTAR = @AMTAR@
101 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
102 AR = @AR@
103 AUTOCONF = @AUTOCONF@
104 AUTOHEADER = @AUTOHEADER@
105 AUTOMAKE = @AUTOMAKE@
106 AWK = @AWK@
107 CC = @CC@
108 CCDEPMODE = @CCDEPMODE@
109 CFLAGS = @CFLAGS@
110 CHECK_CFLAGS = @CHECK_CFLAGS@
111 CHECK_LIBS = @CHECK_LIBS@
112 CPP = @CPP@
113 CPPFLAGS = @CPPFLAGS@
114 CYGPATH_W = @CYGPATH_W@
115 DATADIR = @DATADIR@
116 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
117 DBUS_CFLAGS = @DBUS_CFLAGS@
118 DBUS_LIBS = @DBUS_LIBS@
119 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
120 DEFS = @DEFS@
121 DEPDIR = @DEPDIR@
122 DSYMUTIL = @DSYMUTIL@
123 DUMPBIN = @DUMPBIN@
124 ECHO_C = @ECHO_C@
125 ECHO_N = @ECHO_N@
126 ECHO_T = @ECHO_T@
127 EGREP = @EGREP@
128 ERROR_CFLAGS = @ERROR_CFLAGS@
129 EXEEXT = @EXEEXT@
130 FGREP = @FGREP@
131 GLIB_CFLAGS = @GLIB_CFLAGS@
132 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
133 GLIB_LIBS = @GLIB_LIBS@
134 GREP = @GREP@
135 INSTALL = @INSTALL@
136 INSTALL_DATA = @INSTALL_DATA@
137 INSTALL_PROGRAM = @INSTALL_PROGRAM@
138 INSTALL_SCRIPT = @INSTALL_SCRIPT@
139 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
140 LD = @LD@
141 LDFLAGS = @LDFLAGS@
142 LIBOBJS = @LIBOBJS@
143 LIBS = @LIBS@
144 LIBTOOL = @LIBTOOL@
145 LIPO = @LIPO@
146 LN_S = @LN_S@
147 LTLIBOBJS = @LTLIBOBJS@
148 MAINT = @MAINT@
149 MAKEINFO = @MAKEINFO@
150 MKDIR_P = @MKDIR_P@
151 NM = @NM@
152 NMEDIT = @NMEDIT@
153 OBJDUMP = @OBJDUMP@
154 OBJEXT = @OBJEXT@
155 OTOOL = @OTOOL@
156 OTOOL64 = @OTOOL64@
157 PACKAGE = @PACKAGE@
158 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
159 PACKAGE_NAME = @PACKAGE_NAME@
160 PACKAGE_STRING = @PACKAGE_STRING@
161 PACKAGE_TARNAME = @PACKAGE_TARNAME@
162 PACKAGE_URL = @PACKAGE_URL@
163 PACKAGE_VERSION = @PACKAGE_VERSION@
164 PATH_SEPARATOR = @PATH_SEPARATOR@
165 PKG_CONFIG = @PKG_CONFIG@
166 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
167 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
168 PYTHON = @PYTHON@
169 RANLIB = @RANLIB@
170 SED = @SED@
171 SET_MAKE = @SET_MAKE@
172 SHELL = @SHELL@
173 STRIP = @STRIP@
174 TP_CFLAGS = @TP_CFLAGS@
175 TP_LIBS = @TP_LIBS@
176 UUID_CFLAGS = @UUID_CFLAGS@
177 UUID_LIBS = @UUID_LIBS@
178 VERSION = @VERSION@
179 XSLTPROC = @XSLTPROC@
180 abs_builddir = @abs_builddir@
181 abs_srcdir = @abs_srcdir@
182 abs_top_builddir = @abs_top_builddir@
183 abs_top_srcdir = @abs_top_srcdir@
184 ac_ct_CC = @ac_ct_CC@
185 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
186 am__include = @am__include@
187 am__leading_dot = @am__leading_dot@
188 am__quote = @am__quote@
189 am__tar = @am__tar@
190 am__untar = @am__untar@
191 bindir = @bindir@
192 build = @build@
193 build_alias = @build_alias@
194 build_cpu = @build_cpu@
195 build_os = @build_os@
196 build_vendor = @build_vendor@
197 builddir = @builddir@
198 datadir = @datadir@
199 datarootdir = @datarootdir@
200 docdir = @docdir@
201 dvidir = @dvidir@
202 exec_prefix = @exec_prefix@
203 host = @host@
204 host_alias = @host_alias@
205 host_cpu = @host_cpu@
206 host_os = @host_os@
207 host_vendor = @host_vendor@
208 htmldir = @htmldir@
209 includedir = @includedir@
210 includemodemdir = @includemodemdir@
211 includesmsdir = @includesmsdir@
212 infodir = @infodir@
213 install_sh = @install_sh@
214 libdir = @libdir@
215 libexecdir = @libexecdir@
216 localedir = @localedir@
217 localstatedir = @localstatedir@
218 lt_ECHO = @lt_ECHO@
219 mandir = @mandir@
220 mkdir_p = @mkdir_p@
221 oldincludedir = @oldincludedir@
222 pdfdir = @pdfdir@
223 prefix = @prefix@
224 program_transform_name = @program_transform_name@
225 psdir = @psdir@
226 sbindir = @sbindir@
227 sharedstatedir = @sharedstatedir@
228 srcdir = @srcdir@
229 sysconfdir = @sysconfdir@
230 target_alias = @target_alias@
231 testdir = @testdir@
232 top_build_prefix = @top_build_prefix@
233 top_builddir = @top_builddir@
234 top_srcdir = @top_srcdir@
235 tools_dir = $(top_srcdir)/tools
236 EXTRA_DIST = all.xml.in $(EXT_IFACES)
237 EXT_IFACES = \
238 $(srcdir)/Channel_Future.xml \
239 $(srcdir)/Channel_Interface_Splittable.xml \
240 $(srcdir)/Channel_Interface_Conference_DRAFT.xml \
241 $(srcdir)/Channel_Interface_Mergeable_Conference.xml
242
243 NOT_IFACES = \
244 $(srcdir)/Channel_Interface_Messages.xml \
245 $(srcdir)/Channel_Interface_Dialstrings.xml
246
247 @HAVE_TP_EXTENSIONS_TRUE@noinst_LIBRARIES = libtpextensions.a
248 @HAVE_TP_EXTENSIONS_TRUE@libtpextensions_a_SOURCES = \
249 @HAVE_TP_EXTENSIONS_TRUE@ ring-extensions.h \
250 @HAVE_TP_EXTENSIONS_TRUE@ gtypes.h \
251 @HAVE_TP_EXTENSIONS_TRUE@ body.c
252
253
254 # message-mixin.h message-mixin.c
255 @HAVE_TP_EXTENSIONS_TRUE@nodist_libtpextensions_a_SOURCES = \
256 @HAVE_TP_EXTENSIONS_TRUE@ _gen/signals-marshal.c \
257 @HAVE_TP_EXTENSIONS_TRUE@ _gen/signals-marshal.h \
258 @HAVE_TP_EXTENSIONS_TRUE@ _gen/signals-marshal.list \
259 @HAVE_TP_EXTENSIONS_TRUE@ _gen/enums.h \
260 @HAVE_TP_EXTENSIONS_TRUE@ _gen/gtypes.h _gen/gtypes-body.h \
261 @HAVE_TP_EXTENSIONS_TRUE@ _gen/interfaces.h \
262 @HAVE_TP_EXTENSIONS_TRUE@ _gen/interfaces-body.h \
263 @HAVE_TP_EXTENSIONS_TRUE@ _gen/svc.h _gen/svc.c
264
265 @HAVE_TP_EXTENSIONS_TRUE@BUILT_SOURCES = \
266 @HAVE_TP_EXTENSIONS_TRUE@ all.xml \
267 @HAVE_TP_EXTENSIONS_TRUE@ _gen/all.xml \
268 @HAVE_TP_EXTENSIONS_TRUE@ $(nodist_libtpextensions_a_SOURCES)
269
270 @HAVE_TP_EXTENSIONS_TRUE@CLEANFILES = $(BUILT_SOURCES)
271 @HAVE_TP_EXTENSIONS_TRUE@INCLUDES = -I${top_builddir} -I${top_srcdir}
272 @HAVE_TP_EXTENSIONS_TRUE@AM_CFLAGS = $(ERROR_CFLAGS) @DBUS_CFLAGS@ @GLIB_CFLAGS@ @TP_CFLAGS@
273 @HAVE_TP_EXTENSIONS_TRUE@AM_LDFLAGS = @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@
274
275 # Generated stuff
276 @HAVE_TP_EXTENSIONS_TRUE@DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g'
277 @HAVE_TP_EXTENSIONS_TRUE@XSLTPROCFLAGS = --nonet --novalid
278 all: $(BUILT_SOURCES)
279 $(MAKE) $(AM_MAKEFLAGS) all-am
280
281 .SUFFIXES:
282 .SUFFIXES: .c .lo .o .obj
283 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
284 @for dep in $?; do \
285 case '$(am__configure_deps)' in \
286 *$$dep*) \
287 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
288 && { if test -f $@; then exit 0; else break; fi; }; \
289 exit 1;; \
290 esac; \
291 done; \
292 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ring-extensions/Makefile'; \
293 $(am__cd) $(top_srcdir) && \
294 $(AUTOMAKE) --foreign ring-extensions/Makefile
295 .PRECIOUS: Makefile
296 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
297 @case '$?' in \
298 *config.status*) \
299 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
300 *) \
301 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
302 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
303 esac;
304
305 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
306 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
307
308 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
309 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
310 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
311 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
312 $(am__aclocal_m4_deps):
313
314 clean-noinstLIBRARIES:
315 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
316 libtpextensions.a: $(libtpextensions_a_OBJECTS) $(libtpextensions_a_DEPENDENCIES)
317 $(AM_V_at)-rm -f libtpextensions.a
318 $(AM_V_AR)$(libtpextensions_a_AR) libtpextensions.a $(libtpextensions_a_OBJECTS) $(libtpextensions_a_LIBADD)
319 $(AM_V_at)$(RANLIB) libtpextensions.a
320
321 mostlyclean-compile:
322 -rm -f *.$(OBJEXT)
323
324 distclean-compile:
325 -rm -f *.tab.c
326
327 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/body.Po@am__quote@
328 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals-marshal.Po@am__quote@
329 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc.Po@am__quote@
330
331 .c.o:
332 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
333 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
334 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
335 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
336 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
337 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
338
339 .c.obj:
340 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
341 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
342 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
343 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
344 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
345 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
346
347 .c.lo:
348 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
349 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
350 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
351 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
352 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
353 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
354
355 signals-marshal.o: _gen/signals-marshal.c
356 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signals-marshal.o -MD -MP -MF $(DEPDIR)/signals-marshal.Tpo -c -o signals-marshal.o `test -f '_gen/signals-marshal.c' || echo '$(srcdir)/'`_gen/signals-marshal.c
357 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signals-marshal.Tpo $(DEPDIR)/signals-marshal.Po
358 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
359 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='_gen/signals-marshal.c' object='signals-marshal.o' libtool=no @AMDEPBACKSLASH@
360 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
361 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signals-marshal.o `test -f '_gen/signals-marshal.c' || echo '$(srcdir)/'`_gen/signals-marshal.c
362
363 signals-marshal.obj: _gen/signals-marshal.c
364 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signals-marshal.obj -MD -MP -MF $(DEPDIR)/signals-marshal.Tpo -c -o signals-marshal.obj `if test -f '_gen/signals-marshal.c'; then $(CYGPATH_W) '_gen/signals-marshal.c'; else $(CYGPATH_W) '$(srcdir)/_gen/signals-marshal.c'; fi`
365 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signals-marshal.Tpo $(DEPDIR)/signals-marshal.Po
366 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
367 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='_gen/signals-marshal.c' object='signals-marshal.obj' libtool=no @AMDEPBACKSLASH@
368 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
369 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signals-marshal.obj `if test -f '_gen/signals-marshal.c'; then $(CYGPATH_W) '_gen/signals-marshal.c'; else $(CYGPATH_W) '$(srcdir)/_gen/signals-marshal.c'; fi`
370
371 svc.o: _gen/svc.c
372 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc.o -MD -MP -MF $(DEPDIR)/svc.Tpo -c -o svc.o `test -f '_gen/svc.c' || echo '$(srcdir)/'`_gen/svc.c
373 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc.Tpo $(DEPDIR)/svc.Po
374 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
375 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='_gen/svc.c' object='svc.o' libtool=no @AMDEPBACKSLASH@
376 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
377 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc.o `test -f '_gen/svc.c' || echo '$(srcdir)/'`_gen/svc.c
378
379 svc.obj: _gen/svc.c
380 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc.obj -MD -MP -MF $(DEPDIR)/svc.Tpo -c -o svc.obj `if test -f '_gen/svc.c'; then $(CYGPATH_W) '_gen/svc.c'; else $(CYGPATH_W) '$(srcdir)/_gen/svc.c'; fi`
381 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc.Tpo $(DEPDIR)/svc.Po
382 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
383 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='_gen/svc.c' object='svc.obj' libtool=no @AMDEPBACKSLASH@
384 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
385 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc.obj `if test -f '_gen/svc.c'; then $(CYGPATH_W) '_gen/svc.c'; else $(CYGPATH_W) '$(srcdir)/_gen/svc.c'; fi`
386
387 mostlyclean-libtool:
388 -rm -f *.lo
389
390 clean-libtool:
391 -rm -rf .libs _libs
392
393 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
394 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
395 unique=`for i in $$list; do \
396 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
397 done | \
398 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
399 END { if (nonempty) { for (i in files) print i; }; }'`; \
400 mkid -fID $$unique
401 tags: TAGS
402
403 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
404 $(TAGS_FILES) $(LISP)
405 set x; \
406 here=`pwd`; \
407 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
408 unique=`for i in $$list; do \
409 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
410 done | \
411 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
412 END { if (nonempty) { for (i in files) print i; }; }'`; \
413 shift; \
414 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
415 test -n "$$unique" || unique=$$empty_fix; \
416 if test $$# -gt 0; then \
417 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
418 "$$@" $$unique; \
419 else \
420 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
421 $$unique; \
422 fi; \
423 fi
424 ctags: CTAGS
425 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
426 $(TAGS_FILES) $(LISP)
427 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
428 unique=`for i in $$list; do \
429 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
430 done | \
431 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
432 END { if (nonempty) { for (i in files) print i; }; }'`; \
433 test -z "$(CTAGS_ARGS)$$unique" \
434 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
435 $$unique
436
437 GTAGS:
438 here=`$(am__cd) $(top_builddir) && pwd` \
439 && $(am__cd) $(top_srcdir) \
440 && gtags -i $(GTAGS_ARGS) "$$here"
441
442 distclean-tags:
443 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
444
445 distdir: $(DISTFILES)
446 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
447 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
448 list='$(DISTFILES)'; \
449 dist_files=`for file in $$list; do echo $$file; done | \
450 sed -e "s|^$$srcdirstrip/||;t" \
451 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
452 case $$dist_files in \
453 */*) $(MKDIR_P) `echo "$$dist_files" | \
454 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
455 sort -u` ;; \
456 esac; \
457 for file in $$dist_files; do \
458 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
459 if test -d $$d/$$file; then \
460 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
461 if test -d "$(distdir)/$$file"; then \
462 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
463 fi; \
464 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
465 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
466 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
467 fi; \
468 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
469 else \
470 test -f "$(distdir)/$$file" \
471 || cp -p $$d/$$file "$(distdir)/$$file" \
472 || exit 1; \
473 fi; \
474 done
475 check-am: all-am
476 check: $(BUILT_SOURCES)
477 $(MAKE) $(AM_MAKEFLAGS) check-am
478 all-am: Makefile $(LIBRARIES)
479 installdirs:
480 install: $(BUILT_SOURCES)
481 $(MAKE) $(AM_MAKEFLAGS) install-am
482 install-exec: install-exec-am
483 install-data: install-data-am
484 uninstall: uninstall-am
485
486 install-am: all-am
487 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
488
489 installcheck: installcheck-am
490 install-strip:
491 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
492 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
493 `test -z '$(STRIP)' || \
494 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
495 mostlyclean-generic:
496
497 clean-generic:
498 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
499
500 distclean-generic:
501 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
502 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
503
504 maintainer-clean-generic:
505 @echo "This command is intended for maintainers to use"
506 @echo "it deletes files that may require special tools to rebuild."
507 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
508 @HAVE_TP_EXTENSIONS_FALSE@clean-local:
509 clean: clean-am
510
511 clean-am: clean-generic clean-libtool clean-local \
512 clean-noinstLIBRARIES mostlyclean-am
513
514 distclean: distclean-am
515 -rm -rf ./$(DEPDIR)
516 -rm -f Makefile
517 distclean-am: clean-am distclean-compile distclean-generic \
518 distclean-tags
519
520 dvi: dvi-am
521
522 dvi-am:
523
524 html: html-am
525
526 html-am:
527
528 info: info-am
529
530 info-am:
531
532 install-data-am:
533
534 install-dvi: install-dvi-am
535
536 install-dvi-am:
537
538 install-exec-am:
539
540 install-html: install-html-am
541
542 install-html-am:
543
544 install-info: install-info-am
545
546 install-info-am:
547
548 install-man:
549
550 install-pdf: install-pdf-am
551
552 install-pdf-am:
553
554 install-ps: install-ps-am
555
556 install-ps-am:
557
558 installcheck-am:
559
560 maintainer-clean: maintainer-clean-am
561 -rm -rf ./$(DEPDIR)
562 -rm -f Makefile
563 maintainer-clean-am: distclean-am maintainer-clean-generic
564
565 mostlyclean: mostlyclean-am
566
567 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
568 mostlyclean-libtool
569
570 pdf: pdf-am
571
572 pdf-am:
573
574 ps: ps-am
575
576 ps-am:
577
578 uninstall-am:
579
580 .MAKE: all check install install-am install-strip
581
582 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
583 clean-libtool clean-local clean-noinstLIBRARIES ctags \
584 distclean distclean-compile distclean-generic \
585 distclean-libtool distclean-tags distdir dvi dvi-am html \
586 html-am info info-am install install-am install-data \
587 install-data-am install-dvi install-dvi-am install-exec \
588 install-exec-am install-html install-html-am install-info \
589 install-info-am install-man install-pdf install-pdf-am \
590 install-ps install-ps-am install-strip installcheck \
591 installcheck-am installdirs maintainer-clean \
592 maintainer-clean-generic mostlyclean mostlyclean-compile \
593 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
594 tags uninstall uninstall-am
595
596
597 @HAVE_TP_EXTENSIONS_TRUE@all.xml: all.xml.in Makefile.am
598 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN) $(SHELL) $(srcdir)/all.xml.in $(EXT_IFACES) > $@
599
600 # extensions.html
601
602 @HAVE_TP_EXTENSIONS_TRUE@clean-local:
603 @HAVE_TP_EXTENSIONS_TRUE@ rm -f $(BUILT_SOURCES) _gen/*-gtk-doc.h
604 @HAVE_TP_EXTENSIONS_TRUE@ rmdir _gen
605
606 @HAVE_TP_EXTENSIONS_TRUE@_gen/all.xml: all.xml $(EXT_IFACES) Makefile.am
607 @HAVE_TP_EXTENSIONS_TRUE@ @$(mkdir_p) _gen
608 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py \
609 @HAVE_TP_EXTENSIONS_TRUE@ $< > $@.tmp && mv $@.tmp $@
610
611 @HAVE_TP_EXTENSIONS_TRUE@extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl Makefile.am
612 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
613 @HAVE_TP_EXTENSIONS_TRUE@ --param "allow-undefined-interfaces" "true()" \
614 @HAVE_TP_EXTENSIONS_TRUE@ $(tools_dir)/doc-generator.xsl \
615 @HAVE_TP_EXTENSIONS_TRUE@ $< > $@
616
617 @HAVE_TP_EXTENSIONS_TRUE@_gen/svc.c _gen/svc.h: _gen/all.xml $(tools_dir)/glib-ginterface-gen.py \
618 @HAVE_TP_EXTENSIONS_TRUE@ Makefile.am
619 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
620 @HAVE_TP_EXTENSIONS_TRUE@ --filename=_gen/svc --signal-marshal-prefix=ring_tp \
621 @HAVE_TP_EXTENSIONS_TRUE@ --include='<telepathy-glib/dbus.h>' \
622 @HAVE_TP_EXTENSIONS_TRUE@ --include='"_gen/signals-marshal.h"' \
623 @HAVE_TP_EXTENSIONS_TRUE@ --allow-unstable \
624 @HAVE_TP_EXTENSIONS_TRUE@ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \
625 @HAVE_TP_EXTENSIONS_TRUE@ $< Ring_Svc_
626
627 @HAVE_TP_EXTENSIONS_TRUE@_gen/signals-marshal.list: _gen/all.xml \
628 @HAVE_TP_EXTENSIONS_TRUE@ $(tools_dir)/glib-signals-marshal-gen.py \
629 @HAVE_TP_EXTENSIONS_TRUE@ Makefile.am
630 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@
631
632 @HAVE_TP_EXTENSIONS_TRUE@_gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am
633 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=ring_tp_marshal $< > $@
634
635 @HAVE_TP_EXTENSIONS_TRUE@_gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am
636 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN){ echo '#include "_gen/signals-marshal.h"' && \
637 @HAVE_TP_EXTENSIONS_TRUE@ $(GLIB_GENMARSHAL) --body --prefix=ring_tp_marshal $< ; } > $@
638
639 @HAVE_TP_EXTENSIONS_TRUE@_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-gen.py \
640 @HAVE_TP_EXTENSIONS_TRUE@ Makefile.am
641 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py Tp $< _gen/enums
642
643 @HAVE_TP_EXTENSIONS_TRUE@_gen/interfaces.h _gen/interfaces-body.h: _gen/all.xml \
644 @HAVE_TP_EXTENSIONS_TRUE@ $(tools_dir)/glib-interfaces-gen.py \
645 @HAVE_TP_EXTENSIONS_TRUE@ Makefile.am
646 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \
647 @HAVE_TP_EXTENSIONS_TRUE@ Ring _gen/interfaces-body.h _gen/interfaces.h $<
648
649 @HAVE_TP_EXTENSIONS_TRUE@_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \
650 @HAVE_TP_EXTENSIONS_TRUE@ $(tools_dir)/glib-gtypes-generator.py Makefile.am
651 @HAVE_TP_EXTENSIONS_TRUE@ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \
652 @HAVE_TP_EXTENSIONS_TRUE@ $< _gen/gtypes Ring
653
654 # Tell versions [3.59,3.63) of GNU make to not export all variables.
655 # Otherwise a system limit (for SysV at least) may be exceeded.
656 .NOEXPORT:
0 <?xml version="1.0" ?>
1 <node name="/Tone_Generator" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
2 <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
3
4 <interface name="com.Nokia.Telephony.Tones">
5
6 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
7 An interface for controlling tone generator.
8
9 The event values are defined in <a
10 href="http://www.rfc-editor.org/rfc/rfc4733.txt">RFC 4733</a>.
11 and <a
12 href="http://www.rfc-editor.org/rfc/rfc2833.txt">RFC 2833</a>.
13 </tp:docstring>
14
15
16 <method name="StartEventTone">
17 <arg direction="in" name="event" type="u" tp:type="Event">
18 <tp:docstring>
19 </tp:docstring>
20 </arg>
21 <arg direction="in" name="volume" type="i">
22 <tp:docstring>
23 The power level of the tone with range from 0 to -63 dBm0. (Note:
24 A preferred volume range is -8 dBm0 to -3 dBm0.)
25 </tp:docstring>
26 </arg>
27 <arg direction="in" name="duration" type="u">
28 <tp:docstring>
29 The duration of the tone in milliseconds. The tone starts when
30 the method call is received and lasts for the duration value. The
31 value 0 indicates indefinite duration, the tone is played until
32 StopTone() is called.
33 </tp:docstring>
34 </arg>
35 </method>
36
37 <tp:enum name="Event" type="u">
38 <tp:enumvalue suffix="DTMF_0" value="0">
39 <tp:docstring>DTMF Digit 0</tp:docstring>
40 </tp:enumvalue>
41 <tp:enumvalue suffix="DTMF_1" value="1">
42 <tp:docstring>DTMF Digit 0</tp:docstring>
43 </tp:enumvalue>
44 <tp:enumvalue suffix="DTMF_2" value="2">
45 <tp:docstring>DTMF Digit 0</tp:docstring>
46 </tp:enumvalue>
47 <tp:enumvalue suffix="DTMF_3" value="3">
48 <tp:docstring>DTMF Digit 0</tp:docstring>
49 </tp:enumvalue>
50 <tp:enumvalue suffix="DTMF_4" value="4">
51 <tp:docstring>DTMF Digit 0</tp:docstring>
52 </tp:enumvalue>
53 <tp:enumvalue suffix="DTMF_5" value="5">
54 <tp:docstring>DTMF Digit 0</tp:docstring>
55 </tp:enumvalue>
56 <tp:enumvalue suffix="DTMF_6" value="6">
57 <tp:docstring>DTMF Digit 0</tp:docstring>
58 </tp:enumvalue>
59 <tp:enumvalue suffix="DTMF_7" value="7">
60 <tp:docstring>DTMF Digit 0</tp:docstring>
61 </tp:enumvalue>
62 <tp:enumvalue suffix="DTMF_8" value="8">
63 <tp:docstring>DTMF Digit 0</tp:docstring>
64 </tp:enumvalue>
65 <tp:enumvalue suffix="DTMF_9" value="9">
66 <tp:docstring>DTMF Digit 0</tp:docstring>
67 </tp:enumvalue>
68 <tp:enumvalue suffix="DTMF_Asterisk" value="10">
69 <tp:docstring>DTMF special character *</tp:docstring>
70 </tp:enumvalue>
71 <tp:enumvalue suffix="DTMF_Hash" value="11">
72 <tp:docstring>DTMF special character #</tp:docstring>
73 </tp:enumvalue>
74 <tp:enumvalue suffix="DTMF_A" value="12">
75 <tp:docstring>DTMF Digit 0</tp:docstring>
76 </tp:enumvalue>
77 <tp:enumvalue suffix="DTMF_B" value="13">
78 <tp:docstring>DTMF Digit 0</tp:docstring>
79 </tp:enumvalue>
80 <tp:enumvalue suffix="DTMF_C" value="14">
81 <tp:docstring>DTMF Digit 0</tp:docstring>
82 </tp:enumvalue>
83 <tp:enumvalue suffix="DTMF_D" value="15">
84 <tp:docstring>DTMF Digit 0</tp:docstring>
85 </tp:enumvalue>
86
87
88 <tp:enumvalue suffix="Dial" value="66">
89 <tp:docstring></tp:docstring>
90 </tp:enumvalue>
91 <tp:enumvalue suffix="Ringing" value="70">
92 <tp:docstring></tp:docstring>
93 </tp:enumvalue>
94 <tp:enumvalue suffix="Busy" value="72">
95 <tp:docstring></tp:docstring>
96 </tp:enumvalue>
97 <tp:enumvalue suffix="Congestion" value="73">
98 <tp:docstring></tp:docstring>
99 </tp:enumvalue>
100 <tp:enumvalue suffix="Special_Information" value="74">
101 <tp:docstring></tp:docstring>
102 </tp:enumvalue>
103 <tp:enumvalue suffix="Call Waiting" value="79">
104 <tp:docstring></tp:docstring>
105 </tp:enumvalue>
106 <tp:enumvalue suffix="Radio_Path_Ack" value="256">
107 <tp:docstring></tp:docstring>
108 </tp:enumvalue>
109 <tp:enumvalue suffix="Radio_Path_Unavailable" value="257">
110 <tp:docstring></tp:docstring>
111 </tp:enumvalue>
112 </tp:enum>
113
114 <method name="StartTone">
115 <arg direction="in" name="looping" type="b">
116 <tp:docstring>
117 If true, the tone is looped indefinitely until
118 StopTone() is called.
119 </tp:docstring>
120 </arg>
121 <arg direction="in" name="tone" type="a(iuda(u))" tp:type="Tone">
122 <tp:docstring>
123 Description of tone.
124 </tp:docstring>
125 </arg>
126 </method>
127
128 <tp:struct name="Tone" array-name="Tone_List">
129 <tp:member type="i" name="Volume">
130 <tp:docstring>
131 The power level of the tone with range from 0 to -63 dBm0. (Note:
132 A preferred volume range is -8 dBm0 to -3 dBm0.)
133 </tp:docstring>
134 </tp:member>
135 <tp:member type="u" name="Duration"/>
136 <tp:docstring>
137 The duration of the tone in milliseconds. The tone starts when
138 the previous tone ends and lasts for the specified duration. The
139 value 0 indicates indefinite duration, the tone is played until
140 StopTone() is called.
141 </tp:docstring>
142 </tp:member>
143 <tp:member type="d" name="Modulation">
144 <tp:docstring>
145 The modulation frequency in Hz. If there
146 is no modulation, this field has a value of zero.
147 </tp:docstring>
148 </tp:member>
149 <tp:member name="frequencies" type="a(u)">
150 <tp:docstring>The frequencies of the tones to be added, measured in Hz.
151 A value of zero or an empty array indicates silence.
152 </tp:docstring>
153 </tp:member>
154 </tp:struct>
155
156 <method name="StopTone">
157 <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
158 <p>Stop tone generation.</p>
159 </tp:docstring>
160 </method>
161
162 </interface>
163 </node>
164 <!-- vim:set sw=2 sts=2 et ft=xml: -->
0 /* debug-internal.h for message-mixin.c */
1 #undef DEBUG_FLAG
2 #define DEBUG_FLAG RING_DEBUG_SMS
3 #include "../src/debug.h"
4
0 * Mon Apr 15 2013 Tom Swindell <tom.swindell@jollamobile.com> - 2.3.0
1 - Updated ring media manager properties specification
2
3 * Wed Dec 05 2012 John Brooks <john.brooks@jollamobile.com> - 2.2.1
4 - Added always_dispatch flag for account to stay connected when not online
5
6 * Thu Nov 29 2012 John Brooks <john.brooks@jollamobile.com> - 2.2.0
7 - Fixes NEMO#578: Added mission-control plugin to manage creation of the telepathy-ring account
8 - Removed ensure-tpring-account.sh script
9 - Patches moved to upstream repository
10
11 * Thu Oct 04 2012 Marko Saukko <marko.saukko@jollamobile.com> - 2.1.3
12 - Require telepathy-filesystem.
13
14 * Thu Aug 23 2012 Tom Swindell <t.swindell@rubyx.co.uk> - 2.1.3-2
15 - Added auto-generation of telepathy ring account if not present on device boot.
16
17 * Tue Jul 31 2012 Marko Saukko <marko.saukko@jollamobile.com> - 2.1.3
18 - Initial packaging for nemo.
19
0 #
1 # Do NOT Edit the Auto-generated Part!
2 # Generated by: spectacle version 0.26
3 #
4
5 Name: telepathy-ring
6
7 # >> macros
8 # << macros
9 %define keepstatic 1
10
11 Summary: GSM connection manager for the Telepathy framework
12 Version: 2.2.1
13 Release: 2
14 Group: System/Libraries
15 License: LGPLv2.1
16 URL: https://github.com/nemomobile/telepathy-ring/
17 Source0: %{name}-%{version}.tar.bz2
18 Source100: telepathy-ring.yaml
19 Requires: ofono
20 Requires: telepathy-mission-control
21 BuildRequires: pkgconfig(glib-2.0)
22 BuildRequires: pkgconfig(check)
23 BuildRequires: pkgconfig(libxslt)
24 BuildRequires: pkgconfig(dbus-1)
25 BuildRequires: pkgconfig(dbus-glib-1)
26 BuildRequires: pkgconfig(uuid)
27 BuildRequires: pkgconfig(telepathy-glib) >= 0.11.7
28 BuildRequires: pkgconfig(mission-control-plugins)
29 BuildRequires: python >= 2.5
30
31 %description
32 %{summary}.
33
34 %package tests
35 Summary: Tests for %{name}
36 Group: System/Libraries
37 Requires: %{name} = %{version}-%{release}
38
39 %description tests
40 %{summary}.
41
42 %package devel
43 Summary: Development files for %{name}
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
46
47 %description devel
48 %{summary}.
49
50 %prep
51 %setup -q -n %{name}-%{version}
52
53 # >> setup
54 # << setup
55
56 %build
57 # >> build pre
58 mkdir m4 || true
59 # << build pre
60
61 %reconfigure
62 make %{?jobs:-j%jobs}
63
64 # >> build post
65 # << build post
66
67 %install
68 rm -rf %{buildroot}
69 # >> install pre
70 # << install pre
71 %make_install
72
73 # >> install post
74 # << install post
75
76 %files
77 %defattr(-,root,root,-)
78 %{_datadir}/dbus-1/services/*
79 %{_datadir}/telepathy/managers/*
80 %{_libexecdir}/*
81 %{_libdir}/mission-control-plugins.0/mcp-account-manager-ring.so
82 %doc %{_mandir}/man8/telepathy-ring.8.gz
83 # >> files
84 # << files
85
86 %files tests
87 %defattr(-,root,root,-)
88 /opt/tests/%{name}/*
89 # >> files tests
90 # << files tests
91
92 %files devel
93 %defattr(-,root,root,-)
94 %{_libdir}/*.a
95 %{_includedir}/*
96 # >> files devel
97 # << files devel
0 Name: telepathy-ring
1 Summary: GSM connection manager for the Telepathy framework
2 Version: 2.2.1
3 Release: 2
4 Group: System/Libraries
5 License: LGPLv2.1
6 URL: https://github.com/nemomobile/telepathy-ring/
7 Sources:
8 - "%{name}-%{version}.tar.bz2"
9 Description: "%{summary}."
10
11 Requires:
12 - ofono
13 - telepathy-mission-control
14 PkgBR:
15 - python >= 2.5
16 PkgConfigBR:
17 - glib-2.0
18 - check
19 - libxslt
20 - dbus-1
21 - dbus-glib-1
22 - uuid
23 - telepathy-glib >= 0.11.7
24 - mission-control-plugins
25 Configure: reconfigure
26 Builder: make
27 Files:
28 - "%{_datadir}/dbus-1/services/*"
29 - "%{_datadir}/telepathy/managers/*"
30 - "%{_libexecdir}/*"
31 - "%{_libdir}/mission-control-plugins.0/mcp-account-manager-ring.so"
32 - "%doc %{_mandir}/man8/telepathy-ring.8.gz"
33
34 SubPackages:
35 - Name: tests
36 Summary: Tests for %{name}
37 Group: System/Libraries
38 Description: "%{summary}."
39 Files:
40 - "/opt/tests/%{name}/*"
41
42 - Name: devel
43 Summary: Development files for %{name}
44 Group: Development/Libraries
45 Description: "%{summary}."
46 Files:
47 - "%{_libdir}/*.a"
48 - "%{_includedir}/*"
+0
-382
scripts/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16 VPATH = @srcdir@
17 pkgdatadir = $(datadir)/@PACKAGE@
18 pkgincludedir = $(includedir)/@PACKAGE@
19 pkglibdir = $(libdir)/@PACKAGE@
20 pkglibexecdir = $(libexecdir)/@PACKAGE@
21 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22 install_sh_DATA = $(install_sh) -c -m 644
23 install_sh_PROGRAM = $(install_sh) -c
24 install_sh_SCRIPT = $(install_sh) -c
25 INSTALL_HEADER = $(INSTALL_DATA)
26 transform = $(program_transform_name)
27 NORMAL_INSTALL = :
28 PRE_INSTALL = :
29 POST_INSTALL = :
30 NORMAL_UNINSTALL = :
31 PRE_UNINSTALL = :
32 POST_UNINSTALL = :
33 build_triplet = @build@
34 host_triplet = @host@
35 subdir = scripts
36 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
39 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
40 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
41 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
42 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
43 $(ACLOCAL_M4)
44 mkinstalldirs = $(install_sh) -d
45 CONFIG_HEADER = $(top_builddir)/config.h
46 CONFIG_CLEAN_FILES =
47 CONFIG_CLEAN_VPATH_FILES =
48 AM_V_GEN = $(am__v_GEN_$(V))
49 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
50 am__v_GEN_0 = @echo " GEN " $@;
51 AM_V_at = $(am__v_at_$(V))
52 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
53 am__v_at_0 = @
54 SOURCES =
55 DIST_SOURCES =
56 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
57 ACLOCAL = @ACLOCAL@
58 AMTAR = @AMTAR@
59 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
60 AR = @AR@
61 AUTOCONF = @AUTOCONF@
62 AUTOHEADER = @AUTOHEADER@
63 AUTOMAKE = @AUTOMAKE@
64 AWK = @AWK@
65 CC = @CC@
66 CCDEPMODE = @CCDEPMODE@
67 CFLAGS = @CFLAGS@
68 CHECK_CFLAGS = @CHECK_CFLAGS@
69 CHECK_LIBS = @CHECK_LIBS@
70 CPP = @CPP@
71 CPPFLAGS = @CPPFLAGS@
72 CYGPATH_W = @CYGPATH_W@
73 DATADIR = @DATADIR@
74 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
75 DBUS_CFLAGS = @DBUS_CFLAGS@
76 DBUS_LIBS = @DBUS_LIBS@
77 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
78 DEFS = @DEFS@
79 DEPDIR = @DEPDIR@
80 DSYMUTIL = @DSYMUTIL@
81 DUMPBIN = @DUMPBIN@
82 ECHO_C = @ECHO_C@
83 ECHO_N = @ECHO_N@
84 ECHO_T = @ECHO_T@
85 EGREP = @EGREP@
86 ERROR_CFLAGS = @ERROR_CFLAGS@
87 EXEEXT = @EXEEXT@
88 FGREP = @FGREP@
89 GLIB_CFLAGS = @GLIB_CFLAGS@
90 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
91 GLIB_LIBS = @GLIB_LIBS@
92 GREP = @GREP@
93 INSTALL = @INSTALL@
94 INSTALL_DATA = @INSTALL_DATA@
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@
96 INSTALL_SCRIPT = @INSTALL_SCRIPT@
97 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
98 LD = @LD@
99 LDFLAGS = @LDFLAGS@
100 LIBOBJS = @LIBOBJS@
101 LIBS = @LIBS@
102 LIBTOOL = @LIBTOOL@
103 LIPO = @LIPO@
104 LN_S = @LN_S@
105 LTLIBOBJS = @LTLIBOBJS@
106 MAINT = @MAINT@
107 MAKEINFO = @MAKEINFO@
108 MKDIR_P = @MKDIR_P@
109 NM = @NM@
110 NMEDIT = @NMEDIT@
111 OBJDUMP = @OBJDUMP@
112 OBJEXT = @OBJEXT@
113 OTOOL = @OTOOL@
114 OTOOL64 = @OTOOL64@
115 PACKAGE = @PACKAGE@
116 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
117 PACKAGE_NAME = @PACKAGE_NAME@
118 PACKAGE_STRING = @PACKAGE_STRING@
119 PACKAGE_TARNAME = @PACKAGE_TARNAME@
120 PACKAGE_URL = @PACKAGE_URL@
121 PACKAGE_VERSION = @PACKAGE_VERSION@
122 PATH_SEPARATOR = @PATH_SEPARATOR@
123 PKG_CONFIG = @PKG_CONFIG@
124 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
125 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
126 PYTHON = @PYTHON@
127 RANLIB = @RANLIB@
128 SED = @SED@
129 SET_MAKE = @SET_MAKE@
130 SHELL = @SHELL@
131 STRIP = @STRIP@
132 TP_CFLAGS = @TP_CFLAGS@
133 TP_LIBS = @TP_LIBS@
134 UUID_CFLAGS = @UUID_CFLAGS@
135 UUID_LIBS = @UUID_LIBS@
136 VERSION = @VERSION@
137 XSLTPROC = @XSLTPROC@
138 abs_builddir = @abs_builddir@
139 abs_srcdir = @abs_srcdir@
140 abs_top_builddir = @abs_top_builddir@
141 abs_top_srcdir = @abs_top_srcdir@
142 ac_ct_CC = @ac_ct_CC@
143 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
144 am__include = @am__include@
145 am__leading_dot = @am__leading_dot@
146 am__quote = @am__quote@
147 am__tar = @am__tar@
148 am__untar = @am__untar@
149 bindir = @bindir@
150 build = @build@
151 build_alias = @build_alias@
152 build_cpu = @build_cpu@
153 build_os = @build_os@
154 build_vendor = @build_vendor@
155 builddir = @builddir@
156 datadir = @datadir@
157 datarootdir = @datarootdir@
158 docdir = @docdir@
159 dvidir = @dvidir@
160 exec_prefix = @exec_prefix@
161 host = @host@
162 host_alias = @host_alias@
163 host_cpu = @host_cpu@
164 host_os = @host_os@
165 host_vendor = @host_vendor@
166 htmldir = @htmldir@
167 includedir = @includedir@
168 includemodemdir = @includemodemdir@
169 includesmsdir = @includesmsdir@
170 infodir = @infodir@
171 install_sh = @install_sh@
172 libdir = @libdir@
173 libexecdir = @libexecdir@
174 localedir = @localedir@
175 localstatedir = @localstatedir@
176 lt_ECHO = @lt_ECHO@
177 mandir = @mandir@
178 mkdir_p = @mkdir_p@
179 oldincludedir = @oldincludedir@
180 pdfdir = @pdfdir@
181 prefix = @prefix@
182 program_transform_name = @program_transform_name@
183 psdir = @psdir@
184 sbindir = @sbindir@
185 sharedstatedir = @sharedstatedir@
186 srcdir = @srcdir@
187 sysconfdir = @sysconfdir@
188 target_alias = @target_alias@
189 testdir = @testdir@
190 top_build_prefix = @top_build_prefix@
191 top_builddir = @top_builddir@
192 top_srcdir = @top_srcdir@
193 EXTRA_DIST = start-ring.sh
194 all: all-am
195
196 .SUFFIXES:
197 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
198 @for dep in $?; do \
199 case '$(am__configure_deps)' in \
200 *$$dep*) \
201 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
202 && { if test -f $@; then exit 0; else break; fi; }; \
203 exit 1;; \
204 esac; \
205 done; \
206 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \
207 $(am__cd) $(top_srcdir) && \
208 $(AUTOMAKE) --foreign scripts/Makefile
209 .PRECIOUS: Makefile
210 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
211 @case '$?' in \
212 *config.status*) \
213 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
214 *) \
215 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
216 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
217 esac;
218
219 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
220 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
221
222 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
223 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
224 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
225 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
226 $(am__aclocal_m4_deps):
227
228 mostlyclean-libtool:
229 -rm -f *.lo
230
231 clean-libtool:
232 -rm -rf .libs _libs
233 tags: TAGS
234 TAGS:
235
236 ctags: CTAGS
237 CTAGS:
238
239
240 distdir: $(DISTFILES)
241 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
242 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
243 list='$(DISTFILES)'; \
244 dist_files=`for file in $$list; do echo $$file; done | \
245 sed -e "s|^$$srcdirstrip/||;t" \
246 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
247 case $$dist_files in \
248 */*) $(MKDIR_P) `echo "$$dist_files" | \
249 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
250 sort -u` ;; \
251 esac; \
252 for file in $$dist_files; do \
253 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
254 if test -d $$d/$$file; then \
255 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
256 if test -d "$(distdir)/$$file"; then \
257 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
258 fi; \
259 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
260 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
261 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
262 fi; \
263 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
264 else \
265 test -f "$(distdir)/$$file" \
266 || cp -p $$d/$$file "$(distdir)/$$file" \
267 || exit 1; \
268 fi; \
269 done
270 check-am: all-am
271 check: check-am
272 all-am: Makefile
273 installdirs:
274 install: install-am
275 install-exec: install-exec-am
276 install-data: install-data-am
277 uninstall: uninstall-am
278
279 install-am: all-am
280 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
281
282 installcheck: installcheck-am
283 install-strip:
284 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
285 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
286 `test -z '$(STRIP)' || \
287 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
288 mostlyclean-generic:
289
290 clean-generic:
291
292 distclean-generic:
293 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
294 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
295
296 maintainer-clean-generic:
297 @echo "This command is intended for maintainers to use"
298 @echo "it deletes files that may require special tools to rebuild."
299 clean: clean-am
300
301 clean-am: clean-generic clean-libtool mostlyclean-am
302
303 distclean: distclean-am
304 -rm -f Makefile
305 distclean-am: clean-am distclean-generic
306
307 dvi: dvi-am
308
309 dvi-am:
310
311 html: html-am
312
313 html-am:
314
315 info: info-am
316
317 info-am:
318
319 install-data-am:
320
321 install-dvi: install-dvi-am
322
323 install-dvi-am:
324
325 install-exec-am:
326
327 install-html: install-html-am
328
329 install-html-am:
330
331 install-info: install-info-am
332
333 install-info-am:
334
335 install-man:
336
337 install-pdf: install-pdf-am
338
339 install-pdf-am:
340
341 install-ps: install-ps-am
342
343 install-ps-am:
344
345 installcheck-am:
346
347 maintainer-clean: maintainer-clean-am
348 -rm -f Makefile
349 maintainer-clean-am: distclean-am maintainer-clean-generic
350
351 mostlyclean: mostlyclean-am
352
353 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
354
355 pdf: pdf-am
356
357 pdf-am:
358
359 ps: ps-am
360
361 ps-am:
362
363 uninstall-am:
364
365 .MAKE: install-am install-strip
366
367 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
368 distclean distclean-generic distclean-libtool distdir dvi \
369 dvi-am html html-am info info-am install install-am \
370 install-data install-data-am install-dvi install-dvi-am \
371 install-exec install-exec-am install-html install-html-am \
372 install-info install-info-am install-man install-pdf \
373 install-pdf-am install-ps install-ps-am install-strip \
374 installcheck installcheck-am installdirs maintainer-clean \
375 maintainer-clean-generic mostlyclean mostlyclean-generic \
376 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
377
378
379 # Tell versions [3.59,3.63) of GNU make to not export all variables.
380 # Otherwise a system limit (for SysV at least) may be exceeded.
381 .NOEXPORT:
0
1 # ccache breaks -fprofile-arcs
2 export CCACHE_DISABLE=1
3
4 OUT=lcov
5
6 all : lcov-build
7
8 lcov-clean:
9 find -name "*.gcno" -o -name "*.gcda" -exec rm '{}' ';'
10 rm -rf $(OUT)
11
12 lcov-build:
13 $(MAKE) CFLAGS="-O0 -fprofile-arcs -ftest-coverage" LDFLAGS="-lgcov" check
14
15 lcov-report:
16 : # hack: move gcov file from libraries back to source directory
17 for dir in `find -name .libs`; do \
18 (cd `dirname $$dir`; mv .libs/*.gc?? . || true) 2>/dev/null; \
19 done
20
21 mkdir -p $(OUT)
22 lcov -d . -c >$(OUT)/lcov.info 2>/dev/null
23 lcov -l $(OUT)/lcov.info 2>/dev/null |\
24 egrep '(^/usr|/test.*\.c|signals-marshal)' |\
25 cut -d: -f1 >$(OUT)/lcov.remove
26 lcov -r $(OUT)/lcov.info `cat $(OUT)/lcov.remove` 2>/dev/null >$(OUT)/lcov.info.clean
27 genhtml -o lcov $(OUT)/lcov.info.clean
28
0 #!/bin/sh
1 make -f scripts/lcov.mk lcov-clean && \
2 make -f scripts/lcov.mk lcov-build && \
3 make -f scripts/lcov.mk lcov-report
+0
-18
sms-glib/Makefile.am less more
0 AM_CFLAGS = $(ERROR_CFLAGS) -I$(top_srcdir) \
1 @GLIB_CFLAGS@
2
3 AM_CFLAGS += -DENABLE_DEBUG=1
4
5 lib_LTLIBRARIES = libsms-glib.la
6
7 sms_g_includedir = $(includesmsdir)/sms-glib
8
9 sms_g_include_HEADERS = \
10 message.h deliver.h status-report.h submit.h \
11 enums.h utils.h errors.h
12
13 libsms_glib_la_SOURCES = \
14 message.c deliver.c status-report.c submit.c utils.c \
15 errors.c param-spec.h param-spec.c debug.h debug.c
16
17 libsms_glib_la_LIBADD = @GLIB_LIBS@
+0
-602
sms-glib/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17
18 VPATH = @srcdir@
19 pkgdatadir = $(datadir)/@PACKAGE@
20 pkgincludedir = $(includedir)/@PACKAGE@
21 pkglibdir = $(libdir)/@PACKAGE@
22 pkglibexecdir = $(libexecdir)/@PACKAGE@
23 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24 install_sh_DATA = $(install_sh) -c -m 644
25 install_sh_PROGRAM = $(install_sh) -c
26 install_sh_SCRIPT = $(install_sh) -c
27 INSTALL_HEADER = $(INSTALL_DATA)
28 transform = $(program_transform_name)
29 NORMAL_INSTALL = :
30 PRE_INSTALL = :
31 POST_INSTALL = :
32 NORMAL_UNINSTALL = :
33 PRE_UNINSTALL = :
34 POST_UNINSTALL = :
35 build_triplet = @build@
36 host_triplet = @host@
37 subdir = sms-glib
38 DIST_COMMON = $(sms_g_include_HEADERS) $(srcdir)/Makefile.am \
39 $(srcdir)/Makefile.in
40 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
42 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
43 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
44 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
45 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
46 $(ACLOCAL_M4)
47 mkinstalldirs = $(install_sh) -d
48 CONFIG_HEADER = $(top_builddir)/config.h
49 CONFIG_CLEAN_FILES =
50 CONFIG_CLEAN_VPATH_FILES =
51 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
52 am__vpath_adj = case $$p in \
53 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
54 *) f=$$p;; \
55 esac;
56 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
57 am__install_max = 40
58 am__nobase_strip_setup = \
59 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
60 am__nobase_strip = \
61 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
62 am__nobase_list = $(am__nobase_strip_setup); \
63 for p in $$list; do echo "$$p $$p"; done | \
64 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
65 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
66 if (++n[$$2] == $(am__install_max)) \
67 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
68 END { for (dir in files) print dir, files[dir] }'
69 am__base_list = \
70 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
71 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
72 am__installdirs = "$(DESTDIR)$(libdir)" \
73 "$(DESTDIR)$(sms_g_includedir)"
74 LTLIBRARIES = $(lib_LTLIBRARIES)
75 libsms_glib_la_DEPENDENCIES =
76 am_libsms_glib_la_OBJECTS = message.lo deliver.lo status-report.lo \
77 submit.lo utils.lo errors.lo param-spec.lo debug.lo
78 libsms_glib_la_OBJECTS = $(am_libsms_glib_la_OBJECTS)
79 AM_V_lt = $(am__v_lt_$(V))
80 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
81 am__v_lt_0 = --silent
82 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
83 depcomp = $(SHELL) $(top_srcdir)/depcomp
84 am__depfiles_maybe = depfiles
85 am__mv = mv -f
86 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
87 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
88 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
89 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
90 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
91 $(AM_CFLAGS) $(CFLAGS)
92 AM_V_CC = $(am__v_CC_$(V))
93 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
94 am__v_CC_0 = @echo " CC " $@;
95 AM_V_at = $(am__v_at_$(V))
96 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
97 am__v_at_0 = @
98 CCLD = $(CC)
99 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
100 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
101 $(AM_LDFLAGS) $(LDFLAGS) -o $@
102 AM_V_CCLD = $(am__v_CCLD_$(V))
103 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
104 am__v_CCLD_0 = @echo " CCLD " $@;
105 AM_V_GEN = $(am__v_GEN_$(V))
106 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
107 am__v_GEN_0 = @echo " GEN " $@;
108 SOURCES = $(libsms_glib_la_SOURCES)
109 DIST_SOURCES = $(libsms_glib_la_SOURCES)
110 HEADERS = $(sms_g_include_HEADERS)
111 ETAGS = etags
112 CTAGS = ctags
113 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
114 ACLOCAL = @ACLOCAL@
115 AMTAR = @AMTAR@
116 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
117 AR = @AR@
118 AUTOCONF = @AUTOCONF@
119 AUTOHEADER = @AUTOHEADER@
120 AUTOMAKE = @AUTOMAKE@
121 AWK = @AWK@
122 CC = @CC@
123 CCDEPMODE = @CCDEPMODE@
124 CFLAGS = @CFLAGS@
125 CHECK_CFLAGS = @CHECK_CFLAGS@
126 CHECK_LIBS = @CHECK_LIBS@
127 CPP = @CPP@
128 CPPFLAGS = @CPPFLAGS@
129 CYGPATH_W = @CYGPATH_W@
130 DATADIR = @DATADIR@
131 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
132 DBUS_CFLAGS = @DBUS_CFLAGS@
133 DBUS_LIBS = @DBUS_LIBS@
134 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
135 DEFS = @DEFS@
136 DEPDIR = @DEPDIR@
137 DSYMUTIL = @DSYMUTIL@
138 DUMPBIN = @DUMPBIN@
139 ECHO_C = @ECHO_C@
140 ECHO_N = @ECHO_N@
141 ECHO_T = @ECHO_T@
142 EGREP = @EGREP@
143 ERROR_CFLAGS = @ERROR_CFLAGS@
144 EXEEXT = @EXEEXT@
145 FGREP = @FGREP@
146 GLIB_CFLAGS = @GLIB_CFLAGS@
147 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
148 GLIB_LIBS = @GLIB_LIBS@
149 GREP = @GREP@
150 INSTALL = @INSTALL@
151 INSTALL_DATA = @INSTALL_DATA@
152 INSTALL_PROGRAM = @INSTALL_PROGRAM@
153 INSTALL_SCRIPT = @INSTALL_SCRIPT@
154 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
155 LD = @LD@
156 LDFLAGS = @LDFLAGS@
157 LIBOBJS = @LIBOBJS@
158 LIBS = @LIBS@
159 LIBTOOL = @LIBTOOL@
160 LIPO = @LIPO@
161 LN_S = @LN_S@
162 LTLIBOBJS = @LTLIBOBJS@
163 MAINT = @MAINT@
164 MAKEINFO = @MAKEINFO@
165 MKDIR_P = @MKDIR_P@
166 NM = @NM@
167 NMEDIT = @NMEDIT@
168 OBJDUMP = @OBJDUMP@
169 OBJEXT = @OBJEXT@
170 OTOOL = @OTOOL@
171 OTOOL64 = @OTOOL64@
172 PACKAGE = @PACKAGE@
173 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
174 PACKAGE_NAME = @PACKAGE_NAME@
175 PACKAGE_STRING = @PACKAGE_STRING@
176 PACKAGE_TARNAME = @PACKAGE_TARNAME@
177 PACKAGE_URL = @PACKAGE_URL@
178 PACKAGE_VERSION = @PACKAGE_VERSION@
179 PATH_SEPARATOR = @PATH_SEPARATOR@
180 PKG_CONFIG = @PKG_CONFIG@
181 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
182 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
183 PYTHON = @PYTHON@
184 RANLIB = @RANLIB@
185 SED = @SED@
186 SET_MAKE = @SET_MAKE@
187 SHELL = @SHELL@
188 STRIP = @STRIP@
189 TP_CFLAGS = @TP_CFLAGS@
190 TP_LIBS = @TP_LIBS@
191 UUID_CFLAGS = @UUID_CFLAGS@
192 UUID_LIBS = @UUID_LIBS@
193 VERSION = @VERSION@
194 XSLTPROC = @XSLTPROC@
195 abs_builddir = @abs_builddir@
196 abs_srcdir = @abs_srcdir@
197 abs_top_builddir = @abs_top_builddir@
198 abs_top_srcdir = @abs_top_srcdir@
199 ac_ct_CC = @ac_ct_CC@
200 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
201 am__include = @am__include@
202 am__leading_dot = @am__leading_dot@
203 am__quote = @am__quote@
204 am__tar = @am__tar@
205 am__untar = @am__untar@
206 bindir = @bindir@
207 build = @build@
208 build_alias = @build_alias@
209 build_cpu = @build_cpu@
210 build_os = @build_os@
211 build_vendor = @build_vendor@
212 builddir = @builddir@
213 datadir = @datadir@
214 datarootdir = @datarootdir@
215 docdir = @docdir@
216 dvidir = @dvidir@
217 exec_prefix = @exec_prefix@
218 host = @host@
219 host_alias = @host_alias@
220 host_cpu = @host_cpu@
221 host_os = @host_os@
222 host_vendor = @host_vendor@
223 htmldir = @htmldir@
224 includedir = @includedir@
225 includemodemdir = @includemodemdir@
226 includesmsdir = @includesmsdir@
227 infodir = @infodir@
228 install_sh = @install_sh@
229 libdir = @libdir@
230 libexecdir = @libexecdir@
231 localedir = @localedir@
232 localstatedir = @localstatedir@
233 lt_ECHO = @lt_ECHO@
234 mandir = @mandir@
235 mkdir_p = @mkdir_p@
236 oldincludedir = @oldincludedir@
237 pdfdir = @pdfdir@
238 prefix = @prefix@
239 program_transform_name = @program_transform_name@
240 psdir = @psdir@
241 sbindir = @sbindir@
242 sharedstatedir = @sharedstatedir@
243 srcdir = @srcdir@
244 sysconfdir = @sysconfdir@
245 target_alias = @target_alias@
246 testdir = @testdir@
247 top_build_prefix = @top_build_prefix@
248 top_builddir = @top_builddir@
249 top_srcdir = @top_srcdir@
250 AM_CFLAGS = $(ERROR_CFLAGS) -I$(top_srcdir) @GLIB_CFLAGS@ \
251 -DENABLE_DEBUG=1
252 lib_LTLIBRARIES = libsms-glib.la
253 sms_g_includedir = $(includesmsdir)/sms-glib
254 sms_g_include_HEADERS = \
255 message.h deliver.h status-report.h submit.h \
256 enums.h utils.h errors.h
257
258 libsms_glib_la_SOURCES = \
259 message.c deliver.c status-report.c submit.c utils.c \
260 errors.c param-spec.h param-spec.c debug.h debug.c
261
262 libsms_glib_la_LIBADD = @GLIB_LIBS@
263 all: all-am
264
265 .SUFFIXES:
266 .SUFFIXES: .c .lo .o .obj
267 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
268 @for dep in $?; do \
269 case '$(am__configure_deps)' in \
270 *$$dep*) \
271 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
272 && { if test -f $@; then exit 0; else break; fi; }; \
273 exit 1;; \
274 esac; \
275 done; \
276 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sms-glib/Makefile'; \
277 $(am__cd) $(top_srcdir) && \
278 $(AUTOMAKE) --foreign sms-glib/Makefile
279 .PRECIOUS: Makefile
280 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
281 @case '$?' in \
282 *config.status*) \
283 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
284 *) \
285 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
286 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
287 esac;
288
289 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
290 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
291
292 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
293 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
294 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
295 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
296 $(am__aclocal_m4_deps):
297 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
298 @$(NORMAL_INSTALL)
299 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
300 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
301 list2=; for p in $$list; do \
302 if test -f $$p; then \
303 list2="$$list2 $$p"; \
304 else :; fi; \
305 done; \
306 test -z "$$list2" || { \
307 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
308 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
309 }
310
311 uninstall-libLTLIBRARIES:
312 @$(NORMAL_UNINSTALL)
313 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
314 for p in $$list; do \
315 $(am__strip_dir) \
316 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
317 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
318 done
319
320 clean-libLTLIBRARIES:
321 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
322 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
323 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
324 test "$$dir" != "$$p" || dir=.; \
325 echo "rm -f \"$${dir}/so_locations\""; \
326 rm -f "$${dir}/so_locations"; \
327 done
328 libsms-glib.la: $(libsms_glib_la_OBJECTS) $(libsms_glib_la_DEPENDENCIES)
329 $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libsms_glib_la_OBJECTS) $(libsms_glib_la_LIBADD) $(LIBS)
330
331 mostlyclean-compile:
332 -rm -f *.$(OBJEXT)
333
334 distclean-compile:
335 -rm -f *.tab.c
336
337 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@
338 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deliver.Plo@am__quote@
339 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Plo@am__quote@
340 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@
341 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/param-spec.Plo@am__quote@
342 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status-report.Plo@am__quote@
343 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/submit.Plo@am__quote@
344 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@
345
346 .c.o:
347 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
348 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
349 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
350 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
351 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
352 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
353
354 .c.obj:
355 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
356 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
357 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
358 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
359 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
360 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
361
362 .c.lo:
363 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
364 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
365 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
366 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
367 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
368 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
369
370 mostlyclean-libtool:
371 -rm -f *.lo
372
373 clean-libtool:
374 -rm -rf .libs _libs
375 install-sms_g_includeHEADERS: $(sms_g_include_HEADERS)
376 @$(NORMAL_INSTALL)
377 test -z "$(sms_g_includedir)" || $(MKDIR_P) "$(DESTDIR)$(sms_g_includedir)"
378 @list='$(sms_g_include_HEADERS)'; test -n "$(sms_g_includedir)" || list=; \
379 for p in $$list; do \
380 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
381 echo "$$d$$p"; \
382 done | $(am__base_list) | \
383 while read files; do \
384 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sms_g_includedir)'"; \
385 $(INSTALL_HEADER) $$files "$(DESTDIR)$(sms_g_includedir)" || exit $$?; \
386 done
387
388 uninstall-sms_g_includeHEADERS:
389 @$(NORMAL_UNINSTALL)
390 @list='$(sms_g_include_HEADERS)'; test -n "$(sms_g_includedir)" || list=; \
391 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
392 test -n "$$files" || exit 0; \
393 echo " ( cd '$(DESTDIR)$(sms_g_includedir)' && rm -f" $$files ")"; \
394 cd "$(DESTDIR)$(sms_g_includedir)" && rm -f $$files
395
396 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
397 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
398 unique=`for i in $$list; do \
399 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
400 done | \
401 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
402 END { if (nonempty) { for (i in files) print i; }; }'`; \
403 mkid -fID $$unique
404 tags: TAGS
405
406 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
407 $(TAGS_FILES) $(LISP)
408 set x; \
409 here=`pwd`; \
410 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
411 unique=`for i in $$list; do \
412 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
413 done | \
414 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
415 END { if (nonempty) { for (i in files) print i; }; }'`; \
416 shift; \
417 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
418 test -n "$$unique" || unique=$$empty_fix; \
419 if test $$# -gt 0; then \
420 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
421 "$$@" $$unique; \
422 else \
423 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
424 $$unique; \
425 fi; \
426 fi
427 ctags: CTAGS
428 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
429 $(TAGS_FILES) $(LISP)
430 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
431 unique=`for i in $$list; do \
432 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
433 done | \
434 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
435 END { if (nonempty) { for (i in files) print i; }; }'`; \
436 test -z "$(CTAGS_ARGS)$$unique" \
437 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
438 $$unique
439
440 GTAGS:
441 here=`$(am__cd) $(top_builddir) && pwd` \
442 && $(am__cd) $(top_srcdir) \
443 && gtags -i $(GTAGS_ARGS) "$$here"
444
445 distclean-tags:
446 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
447
448 distdir: $(DISTFILES)
449 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
450 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
451 list='$(DISTFILES)'; \
452 dist_files=`for file in $$list; do echo $$file; done | \
453 sed -e "s|^$$srcdirstrip/||;t" \
454 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
455 case $$dist_files in \
456 */*) $(MKDIR_P) `echo "$$dist_files" | \
457 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
458 sort -u` ;; \
459 esac; \
460 for file in $$dist_files; do \
461 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
462 if test -d $$d/$$file; then \
463 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
464 if test -d "$(distdir)/$$file"; then \
465 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
466 fi; \
467 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
468 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
469 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
470 fi; \
471 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
472 else \
473 test -f "$(distdir)/$$file" \
474 || cp -p $$d/$$file "$(distdir)/$$file" \
475 || exit 1; \
476 fi; \
477 done
478 check-am: all-am
479 check: check-am
480 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
481 installdirs:
482 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sms_g_includedir)"; do \
483 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
484 done
485 install: install-am
486 install-exec: install-exec-am
487 install-data: install-data-am
488 uninstall: uninstall-am
489
490 install-am: all-am
491 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
492
493 installcheck: installcheck-am
494 install-strip:
495 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
496 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
497 `test -z '$(STRIP)' || \
498 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
499 mostlyclean-generic:
500
501 clean-generic:
502
503 distclean-generic:
504 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
505 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
506
507 maintainer-clean-generic:
508 @echo "This command is intended for maintainers to use"
509 @echo "it deletes files that may require special tools to rebuild."
510 clean: clean-am
511
512 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
513 mostlyclean-am
514
515 distclean: distclean-am
516 -rm -rf ./$(DEPDIR)
517 -rm -f Makefile
518 distclean-am: clean-am distclean-compile distclean-generic \
519 distclean-tags
520
521 dvi: dvi-am
522
523 dvi-am:
524
525 html: html-am
526
527 html-am:
528
529 info: info-am
530
531 info-am:
532
533 install-data-am: install-sms_g_includeHEADERS
534
535 install-dvi: install-dvi-am
536
537 install-dvi-am:
538
539 install-exec-am: install-libLTLIBRARIES
540
541 install-html: install-html-am
542
543 install-html-am:
544
545 install-info: install-info-am
546
547 install-info-am:
548
549 install-man:
550
551 install-pdf: install-pdf-am
552
553 install-pdf-am:
554
555 install-ps: install-ps-am
556
557 install-ps-am:
558
559 installcheck-am:
560
561 maintainer-clean: maintainer-clean-am
562 -rm -rf ./$(DEPDIR)
563 -rm -f Makefile
564 maintainer-clean-am: distclean-am maintainer-clean-generic
565
566 mostlyclean: mostlyclean-am
567
568 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
569 mostlyclean-libtool
570
571 pdf: pdf-am
572
573 pdf-am:
574
575 ps: ps-am
576
577 ps-am:
578
579 uninstall-am: uninstall-libLTLIBRARIES uninstall-sms_g_includeHEADERS
580
581 .MAKE: install-am install-strip
582
583 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
584 clean-libLTLIBRARIES clean-libtool ctags distclean \
585 distclean-compile distclean-generic distclean-libtool \
586 distclean-tags distdir dvi dvi-am html html-am info info-am \
587 install install-am install-data install-data-am install-dvi \
588 install-dvi-am install-exec install-exec-am install-html \
589 install-html-am install-info install-info-am \
590 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
591 install-ps install-ps-am install-sms_g_includeHEADERS \
592 install-strip installcheck installcheck-am installdirs \
593 maintainer-clean maintainer-clean-generic mostlyclean \
594 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
595 pdf pdf-am ps ps-am tags uninstall uninstall-am \
596 uninstall-libLTLIBRARIES uninstall-sms_g_includeHEADERS
597
598
599 # Tell versions [3.59,3.63) of GNU make to not export all variables.
600 # Otherwise a system limit (for SysV at least) may be exceeded.
601 .NOEXPORT:
+0
-71
sms-glib/debug.c less more
0 /*
1 * sms-glib/debug.c - Debugging facilities
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 char const sms_g_log_domain[] = "sms-glib";
24 #include "debug.h"
25
26 #include <stdarg.h>
27 #include <string.h>
28
29 static SMSGDebugFlags sms_g_debug_flags = 0;
30
31 static const GDebugKey sms_g_debug_keys[] = {
32 { "submit", SMS_G_DEBUG_SUBMIT },
33 { "deliver", SMS_G_DEBUG_DELIVER },
34 { "status-report", SMS_G_DEBUG_STATUS_REPORT },
35 };
36
37 void sms_g_debug_set_flags(int new_flags)
38 {
39 sms_g_debug_flags |= new_flags;
40 }
41
42 gboolean sms_g_debug_flag_is_set(int flag)
43 {
44 return (sms_g_debug_flags & flag) != 0;
45 }
46
47 void sms_g_debug(int flag, const gchar *format, ...)
48 {
49 if (flag & sms_g_debug_flags) {
50 va_list args;
51 va_start(args, format);
52 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
53 va_end(args);
54 }
55 }
56
57 void sms_g_debug_set_flags_from_env(void)
58 {
59 #if ENABLE_DEBUG
60 const gchar *flags_string;
61
62 flags_string = g_getenv("SMS_DEBUG");
63
64 if (flags_string) {
65 sms_g_debug_set_flags(g_parse_debug_string (flags_string,
66 sms_g_debug_keys,
67 G_N_ELEMENTS(sms_g_debug_keys)));
68 }
69 #endif /* ENABLE_DEBUG */
70 }
+0
-71
sms-glib/debug.h less more
0 /*
1 * sms-glib/debug.h - Debugging facilities
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef _SMS_GLIB_DEBUG_H_
22 #define _SMS_GLIB_DEBUG_H_
23
24 /* Include this file first */
25 #define G_LOG_DOMAIN sms_g_log_domain
26
27 extern char const sms_g_log_domain[];
28
29 #include <glib.h>
30 #include <sms-glib/utils.h>
31
32 G_BEGIN_DECLS
33
34 typedef enum
35 {
36 SMS_G_DEBUG_DELIVER = 1 << 0,
37 SMS_G_DEBUG_STATUS_REPORT = 1 << 1,
38 SMS_G_DEBUG_SUBMIT = 1 << 2,
39 } SMSGDebugFlags;
40
41 gboolean sms_g_debug_flag_is_set(int flag);
42 void sms_g_debug_set_flags(int flag);
43
44 void sms_g_debug(int flag, const gchar *format, ...)
45 G_GNUC_PRINTF (2, 3);
46
47 G_END_DECLS
48
49 #ifdef ENABLE_DEBUG
50
51 #define DEBUG(format, ...) \
52 sms_g_debug(SMS_G_DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__)
53
54 #define DEBUGGING sms_g_debug_flag_is_set(SMS_G_DEBUG_FLAG)
55
56 #else /* ENABLE_DEBUG */
57
58 #define DEBUG(format, ...)
59 #define DEBUGGING (0)
60
61 #endif /* ENABLE_DEBUG */
62
63 #define GERROR_MSG_FMT "%s (%d@%s)"
64
65 #define GERROR_MSG_CODE(e) \
66 (e ? e->message : "no error"), \
67 (e ? e->code : 0), \
68 (e ? g_quark_to_string(e->domain) : "")
69
70 #endif /* _SMS_GLIB_DEBUG_H_ */
+0
-505
sms-glib/deliver.c less more
0 /*
1 * sms-glib/deliver.c - SMSGDeliver class implementation
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #define SMS_G_DEBUG_FLAG SMS_G_DEBUG_DELIVER
24
25 #include "debug.h"
26
27 #include "sms-glib/errors.h"
28 #include "sms-glib/enums.h"
29 #include "sms-glib/utils.h"
30 #include "sms-glib/message.h"
31 #include "sms-glib/deliver.h"
32 #include "sms-glib/param-spec.h"
33
34 #include <stdlib.h>
35 #include <string.h>
36 #include <stdio.h>
37
38 G_DEFINE_TYPE_WITH_CODE(
39 SMSGDeliver, sms_g_deliver, G_TYPE_OBJECT,
40 G_IMPLEMENT_INTERFACE(SMS_G_TYPE_MESSAGE, NULL));
41
42 /* Properties */
43 enum
44 {
45 PROP_NONE,
46 PROP_MESSAGE_TYPE,
47 PROP_MO,
48 PROP_CONTENT_TYPE,
49 PROP_SMSC,
50 PROP_MESSAGE_TOKEN,
51 PROP_ORIGINATOR,
52 PROP_TEXT,
53 PROP_BINARY,
54 PROP_SMS_CLASS,
55 PROP_TIME_SENT,
56 PROP_TIME_RECEIVED,
57 PROP_TIME_DELIVERED,
58 PROP_MWI_TYPE,
59 PROP_MWI_ACTIVE,
60 PROP_MWI_DISCARD,
61 PROP_MWI_LINE,
62 PROP_MWI_MESSAGES,
63 LAST_PROPERTY
64 };
65
66 /* private data */
67 struct _SMSGDeliverPrivate
68 {
69 gchar *text;
70 gchar *originator;
71 gchar *message_token; /* Message ID */
72 gchar *content_type; /* Content-type */
73 gchar *smsc;
74 gchar *mwi_type;
75 GArray binary[1];
76
77 int sms_class;
78
79 gint64 timestamp, received, delivered;
80 };
81
82 /* ---------------------------------------------------------------------- */
83 /* GObject interface */
84
85 static void
86 sms_g_deliver_init(SMSGDeliver *self)
87 {
88 DEBUG("enter");
89
90 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(
91 self, SMS_G_TYPE_DELIVER, SMSGDeliverPrivate);
92
93 DEBUG("return");
94 }
95
96 static void
97 sms_g_deliver_set_property(GObject *object,
98 guint property_id,
99 const GValue *value,
100 GParamSpec *pspec)
101 {
102 SMSGDeliver *self = SMS_G_DELIVER(object);
103 SMSGDeliverPrivate *priv = self->priv;
104
105 switch(property_id) {
106 case PROP_CONTENT_TYPE:
107 priv->content_type = g_value_dup_string(value);
108 break;
109
110 case PROP_SMSC:
111 priv->smsc = g_value_dup_string(value);
112 break;
113
114 case PROP_MESSAGE_TOKEN:
115 priv->message_token = g_value_dup_string(value);
116 break;
117
118 case PROP_ORIGINATOR:
119 priv->originator = g_value_dup_string(value);
120 break;
121
122 case PROP_TEXT:
123 priv->text = g_value_dup_string(value);
124 break;
125
126 case PROP_TIME_RECEIVED:
127 priv->received = g_value_get_int64(value);
128 break;
129
130 case PROP_TIME_DELIVERED:
131 priv->delivered = g_value_get_int64(value);
132 break;
133
134 case PROP_MWI_TYPE:
135 priv->mwi_type = g_value_dup_string(value);
136 break;
137
138 default:
139 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
140 break;
141 }
142 }
143
144 static void
145 sms_g_deliver_get_property(GObject *object,
146 guint property_id,
147 GValue *value,
148 GParamSpec *pspec)
149 {
150 SMSGDeliver *self = SMS_G_DELIVER(object);
151 SMSGDeliverPrivate *priv = self->priv;
152
153 switch(property_id) {
154 case PROP_MESSAGE_TYPE:
155 g_value_set_uint(value, SMS_G_TP_MTI_DELIVER);
156 break;
157
158 case PROP_MO:
159 g_value_set_boolean(value, FALSE);
160 break;
161
162 case PROP_CONTENT_TYPE:
163 g_value_set_string(value, priv->content_type);
164 break;
165
166 case PROP_ORIGINATOR:
167 g_value_set_string(value, priv->originator);
168 break;
169
170 case PROP_TEXT:
171 g_value_set_string(value, priv->text);
172 break;
173
174 case PROP_BINARY:
175 g_value_set_boxed(value, priv->binary);
176 break;
177
178 case PROP_SMSC:
179 g_value_set_string(value, priv->smsc ? priv->smsc : "");
180 break;
181
182 case PROP_SMS_CLASS:
183 g_value_set_int(value, sms_g_deliver_get_sms_class(self));
184 break;
185
186 case PROP_MESSAGE_TOKEN:
187 g_value_set_string(value, priv->message_token);
188 break;
189
190 case PROP_TIME_SENT:
191 g_value_set_int64(value, priv->timestamp);
192 break;
193
194 case PROP_TIME_RECEIVED:
195 g_value_set_int64(value, priv->received);
196 break;
197
198 case PROP_TIME_DELIVERED:
199 g_value_set_int64(value, priv->delivered);
200 break;
201
202 case PROP_MWI_TYPE:
203 g_value_set_string(value, priv->mwi_type);
204 break;
205
206 /* TODO: */
207 case PROP_MWI_ACTIVE:
208 g_value_set_boolean(value, FALSE);
209 break;
210
211 case PROP_MWI_DISCARD:
212 g_value_set_boolean(value, FALSE);
213 break;
214
215 case PROP_MWI_LINE:
216 g_value_set_uint(value, 0);
217 break;
218
219 case PROP_MWI_MESSAGES:
220 g_value_set_uint(value, 0);
221 break;
222
223 default:
224 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
225 break;
226 }
227 }
228
229
230 static void
231 sms_g_deliver_finalize(GObject *object)
232 {
233 SMSGDeliver *self = SMS_G_DELIVER(object);
234 SMSGDeliverPrivate *priv = self->priv;
235
236 DEBUG("SMSGDeliver: enter");
237
238 g_free(priv->text);
239 g_free(priv->originator);
240 g_free(priv->message_token);
241 g_free(priv->smsc);
242 g_free (priv->content_type);
243 g_free(priv->mwi_type);
244
245 G_OBJECT_CLASS(sms_g_deliver_parent_class)->finalize(object);
246 }
247
248
249 static void
250 sms_g_deliver_class_init(SMSGDeliverClass *klass)
251 {
252 GObjectClass *object_class = G_OBJECT_CLASS(klass);
253
254 DEBUG("enter");
255
256 g_type_class_add_private(klass, sizeof (SMSGDeliverPrivate));
257
258 object_class->get_property = sms_g_deliver_get_property;
259 object_class->set_property = sms_g_deliver_set_property;
260 object_class->finalize = sms_g_deliver_finalize;
261
262 /* Properties */
263 g_object_class_override_property(
264 object_class, PROP_MESSAGE_TYPE, "message-type");
265
266 g_object_class_override_property(
267 object_class, PROP_MO, "mobile-originated");
268
269 g_object_class_override_property(
270 object_class, PROP_CONTENT_TYPE, "content-type");
271
272 g_object_class_install_property(
273 object_class, PROP_SMSC,
274 sms_g_param_spec_smsc(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
275
276 g_object_class_install_property(
277 object_class, PROP_MESSAGE_TOKEN,
278 sms_g_param_spec_message_token(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
279
280 g_object_class_install_property(
281 object_class, PROP_ORIGINATOR,
282 g_param_spec_string("originator",
283 "SMS Originator Address",
284 "ISDN Address for SMS originator",
285 NULL, /* default value */
286 G_PARAM_READWRITE |
287 G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY));
288
289 g_object_class_install_property(
290 object_class, PROP_TEXT,
291 g_param_spec_string("text",
292 "Text Content",
293 "Text content",
294 NULL, /* default value */
295 G_PARAM_READWRITE |
296 G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY));
297
298 g_object_class_install_property(
299 object_class, PROP_BINARY,
300 g_param_spec_boxed("binary",
301 "Binary content",
302 "Binary content",
303 SMS_G_TYPE_BYTE_ARRAY, /* GByteArray */
304 G_PARAM_READABLE |
305 G_PARAM_STATIC_STRINGS));
306
307 g_object_class_install_property(
308 object_class, PROP_SMS_CLASS,
309 sms_g_param_spec_sms_class(G_PARAM_READABLE));
310
311 g_object_class_install_property(
312 object_class, PROP_TIME_SENT,
313 sms_g_param_spec_time_sent(G_PARAM_READABLE));
314
315 g_object_class_install_property(
316 object_class, PROP_TIME_RECEIVED,
317 sms_g_param_spec_time_received(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
318
319 g_object_class_install_property(
320 object_class, PROP_TIME_DELIVERED,
321 sms_g_param_spec_time_delivered(G_PARAM_READWRITE));
322
323 g_object_class_install_property(
324 object_class, PROP_MWI_TYPE,
325 g_param_spec_string("mwi-type",
326 "Message Waiting Indicator",
327 "Type of Message Waiting Indicator",
328 NULL, /* default value */
329 G_PARAM_READWRITE |
330 G_PARAM_CONSTRUCT_ONLY |
331 G_PARAM_STATIC_STRINGS));
332
333 g_object_class_install_property(
334 object_class, PROP_MWI_ACTIVE,
335 g_param_spec_boolean("mwi-active",
336 "Message Waiting Indicator should be Active",
337 "When true, activate message waiting indicator for mwi-type, "
338 "when false, deactivate message waiting indicator.",
339 0, /* default value */
340 G_PARAM_READABLE |
341 G_PARAM_STATIC_STRINGS));
342
343 g_object_class_install_property(
344 object_class, PROP_MWI_DISCARD,
345 g_param_spec_boolean("mwi-discard",
346 "Discard Message After Setting MWI",
347 "When true, this message can be discarded after mwi has been set. ",
348 0, /* default value */
349 G_PARAM_READABLE |
350 G_PARAM_STATIC_STRINGS));
351
352 g_object_class_install_property(
353 object_class, PROP_MWI_LINE,
354 g_param_spec_uint("mwi-line",
355 "Message Waiting Indication Line",
356 "Line for Message Waiting Indication",
357 0, 3, 0, /* default value */
358 G_PARAM_READABLE |
359 G_PARAM_STATIC_STRINGS));
360
361 g_object_class_install_property(
362 object_class, PROP_MWI_MESSAGES,
363 g_param_spec_uint("mwi-messages",
364 "Number of Waiting Messages",
365 "Number of Waiting Messages",
366 0, 255, 0,
367 G_PARAM_READABLE |
368 G_PARAM_STATIC_STRINGS));
369 }
370
371 /* --------------------------------------------------------------------------------- */
372 /* sms_g_deliver interface */
373
374 gchar const *
375 sms_g_deliver_get_content_type(SMSGDeliver const *self)
376 {
377 return SMS_G_IS_DELIVER(self) ? self->priv->content_type : NULL;
378 }
379
380 gboolean
381 sms_g_deliver_is_type(SMSGDeliver const *self, gchar const *type)
382 {
383 gchar const *self_type = sms_g_deliver_get_content_type(self);
384
385 return self_type && type && g_ascii_strcasecmp(self_type, type) == 0;
386 }
387
388 gboolean sms_g_deliver_is_text(SMSGDeliver const *self)
389 {
390 return sms_g_deliver_is_type(self, "text/plain");
391 }
392
393 gboolean sms_g_deliver_is_vcard(SMSGDeliver const *self)
394 {
395 return sms_g_deliver_is_type(self, "text/x-vcard");
396 }
397
398 gboolean sms_g_deliver_is_vcalendar(SMSGDeliver const *self)
399 {
400 return sms_g_deliver_is_type(self, "text/x-vcalendar");
401 }
402
403 int sms_g_deliver_get_sms_class(SMSGDeliver const *self)
404 {
405 if (SMS_G_IS_DELIVER(self) && self->priv->sms_class)
406 return self->priv->sms_class & 3;
407 else
408 return -1;
409 }
410
411 /**sms_g_deliver_get_timestamp:
412 * @self: The SMSGDeliver object
413 *
414 * Returns: Timestamp from SMS Service Centre.
415 */
416 time_t sms_g_deliver_get_timestamp(SMSGDeliver const *self)
417 {
418 return (time_t)self->priv->timestamp;
419 }
420
421 /**sms_g_deliver_get_received:
422 * @self: The SMSGDeliver object
423 *
424 * Returns: Timestamp when this message was received.
425 */
426 time_t sms_g_deliver_get_received(SMSGDeliver const *self)
427 {
428 return (time_t)self->priv->received;
429 }
430
431 /**sms_g_deliver_get_received:
432 * @self: The SMSGDeliver object
433 *
434 * Returns: Timestamp when this message was delivered.
435 */
436 time_t sms_g_deliver_get_delivered(SMSGDeliver const *self)
437 {
438 return (time_t)self->priv->delivered;
439 }
440
441 /**
442 * sms_g_deliver_get_originator:
443 * @self: The SMSGDeliver object
444 *
445 * Returns: Originator address.
446 */
447 char const *sms_g_deliver_get_originator(SMSGDeliver const *self)
448 {
449 return self->priv->originator;
450 }
451
452 char const *sms_g_deliver_get_smsc(SMSGDeliver const *self)
453 {
454 return self->priv->smsc ? self->priv->smsc : "";
455 }
456
457 char const *sms_g_deliver_get_message_token(SMSGDeliver const *self)
458 {
459 return self->priv->message_token;
460 }
461
462 char const *sms_g_deliver_get_text(SMSGDeliver const *self)
463 {
464 return SMS_G_IS_DELIVER(self) ? self->priv->text : NULL;
465 }
466
467 GArray const *sms_g_deliver_get_binary(SMSGDeliver const *self)
468 {
469 return self->priv->binary ? self->priv->binary : NULL;
470 }
471
472 SMSGDeliver *
473 sms_g_deliver_incoming(gchar const *message,
474 gchar const *message_token,
475 gchar const *originator,
476 gchar const *smsc,
477 gchar const *content_type,
478 gchar const *mwi_type,
479 GError **return_error)
480 {
481 SMSGDeliver *object;
482
483 if (!sms_g_validate_sms_address(smsc, return_error)) {
484 DEBUG("invalid SMSC number (%s)", smsc);
485 return NULL;
486 }
487
488 if (!sms_g_validate_message_id(message_token, return_error)) {
489 DEBUG("invalid message id (%s)", message_token);
490 return NULL;
491 }
492
493 object = g_object_new(SMS_G_TYPE_DELIVER,
494 "text", message,
495 "originator", originator,
496 "service-centre", smsc,
497 "message-token", message_token,
498 "content-type", content_type,
499 "time-received", sms_g_received_timestamp(),
500 "mwi-type", mwi_type,
501 NULL);
502
503 return object;
504 }
+0
-90
sms-glib/deliver.h less more
0 /*
1 * sms-deliver.h - wrapper class for SMS DELIVER messages
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_G_DELIVER_H__
22 #define __SMS_G_DELIVER_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 typedef struct _SMSGDeliver SMSGDeliver;
29 typedef struct _SMSGDeliverClass SMSGDeliverClass;
30 typedef struct _SMSGDeliverPrivate SMSGDeliverPrivate;
31
32 struct _SMSGDeliverClass {
33 GObjectClass parent_class;
34 };
35
36 struct _SMSGDeliver {
37 GObject parent;
38 SMSGDeliverPrivate *priv;
39 };
40
41 GType sms_g_deliver_get_type(void);
42
43 /* TYPE MACROS */
44 #define SMS_G_TYPE_DELIVER \
45 (sms_g_deliver_get_type())
46 #define SMS_G_DELIVER(obj) \
47 (G_TYPE_CHECK_INSTANCE_CAST((obj), SMS_G_TYPE_DELIVER, SMSGDeliver))
48 #define SMS_G_DELIVER_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_CAST((klass), SMS_G_TYPE_DELIVER, SMSGDeliverClass))
50 #define SMS_G_IS_DELIVER(obj) \
51 (G_TYPE_CHECK_INSTANCE_TYPE((obj), SMS_G_TYPE_DELIVER))
52 #define SMS_G_IS_DELIVER_CLASS(klass) \
53 (G_TYPE_CHECK_CLASS_TYPE((klass), SMS_G_TYPE_DELIVER))
54 #define SMS_G_DELIVER_GET_CLASS(obj) \
55 (G_TYPE_INSTANCE_GET_CLASS ((obj), SMS_G_TYPE_DELIVER, SMSGDeliverClass))
56
57 /* SMSGDeliver interface */
58
59 gchar const *sms_g_deliver_get_content_type(SMSGDeliver const *self);
60
61 gboolean sms_g_deliver_is_type(SMSGDeliver const *self, gchar const *type);
62
63 gboolean sms_g_deliver_is_text(SMSGDeliver const *self); /* text/plain */
64 gboolean sms_g_deliver_is_vcard(SMSGDeliver const *self); /* text/x-vcard */
65 gboolean sms_g_deliver_is_vcalendar(SMSGDeliver const *self); /* text/x-vcalendar */
66
67 char const *sms_g_deliver_get_smsc(SMSGDeliver const *self);
68 char const *sms_g_deliver_get_text(SMSGDeliver const *self);
69 int sms_g_deliver_get_sms_class(SMSGDeliver const *self);
70 time_t sms_g_deliver_get_timestamp(SMSGDeliver const *self);
71 time_t sms_g_deliver_get_received(SMSGDeliver const *self);
72 time_t sms_g_deliver_get_delivered(SMSGDeliver const *self);
73 char const *sms_g_deliver_get_originator(SMSGDeliver const *self);
74 GArray const *sms_g_deliver_get_binary(SMSGDeliver const *self);
75 char const *sms_g_deliver_get_message_token(SMSGDeliver const *self);
76
77 SMSGDeliver *sms_g_deliver_incoming(gchar const *message,
78 gchar const *message_token,
79 gchar const *originator,
80 gchar const *smsc,
81 gchar const *content_type,
82 gchar const *mwi_type,
83 GError **return_error);
84
85 void sms_g_deliver_report(SMSGDeliver *self);
86
87 G_END_DECLS
88
89 #endif /* #ifndef __SMS_G_DELIVER_H__*/
+0
-103
sms-glib/enums.h less more
0 /*
1 * sms-glib/enums.h -
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef SMS_GLIB_ENUMS_H
22 #define SMS_GLIB_ENUMS_H
23
24 G_BEGIN_DECLS
25
26 typedef enum {
27 sms_port_vcard = 0xe2,
28 sms_port_vcalendar = 0xe4,
29 sms_port_wap_vcard = 0x23f4,
30 sms_port_wap_vcalendar = 0x23f5,
31 } SMSGPortNumber;
32
33 enum {
34 SMS_G_SUBMIT_MIN_LEN = 7,
35 SMS_G_DELIVER_MIN_LEN = 13,
36 SMS_G_STATUS_REPORT_MIN_LEN = 19,
37 };
38
39 /* Mask in first byte */
40 enum {
41 SMS_G_TP_MTI_MASK = 0x03,
42 SMS_G_TP_MMS_MASK = 0x04,
43 SMS_G_TP_VPF_MASK = 0x18, /* in SMS-SUBMIT */
44 SMS_G_TP_SRI_MASK = 0x20, /* in SMS-DELIVER */
45 SMS_G_TP_SRR_MASK = 0x20, /* in SMS-SUBMIT */
46 SMS_G_TP_SRQ_MASK = 0x20, /* in SMS-STATUS-REPORT */
47 SMS_G_TP_UDHI_MASK = 0x40,
48 SMS_G_TP_RP_MASK = 0x80 /* in SMS-DELIVER/DELIVER */
49 };
50
51
52 enum {
53 SMS_G_TP_MMS = 0x04,
54 SMS_G_TP_SRI = 0x20, /* in SMS-DELIVER */
55 SMS_G_TP_SRR = 0x20, /* in SMS-SUBMIT */
56 SMS_G_TP_SRQ = 0x20, /* in SMS-STATUS-REPORT */
57 SMS_G_TP_UDHI = 0x40,
58 SMS_G_TP_RP = 0x80 /* in SMS-DELIVER/DELIVER */
59 };
60
61 enum {
62 SMS_G_TP_MTI_DELIVER = 0,
63 SMS_G_TP_MTI_DELIVER_REPORT = 0,
64 SMS_G_TP_MTI_SUBMIT = 1,
65 SMS_G_TP_MTI_SUBMIT_REPORT = 1,
66 SMS_G_TP_MTI_STATUS_REPORT = 2,
67 SMS_G_TP_MTI_COMMAND = 2
68 };
69
70 enum {
71 SMS_G_TP_FCS_UNSUPPORTED_INTERWORKING = 0x80,
72 SMS_G_TP_FCS_UNSUPPORTED_TYPE_0 = 0x81,
73 SMS_G_TP_FCS_UNSUPPORTED_REPLACE = 0x82,
74 SMS_G_TP_FCS_PID_ERROR = 0x8f,
75 SMS_G_TP_FCS_UNSUPPORTED_ALPHABET = 0x90,
76 SMS_G_TP_FCS_UNSUPPORTED_CLASS = 0x91,
77 SMS_G_TP_FCS_DCS_ERROR = 0x9f,
78 SMS_G_TP_FCS_NO_COMMAND_ACTION = 0xa0,
79 SMS_G_TP_FCS_UNSUPPORTED_COMMAND = 0xa1,
80 SMS_G_TP_FCS_COMMAND_ERROR = 0xaf,
81
82 SMS_G_TP_FCS_SC_BUSY = 0xc0,
83 SMS_G_TP_FCS_NO_SC_SUBSCRIPTION = 0xc1,
84 SMS_G_TP_FCS_INVALID_DESTINATION = 0xc2,
85 SMS_G_TP_FCS_BARRED_DESTINATION = 0xc3,
86 SMS_G_TP_FCS_REJECTED_DUPLICATE = 0xc4,
87 SMS_G_TP_FCS_UNSUPPORTED_VPF = 0xc5,
88 SMS_G_TP_FCS_UNSUPPORTED_VALIDITY = 0xc6,
89
90 SMS_G_TP_FCS_SIM_STORAGE_FULL = 0xd0,
91 SMS_G_TP_FCS_NO_SIM_STORAGE = 0xd1,
92 SMS_G_TP_FCS_MS_ERROR = 0xd2,
93 SMS_G_TP_FCS_MEMORY_EXCEEDED = 0xd3,
94 SMS_G_TP_FCS_SIM_ATK_BUSY = 0xd4,
95 SMS_G_TP_FCS_SIM_DOWNLOAD_ERROR = 0xD5,
96
97 SMS_G_TP_FCS_UNSPECIFIED = 0xff,
98 };
99
100 G_END_DECLS
101
102 #endif /* SMS_GLIB_ENUMS_H */
+0
-35
sms-glib/errors.c less more
0 /*
1 * sms-glib/errors.c -
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include <sms-glib/errors.h>
24 #include <glib/gstrfuncs.h>
25
26 #include <stdarg.h>
27
28 GQuark sms_g_errors_quark(void)
29 {
30 static GQuark quark = 0;
31 if (G_UNLIKELY(quark == 0))
32 quark = g_quark_from_static_string("SMSGErrors");
33 return quark;
34 }
+0
-40
sms-glib/errors.h less more
0 /*
1 * sms-glib/errors.h -
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_GLIB_ERRORS_H__
22 #define __SMS_GLIB_ERRORS_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 /** The error domain for sms-glib */
29 #define SMS_G_ERRORS sms_g_errors_quark ()
30
31 GQuark sms_g_errors_quark(void);
32
33 typedef enum {
34 SMS_G_ERROR_INVALID_PARAM = 0
35 } SMSGErrors;
36
37 G_END_DECLS
38
39 #endif
+0
-121
sms-glib/message.c less more
0 /*
1 * sms-glib/message.c - SMS Message interface
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include "sms-glib/message.h"
24 #include "sms-glib/param-spec.h"
25 #include "sms-glib/enums.h"
26
27 static void
28 sms_g_message_base_init(gpointer iface)
29 {
30 static gboolean init;
31
32 if (init)
33 return;
34
35 init = TRUE;
36
37 g_object_interface_install_property(
38 iface, g_param_spec_uint("message-type",
39 "SMS Message Type",
40 "Message Type for SMS",
41 SMS_G_TP_MTI_DELIVER_REPORT, /* min */
42 SMS_G_TP_MTI_COMMAND, /* max */
43 SMS_G_TP_MTI_SUBMIT, /* default value */
44 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
45
46 g_object_interface_install_property(
47 iface, g_param_spec_boolean("mobile-originated",
48 "SMS Message Originated from Mobile",
49 "Message Originated from Mobile",
50 FALSE,
51 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
52
53 g_object_interface_install_property(
54 iface, g_param_spec_string("content-type",
55 "MIME Type",
56 "MIME type for message contents",
57 "*/*",
58 G_PARAM_READWRITE |
59 G_PARAM_CONSTRUCT |
60 G_PARAM_STATIC_STRINGS));
61 }
62
63
64 GType
65 sms_g_message_get_type (void)
66 {
67 static GType type;
68
69 if (G_UNLIKELY(type == 0)) {
70 static const GTypeInfo info = {
71 .class_size = sizeof (SMSGMessageIface),
72 .base_init = sms_g_message_base_init,
73 };
74
75 type = g_type_register_static (G_TYPE_INTERFACE, "SMSGMessage", &info, 0);
76 }
77
78 return type;
79 }
80
81 /* ------------------------------------------------------------------------- */
82
83 static gpointer sms_g_byte_array_copy(gpointer boxed_byte_array);
84 static void sms_g_byte_array_free(gpointer boxed_byte_array);
85
86 /** GType for GByteArray */
87 GType
88 sms_g_byte_array_get_type (void)
89 {
90 static GType type;
91
92 if (G_UNLIKELY(type == 0)) {
93 type = g_boxed_type_register_static("SMSGByteArray",
94 sms_g_byte_array_copy,
95 sms_g_byte_array_free);
96 }
97
98 return type;
99 }
100
101 static gpointer
102 sms_g_byte_array_copy(gpointer boxed_byte_array)
103 {
104 GByteArray const *s = boxed_byte_array;
105 GByteArray *d;
106
107 if (s == NULL)
108 return NULL;
109
110 d = g_byte_array_sized_new(s->len);
111 g_byte_array_append(d, s->data, s->len);
112
113 return (gpointer)d;
114 }
115
116 static void
117 sms_g_byte_array_free(gpointer boxed_byte_array)
118 {
119 g_byte_array_free(boxed_byte_array, TRUE);
120 }
+0
-67
sms-glib/message.h less more
0 /*
1 * sms-glib/message.h - SMS message interface
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_G_MESSAGE_H__
22 #define __SMS_G_MESSAGE_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 typedef struct _SMSGMessage SMSGMessage;
29 typedef struct _SMSGMessageIface SMSGMessageIface;
30
31 GType sms_g_message_get_type(void);
32
33 /* TYPE MACROS */
34 #define SMS_G_TYPE_MESSAGE \
35 (sms_g_message_get_type())
36 #define SMS_G_MESSAGE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj), SMS_G_TYPE_MESSAGE, SMSGMessage))
38 #define SMS_G_IS_MESSAGE(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE((obj), SMS_G_TYPE_MESSAGE))
40 #define SMS_G_MESSAGE_GET_INTERFACE(obj) \
41 (G_TYPE_INSTANCE_GET_INTERFACE((obj), SMS_G_TYPE_MESSAGE, SMSGMessageIface))
42
43 struct _SMSGMessageIface {
44 GTypeInterface parent;
45 };
46
47 enum {
48 /* Mobile-terminated */
49 SMS_MESSAGE_TYPE_DELIVER = 0,
50 SMS_MESSAGE_TYPE_SUBMIT_REPORT = 1,
51 SMS_MESSAGE_TYPE_STATUS_REPORT = 2,
52
53 /* Mobile-originated */
54 SMS_MESSAGE_TYPE_DELIVER_REPORT = 0,
55 SMS_MESSAGE_TYPE_SUBMIT = 1,
56 SMS_MESSAGE_TYPE_COMMAND = 2
57 };
58
59 /* GByteArray */
60 #define SMS_G_TYPE_BYTE_ARRAY sms_g_byte_array_get_type()
61
62 GType sms_g_byte_array_get_type(void);
63
64 G_END_DECLS
65
66 #endif /* #ifndef __SMS_G_MESSAGE_H__*/
+0
-120
sms-glib/param-spec.c less more
0 /*
1 * sms-glib/param-spec.c -
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include "sms-glib/param-spec.h"
24 #include "sms-glib/enums.h"
25
26 GParamSpec *sms_g_param_spec_smsc(guint flags)
27 {
28 return
29 g_param_spec_string("service-centre",
30 "SMS Service Centre",
31 "ISDN Address for SMS Service Centre",
32 "", /* default value */
33 flags | G_PARAM_STATIC_STRINGS);
34 }
35
36 GParamSpec *sms_g_param_spec_validity_period(guint flags)
37 {
38 return
39 g_param_spec_uint("validity-period",
40 "SMS Validity Period",
41 "Period while SMS service centre "
42 "keep trying to deliver SMS.",
43 /* anything above 0 gets rounded up to 5 minutes */
44 0, /* 0 means no validity period */
45 63 * 7 * 24 * 60 * 60, /* max - 63 weeks */
46 0, /* no validity period - it is up to service centre */
47 flags | G_PARAM_STATIC_STRINGS);
48 }
49
50 GParamSpec *sms_g_param_spec_reduced_charset(guint flags)
51 {
52 return
53 g_param_spec_boolean("reduced-charset",
54 "SMS reduced character set support",
55 "Whether SMS should be encoded with "
56 "a reduced character set",
57 FALSE,
58 flags | G_PARAM_STATIC_STRINGS);
59 }
60
61 GParamSpec *sms_g_param_spec_sms_class(guint flags)
62 {
63 return
64 g_param_spec_int("class",
65 "Short Message Class",
66 "Short Message Class (0-3), -1 indicates classless",
67 -1 /* min */, 3 /* max */, -1 /* default value */,
68 flags | G_PARAM_STATIC_STRINGS);
69 }
70
71 GParamSpec *sms_g_param_spec_message_token(guint flags)
72 {
73 return
74 g_param_spec_string("message-token",
75 "Message Token",
76 "Unique identifier for this object",
77 "", /* default value */
78 flags | G_PARAM_STATIC_STRINGS);
79 }
80
81 GParamSpec *sms_g_param_spec_time_sent(guint flags)
82 {
83 return
84 g_param_spec_int64("time-sent",
85 "Time when this message was sent",
86 "Timestamp set by Short Message Service Centre",
87 G_MININT64, G_MAXINT64, 0, /* min, max, default value */
88 flags | G_PARAM_STATIC_STRINGS);
89 }
90
91 GParamSpec *sms_g_param_spec_time_original(guint flags)
92 {
93 return
94 g_param_spec_int64("time-original",
95 "Timestamp when original sent",
96 "Timestamp when the original message was received by server",
97 G_MININT64, G_MAXINT64, 0, /* min, max, default value */
98 flags | G_PARAM_STATIC_STRINGS);
99 }
100
101 GParamSpec *sms_g_param_spec_time_received(guint flags)
102 {
103 return
104 g_param_spec_int64("time-received",
105 "Timestamp when received",
106 "Timestamp when the message was originally received",
107 G_MININT64, G_MAXINT64, 0, /* min, max, default value */
108 flags | G_PARAM_STATIC_STRINGS);
109 }
110
111 GParamSpec *sms_g_param_spec_time_delivered(guint flags)
112 {
113 return
114 g_param_spec_int64("time-delivered",
115 "Timestamp when delivered",
116 "Timestamp when the message was originally delivered",
117 G_MININT64, G_MAXINT64, 0, /* min, max, default value */
118 flags | G_PARAM_STATIC_STRINGS);
119 }
+0
-41
sms-glib/param-spec.h less more
0 /*
1 * sms-glib/param-spec.h - common parameters for SMS Glib objects
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef _SMS_G_PARAM_SPEC_H_
22 #define _SMS_G_PARAM_SPEC_H_
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 GParamSpec *sms_g_param_spec_message_token(guint flags);
29 GParamSpec *sms_g_param_spec_smsc(guint flags);
30 GParamSpec *sms_g_param_spec_validity_period(guint flags);
31 GParamSpec *sms_g_param_spec_reduced_charset(guint flags);
32 GParamSpec *sms_g_param_spec_sms_class(guint flags);
33 GParamSpec *sms_g_param_spec_time_sent(guint flags);
34 GParamSpec *sms_g_param_spec_time_original(guint flags);
35 GParamSpec *sms_g_param_spec_time_received(guint flags);
36 GParamSpec *sms_g_param_spec_time_delivered(guint flags);
37
38 G_END_DECLS
39
40 #endif /* #ifndef _SMS_G_PARAM_SPEC_H_ */
+0
-521
sms-glib/status-report.c less more
0 /*
1 * sms-glib/status-report.c - SMSGStatusReport class implementation
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #define SMS_G_DEBUG_FLAG SMS_G_DEBUG_STATUS_REPORT
24
25 #include "debug.h"
26
27 #undef SMS_G_STATUS_REPORT
28
29 #include "sms-glib/errors.h"
30 #include "sms-glib/enums.h"
31 #include "sms-glib/message.h"
32 #include "sms-glib/status-report.h"
33 #include "sms-glib/utils.h"
34 #include "sms-glib/param-spec.h"
35
36 #include <limits.h>
37
38 #include <stdlib.h>
39 #include <string.h>
40 #include <stdio.h>
41 #include <unistd.h>
42 #include <errno.h>
43
44 static void sms_g_status_report_init_message_iface(gpointer, gpointer);
45
46 G_DEFINE_TYPE_WITH_CODE(
47 SMSGStatusReport, sms_g_status_report, G_TYPE_OBJECT,
48 G_IMPLEMENT_INTERFACE(SMS_G_TYPE_MESSAGE,
49 sms_g_status_report_init_message_iface);
50 );
51
52 /* Properties */
53 enum
54 {
55 PROP_NONE,
56 PROP_MESSAGE_TYPE,
57 PROP_MO,
58 PROP_CONTENT_TYPE,
59 PROP_SRQ,
60 PROP_REFERENCE,
61 PROP_RECIPIENT,
62 PROP_TIME_ORIGINAL,
63 PROP_TIME_SENT,
64 PROP_TIME_RECEIVED,
65 PROP_TIME_DELIVERED,
66 PROP_STATUS,
67 PROP_SMSC,
68 PROP_MESSAGE_TOKEN,
69 PROP_DELIVERY_TOKEN,
70 LAST_PROPERTY
71 };
72
73 /* private data */
74 struct _SMSGStatusReportPrivate
75 {
76 gchar *message_token; /* Message ID */
77 gchar *delivery_token; /* Path of message that report concerns */
78 gchar *smsc;
79 gchar *recipient;
80
81 gint64 original, discharge, received, delivered;
82
83 guint8 reference, status;
84
85 unsigned srq:1, dispose_has_run:1, :0;
86 };
87
88 /* ---------------------------------------------------------------------- */
89
90 /* ---------------------------------------------------------------------- */
91 /* GObject interface */
92
93 static void
94 sms_g_status_report_init(SMSGStatusReport *self)
95 {
96 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(
97 self, SMS_G_TYPE_STATUS_REPORT, SMSGStatusReportPrivate);
98 }
99
100 static void
101 sms_g_status_report_get_property(GObject *object,
102 guint property_id,
103 GValue *value,
104 GParamSpec *pspec)
105 {
106 SMSGStatusReport *self = SMS_G_STATUS_REPORT(object);
107 SMSGStatusReportPrivate *priv = self->priv;
108
109 switch(property_id) {
110 case PROP_MESSAGE_TYPE:
111 g_value_set_uint(value, SMS_G_TP_MTI_STATUS_REPORT);
112 break;
113
114 case PROP_MO:
115 g_value_set_boolean(value, FALSE);
116 break;
117
118 case PROP_CONTENT_TYPE:
119 g_value_set_static_string(value, "sms-status-report");
120 break;
121
122 case PROP_SRQ:
123 g_value_set_boolean(value, priv->srq);
124 break;
125
126 case PROP_REFERENCE:
127 g_value_set_uchar(value, priv->reference);
128 break;
129
130 case PROP_RECIPIENT:
131 g_value_set_string(value, priv->recipient);
132 break;
133
134 case PROP_TIME_ORIGINAL:
135 g_value_set_int64(value, priv->original);
136 break;
137
138 case PROP_TIME_SENT:
139 g_value_set_int64(value, priv->discharge);
140 break;
141
142 case PROP_TIME_RECEIVED:
143 g_value_set_int64(value, priv->received);
144 break;
145
146 case PROP_TIME_DELIVERED:
147 g_value_set_int64(value, priv->delivered);
148 break;
149
150 case PROP_STATUS:
151 g_value_set_uchar(value, priv->status);
152 break;
153
154 case PROP_SMSC:
155 g_value_set_string(value, priv->smsc ? priv->smsc : "");
156 break;
157
158 case PROP_MESSAGE_TOKEN:
159 g_value_set_string(value, priv->message_token);
160 break;
161
162 case PROP_DELIVERY_TOKEN:
163 g_value_set_string(value, priv->delivery_token);
164 break;
165
166 default:
167 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
168 break;
169 }
170 }
171
172 static void
173 sms_g_status_report_set_property(GObject *object,
174 guint property_id,
175 const GValue *value,
176 GParamSpec *pspec)
177 {
178 SMSGStatusReport *self = SMS_G_STATUS_REPORT(object);
179 SMSGStatusReportPrivate *priv = self->priv;
180 gpointer old;
181
182 switch(property_id) {
183 case PROP_CONTENT_TYPE:
184 /* Writeable in interface but not meaningfully writeable here */
185 break;
186
187 case PROP_SMSC:
188 priv->smsc = g_value_dup_string(value);
189 break;
190
191 case PROP_SRQ:
192 priv->srq = g_value_get_boolean(value);
193 break;
194
195 case PROP_REFERENCE:
196 priv->reference = g_value_get_uchar(value);
197 break;
198
199 case PROP_RECIPIENT:
200 priv->recipient = g_value_dup_string(value);
201 break;
202
203 case PROP_TIME_ORIGINAL:
204 priv->original = g_value_get_int64(value);
205 break;
206
207 case PROP_TIME_SENT:
208 priv->discharge = g_value_get_int64(value);
209 break;
210
211 case PROP_TIME_RECEIVED:
212 priv->received = g_value_get_int64(value);
213 break;
214
215 case PROP_TIME_DELIVERED:
216 priv->delivered = g_value_get_int64(value);
217 break;
218
219 case PROP_STATUS:
220 priv->status = g_value_get_uchar(value);
221 break;
222
223 case PROP_MESSAGE_TOKEN:
224 priv->message_token = g_value_dup_string(value);
225 break;
226
227 case PROP_DELIVERY_TOKEN:
228 old = priv->delivery_token;
229 priv->delivery_token = g_value_dup_string(value);
230 if (old) g_free(old);
231 break;
232
233 default:
234 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
235 break;
236 }
237 }
238
239
240 static void
241 sms_g_status_report_dispose(GObject *object)
242 {
243 SMSGStatusReport *self = SMS_G_STATUS_REPORT(object);
244 SMSGStatusReportPrivate *priv = self->priv;
245
246 DEBUG("SMSGStatusReport: enter: %s", priv->dispose_has_run ? "already" : "disposing");
247
248 if (priv->dispose_has_run)
249 return;
250 priv->dispose_has_run = TRUE;
251
252 if (G_OBJECT_CLASS(sms_g_status_report_parent_class)->dispose)
253 G_OBJECT_CLASS(sms_g_status_report_parent_class)->dispose(object);
254 }
255
256
257 static void
258 sms_g_status_report_finalize(GObject *object)
259 {
260 SMSGStatusReport *self = SMS_G_STATUS_REPORT(object);
261 SMSGStatusReportPrivate *priv = self->priv;
262
263 DEBUG("SMSGStatusReport: enter");
264
265 g_free(priv->message_token), priv->message_token = NULL;
266 g_free(priv->delivery_token), priv->delivery_token = NULL;
267 g_free(priv->smsc), priv->smsc = NULL;
268 g_free(priv->recipient), priv->recipient = NULL;
269
270 G_OBJECT_CLASS(sms_g_status_report_parent_class)->finalize(object);
271 }
272
273
274 static void
275 sms_g_status_report_class_init(SMSGStatusReportClass *klass)
276 {
277 GObjectClass *object_class = G_OBJECT_CLASS(klass);
278
279 DEBUG("enter");
280
281 g_type_class_add_private(klass, sizeof (SMSGStatusReportPrivate));
282
283 object_class->get_property = sms_g_status_report_get_property;
284 object_class->set_property = sms_g_status_report_set_property;
285 object_class->dispose = sms_g_status_report_dispose;
286 object_class->finalize = sms_g_status_report_finalize;
287
288 /* Properties */
289 g_object_class_override_property(
290 object_class, PROP_MESSAGE_TYPE, "message-type");
291 g_object_class_override_property(
292 object_class, PROP_MO, "mobile-originated");
293 g_object_class_override_property(
294 object_class, PROP_CONTENT_TYPE, "content-type");
295
296 g_object_class_install_property(
297 object_class, PROP_SRQ,
298 g_param_spec_boolean("srq",
299 "Status Report Qualifier",
300 "True if this STATUS-REPORT is sent in reponse to SMS-COMMAND",
301 FALSE, /* default value */
302 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
303 G_PARAM_STATIC_STRINGS));
304
305 g_object_class_install_property(
306 object_class, PROP_REFERENCE,
307 g_param_spec_uchar("reference",
308 "Message Reference",
309 "Message rerefence identifying original message",
310 0, 255, 0, /* min, max, default value */
311 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
312 G_PARAM_STATIC_STRINGS));
313
314 g_object_class_install_property(
315 object_class, PROP_RECIPIENT,
316 g_param_spec_string("recipient",
317 "SMS Recipient Address",
318 "Address for SMS recipient",
319 NULL, /* default value */
320 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
321 G_PARAM_STATIC_STRINGS));
322
323 g_object_class_install_property(
324 object_class, PROP_TIME_ORIGINAL,
325 sms_g_param_spec_time_original(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
326
327 g_object_class_install_property(
328 object_class, PROP_TIME_SENT,
329 sms_g_param_spec_time_sent(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
330
331 g_object_class_install_property(
332 object_class, PROP_TIME_RECEIVED,
333 sms_g_param_spec_time_received(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
334
335 g_object_class_install_property(
336 object_class, PROP_TIME_DELIVERED,
337 sms_g_param_spec_time_delivered(G_PARAM_READWRITE));
338
339 g_object_class_install_property(
340 object_class, PROP_STATUS,
341 g_param_spec_uchar("status",
342 "Status of previously sent SMS",
343 "TP-FailureCauseStatus indicating status of "
344 "previously sent Short Message",
345 0, 255, 0, /* min, max, default value */
346 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
347 G_PARAM_STATIC_STRINGS));
348
349 g_object_class_install_property(
350 object_class, PROP_SMSC,
351 sms_g_param_spec_smsc(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
352
353 g_object_class_install_property(
354 object_class, PROP_MESSAGE_TOKEN,
355 sms_g_param_spec_message_token(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
356
357 g_object_class_install_property(
358 object_class, PROP_DELIVERY_TOKEN,
359 g_param_spec_string("delivery-token",
360 "Report Path",
361 "Unique identifier of message which status is reported",
362 "", /* default value */
363 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
364 G_PARAM_STATIC_STRINGS));
365
366 DEBUG("return");
367 }
368
369 /* --------------------------------------------------------------------------------- */
370 /* sms_g_message interface */
371
372 static void
373 sms_g_status_report_init_message_iface(gpointer ifacep,
374 gpointer data)
375 {
376 (void)ifacep, (void)data;
377 }
378
379 /* --------------------------------------------------------------------------------- */
380 /* sms_g_status_report interface */
381
382 SMSGStatusReport *
383 sms_g_status_report_incoming(GPtrArray const *tpdus,
384 gchar const *smsc,
385 gchar const *message_token,
386 GError **return_error)
387 {
388 SMSGStatusReport *object;
389 gint64 t_received;
390
391 if (!sms_g_validate_sms_address(smsc, return_error)) {
392 DEBUG("invalid SMSC number (%s)", smsc);
393 return NULL;
394 }
395
396 if (!sms_g_validate_message_id(message_token, return_error)) {
397 DEBUG("invalid message id (%s)", message_token);
398 return NULL;
399 }
400
401 t_received = sms_g_received_timestamp();
402
403 #if nomore
404 DEBUG("SMS-STATUS-REPORT from %s\n"
405 "\tsrq = %u\n"
406 "\treference = %u\n"
407 "\trecipient = %s\n"
408 "\ttimestamp = %lld (zone=%d)\n"
409 "\tdischarge = %lld\n"
410 "\treceived = %lld\n"
411 "\tstatus = %u\n"
412 "\tmessage_id = %s\n",
413 smsc,
414 tpdu->status_report,
415 tpdu->msg_reference,
416 tpdu->addr_value.str,
417 t_scts, tpdu->smsc_time.offset,
418 t_discharge,
419 t_received,
420 tpdu->status,
421 message_token);
422 #endif
423
424 object = (SMSGStatusReport *)
425 g_object_new(SMS_G_TYPE_STATUS_REPORT,
426 "service-centre", smsc,
427 /*"time-original", t_scts,
428 "time-sent", t_discharge,*/
429 "time-received", t_received,
430 "message-token", message_token,
431 NULL);
432
433 return object;
434 }
435
436 char const *sms_g_status_report_get_smsc(SMSGStatusReport const *self)
437 {
438 if (SMS_G_IS_STATUS_REPORT(self) && self->priv->smsc)
439 return self->priv->smsc;
440 else
441 return "";
442 }
443
444 gboolean sms_g_status_report_get_srq(SMSGStatusReport const *self)
445 {
446 if (SMS_G_IS_STATUS_REPORT(self))
447 return self->priv->srq;
448 else
449 return FALSE;
450 }
451
452 guint8 sms_g_status_report_get_reference(SMSGStatusReport const *self)
453 {
454 if (SMS_G_IS_STATUS_REPORT(self))
455 return self->priv->reference;
456 else
457 return FALSE;
458 }
459
460 char const *sms_g_status_report_get_recipient(SMSGStatusReport const *self)
461 {
462 if (SMS_G_IS_STATUS_REPORT(self) && self->priv->recipient)
463 return self->priv->recipient;
464 else
465 return "";
466 }
467
468 guint8 sms_g_status_report_get_status(SMSGStatusReport const *self)
469 {
470 if (SMS_G_IS_STATUS_REPORT(self))
471 return self->priv->status;
472 else
473 return SMS_G_TP_FCS_UNSPECIFIED;
474 }
475
476 /** Return "message-token" property.
477 *
478 * The "message-token" is the message-id created for incoming SMS-STATUS-REPORT by
479 * libsms.
480 */
481 char const *sms_g_status_report_get_message_token(SMSGStatusReport const *self)
482 {
483 if (SMS_G_IS_STATUS_REPORT(self))
484 return self->priv->message_token;
485 else
486 return "";
487 }
488
489 /** Return "delivery-token" property. */
490 char const *sms_g_status_report_get_delivery_token(SMSGStatusReport const *self)
491 {
492 if (SMS_G_IS_STATUS_REPORT(self))
493 return self->priv->delivery_token;
494 else
495 return "";
496 }
497
498 /** Return true if TP-Status indicates transaction completed. */
499 gboolean sms_g_status_report_is_status_completed(SMSGStatusReport const *self)
500 {
501 return SMS_G_IS_STATUS_REPORT(self) && (self->priv->status & 0xe0) == 0x00;
502 }
503
504 /** Return true if TP-Status indicates that SMSC still tries to send message. */
505 gboolean sms_g_status_report_is_status_still_trying(SMSGStatusReport const *self)
506 {
507 return SMS_G_IS_STATUS_REPORT(self) && (self->priv->status & 0xe0) == 0x20;
508 }
509
510 /** Return true if TP-Status is permanent. */
511 gboolean sms_g_status_report_is_status_permanent(SMSGStatusReport const *self)
512 {
513 return SMS_G_IS_STATUS_REPORT(self) && (self->priv->status & 0xe0) == 0x40;
514 }
515
516 /** Return true if TP-Status indicates temporary error. */
517 gboolean sms_g_status_report_is_status_temporary(SMSGStatusReport const *self)
518 {
519 return SMS_G_IS_STATUS_REPORT(self) && (self->priv->status & 0xe0) == 0x60;
520 }
+0
-86
sms-glib/status-report.h less more
0 /*
1 * sms-status-report.h - wrapper class for SMS-STATUS-REPORT
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_G_STATUS_REPORT_H__
22 #define __SMS_G_STATUS_REPORT_H__
23
24 #include <glib-object.h>
25 #include <time.h>
26
27 G_BEGIN_DECLS
28
29 typedef struct _SMSGStatusReport SMSGStatusReport;
30 typedef struct _SMSGStatusReportClass SMSGStatusReportClass;
31 typedef struct _SMSGStatusReportPrivate SMSGStatusReportPrivate;
32
33 struct _SMSGStatusReportClass {
34 GObjectClass parent_class;
35 };
36
37 struct _SMSGStatusReport {
38 GObject parent;
39 SMSGStatusReportPrivate *priv;
40 };
41
42 GType sms_g_status_report_get_type(void);
43
44 /* TYPE MACROS */
45 #define SMS_G_TYPE_STATUS_REPORT \
46 (sms_g_status_report_get_type())
47 #define SMS_G_STATUS_REPORT(obj) \
48 (G_TYPE_CHECK_INSTANCE_CAST((obj), SMS_G_TYPE_STATUS_REPORT, SMSGStatusReport))
49 #define SMS_G_STATUS_REPORT_CLASS(klass) \
50 (G_TYPE_CHECK_CLASS_CAST((klass), SMS_G_TYPE_STATUS_REPORT, SMSGStatusReportClass))
51 #define SMS_G_IS_STATUS_REPORT(obj) \
52 (G_TYPE_CHECK_INSTANCE_TYPE((obj), SMS_G_TYPE_STATUS_REPORT))
53 #define SMS_G_IS_STATUS_REPORT_CLASS(klass) \
54 (G_TYPE_CHECK_CLASS_TYPE((klass), SMS_G_TYPE_STATUS_REPORT))
55 #define SMS_G_STATUS_REPORT_GET_CLASS(obj) \
56 (G_TYPE_INSTANCE_GET_CLASS ((obj), SMS_G_TYPE_STATUS_REPORT, SMSGStatusReportClass))
57
58 /* SMSGStatusReport interface */
59
60 SMSGStatusReport *sms_g_status_report_incoming(GPtrArray const *tpdus,
61 gchar const *smsc,
62 gchar const *message_token,
63 GError **return_error);
64
65 gchar const *sms_g_status_report_get_smsc(SMSGStatusReport const *self);
66
67 gboolean sms_g_status_report_get_srq(SMSGStatusReport const *self);
68 guint8 sms_g_status_report_get_reference(SMSGStatusReport const *self);
69 gchar const *sms_g_status_report_get_recipient(SMSGStatusReport const *self);
70 time_t sms_g_status_report_get_timestamp(SMSGStatusReport const *self);
71 time_t sms_g_status_report_get_discharge(SMSGStatusReport const *self);
72 time_t sms_g_status_report_get_received(SMSGStatusReport const *self);
73 time_t sms_g_status_report_get_delivered(SMSGStatusReport const *self);
74 guint8 sms_g_status_report_get_status(SMSGStatusReport const *self);
75 char const *sms_g_status_report_get_message_token(SMSGStatusReport const *self);
76 char const *sms_g_status_report_get_delivery_token(SMSGStatusReport const *self);
77
78 gboolean sms_g_status_report_is_status_completed(SMSGStatusReport const *self);
79 gboolean sms_g_status_report_is_status_still_trying(SMSGStatusReport const *self);
80 gboolean sms_g_status_report_is_status_permanent(SMSGStatusReport const *self);
81 gboolean sms_g_status_report_is_status_temporary(SMSGStatusReport const *self);
82
83 G_END_DECLS
84
85 #endif /* #ifndef __SMS_G_STATUS_REPORT_H__*/
+0
-450
sms-glib/submit.c less more
0 /*
1 * sms-glib/submit.c - SMSGSubmit class implementation
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #define SMS_G_DEBUG_FLAG SMS_G_DEBUG_SUBMIT
24
25 #include "debug.h"
26
27 #include "sms-glib/errors.h"
28 #include "sms-glib/enums.h"
29 #include "sms-glib/message.h"
30 #include "sms-glib/submit.h"
31 #include "sms-glib/param-spec.h"
32
33 #include <stdlib.h>
34 #include <string.h>
35 #include <stdio.h>
36
37 G_DEFINE_TYPE_WITH_CODE(
38 SMSGSubmit, sms_g_submit, G_TYPE_OBJECT,
39 G_IMPLEMENT_INTERFACE(SMS_G_TYPE_MESSAGE, NULL);
40 );
41
42 /* Properties */
43 enum {
44 PROP_NONE,
45 PROP_MESSAGE_TYPE,
46 PROP_MO,
47 PROP_CONTENT_TYPE,
48 PROP_DESTINATION,
49 PROP_SMSC,
50 PROP_CLASS,
51 PROP_STATUS_REPORT_REQUEST,
52 PROP_VALIDITY_PERIOD,
53 PROP_REDUCED_CHARSET,
54 LAST_PROPERTY
55 };
56
57 /* private data */
58 struct _SMSGSubmitPrivate
59 {
60 GPtrArray aay[1];
61 gpointer ptrarray[256];
62 GByteArray ay[256];
63
64 gchar *content_type;
65 gchar *destination;
66 gchar *smsc;
67 guint validity_period;
68 unsigned sms_class:5;
69
70 unsigned reduced_charset:1;
71 unsigned status_report_request:1;
72 unsigned constructed:1;
73 };
74
75 /* ---------------------------------------------------------------------- */
76
77 /* ---------------------------------------------------------------------- */
78 /* GObject interface */
79
80 static void
81 sms_g_submit_init(SMSGSubmit *self)
82 {
83 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(
84 self, SMS_G_TYPE_SUBMIT, SMSGSubmitPrivate);
85 }
86
87 static void
88 sms_g_submit_get_property(GObject *object,
89 guint property_id,
90 GValue *value,
91 GParamSpec *pspec)
92 {
93 SMSGSubmit *self = SMS_G_SUBMIT(object);
94 SMSGSubmitPrivate *priv = self->priv;
95
96 switch(property_id) {
97 case PROP_MESSAGE_TYPE:
98 g_value_set_uint(value, SMS_G_TP_MTI_SUBMIT);
99 break;
100
101 case PROP_MO:
102 g_value_set_boolean(value, TRUE);
103 break;
104
105 case PROP_CONTENT_TYPE:
106 g_value_set_string(value, priv->content_type);
107 break;
108
109 case PROP_DESTINATION:
110 g_value_set_string(value, sms_g_submit_get_destination(self));
111 break;
112
113 case PROP_STATUS_REPORT_REQUEST:
114 g_value_set_boolean(value, priv->status_report_request);
115 break;
116
117 case PROP_SMSC:
118 g_value_set_string(value, sms_g_submit_get_smsc(self));
119 break;
120
121 case PROP_CLASS:
122 g_value_set_int(value, sms_g_submit_get_sms_class(self));
123 break;
124
125 case PROP_VALIDITY_PERIOD:
126 g_value_set_uint(value, priv->validity_period);
127 break;
128
129 case PROP_REDUCED_CHARSET:
130 g_value_set_boolean(value, priv->reduced_charset);
131 break;
132
133 default:
134 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
135 break;
136 }
137 }
138
139 static void
140 sms_g_submit_set_property(GObject *object,
141 guint property_id,
142 const GValue *value,
143 GParamSpec *pspec)
144 {
145 SMSGSubmit *self = SMS_G_SUBMIT(object);
146 SMSGSubmitPrivate *priv = self->priv;
147
148 switch(property_id) {
149 case PROP_DESTINATION:
150 g_free(priv->destination);
151 priv->destination = g_value_dup_string(value);
152 return;
153
154 case PROP_CONTENT_TYPE:
155 priv->content_type = g_value_dup_string(value);
156 break;
157
158 case PROP_STATUS_REPORT_REQUEST:
159 priv->status_report_request = g_value_get_boolean(value);
160 return;
161
162 case PROP_SMSC:
163 g_free(priv->smsc);
164 priv->smsc = g_value_dup_string(value);
165 break;
166
167 case PROP_CLASS:
168 if (g_value_get_int(value) >= 0)
169 priv->sms_class = g_value_get_int(value);
170 else
171 priv->sms_class = 0;
172 return;
173
174 case PROP_VALIDITY_PERIOD:
175 priv->validity_period = g_value_get_uint(value);
176 break;
177
178 case PROP_REDUCED_CHARSET:
179 priv->reduced_charset = g_value_get_boolean(value);
180 break;
181
182 default:
183 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
184 }
185 }
186
187 static void
188 sms_g_submit_constructed(GObject *object)
189 {
190 if (G_OBJECT_CLASS(sms_g_submit_parent_class)->constructed)
191 G_OBJECT_CLASS(sms_g_submit_parent_class)->constructed(object);
192
193 SMS_G_SUBMIT(object)->priv->constructed = 1;
194 }
195
196 static void
197 sms_g_submit_finalize(GObject *object)
198 {
199 SMSGSubmit *self = SMS_G_SUBMIT(object);
200 SMSGSubmitPrivate *priv = self->priv;
201
202 DEBUG("enter");
203
204 g_free(priv->destination);
205 g_free(priv->content_type);
206 g_free(priv->smsc);
207
208 G_OBJECT_CLASS(sms_g_submit_parent_class)->finalize(object);
209 }
210
211
212 static void
213 sms_g_submit_class_init(SMSGSubmitClass *klass)
214 {
215 GObjectClass *object_class = G_OBJECT_CLASS(klass);
216
217 DEBUG("enter");
218
219 g_type_class_add_private(klass, sizeof (SMSGSubmitPrivate));
220
221 object_class->get_property = sms_g_submit_get_property;
222 object_class->set_property = sms_g_submit_set_property;
223 object_class->constructed = sms_g_submit_constructed;
224 object_class->finalize = sms_g_submit_finalize;
225
226 /* No Signals */
227
228 /* Properties */
229 g_object_class_override_property(
230 object_class, PROP_MESSAGE_TYPE, "message-type");
231
232 g_object_class_override_property(
233 object_class, PROP_MO, "mobile-originated");
234
235 g_object_class_override_property(
236 object_class, PROP_CONTENT_TYPE, "content-type");
237
238 g_object_class_install_property(
239 object_class, PROP_DESTINATION,
240 g_param_spec_string("destination",
241 "SMS Destination Address",
242 "Address for SMS destination",
243 NULL, /* default value */
244 G_PARAM_READWRITE |
245 G_PARAM_STATIC_STRINGS));
246
247 g_object_class_install_property(
248 object_class, PROP_STATUS_REPORT_REQUEST,
249 g_param_spec_boolean("status-report-request",
250 "Request status report",
251 "Request for SMS-STATUS-REPORT in SMS-SUBMIT.",
252 FALSE, /* default value */
253 G_PARAM_READWRITE |
254 G_PARAM_STATIC_STRINGS));
255
256 g_object_class_install_property(
257 object_class, PROP_SMSC,
258 sms_g_param_spec_smsc(G_PARAM_READWRITE));
259
260 g_object_class_install_property(
261 object_class, PROP_CLASS,
262 sms_g_param_spec_sms_class(G_PARAM_READWRITE));
263
264 g_object_class_install_property(
265 object_class, PROP_VALIDITY_PERIOD,
266 sms_g_param_spec_validity_period(G_PARAM_READWRITE));
267
268 g_object_class_install_property(
269 object_class, PROP_REDUCED_CHARSET,
270 sms_g_param_spec_reduced_charset(G_PARAM_READWRITE));
271
272 DEBUG("return");
273 }
274
275 /* --------------------------------------------------------------------------------- */
276 /* sms_g_submit interface */
277
278 gchar const *sms_g_submit_get_destination(SMSGSubmit const *self)
279 {
280 if (SMS_G_IS_SUBMIT(self) && self->priv->destination)
281 return self->priv->destination;
282 else
283 return "";
284 }
285
286 void sms_g_submit_set_destination(SMSGSubmit *self, gchar const *destination)
287 {
288 g_object_set((GObject *)self, "destination", destination, NULL);
289 }
290
291 char const *sms_g_submit_get_smsc(SMSGSubmit const *self)
292 {
293 if (SMS_G_IS_SUBMIT(self) && self->priv->smsc)
294 return self->priv->smsc;
295 else
296 return "";
297 }
298
299 void sms_g_submit_set_smsc(SMSGSubmit *self, gchar const *smsc)
300 {
301 g_object_set((GObject *)self, "service-centre", smsc, NULL);
302 }
303
304 gint sms_g_submit_get_sms_class(SMSGSubmit const *self)
305 {
306 if (SMS_G_IS_SUBMIT(self) && self->priv->sms_class)
307 return self->priv->sms_class & 3;
308 else
309 return -1;
310 }
311
312 void sms_g_submit_set_sms_class(SMSGSubmit *self, gint sms_class)
313 {
314 g_object_set((GObject *)self, "class", sms_class, NULL);
315 }
316
317 gboolean sms_g_submit_get_status_report_request(SMSGSubmit *self)
318 {
319 if (SMS_G_IS_SUBMIT(self))
320 return self->priv->status_report_request;
321 else
322 return FALSE;
323 }
324
325 void sms_g_submit_set_status_report_request(SMSGSubmit *self, gboolean srr)
326 {
327 g_object_set((GObject *)self, "status-report-request", srr, NULL);
328 }
329
330 guint sms_g_submit_get_validity_period(SMSGSubmit const *self)
331 {
332 if (SMS_G_IS_SUBMIT(self))
333 return self->priv->validity_period;
334 else
335 return 0;
336 }
337
338 void sms_g_submit_set_validity_period(SMSGSubmit *self, guint validity_period)
339 {
340 return g_object_set((GObject *)self, "validity-period", validity_period, NULL);
341 }
342
343 gboolean sms_g_submit_get_reduced_charset(SMSGSubmit const *self)
344 {
345 if (SMS_G_IS_SUBMIT(self))
346 return self->priv->reduced_charset;
347 else
348 return FALSE;
349 }
350
351 void sms_g_submit_set_reduced_charset(SMSGSubmit *self, gboolean reduced_charset)
352 {
353 return g_object_set((GObject *)self, "reduced-charset", reduced_charset, NULL);
354 }
355
356 SMSGSubmit *
357 sms_g_submit_new(void)
358 {
359 return sms_g_submit_new_type("*/*");
360 }
361
362 SMSGSubmit *
363 sms_g_submit_new_type(char const *content_type)
364 {
365 return (SMSGSubmit *) g_object_new(SMS_G_TYPE_SUBMIT,
366 "content-type", content_type,
367 NULL);
368 }
369
370 /* ---------------------------------------------------------------------- */
371
372 static
373 GPtrArray const *
374 sms_g_submit_any(SMSGSubmit *self,
375 gchar const *text,
376 GArray const *binary,
377 GError **gerror)
378 {
379 SMSGSubmitPrivate *priv;
380
381 if (text == NULL && binary == NULL) {
382 g_set_error(gerror, SMS_G_ERRORS, SMS_G_ERROR_INVALID_PARAM,
383 "No data to encode");
384 return NULL;
385 }
386
387 priv = self->priv;
388
389 if (priv->destination == NULL) {
390 g_set_error(gerror, SMS_G_ERRORS, SMS_G_ERROR_INVALID_PARAM,
391 "No destination address");
392 return NULL;
393 }
394
395 return priv->aay;
396 }
397
398 GPtrArray const *
399 sms_g_submit_text(SMSGSubmit *self,
400 gchar const *text,
401 GError **gerror)
402 {
403 return sms_g_submit_any(self, text, NULL, gerror);
404 }
405
406 GPtrArray const *
407 sms_g_submit_binary(SMSGSubmit *self,
408 GArray const *binary,
409 GError **gerror)
410 {
411 return sms_g_submit_any(self, NULL, binary, gerror);
412 }
413
414 GPtrArray const *
415 sms_g_submit_bytes(SMSGSubmit *self,
416 gconstpointer data,
417 guint size,
418 GError **gerror)
419
420 {
421 GArray array = { (gpointer)data, size };
422 return sms_g_submit_any(self, NULL, &array, gerror);
423 }
424
425 GPtrArray const *
426 sms_g_submit_get_data(SMSGSubmit const *self)
427 {
428 if (SMS_G_IS_SUBMIT(self) && self->priv->aay->pdata)
429 return self->priv->aay; /* Encoded */
430 else
431 return NULL; /* Not encoded */
432 }
433
434 gpointer const *
435 sms_g_submit_get_pdata(SMSGSubmit const *self)
436 {
437 if (SMS_G_IS_SUBMIT(self) && self->priv->aay->pdata)
438 return self->priv->aay->pdata; /* Encoded */
439 else
440 return NULL; /* Not encoded */
441 }
442
443 guint sms_g_submit_get_len(SMSGSubmit const *self)
444 {
445 if (SMS_G_IS_SUBMIT(self) && self->priv->aay->pdata)
446 return self->priv->aay->len;
447 else
448 return 0;
449 }
+0
-98
sms-glib/submit.h less more
0 /*
1 * sms-glib/submit.h - SMS Submit
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_G_SUBMIT_H__
22 #define __SMS_G_SUBMIT_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 typedef struct _SMSGSubmit SMSGSubmit;
29 typedef struct _SMSGSubmitClass SMSGSubmitClass;
30 typedef struct _SMSGSubmitPrivate SMSGSubmitPrivate;
31
32 struct _SMSGSubmitClass {
33 GObjectClass parent_class;
34 };
35
36 struct _SMSGSubmit {
37 GObject parent;
38 SMSGSubmitPrivate *priv;
39 };
40
41 GType sms_g_submit_get_type(void);
42
43 /* TYPE MACROS */
44 #define SMS_G_TYPE_SUBMIT \
45 (sms_g_submit_get_type())
46 #define SMS_G_SUBMIT(obj) \
47 (G_TYPE_CHECK_INSTANCE_CAST((obj), SMS_G_TYPE_SUBMIT, SMSGSubmit))
48 #define SMS_G_SUBMIT_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_CAST((klass), SMS_G_TYPE_SUBMIT, SMSGSubmitClass))
50 #define SMS_G_IS_SUBMIT(obj) \
51 (G_TYPE_CHECK_INSTANCE_TYPE((obj), SMS_G_TYPE_SUBMIT))
52 #define SMS_G_IS_SUBMIT_CLASS(klass) \
53 (G_TYPE_CHECK_CLASS_TYPE((klass), SMS_G_TYPE_SUBMIT))
54 #define SMS_G_SUBMIT_GET_CLASS(obj) \
55 (G_TYPE_INSTANCE_GET_CLASS ((obj), SMS_G_TYPE_SUBMIT, SMSGSubmitClass))
56
57 /* SMSGSubmit interface */
58
59 void sms_g_submit_set_status_report_request(SMSGSubmit *self, gboolean);
60 void sms_g_submit_set_destination(SMSGSubmit *self, gchar const *);
61 void sms_g_submit_set_smsc(SMSGSubmit *self, gchar const *);
62 void sms_g_submit_set_sms_class(SMSGSubmit *self, gint);
63 void sms_g_submit_set_validity_period(SMSGSubmit *self, guint);
64 void sms_g_submit_set_reduced_charset(SMSGSubmit *self, gboolean);
65
66 gboolean sms_g_submit_get_status_report_request(SMSGSubmit *self);
67 gchar const *sms_g_submit_get_destination(SMSGSubmit const *self);
68 gchar const *sms_g_submit_get_smsc(SMSGSubmit const *self);
69 gint sms_g_submit_get_sms_class(SMSGSubmit const *self);
70 guint sms_g_submit_get_validity_period(SMSGSubmit const *self);
71 gboolean sms_g_submit_get_reduced_charset(SMSGSubmit const *self);
72
73 SMSGSubmit *sms_g_submit_new(void);
74
75 SMSGSubmit *sms_g_submit_new_type(char const *content_type);
76
77 GPtrArray const *sms_g_submit_text(SMSGSubmit *self,
78 gchar const *text,
79 GError **gerror);
80
81 GPtrArray const *sms_g_submit_binary(SMSGSubmit *self,
82 GArray const *binary,
83 GError **gerror);
84
85 GPtrArray const *sms_g_submit_bytes(SMSGSubmit *self,
86 gconstpointer data,
87 guint size,
88 GError **gerror);
89
90 GPtrArray const *sms_g_submit_get_data(SMSGSubmit const *self);
91
92 gpointer const *sms_g_submit_get_pdata(SMSGSubmit const *self);
93 guint sms_g_submit_get_len(SMSGSubmit const *self);
94
95 G_END_DECLS
96
97 #endif /* #ifndef __SMS_G_SUBMIT_H__*/
+0
-133
sms-glib/utils.c less more
0 /*
1 * sms-glib/utils.c - SMS-related utilites
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include "sms-glib/errors.h"
24 #include "sms-glib/enums.h"
25 #include "sms-glib/utils.h"
26
27 #include <stdlib.h>
28 #include <string.h>
29 #include <stdio.h>
30
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include <unistd.h>
34
35 static gchar const *
36 _sms_g_is_valid_sms_address(gchar const *address)
37 {
38 size_t len;
39
40 if (address == NULL)
41 return "NULL";
42
43 if (address[0] == '+') {
44 address++;
45 }
46
47 len = strspn(address, "0123456789");
48
49 if (address[len])
50 return "invalid character";
51
52 if (len == 0)
53 return "too short";
54
55 if (len > 20)
56 return "too long";
57
58 return NULL;
59 }
60
61 /** Return TRUE if @a address is a valid SMS address.
62 *
63 * A valid SMS address is a phone number with at most 20 digits either in
64 * national or in international format (starting with +).
65 *
66 * @param address - ISDN address of address
67 *
68 * @retval TRUE - address is a valid Short Message Service Centre address
69 * @retval FALSE - address is NULL, does not contain valid phone number, or it
70 * is too long.
71 */
72 gboolean
73 sms_g_is_valid_sms_address(gchar const *address)
74 {
75 return !_sms_g_is_valid_sms_address(address);
76 }
77
78 /** Validate a SMS address @a address.
79 *
80 * A valid SMS address is a phone number with at most 20 digits either in
81 * national or in international format (starting with +).
82 *
83 * @param address - ISDN address of address
84 * @param error - return value for GError describing the ADDRESS validation error
85 *
86 * @retval TRUE - address is a valid Short Message Service Centre address
87 * @retval FALSE - address is NULL, does not contain valid phone number, or it
88 * is too long.
89 */
90 gboolean
91 sms_g_validate_sms_address(gchar const *address, GError **error)
92 {
93 gchar const *reason = _sms_g_is_valid_sms_address(address);
94
95 if (reason)
96 g_set_error(error, SMS_G_ERRORS, SMS_G_ERROR_INVALID_PARAM,
97 "Invalid SMS address \"%s\": %s", address, reason);
98
99 return !reason;
100 }
101
102 static gchar const *
103 _sms_g_is_valid_message_id(gchar const *message_id)
104 {
105 if (message_id == NULL) return "NULL";
106 if (strlen(message_id) == 0) return "empty";
107 return NULL;
108 }
109
110 gboolean
111 sms_g_is_valid_message_id(gchar const *message_id)
112 {
113 return !_sms_g_is_valid_message_id(message_id);
114 }
115
116 gboolean
117 sms_g_validate_message_id(gchar const *message_id, GError **error)
118 {
119 gchar const *reason = _sms_g_is_valid_message_id(message_id);
120
121 if (reason)
122 g_set_error(error, SMS_G_ERRORS, SMS_G_ERROR_INVALID_PARAM,
123 "Invalid message_id %s: %s", message_id, reason);
124
125 return !reason;
126 }
127
128 gint64
129 sms_g_received_timestamp(void)
130 {
131 return (gint64)time(NULL);
132 }
+0
-41
sms-glib/utils.h less more
0 /*
1 * sms-utils.h - utilities for SMS glibrary
2 *
3 * Copyright (C) 2008-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __SMS_UTILS_H__
22 #define __SMS_UTILS_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 void sms_g_debug_set_flags_from_env(void);
29
30 gboolean sms_g_is_valid_sms_address(gchar const *smsc);
31 gboolean sms_g_validate_sms_address(gchar const *smsc, GError **error);
32
33 gboolean sms_g_is_valid_message_id(gchar const *message_id);
34 gboolean sms_g_validate_message_id(gchar const *message_id, GError **error);
35
36 gint64 sms_g_received_timestamp(void);
37
38 G_END_DECLS
39
40 #endif /* #ifndef __SMS_UTILS_H__*/
3232 test_ring_LDADD = \
3333 libtpring.la $(TP_EXTLIB) \
3434 ../modem/libmodem-glib.la \
35 ../sms-glib/libsms-glib.la \
3635 ../tests/libtestcommon.la \
3736 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
3837 @CHECK_LIBS@ -lpthread
4140 # Rules for building the targets
4241
4342 libtpring_la_SOURCES = \
43 base-call-channel.h base-call-channel.c \
44 ring-call-content.h ring-call-content.c \
45 ring-call-stream.h ring-call-stream.c \
46 ring-call-member.h ring-call-member.c \
4447 ring-connection-manager.h ring-connection-manager.c \
4548 ring-protocol.h ring-protocol.c \
4649 ring-connection.h ring-connection.c \
5053 ring-media-manager.h ring-media-manager.c \
5154 ring-media-channel.h ring-media-channel.c \
5255 ring-call-channel.h ring-call-channel.c \
56 ring-streamed-media-mixin.h ring-streamed-media-mixin.c \
5357 ring-member-channel.h ring-member-channel.c \
58 ring-conference-manager.h ring-conference-manager.c \
5459 ring-conference-channel.h ring-conference-channel.c \
5560 ring-param-spec.h ring-param-spec.c \
5661 ring-emergency-service.h ring-emergency-service.c \
57 ring-util.h ring-util.c
62 ring-util.h ring-util.c \
63 util.h util.c
5864
5965 TP_EXTLIB =
6066 TP_EXTLIB += $(top_builddir)/ring-extensions/libtpextensions.a
6268 telepathy_ring_LDADD = \
6369 libtpring.la $(TP_EXTLIB) \
6470 ../modem/libmodem-glib.la \
65 ../sms-glib/libsms-glib.la \
6671 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
6772 -lpthread
6873
+0
-914
src/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 #
18 # Makefile.am for telepathy-ring/src
19 #
20 # Copyright (C) 2007 Nokia Corporation
21 # Contact: Pekka pessi <first.surname@nokia.com>
22 # See file COPYING.
23 #
24
25 # -----------------------------------------------------------------------------
26 # Automake options
27
28 # -----------------------------------------------------------------------------
29 # Headers and libraries
30
31
32
33 VPATH = @srcdir@
34 pkgdatadir = $(datadir)/@PACKAGE@
35 pkgincludedir = $(includedir)/@PACKAGE@
36 pkglibdir = $(libdir)/@PACKAGE@
37 pkglibexecdir = $(libexecdir)/@PACKAGE@
38 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
39 install_sh_DATA = $(install_sh) -c -m 644
40 install_sh_PROGRAM = $(install_sh) -c
41 install_sh_SCRIPT = $(install_sh) -c
42 INSTALL_HEADER = $(INSTALL_DATA)
43 transform = $(program_transform_name)
44 NORMAL_INSTALL = :
45 PRE_INSTALL = :
46 POST_INSTALL = :
47 NORMAL_UNINSTALL = :
48 PRE_UNINSTALL = :
49 POST_UNINSTALL = :
50 build_triplet = @build@
51 host_triplet = @host@
52 libexec_PROGRAMS = telepathy-ring$(EXEEXT)
53 test_PROGRAMS = test-ring$(EXEEXT)
54 TESTS = $(test_PROGRAMS)
55 subdir = src
56 DIST_COMMON = $(dist_manager_DATA) $(srcdir)/Makefile.am \
57 $(srcdir)/Makefile.in
58 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
59 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
60 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
61 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
62 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
63 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
64 $(ACLOCAL_M4)
65 mkinstalldirs = $(install_sh) -d
66 CONFIG_HEADER = $(top_builddir)/config.h
67 CONFIG_CLEAN_FILES =
68 CONFIG_CLEAN_VPATH_FILES =
69 LTLIBRARIES = $(noinst_LTLIBRARIES)
70 libtpring_la_LIBADD =
71 am_libtpring_la_OBJECTS = ring-connection-manager.lo ring-protocol.lo \
72 ring-connection.lo ring-debug.lo ring-text-manager.lo \
73 ring-text-channel.lo ring-media-manager.lo \
74 ring-media-channel.lo ring-call-channel.lo \
75 ring-member-channel.lo ring-conference-channel.lo \
76 ring-param-spec.lo ring-emergency-service.lo ring-util.lo
77 libtpring_la_OBJECTS = $(am_libtpring_la_OBJECTS)
78 AM_V_lt = $(am__v_lt_$(V))
79 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
80 am__v_lt_0 = --silent
81 am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(testdir)" \
82 "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"
83 PROGRAMS = $(libexec_PROGRAMS) $(test_PROGRAMS)
84 telepathy_ring_SOURCES = telepathy-ring.c
85 telepathy_ring_OBJECTS = telepathy-ring.$(OBJEXT)
86 telepathy_ring_DEPENDENCIES = libtpring.la $(TP_EXTLIB) \
87 ../modem/libmodem-glib.la ../sms-glib/libsms-glib.la
88 am_test_ring_OBJECTS = test-ring.$(OBJEXT) test-ring-util.$(OBJEXT)
89 test_ring_OBJECTS = $(am_test_ring_OBJECTS)
90 test_ring_DEPENDENCIES = libtpring.la $(TP_EXTLIB) \
91 ../modem/libmodem-glib.la ../sms-glib/libsms-glib.la \
92 ../tests/libtestcommon.la
93 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
94 depcomp = $(SHELL) $(top_srcdir)/depcomp
95 am__depfiles_maybe = depfiles
96 am__mv = mv -f
97 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
98 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
99 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
100 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
101 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
102 $(AM_CFLAGS) $(CFLAGS)
103 AM_V_CC = $(am__v_CC_$(V))
104 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
105 am__v_CC_0 = @echo " CC " $@;
106 AM_V_at = $(am__v_at_$(V))
107 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
108 am__v_at_0 = @
109 CCLD = $(CC)
110 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
111 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
112 $(AM_LDFLAGS) $(LDFLAGS) -o $@
113 AM_V_CCLD = $(am__v_CCLD_$(V))
114 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
115 am__v_CCLD_0 = @echo " CCLD " $@;
116 AM_V_GEN = $(am__v_GEN_$(V))
117 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
118 am__v_GEN_0 = @echo " GEN " $@;
119 SOURCES = $(libtpring_la_SOURCES) telepathy-ring.c \
120 $(test_ring_SOURCES)
121 DIST_SOURCES = $(libtpring_la_SOURCES) telepathy-ring.c \
122 $(test_ring_SOURCES)
123 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
124 am__vpath_adj = case $$p in \
125 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
126 *) f=$$p;; \
127 esac;
128 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
129 am__install_max = 40
130 am__nobase_strip_setup = \
131 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
132 am__nobase_strip = \
133 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
134 am__nobase_list = $(am__nobase_strip_setup); \
135 for p in $$list; do echo "$$p $$p"; done | \
136 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
137 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
138 if (++n[$$2] == $(am__install_max)) \
139 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
140 END { for (dir in files) print dir, files[dir] }'
141 am__base_list = \
142 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
143 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
144 DATA = $(dist_manager_DATA) $(service_DATA)
145 ETAGS = etags
146 CTAGS = ctags
147 am__tty_colors = \
148 red=; grn=; lgn=; blu=; std=
149 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
150 ACLOCAL = @ACLOCAL@
151 AMTAR = @AMTAR@
152 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
153 AR = @AR@
154 AUTOCONF = @AUTOCONF@
155 AUTOHEADER = @AUTOHEADER@
156 AUTOMAKE = @AUTOMAKE@
157 AWK = @AWK@
158 CC = @CC@
159 CCDEPMODE = @CCDEPMODE@
160 CFLAGS = @CFLAGS@
161 CHECK_CFLAGS = @CHECK_CFLAGS@
162 CHECK_LIBS = @CHECK_LIBS@
163 CPP = @CPP@
164 CPPFLAGS = @CPPFLAGS@
165 CYGPATH_W = @CYGPATH_W@
166 DATADIR = @DATADIR@
167 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
168 DBUS_CFLAGS = @DBUS_CFLAGS@
169 DBUS_LIBS = @DBUS_LIBS@
170 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
171 DEFS = @DEFS@
172 DEPDIR = @DEPDIR@
173 DSYMUTIL = @DSYMUTIL@
174 DUMPBIN = @DUMPBIN@
175 ECHO_C = @ECHO_C@
176 ECHO_N = @ECHO_N@
177 ECHO_T = @ECHO_T@
178 EGREP = @EGREP@
179 ERROR_CFLAGS = @ERROR_CFLAGS@
180 EXEEXT = @EXEEXT@
181 FGREP = @FGREP@
182 GLIB_CFLAGS = @GLIB_CFLAGS@
183 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
184 GLIB_LIBS = @GLIB_LIBS@
185 GREP = @GREP@
186 INSTALL = @INSTALL@
187 INSTALL_DATA = @INSTALL_DATA@
188 INSTALL_PROGRAM = @INSTALL_PROGRAM@
189 INSTALL_SCRIPT = @INSTALL_SCRIPT@
190 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
191 LD = @LD@
192 LDFLAGS = @LDFLAGS@
193 LIBOBJS = @LIBOBJS@
194 LIBS = @LIBS@
195 LIBTOOL = @LIBTOOL@
196 LIPO = @LIPO@
197 LN_S = @LN_S@
198 LTLIBOBJS = @LTLIBOBJS@
199 MAINT = @MAINT@
200 MAKEINFO = @MAKEINFO@
201 MKDIR_P = @MKDIR_P@
202 NM = @NM@
203 NMEDIT = @NMEDIT@
204 OBJDUMP = @OBJDUMP@
205 OBJEXT = @OBJEXT@
206 OTOOL = @OTOOL@
207 OTOOL64 = @OTOOL64@
208 PACKAGE = @PACKAGE@
209 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
210 PACKAGE_NAME = @PACKAGE_NAME@
211 PACKAGE_STRING = @PACKAGE_STRING@
212 PACKAGE_TARNAME = @PACKAGE_TARNAME@
213 PACKAGE_URL = @PACKAGE_URL@
214 PACKAGE_VERSION = @PACKAGE_VERSION@
215 PATH_SEPARATOR = @PATH_SEPARATOR@
216 PKG_CONFIG = @PKG_CONFIG@
217 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
218 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
219 PYTHON = @PYTHON@
220 RANLIB = @RANLIB@
221 SED = @SED@
222 SET_MAKE = @SET_MAKE@
223 SHELL = @SHELL@
224 STRIP = @STRIP@
225 TP_CFLAGS = @TP_CFLAGS@
226 TP_LIBS = @TP_LIBS@
227 UUID_CFLAGS = @UUID_CFLAGS@
228 UUID_LIBS = @UUID_LIBS@
229 VERSION = @VERSION@
230 XSLTPROC = @XSLTPROC@
231 abs_builddir = @abs_builddir@
232 abs_srcdir = @abs_srcdir@
233 abs_top_builddir = @abs_top_builddir@
234 abs_top_srcdir = @abs_top_srcdir@
235 ac_ct_CC = @ac_ct_CC@
236 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
237 am__include = @am__include@
238 am__leading_dot = @am__leading_dot@
239 am__quote = @am__quote@
240 am__tar = @am__tar@
241 am__untar = @am__untar@
242 bindir = @bindir@
243 build = @build@
244 build_alias = @build_alias@
245 build_cpu = @build_cpu@
246 build_os = @build_os@
247 build_vendor = @build_vendor@
248 builddir = @builddir@
249 datadir = @datadir@
250 datarootdir = @datarootdir@
251 docdir = @docdir@
252 dvidir = @dvidir@
253 exec_prefix = @exec_prefix@
254 host = @host@
255 host_alias = @host_alias@
256 host_cpu = @host_cpu@
257 host_os = @host_os@
258 host_vendor = @host_vendor@
259 htmldir = @htmldir@
260 includedir = @includedir@
261 includemodemdir = @includemodemdir@
262 includesmsdir = @includesmsdir@
263 infodir = @infodir@
264 install_sh = @install_sh@
265 libdir = @libdir@
266 libexecdir = @libexecdir@
267 localedir = @localedir@
268 localstatedir = @localstatedir@
269 lt_ECHO = @lt_ECHO@
270 mandir = @mandir@
271 mkdir_p = @mkdir_p@
272 oldincludedir = @oldincludedir@
273 pdfdir = @pdfdir@
274 prefix = @prefix@
275 program_transform_name = @program_transform_name@
276 psdir = @psdir@
277 sbindir = @sbindir@
278 sharedstatedir = @sharedstatedir@
279 srcdir = @srcdir@
280 sysconfdir = @sysconfdir@
281 target_alias = @target_alias@
282 testdir = @testdir@
283 top_build_prefix = @top_build_prefix@
284 top_builddir = @top_builddir@
285 top_srcdir = @top_srcdir@
286 AM_CFLAGS = $(ERROR_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ @TP_CFLAGS@
287 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests -I${top_builddir}
288 AM_LDFLAGS =
289 noinst_LTLIBRARIES = libtpring.la
290 test_ring_SOURCES = tests/test-ring.h tests/test-ring.c tests/test-ring-util.c
291 test_ring_LDADD = \
292 libtpring.la $(TP_EXTLIB) \
293 ../modem/libmodem-glib.la \
294 ../sms-glib/libsms-glib.la \
295 ../tests/libtestcommon.la \
296 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
297 @CHECK_LIBS@ -lpthread
298
299
300 # -----------------------------------------------------------------------------
301 # Rules for building the targets
302 libtpring_la_SOURCES = \
303 ring-connection-manager.h ring-connection-manager.c \
304 ring-protocol.h ring-protocol.c \
305 ring-connection.h ring-connection.c \
306 ring-debug.h ring-debug.c \
307 ring-text-manager.h ring-text-manager.c \
308 ring-text-channel.h ring-text-channel.c \
309 ring-media-manager.h ring-media-manager.c \
310 ring-media-channel.h ring-media-channel.c \
311 ring-call-channel.h ring-call-channel.c \
312 ring-member-channel.h ring-member-channel.c \
313 ring-conference-channel.h ring-conference-channel.c \
314 ring-param-spec.h ring-param-spec.c \
315 ring-emergency-service.h ring-emergency-service.c \
316 ring-util.h ring-util.c
317
318 TP_EXTLIB = $(top_builddir)/ring-extensions/libtpextensions.a
319 telepathy_ring_LDADD = \
320 libtpring.la $(TP_EXTLIB) \
321 ../modem/libmodem-glib.la \
322 ../sms-glib/libsms-glib.la \
323 @TP_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \
324 -lpthread
325
326
327 # ----------------------------------------------------------------------
328 # Install and distribution rules
329 managerdir = $(datadir)/telepathy/managers
330 dist_manager_DATA = ring.manager
331 service = org.freedesktop.Telepathy.ConnectionManager.ring.service
332
333 # Install services
334 servicedir = $(DBUS_SERVICES_DIR)
335 service_DATA = ${service}
336 EXTRA_DIST = ${service}-in ${handlers}
337 CLEANFILES = ${service}
338 all: all-am
339
340 .SUFFIXES:
341 .SUFFIXES: .c .lo .o .obj .service .service-in
342 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
343 @for dep in $?; do \
344 case '$(am__configure_deps)' in \
345 *$$dep*) \
346 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
347 && { if test -f $@; then exit 0; else break; fi; }; \
348 exit 1;; \
349 esac; \
350 done; \
351 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
352 $(am__cd) $(top_srcdir) && \
353 $(AUTOMAKE) --foreign src/Makefile
354 .PRECIOUS: Makefile
355 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
356 @case '$?' in \
357 *config.status*) \
358 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
359 *) \
360 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
361 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
362 esac;
363
364 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
365 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
366
367 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
368 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
369 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
370 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
371 $(am__aclocal_m4_deps):
372
373 clean-noinstLTLIBRARIES:
374 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
375 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
376 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
377 test "$$dir" != "$$p" || dir=.; \
378 echo "rm -f \"$${dir}/so_locations\""; \
379 rm -f "$${dir}/so_locations"; \
380 done
381 libtpring.la: $(libtpring_la_OBJECTS) $(libtpring_la_DEPENDENCIES)
382 $(AM_V_CCLD)$(LINK) $(libtpring_la_OBJECTS) $(libtpring_la_LIBADD) $(LIBS)
383 install-libexecPROGRAMS: $(libexec_PROGRAMS)
384 @$(NORMAL_INSTALL)
385 test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
386 @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
387 for p in $$list; do echo "$$p $$p"; done | \
388 sed 's/$(EXEEXT)$$//' | \
389 while read p p1; do if test -f $$p || test -f $$p1; \
390 then echo "$$p"; echo "$$p"; else :; fi; \
391 done | \
392 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
393 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
394 sed 'N;N;N;s,\n, ,g' | \
395 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
396 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
397 if ($$2 == $$4) files[d] = files[d] " " $$1; \
398 else { print "f", $$3 "/" $$4, $$1; } } \
399 END { for (d in files) print "f", d, files[d] }' | \
400 while read type dir files; do \
401 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
402 test -z "$$files" || { \
403 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
404 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
405 } \
406 ; done
407
408 uninstall-libexecPROGRAMS:
409 @$(NORMAL_UNINSTALL)
410 @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
411 files=`for p in $$list; do echo "$$p"; done | \
412 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
413 -e 's/$$/$(EXEEXT)/' `; \
414 test -n "$$list" || exit 0; \
415 echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
416 cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
417
418 clean-libexecPROGRAMS:
419 @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
420 echo " rm -f" $$list; \
421 rm -f $$list || exit $$?; \
422 test -n "$(EXEEXT)" || exit 0; \
423 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
424 echo " rm -f" $$list; \
425 rm -f $$list
426 install-testPROGRAMS: $(test_PROGRAMS)
427 @$(NORMAL_INSTALL)
428 test -z "$(testdir)" || $(MKDIR_P) "$(DESTDIR)$(testdir)"
429 @list='$(test_PROGRAMS)'; test -n "$(testdir)" || list=; \
430 for p in $$list; do echo "$$p $$p"; done | \
431 sed 's/$(EXEEXT)$$//' | \
432 while read p p1; do if test -f $$p || test -f $$p1; \
433 then echo "$$p"; echo "$$p"; else :; fi; \
434 done | \
435 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
436 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
437 sed 'N;N;N;s,\n, ,g' | \
438 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
439 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
440 if ($$2 == $$4) files[d] = files[d] " " $$1; \
441 else { print "f", $$3 "/" $$4, $$1; } } \
442 END { for (d in files) print "f", d, files[d] }' | \
443 while read type dir files; do \
444 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
445 test -z "$$files" || { \
446 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testdir)$$dir'"; \
447 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testdir)$$dir" || exit $$?; \
448 } \
449 ; done
450
451 uninstall-testPROGRAMS:
452 @$(NORMAL_UNINSTALL)
453 @list='$(test_PROGRAMS)'; test -n "$(testdir)" || list=; \
454 files=`for p in $$list; do echo "$$p"; done | \
455 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
456 -e 's/$$/$(EXEEXT)/' `; \
457 test -n "$$list" || exit 0; \
458 echo " ( cd '$(DESTDIR)$(testdir)' && rm -f" $$files ")"; \
459 cd "$(DESTDIR)$(testdir)" && rm -f $$files
460
461 clean-testPROGRAMS:
462 @list='$(test_PROGRAMS)'; test -n "$$list" || exit 0; \
463 echo " rm -f" $$list; \
464 rm -f $$list || exit $$?; \
465 test -n "$(EXEEXT)" || exit 0; \
466 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
467 echo " rm -f" $$list; \
468 rm -f $$list
469 telepathy-ring$(EXEEXT): $(telepathy_ring_OBJECTS) $(telepathy_ring_DEPENDENCIES)
470 @rm -f telepathy-ring$(EXEEXT)
471 $(AM_V_CCLD)$(LINK) $(telepathy_ring_OBJECTS) $(telepathy_ring_LDADD) $(LIBS)
472 test-ring$(EXEEXT): $(test_ring_OBJECTS) $(test_ring_DEPENDENCIES)
473 @rm -f test-ring$(EXEEXT)
474 $(AM_V_CCLD)$(LINK) $(test_ring_OBJECTS) $(test_ring_LDADD) $(LIBS)
475
476 mostlyclean-compile:
477 -rm -f *.$(OBJEXT)
478
479 distclean-compile:
480 -rm -f *.tab.c
481
482 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-call-channel.Plo@am__quote@
483 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-conference-channel.Plo@am__quote@
484 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-connection-manager.Plo@am__quote@
485 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-connection.Plo@am__quote@
486 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-debug.Plo@am__quote@
487 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-emergency-service.Plo@am__quote@
488 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-media-channel.Plo@am__quote@
489 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-media-manager.Plo@am__quote@
490 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-member-channel.Plo@am__quote@
491 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-param-spec.Plo@am__quote@
492 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-protocol.Plo@am__quote@
493 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-text-channel.Plo@am__quote@
494 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-text-manager.Plo@am__quote@
495 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ring-util.Plo@am__quote@
496 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/telepathy-ring.Po@am__quote@
497 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ring-util.Po@am__quote@
498 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ring.Po@am__quote@
499
500 .c.o:
501 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
502 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
503 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
504 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
505 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
506 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
507
508 .c.obj:
509 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
510 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
511 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
512 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
513 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
514 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
515
516 .c.lo:
517 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
518 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
519 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
520 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
521 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
522 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
523
524 test-ring.o: tests/test-ring.c
525 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-ring.o -MD -MP -MF $(DEPDIR)/test-ring.Tpo -c -o test-ring.o `test -f 'tests/test-ring.c' || echo '$(srcdir)/'`tests/test-ring.c
526 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-ring.Tpo $(DEPDIR)/test-ring.Po
527 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
528 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/test-ring.c' object='test-ring.o' libtool=no @AMDEPBACKSLASH@
529 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
530 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-ring.o `test -f 'tests/test-ring.c' || echo '$(srcdir)/'`tests/test-ring.c
531
532 test-ring.obj: tests/test-ring.c
533 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-ring.obj -MD -MP -MF $(DEPDIR)/test-ring.Tpo -c -o test-ring.obj `if test -f 'tests/test-ring.c'; then $(CYGPATH_W) 'tests/test-ring.c'; else $(CYGPATH_W) '$(srcdir)/tests/test-ring.c'; fi`
534 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-ring.Tpo $(DEPDIR)/test-ring.Po
535 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
536 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/test-ring.c' object='test-ring.obj' libtool=no @AMDEPBACKSLASH@
537 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
538 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-ring.obj `if test -f 'tests/test-ring.c'; then $(CYGPATH_W) 'tests/test-ring.c'; else $(CYGPATH_W) '$(srcdir)/tests/test-ring.c'; fi`
539
540 test-ring-util.o: tests/test-ring-util.c
541 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-ring-util.o -MD -MP -MF $(DEPDIR)/test-ring-util.Tpo -c -o test-ring-util.o `test -f 'tests/test-ring-util.c' || echo '$(srcdir)/'`tests/test-ring-util.c
542 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-ring-util.Tpo $(DEPDIR)/test-ring-util.Po
543 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
544 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/test-ring-util.c' object='test-ring-util.o' libtool=no @AMDEPBACKSLASH@
545 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
546 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-ring-util.o `test -f 'tests/test-ring-util.c' || echo '$(srcdir)/'`tests/test-ring-util.c
547
548 test-ring-util.obj: tests/test-ring-util.c
549 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-ring-util.obj -MD -MP -MF $(DEPDIR)/test-ring-util.Tpo -c -o test-ring-util.obj `if test -f 'tests/test-ring-util.c'; then $(CYGPATH_W) 'tests/test-ring-util.c'; else $(CYGPATH_W) '$(srcdir)/tests/test-ring-util.c'; fi`
550 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-ring-util.Tpo $(DEPDIR)/test-ring-util.Po
551 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
552 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/test-ring-util.c' object='test-ring-util.obj' libtool=no @AMDEPBACKSLASH@
553 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
554 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-ring-util.obj `if test -f 'tests/test-ring-util.c'; then $(CYGPATH_W) 'tests/test-ring-util.c'; else $(CYGPATH_W) '$(srcdir)/tests/test-ring-util.c'; fi`
555
556 mostlyclean-libtool:
557 -rm -f *.lo
558
559 clean-libtool:
560 -rm -rf .libs _libs
561 install-dist_managerDATA: $(dist_manager_DATA)
562 @$(NORMAL_INSTALL)
563 test -z "$(managerdir)" || $(MKDIR_P) "$(DESTDIR)$(managerdir)"
564 @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \
565 for p in $$list; do \
566 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
567 echo "$$d$$p"; \
568 done | $(am__base_list) | \
569 while read files; do \
570 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \
571 $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \
572 done
573
574 uninstall-dist_managerDATA:
575 @$(NORMAL_UNINSTALL)
576 @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \
577 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
578 test -n "$$files" || exit 0; \
579 echo " ( cd '$(DESTDIR)$(managerdir)' && rm -f" $$files ")"; \
580 cd "$(DESTDIR)$(managerdir)" && rm -f $$files
581 install-serviceDATA: $(service_DATA)
582 @$(NORMAL_INSTALL)
583 test -z "$(servicedir)" || $(MKDIR_P) "$(DESTDIR)$(servicedir)"
584 @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \
585 for p in $$list; do \
586 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
587 echo "$$d$$p"; \
588 done | $(am__base_list) | \
589 while read files; do \
590 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \
591 $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \
592 done
593
594 uninstall-serviceDATA:
595 @$(NORMAL_UNINSTALL)
596 @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \
597 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
598 test -n "$$files" || exit 0; \
599 echo " ( cd '$(DESTDIR)$(servicedir)' && rm -f" $$files ")"; \
600 cd "$(DESTDIR)$(servicedir)" && rm -f $$files
601
602 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
603 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
604 unique=`for i in $$list; do \
605 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
606 done | \
607 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
608 END { if (nonempty) { for (i in files) print i; }; }'`; \
609 mkid -fID $$unique
610 tags: TAGS
611
612 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
613 $(TAGS_FILES) $(LISP)
614 set x; \
615 here=`pwd`; \
616 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
617 unique=`for i in $$list; do \
618 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
619 done | \
620 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
621 END { if (nonempty) { for (i in files) print i; }; }'`; \
622 shift; \
623 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
624 test -n "$$unique" || unique=$$empty_fix; \
625 if test $$# -gt 0; then \
626 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
627 "$$@" $$unique; \
628 else \
629 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
630 $$unique; \
631 fi; \
632 fi
633 ctags: CTAGS
634 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
635 $(TAGS_FILES) $(LISP)
636 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
637 unique=`for i in $$list; do \
638 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
639 done | \
640 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
641 END { if (nonempty) { for (i in files) print i; }; }'`; \
642 test -z "$(CTAGS_ARGS)$$unique" \
643 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
644 $$unique
645
646 GTAGS:
647 here=`$(am__cd) $(top_builddir) && pwd` \
648 && $(am__cd) $(top_srcdir) \
649 && gtags -i $(GTAGS_ARGS) "$$here"
650
651 distclean-tags:
652 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
653
654 check-TESTS: $(TESTS)
655 @failed=0; all=0; xfail=0; xpass=0; skip=0; \
656 srcdir=$(srcdir); export srcdir; \
657 list=' $(TESTS) '; \
658 $(am__tty_colors); \
659 if test -n "$$list"; then \
660 for tst in $$list; do \
661 if test -f ./$$tst; then dir=./; \
662 elif test -f $$tst; then dir=; \
663 else dir="$(srcdir)/"; fi; \
664 if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
665 all=`expr $$all + 1`; \
666 case " $(XFAIL_TESTS) " in \
667 *[\ \ ]$$tst[\ \ ]*) \
668 xpass=`expr $$xpass + 1`; \
669 failed=`expr $$failed + 1`; \
670 col=$$red; res=XPASS; \
671 ;; \
672 *) \
673 col=$$grn; res=PASS; \
674 ;; \
675 esac; \
676 elif test $$? -ne 77; then \
677 all=`expr $$all + 1`; \
678 case " $(XFAIL_TESTS) " in \
679 *[\ \ ]$$tst[\ \ ]*) \
680 xfail=`expr $$xfail + 1`; \
681 col=$$lgn; res=XFAIL; \
682 ;; \
683 *) \
684 failed=`expr $$failed + 1`; \
685 col=$$red; res=FAIL; \
686 ;; \
687 esac; \
688 else \
689 skip=`expr $$skip + 1`; \
690 col=$$blu; res=SKIP; \
691 fi; \
692 echo "$${col}$$res$${std}: $$tst"; \
693 done; \
694 if test "$$all" -eq 1; then \
695 tests="test"; \
696 All=""; \
697 else \
698 tests="tests"; \
699 All="All "; \
700 fi; \
701 if test "$$failed" -eq 0; then \
702 if test "$$xfail" -eq 0; then \
703 banner="$$All$$all $$tests passed"; \
704 else \
705 if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
706 banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
707 fi; \
708 else \
709 if test "$$xpass" -eq 0; then \
710 banner="$$failed of $$all $$tests failed"; \
711 else \
712 if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
713 banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
714 fi; \
715 fi; \
716 dashes="$$banner"; \
717 skipped=""; \
718 if test "$$skip" -ne 0; then \
719 if test "$$skip" -eq 1; then \
720 skipped="($$skip test was not run)"; \
721 else \
722 skipped="($$skip tests were not run)"; \
723 fi; \
724 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
725 dashes="$$skipped"; \
726 fi; \
727 report=""; \
728 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
729 report="Please report to $(PACKAGE_BUGREPORT)"; \
730 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
731 dashes="$$report"; \
732 fi; \
733 dashes=`echo "$$dashes" | sed s/./=/g`; \
734 if test "$$failed" -eq 0; then \
735 echo "$$grn$$dashes"; \
736 else \
737 echo "$$red$$dashes"; \
738 fi; \
739 echo "$$banner"; \
740 test -z "$$skipped" || echo "$$skipped"; \
741 test -z "$$report" || echo "$$report"; \
742 echo "$$dashes$$std"; \
743 test "$$failed" -eq 0; \
744 else :; fi
745
746 distdir: $(DISTFILES)
747 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
748 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
749 list='$(DISTFILES)'; \
750 dist_files=`for file in $$list; do echo $$file; done | \
751 sed -e "s|^$$srcdirstrip/||;t" \
752 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
753 case $$dist_files in \
754 */*) $(MKDIR_P) `echo "$$dist_files" | \
755 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
756 sort -u` ;; \
757 esac; \
758 for file in $$dist_files; do \
759 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
760 if test -d $$d/$$file; then \
761 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
762 if test -d "$(distdir)/$$file"; then \
763 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
764 fi; \
765 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
766 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
767 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
768 fi; \
769 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
770 else \
771 test -f "$(distdir)/$$file" \
772 || cp -p $$d/$$file "$(distdir)/$$file" \
773 || exit 1; \
774 fi; \
775 done
776 check-am: all-am
777 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
778 check: check-am
779 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA)
780 installdirs:
781 for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(testdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \
782 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
783 done
784 install: install-am
785 install-exec: install-exec-am
786 install-data: install-data-am
787 uninstall: uninstall-am
788
789 install-am: all-am
790 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
791
792 installcheck: installcheck-am
793 install-strip:
794 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
795 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
796 `test -z '$(STRIP)' || \
797 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
798 mostlyclean-generic:
799
800 clean-generic:
801 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
802
803 distclean-generic:
804 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
805 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
806
807 maintainer-clean-generic:
808 @echo "This command is intended for maintainers to use"
809 @echo "it deletes files that may require special tools to rebuild."
810 clean: clean-am
811
812 clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
813 clean-noinstLTLIBRARIES clean-testPROGRAMS mostlyclean-am
814
815 distclean: distclean-am
816 -rm -rf ./$(DEPDIR)
817 -rm -f Makefile
818 distclean-am: clean-am distclean-compile distclean-generic \
819 distclean-tags
820
821 dvi: dvi-am
822
823 dvi-am:
824
825 html: html-am
826
827 html-am:
828
829 info: info-am
830
831 info-am:
832
833 install-data-am: install-dist_managerDATA install-serviceDATA \
834 install-testPROGRAMS
835
836 install-dvi: install-dvi-am
837
838 install-dvi-am:
839
840 install-exec-am: install-libexecPROGRAMS
841
842 install-html: install-html-am
843
844 install-html-am:
845
846 install-info: install-info-am
847
848 install-info-am:
849
850 install-man:
851
852 install-pdf: install-pdf-am
853
854 install-pdf-am:
855
856 install-ps: install-ps-am
857
858 install-ps-am:
859
860 installcheck-am:
861
862 maintainer-clean: maintainer-clean-am
863 -rm -rf ./$(DEPDIR)
864 -rm -f Makefile
865 maintainer-clean-am: distclean-am maintainer-clean-generic
866
867 mostlyclean: mostlyclean-am
868
869 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
870 mostlyclean-libtool
871
872 pdf: pdf-am
873
874 pdf-am:
875
876 ps: ps-am
877
878 ps-am:
879
880 uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \
881 uninstall-serviceDATA uninstall-testPROGRAMS
882
883 .MAKE: check-am install-am install-strip
884
885 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
886 clean-generic clean-libexecPROGRAMS clean-libtool \
887 clean-noinstLTLIBRARIES clean-testPROGRAMS ctags distclean \
888 distclean-compile distclean-generic distclean-libtool \
889 distclean-tags distdir dvi dvi-am html html-am info info-am \
890 install install-am install-data install-data-am \
891 install-dist_managerDATA install-dvi install-dvi-am \
892 install-exec install-exec-am install-html install-html-am \
893 install-info install-info-am install-libexecPROGRAMS \
894 install-man install-pdf install-pdf-am install-ps \
895 install-ps-am install-serviceDATA install-strip \
896 install-testPROGRAMS installcheck installcheck-am installdirs \
897 maintainer-clean maintainer-clean-generic mostlyclean \
898 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
899 pdf pdf-am ps ps-am tags uninstall uninstall-am \
900 uninstall-dist_managerDATA uninstall-libexecPROGRAMS \
901 uninstall-serviceDATA uninstall-testPROGRAMS
902
903
904 # configure script would insert ${prefix}/lib/telepathy-ring in service file
905 .service-in.service:
906 @-rm -f $@
907 $(AM_V_GEN)sed -e 's![@]libexecdir[@]!${libexecdir}!' '${srcdir}/$@-in' > $@
908
909 ${service} : Makefile
910
911 # Tell versions [3.59,3.63) of GNU make to not export all variables.
912 # Otherwise a system limit (for SysV at least) may be exceeded.
913 .NOEXPORT:
0 /*
1 * base-call-channel.c - Source for RingBaseCallChannel
2 * Copyright © 2009–2010 Collabora Ltd.
3 * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
4 * @author Tom Swindell <t.swindell@rubyx.co.uk>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include <stdio.h>
24 #include <stdlib.h>
25
26 #include <gio/gio.h>
27
28 #include <telepathy-glib/telepathy-glib.h>
29 #include <telepathy-glib/telepathy-glib-dbus.h>
30
31 #include "util.h"
32 #include "ring-call-content.h"
33 #include "ring-call-member.h"
34
35 #include "base-call-channel.h"
36 #include "ring-connection.h"
37
38 /*
39 #define DEBUG_FLAG RING_DEBUG_MEDIA
40 #include "debug.h"
41 */
42
43 G_DEFINE_TYPE(RingBaseCallChannel, ring_base_call_channel,
44 TP_TYPE_BASE_MEDIA_CALL_CHANNEL);
45
46 static void ring_base_call_channel_hangup (
47 TpBaseCallChannel *base,
48 guint reason,
49 const gchar *detailed_reason,
50 const gchar *message);
51
52 static void ring_base_call_channel_close (TpBaseChannel *base);
53
54 /* properties */
55 enum
56 {
57 PROP_OBJECT_PATH_PREFIX = 1,
58 LAST_PROPERTY
59 };
60
61 /* private structure */
62 struct _RingBaseCallChannelPrivate
63 {
64 gchar *object_path_prefix;
65
66 gboolean dispose_has_run;
67
68 /* handle -> CallMember object hash */
69 GHashTable *members;
70 };
71
72 static void
73 ring_base_call_channel_init (RingBaseCallChannel *self)
74 {
75 RingBaseCallChannelPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
76 RING_TYPE_BASE_CALL_CHANNEL, RingBaseCallChannelPrivate);
77
78 self->priv = priv;
79
80 priv->members = g_hash_table_new_full (g_direct_hash, g_direct_equal,
81 NULL, g_object_unref);
82 }
83
84 static void ring_base_call_channel_dispose (GObject *object);
85 static void ring_base_call_channel_finalize (GObject *object);
86
87 static void
88 ring_base_call_channel_get_property (GObject *object,
89 guint property_id,
90 GValue *value,
91 GParamSpec *pspec)
92 {
93 RingBaseCallChannel *self = RING_BASE_CALL_CHANNEL (object);
94 RingBaseCallChannelPrivate *priv = self->priv;
95
96 switch (property_id)
97 {
98 case PROP_OBJECT_PATH_PREFIX:
99 g_value_set_string (value, priv->object_path_prefix);
100 break;
101 default:
102 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
103 break;
104 }
105 }
106
107 static void
108 ring_base_call_channel_set_property (GObject *object,
109 guint property_id,
110 const GValue *value,
111 GParamSpec *pspec)
112 {
113 RingBaseCallChannel *self = RING_BASE_CALL_CHANNEL (object);
114 RingBaseCallChannelPrivate *priv = self->priv;
115
116 switch (property_id)
117 {
118 case PROP_OBJECT_PATH_PREFIX:
119 priv->object_path_prefix = g_value_dup_string (value);
120 break;
121 default:
122 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
123 break;
124 }
125 }
126
127 static gchar *
128 ring_base_call_channel_get_object_path_suffix (TpBaseChannel *base)
129 {
130 RingBaseCallChannel *self = RING_BASE_CALL_CHANNEL (base);
131 RingBaseCallChannelPrivate *priv = self->priv;
132
133 g_assert (priv->object_path_prefix != NULL);
134
135 return g_strdup_printf ("%s/CallChannel%p", priv->object_path_prefix, self);
136 }
137
138 static void
139 ring_base_call_channel_class_init (
140 RingBaseCallChannelClass *ring_base_call_channel_class)
141 {
142 GObjectClass *object_class = G_OBJECT_CLASS (ring_base_call_channel_class);
143 TpBaseChannelClass *base_channel_class =
144 TP_BASE_CHANNEL_CLASS (ring_base_call_channel_class);
145 TpBaseCallChannelClass *tp_base_call_channel_class =
146 TP_BASE_CALL_CHANNEL_CLASS (ring_base_call_channel_class);
147 GParamSpec *param_spec;
148
149 g_type_class_add_private (ring_base_call_channel_class,
150 sizeof (RingBaseCallChannelPrivate));
151
152 object_class->get_property = ring_base_call_channel_get_property;
153 object_class->set_property = ring_base_call_channel_set_property;
154
155 object_class->dispose = ring_base_call_channel_dispose;
156 object_class->finalize = ring_base_call_channel_finalize;
157
158 base_channel_class->get_object_path_suffix =
159 ring_base_call_channel_get_object_path_suffix;
160 base_channel_class->close = ring_base_call_channel_close;
161
162 tp_base_call_channel_class->hangup = ring_base_call_channel_hangup;
163
164 param_spec = g_param_spec_string ("object-path-prefix", "Object path prefix",
165 "prefix of the object path",
166 NULL,
167 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
168 g_object_class_install_property (object_class, PROP_OBJECT_PATH_PREFIX,
169 param_spec);
170 }
171
172 void
173 ring_base_call_channel_dispose (GObject *object)
174 {
175 RingBaseCallChannel *self = RING_BASE_CALL_CHANNEL (object);
176 RingBaseCallChannelPrivate *priv = self->priv;
177
178 if (priv->dispose_has_run)
179 return;
180
181 self->priv->dispose_has_run = TRUE;
182
183 tp_clear_pointer (&priv->members, g_hash_table_unref);
184
185 if (G_OBJECT_CLASS (ring_base_call_channel_parent_class)->dispose)
186 G_OBJECT_CLASS (ring_base_call_channel_parent_class)->dispose (object);
187 }
188
189 void
190 ring_base_call_channel_finalize (GObject *object)
191 {
192 RingBaseCallChannel *self = RING_BASE_CALL_CHANNEL (object);
193 RingBaseCallChannelPrivate *priv = self->priv;
194
195 g_free (priv->object_path_prefix);
196
197 G_OBJECT_CLASS (ring_base_call_channel_parent_class)->finalize (object);
198 }
199
200 RingCallContent *
201 ring_base_call_channel_add_content (RingBaseCallChannel *self,
202 const gchar *name,
203 TpCallContentDisposition disposition)
204 {
205 TpBaseChannel *base = TP_BASE_CHANNEL (self);
206 gchar *object_path;
207 TpBaseCallContent *content;
208 gchar *escaped;
209
210 /* FIXME could clash when other party in a one-to-one call creates a stream
211 * with the same media type and name */
212 escaped = tp_escape_as_identifier (name);
213 object_path = g_strdup_printf ("%s/Content_%s",
214 tp_base_channel_get_object_path (base),
215 escaped);
216 g_free (escaped);
217
218 content = g_object_new (RING_TYPE_CALL_CONTENT,
219 "connection", tp_base_channel_get_connection (base),
220 "object-path", object_path,
221 "disposition", disposition,
222 //"media-type", wocky_jingle_media_type_to_tp (mtype),
223 "name", name,
224 NULL);
225
226 g_free (object_path);
227
228 tp_base_call_channel_add_content (TP_BASE_CALL_CHANNEL (self),
229 content);
230
231 return RING_CALL_CONTENT (content);
232 }
233
234 static void
235 call_member_flags_changed_cb (RingCallMember *member,
236 TpCallMemberFlags flags,
237 gpointer user_data)
238 {
239 TpBaseCallChannel *base = TP_BASE_CALL_CHANNEL (user_data);
240
241 tp_base_call_channel_update_member_flags (base,
242 ring_call_member_get_handle (member),
243 flags,
244 0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
245 }
246
247 RingCallMember *
248 ring_base_call_channel_get_member_from_handle (
249 RingBaseCallChannel *self,
250 TpHandle handle)
251 {
252 return g_hash_table_lookup (self->priv->members, GUINT_TO_POINTER (handle));
253 }
254
255 RingCallMember *
256 ring_base_call_channel_ensure_member_from_handle (
257 RingBaseCallChannel *self,
258 TpHandle handle)
259 {
260 RingBaseCallChannelPrivate *priv = self->priv;
261 RingCallMember *m;
262
263 m = g_hash_table_lookup (priv->members, GUINT_TO_POINTER (handle));
264 if (m == NULL)
265 {
266 m = RING_CALL_MEMBER (g_object_new (RING_TYPE_CALL_MEMBER,
267 "target", handle,
268 "call", self,
269 NULL));
270 g_hash_table_insert (priv->members, GUINT_TO_POINTER (handle), m);
271
272 tp_base_call_channel_update_member_flags (TP_BASE_CALL_CHANNEL (self),
273 ring_call_member_get_handle (m),
274 ring_call_member_get_flags (m),
275 0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
276
277 ring_signal_connect_weak (m, "flags-changed",
278 G_CALLBACK (call_member_flags_changed_cb), G_OBJECT (self));
279 }
280
281 return m;
282 }
283
284 void
285 ring_base_call_channel_remove_member (RingBaseCallChannel *self,
286 RingCallMember *member)
287 {
288 TpHandle h = ring_call_member_get_handle (member);
289
290 g_assert (g_hash_table_lookup (self->priv->members,
291 GUINT_TO_POINTER (h))== member);
292
293 ring_call_member_shutdown (member);
294 tp_base_call_channel_remove_member (TP_BASE_CALL_CHANNEL (self),
295 ring_call_member_get_handle (member),
296 0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
297 g_hash_table_remove (self->priv->members, GUINT_TO_POINTER (h));
298 }
299
300 static void
301 ring_base_call_channel_shutdown_all_members (RingBaseCallChannel *self)
302 {
303 GHashTableIter iter;
304 gpointer value;
305
306 g_hash_table_iter_init (&iter, self->priv->members);
307 while (g_hash_table_iter_next (&iter, NULL, &value))
308 ring_call_member_shutdown (RING_CALL_MEMBER (value));
309 }
310
311 static void
312 ring_base_call_channel_hangup (TpBaseCallChannel *base,
313 guint reason,
314 const gchar *detailed_reason,
315 const gchar *message)
316 {
317 ring_base_call_channel_shutdown_all_members (
318 RING_BASE_CALL_CHANNEL (base));
319 }
320
321 static void
322 ring_base_call_channel_close (TpBaseChannel *base)
323 {
324 ring_base_call_channel_shutdown_all_members (
325 RING_BASE_CALL_CHANNEL (base));
326
327 TP_BASE_CHANNEL_CLASS (ring_base_call_channel_parent_class)->close (base);
328 }
0 /*
1 * base-call-channel.h - Header for RingBaseCallChannel
2 * Copyright © 2009–2010 Collabora Ltd.
3 * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
4 * @author Tom Swindell <t.swindell@rubyx.co.uk>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __RING_BASE_CALL_CHANNEL_H__
22 #define __RING_BASE_CALL_CHANNEL_H__
23
24 #include <glib-object.h>
25
26 #include <telepathy-glib/telepathy-glib.h>
27 #include <telepathy-glib/telepathy-glib-dbus.h>
28
29 #include "ring-call-content.h"
30 #include "ring-call-member.h"
31
32 G_BEGIN_DECLS
33
34 typedef struct _RingBaseCallChannel RingBaseCallChannel;
35 typedef struct _RingBaseCallChannelPrivate RingBaseCallChannelPrivate;
36 typedef struct _RingBaseCallChannelClass RingBaseCallChannelClass;
37
38 struct _RingBaseCallChannelClass {
39 TpBaseMediaCallChannelClass parent_class;
40 };
41
42 struct _RingBaseCallChannel {
43 TpBaseMediaCallChannel parent;
44
45 RingBaseCallChannelPrivate *priv;
46 };
47
48 GType ring_base_call_channel_get_type (void);
49
50 /* TYPE MACROS */
51 #define RING_TYPE_BASE_CALL_CHANNEL \
52 (ring_base_call_channel_get_type ())
53 #define RING_BASE_CALL_CHANNEL(obj) \
54 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
55 RING_TYPE_BASE_CALL_CHANNEL, RingBaseCallChannel))
56 #define RING_BASE_CALL_CHANNEL_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_CAST((klass), \
58 RING_TYPE_BASE_CALL_CHANNEL, RingBaseCallChannelClass))
59 #define RING_IS_BASE_CALL_CHANNEL(obj) \
60 (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_TYPE_BASE_CALL_CHANNEL))
61 #define RING_IS_BASE_CALL_CHANNEL_CLASS(klass) \
62 (G_TYPE_CHECK_CLASS_TYPE((klass), RING_TYPE_BASE_CALL_CHANNEL))
63 #define RING_BASE_CALL_CHANNEL_GET_CLASS(obj) \
64 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
65 RING_TYPE_BASE_CALL_CHANNEL, RingBaseCallChannelClass))
66
67 RingCallMember *ring_base_call_channel_ensure_member (
68 RingBaseCallChannel *self,
69 const gchar *jid);
70
71 void ring_base_call_channel_remove_member (RingBaseCallChannel *self,
72 RingCallMember *member);
73
74 RingCallMember *ring_base_call_channel_ensure_member_from_handle (
75 RingBaseCallChannel *self,
76 TpHandle handle);
77
78 RingCallMember * ring_base_call_channel_get_member_from_handle (
79 RingBaseCallChannel *self,
80 TpHandle handle);
81
82 RingCallContent * ring_base_call_channel_add_content (
83 RingBaseCallChannel *self,
84 const gchar *name,
85 TpCallContentDisposition disposition);
86
87 void ring_base_call_channel_remove_content (RingBaseCallChannel *self,
88 RingCallContent *content);
89
90 GHashTable *ring_base_call_channel_get_members (RingBaseCallChannel *self);
91
92 G_END_DECLS
93
94 #endif /* #ifndef __RING_BASE_CALL_CHANNEL_H__*/
33 *
44 * Copyright (C) 2007-2009 Nokia Corporation
55 * @author Pekka Pessi <first.surname@nokia.com>
6 * Copyright (C) 2013-14 Jolla Ltd
67 *
78 * This work is free software; you can redistribute it and/or
89 * modify it under the terms of the GNU Lesser General Public
8687 char *initial_emergency_service;
8788
8889 TpHandle peer_handle, initial_remote;
89 TpHandle initiator, target;
9090
9191 char *accepted;
9292
9797 TpHandle actor;
9898 TpChannelGroupChangeReason reason;
9999 guchar causetype, cause;
100 guint retry_source, retry_count;
100101 } release;
101102
102103 struct {
117118 unsigned call_state; /* Channel.Interface.CallState bits */
118119
119120 struct {
120 gulong emergency, multiparty;
121 gulong emergency;
121122 gulong waiting, on_hold, forwarded;
123 gulong notify_multiparty;
122124 } signals;
123125 };
124126
126128 enum
127129 {
128130 PROP_NONE,
129 PROP_CHANNEL_PROPERTIES,
130 PROP_INTERFACES, /* o.f.T.Channel.Interfaces */
131
132 PROP_TARGET, /* o.f.T.Channel.TargetHandle */
133 PROP_TARGET_ID, /* o.f.T.Channel.TargetID */
134 PROP_TARGET_TYPE, /* o.f.T.Channel.HandleType */
135
136 PROP_INITIATOR, /* o.f.T.Channel.InitiatorHandle */
137 PROP_INITIATOR_ID, /* o.f.T.Channel.InitiatorID */
138131
139132 PROP_ANON_MODES,
140133
180173
181174 G_DEFINE_TYPE_WITH_CODE(
182175 RingCallChannel, ring_call_channel, RING_TYPE_MEDIA_CHANNEL,
183 G_IMPLEMENT_INTERFACE(RING_TYPE_MEMBER_CHANNEL, NULL)
184 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
185 tp_dbus_properties_mixin_iface_init)
176 G_IMPLEMENT_INTERFACE(RING_TYPE_MEMBER_CHANNEL, NULL);
186177 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
187 tp_group_mixin_iface_init)
178 tp_group_mixin_iface_init);
188179 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_CALL_STATE,
189 ring_channel_call_state_iface_init)
180 ring_channel_call_state_iface_init);
190181 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_SERVICE_POINT,
191182 NULL);
192183 G_IMPLEMENT_INTERFACE(RING_TYPE_SVC_CHANNEL_INTERFACE_SPLITTABLE,
201192 NULL
202193 };
203194
204 static GHashTable *ring_call_channel_properties(RingCallChannel *self);
195 static void ring_call_channel_fill_immutable_properties(TpBaseChannel *base,
196 GHashTable *props);
205197
206198 static void ring_call_channel_update_state(RingMediaChannel *_self,
207199 guint state, guint causetype, guint cause);
211203 gboolean immediately);
212204 static void ring_call_channel_set_call_instance(RingMediaChannel *_self,
213205 ModemCall *ci);
214 static gboolean ring_call_channel_validate_media_handle(
215 RingMediaChannel *_self,
206 static gboolean ring_call_channel_validate_media_handle (gpointer _self,
216207 guint *handle,
217208 GError **);
218 static gboolean ring_call_channel_create_streams(RingMediaChannel *_self,
209 static gboolean ring_call_channel_create_streams (gpointer _self,
219210 TpHandle handle,
220211 gboolean audio,
221212 gboolean video,
233224 #endif
234225 static void on_modem_call_state_active(RingCallChannel *self);
235226 static void on_modem_call_state_mo_release(RingCallChannel *, guint causetype, guint cause);
236 #ifdef nomore
237227 static void on_modem_call_state_mt_release(RingCallChannel *, guint causetype, guint cause);
238228 static void on_modem_call_state_terminated(RingCallChannel *, guint causetype, guint cause);
239 #endif
229
230 void reply_to_hangup (ModemCall *call_instance, ModemRequest *request, GError *error, gpointer user_data);
231
240232
241233 static void ring_call_channel_released(RingCallChannel *self,
242234 TpHandle actor, TpChannelGroupChangeReason reason, char const *message,
245237 static void on_modem_call_emergency(ModemCall *, char const *, RingCallChannel *);
246238 static void on_modem_call_on_hold(ModemCall *, int onhold, RingCallChannel *);
247239 static void on_modem_call_forwarded(ModemCall *, RingCallChannel *);
240 static void on_modem_call_notify_multiparty(ModemCall *ci, GParamSpec *pspec, gpointer user_data);
248241 static void on_modem_call_waiting(ModemCall *, RingCallChannel *);
249 static void on_modem_call_multiparty(ModemCall *, RingCallChannel *);
250242
251243 /* ====================================================================== */
252244 /* GObject interface */
263255 {
264256 RingCallChannel *self = RING_CALL_CHANNEL(object);
265257 RingCallChannelPrivate *priv = self->priv;
266 TpBaseConnection *connection;
267 TpHandleRepoIface *repo;
258 TpBaseChannel *base = TP_BASE_CHANNEL (self);
259 TpBaseConnection *connection = tp_base_channel_get_connection (base);
268260 TpHandle self_handle;
269261
270262 if (G_OBJECT_CLASS(ring_call_channel_parent_class)->constructed)
271263 G_OBJECT_CLASS(ring_call_channel_parent_class)->constructed(object);
272264
273 connection = TP_BASE_CONNECTION(self->base.connection);
274 repo = tp_base_connection_get_handles(connection, TP_HANDLE_TYPE_CONTACT);
275 if (priv->target)
276 tp_handle_ref(repo, priv->target);
277 tp_handle_ref(repo, priv->initiator);
278
279265 if (priv->peer_handle != 0)
280 g_assert(priv->peer_handle == priv->target);
266 g_assert(priv->peer_handle == tp_base_channel_get_target_handle (base));
281267
282268 self_handle = tp_base_connection_get_self_handle(connection);
283269
295281 TpGroupMixin *mixin = TP_GROUP_MIXIN(_self);
296282 RingCallChannel *self = RING_CALL_CHANNEL(_self);
297283 RingCallChannelPrivate *priv = self->priv;
284 TpBaseChannel *base = TP_BASE_CHANNEL (self);
298285 TpHandle self_handle = mixin->self_handle;
299286 TpIntSet *member_set = tp_intset_new();
300287 TpIntSet *local_pending_set = NULL, *remote_pending_set = NULL;
302289 TpChannelGroupChangeReason reason = 0;
303290 TpChannelGroupFlags add = 0, del = 0;
304291
305 tp_intset_add(member_set, priv->initiator);
306
307 if (priv->initiator == priv->target) {
292 tp_intset_add(member_set, tp_base_channel_get_initiator (base));
293
294 if (!tp_base_channel_is_requested (base)) {
308295 /* Incoming call */
309296 message = "Channel created for incoming call";
310297 reason = TP_CHANNEL_GROUP_CHANGE_REASON_INVITED;
323310 /* Outgoing call, but without handle */
324311 message = "Channel created";
325312 reason = TP_CHANNEL_GROUP_CHANGE_REASON_NONE;
326 if (priv->target == 0)
313 if (tp_base_channel_get_target_handle (base) == 0)
327314 add |= TP_CHANNEL_GROUP_FLAG_CAN_ADD;
328315 }
329316
336323 tp_group_mixin_change_members(G_OBJECT(self), message,
337324 member_set, NULL,
338325 local_pending_set, remote_pending_set,
339 priv->initiator, reason);
326 tp_base_channel_get_initiator (base), reason);
340327
341328 tp_intset_destroy(member_set);
342329 if (local_pending_set) tp_intset_destroy(local_pending_set);
351338 {
352339 RingCallChannel *self = RING_CALL_CHANNEL(obj);
353340 RingCallChannelPrivate *priv = self->priv;
354 char const *id;
355341
356342 switch (property_id) {
357 case PROP_CHANNEL_PROPERTIES:
358 g_value_take_boxed(value, ring_call_channel_properties(self));
359 break;
360 case PROP_INTERFACES:
361 g_value_set_boxed(value, ring_call_channel_interfaces);
362 break;
363 case PROP_TARGET:
364 g_value_set_uint(value, priv->target);
365 break;
366 case PROP_TARGET_TYPE:
367 g_value_set_uint(value, priv->target
368 ? TP_HANDLE_TYPE_CONTACT
369 : TP_HANDLE_TYPE_NONE);
370 break;
371 case PROP_TARGET_ID:
372 id = ring_connection_inspect_contact(self->base.connection, priv->target);
373 g_value_set_string(value, id);
374 break;
375 case PROP_INITIATOR:
376 g_value_set_uint (value, priv->initiator);
377 break;
378 case PROP_INITIATOR_ID:
379 id = ring_connection_inspect_contact(self->base.connection, priv->initiator);
380 g_value_set_static_string(value, id);
381 break;
382343 case PROP_ANON_MODES:
383344 g_value_set_uint(value, priv->anon_modes);
384345 break;
441402 {
442403 RingCallChannel *self = RING_CALL_CHANNEL(obj);
443404 RingCallChannelPrivate *priv = self->priv;
405 TpBaseChannel *base = TP_BASE_CHANNEL (self);
444406
445407 switch (property_id) {
446408 case PROP_ANON_MODES:
447409 priv->anon_modes = g_value_get_uint(value);
448410 break;
449 case PROP_TARGET_TYPE:
450 /* this property is writable in the interface, but not actually
451 * meaningfully changable on this channel, so we do nothing */
452 break;
453 case PROP_TARGET:
454 priv->target = g_value_get_uint(value);
455 break;
456 case PROP_INITIATOR:
457 priv->initiator = g_value_get_uint(value);
458 break;
459411 case PROP_ORIGINATING:
460412 priv->originating = g_value_get_boolean(value);
461413 break;
462414 case PROP_TERMINATING:
463415 priv->terminating = g_value_get_boolean(value);
464416 break;
465 case PROP_MEMBER:
466 priv->member.handle = g_value_get_uint(value);
467 break;
468417 case PROP_INITIAL_EMERGENCY_SERVICE:
469418 priv->initial_emergency_service = g_value_dup_string(value);
470419 break;
471420 case PROP_PEER:
472421 if (priv->peer_handle == 0) {
473 if (priv->target == 0 || priv->target == g_value_get_uint(value))
422 if (tp_base_channel_get_target_handle (base) == 0 ||
423 tp_base_channel_get_target_handle (base) == g_value_get_uint(value))
474424 priv->peer_handle = g_value_get_uint(value);
475425 }
476426 break;
488438 {
489439 RingCallChannel *self = RING_CALL_CHANNEL(object);
490440 RingCallChannelPrivate *priv = self->priv;
441 TpBaseChannel *base = TP_BASE_CHANNEL (object);
442
443 if (self->priv->disposed)
444 return;
445 self->priv->disposed = TRUE;
491446
492447 if (priv->member.handle) {
493448 TpHandleRepoIface *repo = tp_base_connection_get_handles(
494 (TpBaseConnection *)(self->base.connection), TP_HANDLE_TYPE_CONTACT);
449 tp_base_channel_get_connection (base), TP_HANDLE_TYPE_CONTACT);
495450 tp_handle_unref(repo, priv->member.handle);
496451 priv->member.handle = 0;
452 }
453 if (priv->release.retry_source) {
454 g_source_remove(priv->release.retry_source);
455 priv->release.retry_source = 0;
497456 }
498457
499458 ((GObjectClass *)ring_call_channel_parent_class)->dispose(object);
526485 ring_call_channel_class_init(RingCallChannelClass *klass)
527486 {
528487 GObjectClass *object_class = G_OBJECT_CLASS(klass);
488 TpBaseChannelClass *base_chan_class = TP_BASE_CHANNEL_CLASS (klass);
529489
530490 g_type_class_add_private(klass, sizeof (RingCallChannelPrivate));
531491
535495 object_class->dispose = ring_call_channel_dispose;
536496 object_class->finalize = ring_call_channel_finalize;
537497
538 ring_call_channel_implement_media_channel(RING_MEDIA_CHANNEL_CLASS(klass));
498 base_chan_class->interfaces = ring_call_channel_interfaces;
499 base_chan_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
500 base_chan_class->fill_immutable_properties = ring_call_channel_fill_immutable_properties;
501
502 ring_call_channel_implement_media_channel (RING_MEDIA_CHANNEL_CLASS(klass));
539503
540504 klass->dbus_properties_class.interfaces =
541505 ring_call_channel_dbus_property_interfaces;
550514 NULL);
551515 tp_group_mixin_class_set_remove_with_reason_func(
552516 object_class, ring_call_channel_remove_member_with_reason);
553
554 g_object_class_override_property(
555 object_class, PROP_CHANNEL_PROPERTIES, "channel-properties");
556
557 g_object_class_override_property(
558 object_class, PROP_INTERFACES, "interfaces");
559
560 g_object_class_override_property(
561 object_class, PROP_TARGET_TYPE, "handle-type");
562
563 g_object_class_override_property(
564 object_class, PROP_TARGET, "handle");
565
566 g_object_class_override_property(
567 object_class, PROP_TARGET_ID, "handle-id");
568
569 g_object_class_override_property(
570 object_class, PROP_INITIATOR, "initiator");
571
572 g_object_class_override_property(
573 object_class, PROP_INITIATOR_ID, "initiator-id");
574517
575518 g_object_class_install_property(
576519 object_class, PROP_ANON_MODES, ring_param_spec_anon_modes());
671614 { NULL }
672615 };
673616
674 /** Return a hash describing channel properties
675 *
676 * A channel's properties are constant for its lifetime on the bus, so
677 * this property should only change when the closed signal is emitted (so
678 * that respawned channels can reappear on the bus with different
679 * properties).
680 */
681 static GHashTable *
682 ring_call_channel_properties(RingCallChannel *self)
683 {
684 GHashTable *properties;
685
686 properties = ring_media_channel_properties(RING_MEDIA_CHANNEL(self));
687
688 ring_channel_add_properties(self, properties,
617 static void
618 ring_call_channel_fill_immutable_properties(TpBaseChannel *base,
619 GHashTable *props)
620 {
621 RingCallChannel *self = RING_CALL_CHANNEL (base);
622 GObject *obj = (GObject *) self;
623
624 TP_BASE_CHANNEL_CLASS (ring_call_channel_parent_class)->fill_immutable_properties (
625 base, props);
626
627 tp_dbus_properties_mixin_fill_properties_hash (obj, props,
689628 TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT, "CurrentServicePoint",
690629 NULL);
691630
692631 if (!RING_STR_EMPTY(self->priv->initial_emergency_service))
693 ring_channel_add_properties(self, properties,
632 tp_dbus_properties_mixin_fill_properties_hash (obj, props,
694633 TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT, "InitialServicePoint",
695634 NULL);
696
697 return properties;
698635 }
699636
700637 /* ====================================================================== */
720657 "Member channel closed",
721658 actor, reason);
722659
660 /* above emit calls ring_member_channel_left() */
723661 g_assert(priv->member.conference == NULL);
724 priv->member.conference = NULL;
725662 }
726663
727664 if (self->base.call_instance) {
744681 return TRUE;
745682 }
746683
684 static gboolean
685 ring_call_channel_alert_tone_needed(RingCallChannel *self)
686 {
687 ModemCallService *call_service = ring_media_channel_get_call_service (self);
688 GValue alert = G_VALUE_INIT;
689 g_value_init (&alert, G_TYPE_BOOLEAN);
690 g_object_get_property(call_service, "alert-tone-needed", &alert);
691 return g_value_get_boolean(&alert);
692 }
693
747694 static void
748695 ring_call_channel_update_state(RingMediaChannel *_self,
749696 guint state, guint causetype, guint cause)
761708 ring_media_channel_stop_playing(RING_MEDIA_CHANNEL(self), TRUE);
762709 break;
763710 case MODEM_CALL_STATE_ALERTING:
764 ring_media_channel_play_tone(RING_MEDIA_CHANNEL(self),
765 TONES_EVENT_RINGING, 0, 0);
711 if (ring_call_channel_alert_tone_needed(self)) {
712 DEBUG ("play local alert tone (no in-band audio)");
713 ring_media_channel_play_tone (RING_MEDIA_CHANNEL(self),
714 TONES_EVENT_RINGING, 0, 0);
715 }
766716 break;
767717 case MODEM_CALL_STATE_DISCONNECTED:
768718 ring_call_channel_play_error_tone(self, state, causetype, cause);
790740 case MODEM_CALL_STATE_ALERTING: on_modem_call_state_mo_alerting(self); break;
791741 case MODEM_CALL_STATE_WAITING: on_modem_call_state_waiting(self); break;
792742 case MODEM_CALL_STATE_ACTIVE: on_modem_call_state_active(self); break;
793 case MODEM_CALL_STATE_DISCONNECTED: on_modem_call_state_mo_release(self, causetype, cause); break;
794 /*case MODEM_CALL_STATE_TERMINATED: on_modem_call_state_terminated(self, causetype, cause); break;*/
743 case MODEM_CALL_STATE_DISCONNECTED:
744 switch (causetype) {
745 case MODEM_CALL_CAUSE_TYPE_LOCAL:
746 on_modem_call_state_mo_release(self, causetype, cause);
747 break;
748 case MODEM_CALL_CAUSE_TYPE_REMOTE:
749 on_modem_call_state_mt_release(self, causetype, cause);
750 break;
751 case MODEM_CALL_CAUSE_TYPE_NETWORK:
752 on_modem_call_state_terminated(self, causetype, cause);
753 break;
754 }
755 break;
795756 default:
796757 break;
797758 }
812773
813774 event_tone = modem_call_event_tone(state, causetype, cause);
814775
815 #if nomore
816 if (state == MODEM_CALL_STATE_MT_RELEASE &&
776 if (state == MODEM_CALL_STATE_DISCONNECTED &&
777 causetype == MODEM_CALL_CAUSE_TYPE_REMOTE &&
817778 event_tone != TONES_STOP && event_tone != TONES_NONE) {
818779 TpGroupMixin *mixin = TP_GROUP_MIXIN(self);
819 if (tp_handle_set_size(mixin->local_pending))
780 if (tp_handle_set_size(mixin->local_pending)) {
820781 /* Case remote end drops call before it is accepted */
821782 event_tone = TONES_NONE;
822 }
823 #endif
783 }
784 }
824785
825786 hold = TP_LOCAL_HOLD_STATE_UNHELD;
826787 g_object_get(self, "hold-state", &hold, NULL);
849810 g_signal_connect(ci, n, G_CALLBACK(on_modem_call_ ## f), self)
850811
851812 priv->signals.waiting = CONNECT("waiting", waiting);
852 priv->signals.multiparty = CONNECT("multiparty", multiparty);
853813 priv->signals.emergency = CONNECT("emergency", emergency);
854814 priv->signals.on_hold = CONNECT("on-hold", on_hold);
855815 priv->signals.forwarded = CONNECT("forwarded", forwarded);
816 priv->signals.notify_multiparty = CONNECT("notify::multiparty", notify_multiparty);
856817 #undef CONNECT
857818 }
858819 else {
865826 } (priv->signals.n = 0)
866827
867828 DISCONNECT(waiting);
868 DISCONNECT(multiparty);
869829 DISCONNECT(emergency);
870830 DISCONNECT(on_hold);
871831 DISCONNECT(forwarded);
832 DISCONNECT(notify_multiparty);
872833 #undef DISCONNECT
873834 }
874835 }
875836
876837 static gboolean
877 ring_call_channel_validate_media_handle(RingMediaChannel *_self,
878 guint *handlep,
879 GError **error)
838 ring_call_channel_validate_media_handle (gpointer _self,
839 guint *handlep,
840 GError **error)
880841 {
881842 DEBUG("enter");
882843
883844 RingCallChannel *self = RING_CALL_CHANNEL(_self);
845 TpBaseChannel *base = TP_BASE_CHANNEL (self);
884846 TpGroupMixin *mixin = TP_GROUP_MIXIN(self);
885847 TpHandleRepoIface *repo;
886848 RingCallChannelPrivate *priv = self->priv;
891853 if (handle == 0)
892854 handle = priv->peer_handle;
893855 if (handle == 0)
894 handle = priv->target;
856 handle = tp_base_channel_get_target_handle (base);
895857
896858 repo = tp_base_connection_get_handles(
897 (TpBaseConnection *)(self->base.connection), TP_HANDLE_TYPE_CONTACT);
859 tp_base_channel_get_connection(base), TP_HANDLE_TYPE_CONTACT);
898860
899861 if (!tp_handle_is_valid(repo, handle, error))
900862 return FALSE;
901863
902864 if (handle == mixin->self_handle) {
903 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
865 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
904866 "cannot establish call streams with yourself");
905867 return FALSE;
906868 }
907869
908870 if (!modem_call_is_valid_address(tp_handle_inspect(repo, handle))) {
909 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
871 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
910872 "Invalid handle %u=\"%s\" for media streams",
911873 handle, tp_handle_inspect(repo, handle));
912874 return FALSE;
914876
915877 if (!tp_handle_set_is_member(self->group.members, handle) &&
916878 !tp_handle_set_is_member(self->group.remote_pending, handle) &&
917 handle != priv->target) {
879 handle != tp_base_channel_get_target_handle (base)) {
918880 g_set_error(error,
919 TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
881 TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
920882 "given handle %u is not a member of the channel",
921883 handle);
922884 return FALSE;
933895 gpointer _channel);
934896
935897 static gboolean
936 ring_call_channel_create_streams(RingMediaChannel *_self,
937 guint handle,
898 ring_call_channel_create_streams (gpointer _self,
899 TpHandle handle,
938900 gboolean audio,
939901 gboolean video,
940902 GError **error)
941903 {
942904 RingCallChannel *self = RING_CALL_CHANNEL(_self);
943905 RingCallChannelPrivate *priv = self->priv;
906 ModemCallService *call_service = ring_media_channel_get_call_service (_self);
944907
945908 (void)audio; (void)video;
946909
948911 g_object_set(self, "peer", handle, NULL);
949912
950913 if (handle != priv->peer_handle) {
951 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Invalid handle");
914 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid handle");
952915 return FALSE;
953916 }
954917
955 if (self->base.call_service == NULL ||
956 !modem_oface_is_connected (MODEM_OFACE (self->base.call_service))) {
957 g_set_error(error, TP_ERRORS, TP_ERROR_DISCONNECTED,
958 "not connected to call service");
959 return FALSE;
960 }
918 if (call_service == NULL)
919 {
920 g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
921 "Modem does not support voice calls");
922 return FALSE;
923 }
961924
962925 if (priv->call_instance_seen) {
963926 DEBUG("Already associated with a call");
1004967 char const *destination;
1005968 ModemClirOverride clir;
1006969 char *number = NULL;
970 ModemCallService *service;
1007971 ModemRequest *request;
1008972
1009 destination = ring_connection_inspect_contact(self->base.connection, handle);
973 destination = ring_connection_inspect_contact (
974 RING_CONNECTION(tp_base_channel_get_connection(TP_BASE_CHANNEL(self))),
975 handle);
1010976
1011977 if (RING_STR_EMPTY(destination)) {
1012 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Invalid handle");
978 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid handle");
1013979 return NULL;
1014980 }
1015981
1027993 if (priv->dial2nd)
1028994 DEBUG("2nd stage dialing: \"%s\"", priv->dial2nd);
1029995
1030 request = modem_call_request_dial(self->base.call_service, number, clir,
996 service = ring_media_channel_get_call_service (RING_MEDIA_CHANNEL (self));
997
998 request = modem_call_request_dial (service, number, clir,
1031999 reply_to_modem_call_request_dial, self);
10321000
10331001 g_free(number);
10491017 {
10501018 RingCallChannel *self = RING_CALL_CHANNEL(_channel);
10511019 RingCallChannelPrivate *priv = self->priv;
1020 TpBaseChannel *base = TP_BASE_CHANNEL (self);
10521021 GError *error0 = NULL;
10531022 TpChannelGroupChangeReason reason;
10541023 char *debug;
10671036 manager = modem_request_get_qdata(request, g_type_qname(RING_TYPE_MEDIA_MANAGER));
10681037
10691038 if (ci)
1070 g_object_set(self, "initial-remote", priv->target, NULL);
1039 g_object_set(self,
1040 "initial-remote", tp_base_channel_get_target_handle (base),
1041 NULL);
10711042
10721043 ring_media_manager_emit_new_channel(manager, channelrequest, self, NULL);
10731044 }
11151086 media_class->close = ring_call_channel_close;
11161087 media_class->update_state = ring_call_channel_update_state;
11171088 media_class->set_call_instance = ring_call_channel_set_call_instance;
1118 media_class->validate_media_handle = ring_call_channel_validate_media_handle;
1119 media_class->create_streams = ring_call_channel_create_streams;
1089
1090 ring_streamed_media_mixin_class_init (G_OBJECT_CLASS(media_class),
1091 G_STRUCT_OFFSET(RingCallChannelClass, base_class.streamed_media_class),
1092 ring_call_channel_validate_media_handle,
1093 ring_call_channel_create_streams);
11201094 }
11211095
11221096 /* ---------------------------------------------------------------------- */
11941168 ring_update_call_state(self, TP_CHANNEL_CALL_STATE_FORWARDED, 0);
11951169 }
11961170
1171 static void
1172 on_modem_call_notify_multiparty(ModemCall *ci, GParamSpec *pspec, gpointer user_data)
1173 {
1174 RingCallChannel *self = RING_CALL_CHANNEL (user_data);
1175 RingCallChannelPrivate *priv = self->priv;
1176 gboolean multiparty_member;
1177
1178 DEBUG ("");
1179
1180 g_object_get(ci, "multiparty", &multiparty_member, NULL);
1181
1182 /*
1183 * This does _not_ cover membership in peer hosted conferences
1184 * (i.e. when there is no local conference channel).
1185 **/
1186
1187 if (priv->member.conference && multiparty_member == FALSE) {
1188 TpHandle actor = 0; /* unknown actor */
1189 TpChannelGroupChangeReason reason = TP_CHANNEL_GROUP_CHANGE_REASON_SEPARATED;
1190
1191 ring_conference_channel_emit_channel_removed(
1192 priv->member.conference, RING_MEMBER_CHANNEL(self),
1193 "Conference call split", actor, reason);
1194
1195 /* above emit calls ring_member_channel_left() */
1196 g_assert(priv->member.conference == NULL);
1197 }
1198 }
1199
11971200 /* MO call is waiting */
11981201 static void
11991202 on_modem_call_waiting(ModemCall *ci,
12001203 RingCallChannel *self)
12011204 {
12021205 ring_update_call_state(self, TP_CHANNEL_CALL_STATE_QUEUED, 0);
1203 }
1204
1205 static void
1206 on_modem_call_multiparty(ModemCall *ci,
1207 RingCallChannel *self)
1208 {
1209 RingCallChannelPrivate *priv = self->priv;
1210
1211 /* If the conference host state is set, we need to first zap it */
1212 if (priv->call_state & TP_CHANNEL_CALL_STATE_CONFERENCE_HOST)
1213 ring_update_call_state(self, 0, TP_CHANNEL_CALL_STATE_CONFERENCE_HOST);
1214
1215 ring_update_call_state(self, TP_CHANNEL_CALL_STATE_CONFERENCE_HOST, 0);
12161206 }
12171207
12181208 /* Invoked when MO call targets an emergency service */
13061296 DEBUG("enter");
13071297
13081298 if (handle != mixin->self_handle && handle != priv->peer_handle) {
1309 g_set_error(error, TP_ERRORS, TP_ERROR_PERMISSION_DENIED,
1299 g_set_error(error, TP_ERROR, TP_ERROR_PERMISSION_DENIED,
13101300 "handle %u cannot be removed", handle);
13111301 return FALSE;
13121302 }
13231313 priv->release.message = g_strdup(message ? message : "Call released");
13241314 priv->release.actor = mixin->self_handle;
13251315 priv->release.reason = reason;
1326 modem_call_request_release(self->base.call_instance, NULL, NULL);
1316 priv->release.retry_count = 0;
1317
1318 modem_call_request_release(self->base.call_instance, reply_to_hangup, self);
13271319 }
13281320 else {
13291321 /* Remove handle from set */
13481340 RingCallChannel *self = RING_CALL_CHANNEL(iface);
13491341 char const *destination;
13501342
1351 destination = ring_connection_inspect_contact(self->base.connection, handle);
1343 destination = ring_connection_inspect_contact(
1344 RING_CONNECTION(tp_base_channel_get_connection(TP_BASE_CHANNEL(self))),
1345 handle);
13521346
13531347 DEBUG("Trying to add %u=\"%s\" to remote pending", handle, destination);
13541348
13551349 g_assert(handle != 0);
13561350
13571351 if (!modem_call_is_valid_address(destination)) {
1358 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1352 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
13591353 "Invalid handle for media channel");
13601354 return FALSE;
13611355 }
13671361 return TRUE;
13681362 }
13691363 else {
1370 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1364 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
13711365 "Only one target allowed for media channel");
13721366 return FALSE;
13731367 }
14111405 }
14121406
14131407 gboolean
1408 retry_modem_call_request_release(gpointer user_data)
1409 {
1410 RingCallChannel *self = RING_CALL_CHANNEL(user_data);
1411 RingCallChannelPrivate *priv = self->priv;
1412
1413 priv->release.retry_source = 0;
1414 modem_call_request_release(self->base.call_instance, reply_to_hangup, self);
1415
1416 return FALSE;
1417 }
1418
1419 void
1420 reply_to_answer (ModemCall *call_instance,
1421 ModemRequest *request,
1422 GError *error,
1423 gpointer user_data)
1424 {
1425 DEBUG ("%s: %s", (char *)user_data, error ? error->message : "ok");
1426
1427 g_free (user_data);
1428 }
1429
1430 void
1431 reply_to_hangup (ModemCall *call_instance,
1432 ModemRequest *request,
1433 GError *error,
1434 gpointer user_data)
1435 {
1436 RingCallChannel *self = RING_CALL_CHANNEL(user_data);
1437 RingCallChannelPrivate *priv = self->priv;
1438 DEBUG ("%s", error ? error->message : "ok");
1439
1440 if (error) {
1441 if (error->code == MODEM_OFONO_ERROR_IN_PROGRESS && priv->release.retry_count <= 5) {
1442 /* retry for up to 32s, increasing delay each time */
1443 int delay = (1 << priv->release.retry_count);
1444 ring_message("Error in hangup %s, retry %d in %ds",
1445 error->message, priv->release.retry_count, delay);
1446 priv->release.retry_source = g_timeout_add_seconds(delay,
1447 retry_modem_call_request_release, self);
1448 ++priv->release.retry_count;
1449 } else {
1450 ring_message("Error in hangup, giving up %s", error->message);
1451 }
1452 }
1453 }
1454
1455 gboolean
14141456 ring_call_channel_accept_pending(GObject *iface,
14151457 TpHandle handle,
14161458 const char *message,
14221464 DEBUG("accepting an incoming call");
14231465
14241466 if (self->base.call_instance == NULL) {
1425 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1467 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
14261468 "Missing call instance");
14271469 return FALSE;
14281470 }
14301472 g_object_get(self->base.call_instance, "state", &state, NULL);
14311473
14321474 if (state == MODEM_CALL_STATE_DISCONNECTED) {
1433 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1475 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
14341476 "Invalid call state");
14351477 return FALSE;
14361478 }
14381480 if (!self->priv->accepted)
14391481 self->priv->accepted = g_strdup(message ? message : "Call accepted");
14401482
1441 modem_call_request_answer(self->base.call_instance, NULL, NULL);
1483 modem_call_request_answer(self->base.call_instance, reply_to_answer,
1484 g_strdup(self->base.nick));
14421485
14431486 return TRUE;
14441487 }
15901633 g_free(debug);
15911634 }
15921635
1593 #ifdef nomore
15941636 static void
15951637 on_modem_call_state_mt_release(RingCallChannel *self,
15961638 guint causetype,
16781720 g_error_free(error);
16791721 g_free(debug);
16801722 }
1681 #endif
16821723
16831724 static void
16841725 ring_call_channel_released(RingCallChannel *self,
17161757 ring_util_group_change_members(self,
17171758 NULL, removed, NULL, NULL,
17181759 actor ? "actor" : "", G_TYPE_UINT, actor,
1719 reason ? "change-reason" : "", G_TYPE_UINT, reason,
1760 "change-reason", G_TYPE_UINT, reason,
17201761 message ? "message" : "", G_TYPE_STRING, message,
17211762 dbus_error ? "error" : "", G_TYPE_STRING, dbus_error,
17221763 "debug-message", G_TYPE_STRING, debug,
17281769 ring_conference_channel_emit_channel_removed(
17291770 self->priv->member.conference, RING_MEMBER_CHANNEL(self),
17301771 message, actor, reason);
1772 /* above emit calls ring_member_channel_left() */
1773 g_assert(self->priv->member.conference == NULL);
17311774 }
17321775
17331776 g_free(dbus_error);
17611804 GError **error)
17621805 {
17631806 if (!iface || !RING_IS_CALL_CHANNEL(iface)) {
1764 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1807 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
17651808 "Member is not valid channel object");
17661809 return FALSE;
17671810 }
17701813 RingCallChannelPrivate const *priv = self->priv;
17711814
17721815 if (!priv->peer_handle) {
1773 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1816 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
17741817 "Member channel has no target");
17751818 return FALSE;
17761819 }
17771820 if (priv->member.conference) {
1778 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1821 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
17791822 "Member channel is already in conference");
17801823 return FALSE;
17811824 }
17821825
17831826 if (!self->base.call_instance) {
1784 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1827 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
17851828 "Member channel has no ongoing call");
17861829 return FALSE;
17871830 }
17881831
17891832 if (!modem_call_can_join(self->base.call_instance)) {
1790 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1833 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
17911834 "Member channel in state %s",
17921835 modem_call_get_state_name(
17931836 modem_call_get_state(self->base.call_instance)));
18061849
18071850 if (handle == 0) {
18081851 TpHandleRepoIface *repo = tp_base_connection_get_handles(
1809 TP_BASE_CONNECTION((self->base.connection)), TP_HANDLE_TYPE_CONTACT);
1852 tp_base_channel_get_connection(TP_BASE_CHANNEL(self)),
1853 TP_HANDLE_TYPE_CONTACT);
18101854 gpointer context = ring_network_normalization_context();
18111855 char *object_path, *unique, *membername;
18121856
18561900 RingCallChannelPrivate *priv = self->priv;
18571901
18581902 if (priv->release.message) {
1859 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "already releasing");
1903 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "already releasing");
18601904 return FALSE;
18611905 }
18621906
18631907 if (self->base.call_instance == NULL) {
1864 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "no call instance");
1908 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "no call instance");
18651909 return FALSE;
18661910 }
18671911
18701914 priv->release.message = g_strdup(message ? message : "Call Released");
18711915 priv->release.actor = TP_GROUP_MIXIN(iface)->self_handle;
18721916 priv->release.reason = reason;
1873
1874 modem_call_request_release(self->base.call_instance, NULL, NULL);
1917 priv->release.retry_count = 0;
1918
1919 modem_call_request_release(self->base.call_instance, reply_to_hangup, self);
18751920
18761921 return TRUE;
18771922 }
18841929 RingCallChannelPrivate *priv = self->priv;
18851930
18861931 if (priv->member.conference) {
1932 DEBUG("switching to a new conference");
18871933 if (priv->member.conference == conference)
18881934 return;
18891935 ring_conference_channel_emit_channel_removed(
18911937 "Joined new conference",
18921938 self->group.self_handle,
18931939 TP_CHANNEL_GROUP_CHANGE_REASON_INVITED);
1940 /* above emit calls ring_member_channel_left() */
1941 g_assert(priv->member.conference == NULL);
18941942 }
18951943
18961944 g_assert(priv->member.conference == NULL);
18991947
19001948 DEBUG("%s joined conference %s",
19011949 RING_MEDIA_CHANNEL(self)->nick,
1902 RING_MEDIA_CHANNEL(conference)->nick);
1950 RING_CONFERENCE_CHANNEL(conference)->nick);
19031951 }
19041952
19051953 void
19301978 DBusGMethodInvocation *context)
19311979 {
19321980 RingCallChannel *self = RING_CALL_CHANNEL(iface);
1933 GError *error = NULL;
1981 GError *error;
19341982
19351983 DEBUG("enter");
19361984
19371985 if (ring_member_channel_is_in_conference(RING_MEMBER_CHANNEL(self))) {
1938 #if 0
19391986 RingConferenceChannel *conference = self->priv->member.conference;
19401987
19411988 if (ring_conference_channel_has_members(conference) <= 1) {
1942 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1943 "Last member cannot leave");
1944
1945 /* ConferenceChannel gets now closed if there is only one member
1946 * channel */
1947 ring_svc_channel_interface_splittable_return_from_split
1948 (context);
1949 ring_conference_channel_emit_channel_removed(
1950 conference, (RingMemberChannel *)self,
1951 tp_base_connection_get_self_handle(
1952 TP_BASE_CONNECTION(self->base.connection)),
1953 TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
1954
1955 /* If conference was on hold, unhold it */
1956 ModemCallConference *cc;
1957
1958 cc = modem_call_service_get_conference(self->base.call_service);
1959
1960 if (modem_call_is_hold(MODEM_CALL(cc))) {
1961 modem_call_request_hold(MODEM_CALL(cc), 0);
1962 }
1989
1990 /*
1991 * This is handles a race condition between two last members
1992 * of a conference. If one is currently leaving, and client
1993 * tries to Split() out the other, this branch is hit. We try
1994 * to follow Split() semantics even in this case.
1995 */
1996 ring_warning("Only one member left in conference unable to split");
1997
1998 /*
1999 * Make sure the remaining call is unheld to follow
2000 * Split() semantics the callerexpects.
2001 **/
2002 modem_call_request_hold(self->base.call_instance,
2003 0, NULL, context);
2004
19632005 return;
19642006 }
1965 #endif
19662007
19672008 ModemRequest *request;
19682009 request = modem_call_request_split(self->base.call_instance,
19752016 return;
19762017 }
19772018
1978 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
2019 g_set_error(&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
19792020 "Not a member channel");
19802021 dbus_g_method_return_error(context, error);
19812022 g_error_free(error);
19982039 DEBUG("split failed: " GERROR_MSG_FMT, GERROR_MSG_CODE(error));
19992040
20002041 GError tperror[1] = {{
2001 TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
2042 TP_ERROR, TP_ERROR_NOT_AVAILABLE,
20022043 "Cannot LeaveConference"
20032044 }};
20042045
22 *
33 * Copyright (C) 2007-2009 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
56 *
67 * This work is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU Lesser General Public
0 /*
1 * ring-call-content.c - a Content object owned by a Call channel
2 * Copyright ©2010 Collabora Ltd.
3 * Copyright ©2010 Nokia Corporation
4 * @author Will Thompson <will.thompson@collabora.co.uk>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include "ring-call-content.h"
23
24 #include <telepathy-glib/telepathy-glib.h>
25
26 #include <ring-extensions/ring-extensions.h>
27
28 #define DEBUG_FLAG RING_DEBUG_MEDIA
29 #include "ring-debug.h"
30
31 struct _RingCallContentPrivate {
32 RingCallStream *stream;
33 };
34
35 static void implement_call_content (gpointer klass,
36 gpointer unused G_GNUC_UNUSED);
37
38 G_DEFINE_TYPE (RingCallContent, ring_call_content,
39 TP_TYPE_BASE_MEDIA_CALL_CONTENT);
40
41 static void
42 ring_call_content_init (RingCallContent *self)
43 {
44 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RING_TYPE_CALL_CONTENT,
45 RingCallContentPrivate);
46 }
47
48 static void
49 ring_call_content_constructed (GObject *object)
50 {
51 RingCallContent *self = RING_CALL_CONTENT (object);
52 RingCallContentPrivate *priv = self->priv;
53 TpBaseCallContent *base = TP_BASE_CALL_CONTENT (self);
54 gchar *stream_path;
55
56 if (G_OBJECT_CLASS (ring_call_content_parent_class)->constructed != NULL)
57 G_OBJECT_CLASS (ring_call_content_parent_class)->constructed (object);
58
59 stream_path = g_strdup_printf ("%s/%s",
60 tp_base_call_content_get_object_path (base), "stream");
61 priv->stream = ring_call_stream_new (
62 RING_CONNECTION(tp_base_call_content_get_connection (base)), stream_path);
63 tp_base_call_content_add_stream (base,
64 TP_BASE_CALL_STREAM (priv->stream));
65 g_free (stream_path);
66 }
67
68 static void
69 ring_call_content_dispose (GObject *object)
70 {
71 RingCallContent *self = RING_CALL_CONTENT (object);
72 RingCallContentPrivate *priv = self->priv;
73
74 tp_clear_object (&priv->stream);
75
76 if (G_OBJECT_CLASS (ring_call_content_parent_class)->dispose != NULL)
77 G_OBJECT_CLASS (ring_call_content_parent_class)->dispose (object);
78 }
79
80 static void
81 ring_call_content_class_init (RingCallContentClass *klass)
82 {
83 GObjectClass *object_class = G_OBJECT_CLASS (klass);
84 TpBaseCallContentClass *base_class = TP_BASE_CALL_CONTENT_CLASS(klass);
85
86 object_class->constructed = ring_call_content_constructed;
87 object_class->dispose = ring_call_content_dispose;
88
89 g_type_class_add_private (klass, sizeof (RingCallContentPrivate));
90 }
91
92 RingCallContent *
93 ring_call_content_new (RingConnection *connection,
94 const gchar *object_path,
95 TpHandle creator)
96 {
97 return g_object_new (RING_TYPE_CALL_CONTENT,
98 "connection", connection,
99 "object-path", object_path,
100 "name", "audio",
101 "media-type", TP_MEDIA_STREAM_TYPE_AUDIO,
102 "creator", creator,
103 "disposition", TP_CALL_CONTENT_DISPOSITION_INITIAL,
104 NULL);
105 }
106
107 RingCallStream *
108 ring_call_content_get_stream (RingCallContent *self)
109 {
110 g_return_val_if_fail (RING_IS_CALL_CONTENT (self), NULL);
111
112 return self->priv->stream;
113 }
114
115 static void
116 ring_call_content_remove (
117 RingCallContent *self,
118 DBusGMethodInvocation *context)
119 {
120 /* We could just leave all this out — the base class leaves Remove()
121 * unimplemented, so TP_ERROR_NOT_IMPLEMENTED would be returned just like
122 * this. But I think having a less generic error message is worth thirty(!)
123 * lines of boilerplate.
124 */
125 GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
126 "Removing contents is not supported for cellular calls." };
127
128 dbus_g_method_return_error (context, &error);
129 }
130
131 static void
132 implement_call_content (gpointer klass,
133 gpointer unused G_GNUC_UNUSED)
134 {
135 #define IMPLEMENT(x) ring_svc_call_content_implement_##x (\
136 klass, ring_call_content_##x)
137 IMPLEMENT (remove);
138 #undef IMPLEMENT
139 }
0 /*
1 * ring-call-content.h - header for a Content object owned by a Call channel
2 * Copyright ©2010 Collabora Ltd.
3 * Copyright ©2010 Nokia Corporation
4 * @author Will Thompson <will.thompson@collabora.co.uk>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef RING_CALL_CONTENT_H
23 #define RING_CALL_CONTENT_H
24
25 #include <glib-object.h>
26
27 #include <telepathy-glib/telepathy-glib.h>
28
29 #include "ring-connection.h"
30 #include "ring-call-stream.h"
31
32 typedef struct _RingCallContent RingCallContent;
33 typedef struct _RingCallContentClass RingCallContentClass;
34 typedef struct _RingCallContentPrivate RingCallContentPrivate;
35
36 struct _RingCallContentClass {
37 TpBaseMediaCallContentClass parent_class;
38 };
39
40 struct _RingCallContent {
41 TpBaseMediaCallContent parent;
42
43 RingCallContentPrivate *priv;
44 };
45
46 GType ring_call_content_get_type (void);
47
48 RingCallContent *ring_call_content_new (RingConnection *connection,
49 const gchar *object_path,
50 TpHandle creator);
51
52 RingCallStream *ring_call_content_get_stream (RingCallContent *self);
53
54 static void ring_call_content_remove(RingCallContent *self, DBusGMethodInvocation *context);
55
56 /* TYPE MACROS */
57 #define RING_TYPE_CALL_CONTENT \
58 (ring_call_content_get_type ())
59 #define RING_CALL_CONTENT(obj) \
60 (G_TYPE_CHECK_INSTANCE_CAST((obj), RING_TYPE_CALL_CONTENT, RingCallContent))
61 #define RING_CALL_CONTENT_CLASS(klass) \
62 (G_TYPE_CHECK_CLASS_CAST((klass), RING_TYPE_CALL_CONTENT,\
63 RingCallContentClass))
64 #define RING_IS_CALL_CONTENT(obj) \
65 (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_TYPE_CALL_CONTENT))
66 #define RING_IS_CALL_CONTENT_CLASS(klass) \
67 (G_TYPE_CHECK_CLASS_TYPE((klass), RING_TYPE_CALL_CONTENT))
68 #define RING_CALL_CONTENT_GET_CLASS(obj) \
69 (G_TYPE_INSTANCE_GET_CLASS ((obj), RING_TYPE_CALL_CONTENT, \
70 RingCallContentClass))
71
72 #endif /* RING_CALL_CONTENT_H */
0 /*
1 * ring-call-member.c - Source for CallMember
2 * Copyright (C) 2010 Collabora Ltd.
3 * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
4 * @author Tom Swindell <t.swindell@rubyx.co.uk>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include <stdio.h>
24 #include <stdlib.h>
25
26 #include "util.h"
27
28 #include "base-call-channel.h"
29
30 #include "ring-connection.h"
31 #include "ring-call-member.h"
32
33 G_DEFINE_TYPE(RingCallMember, ring_call_member, G_TYPE_OBJECT)
34
35 /* signal enum */
36 enum
37 {
38 FLAGS_CHANGED,
39 CONTENT_ADDED,
40 CONTENT_REMOVED,
41 LAST_SIGNAL
42 };
43
44 static guint signals[LAST_SIGNAL] = { 0 };
45
46 /* properties */
47 enum
48 {
49 PROP_CALL = 1,
50 PROP_TARGET
51 };
52
53 /* private structure */
54 struct _RingCallMemberPrivate
55 {
56 TpHandle target;
57
58 RingBaseCallChannel *call;
59 TpCallMemberFlags flags;
60
61 GList *contents;
62 gchar *transport_ns;
63 gboolean accepted;
64
65 gboolean dispose_has_run;
66 };
67
68 #define RING_CALL_MEMBER_GET_PRIVATE(o) \
69 (G_TYPE_INSTANCE_GET_PRIVATE ((o), RING_TYPE_CALL_MEMBER, \
70 RingCallMemberPrivate))
71
72 static void
73 ring_call_member_init (RingCallMember *self)
74 {
75 RingCallMemberPrivate *priv =
76 RING_CALL_MEMBER_GET_PRIVATE (self);
77
78 self->priv = priv;
79 priv->accepted = FALSE;
80 }
81
82 static void
83 ring_call_member_get_property (GObject *object,
84 guint property_id,
85 GValue *value,
86 GParamSpec *pspec)
87 {
88 RingCallMember *self = RING_CALL_MEMBER (object);
89 RingCallMemberPrivate *priv = self->priv;
90
91 switch (property_id)
92 {
93 case PROP_CALL:
94 g_value_set_object (value, ring_call_member_get_connection (self));
95 break;
96 case PROP_TARGET:
97 g_value_set_uint (value, priv->target);
98 break;
99 default:
100 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
101 break;
102 }
103 }
104
105 static void
106 ring_call_member_set_property (GObject *object,
107 guint property_id,
108 const GValue *value,
109 GParamSpec *pspec)
110 {
111 RingCallMember *self = RING_CALL_MEMBER (object);
112 RingCallMemberPrivate *priv = self->priv;
113
114 switch (property_id)
115 {
116 case PROP_CALL:
117 priv->call = g_value_get_object (value);
118 g_assert (priv->call != NULL);
119 break;
120 case PROP_TARGET:
121 priv->target = g_value_get_uint (value);
122 g_assert (priv->target != 0);
123 break;
124 default:
125 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
126 break;
127 }
128 }
129
130 static void ring_call_member_dispose (GObject *object);
131 static void ring_call_member_finalize (GObject *object);
132
133 static void
134 ring_call_member_class_init (
135 RingCallMemberClass *ring_call_member_class)
136 {
137 GObjectClass *object_class = G_OBJECT_CLASS (ring_call_member_class);
138 GParamSpec *param_spec;
139
140 g_type_class_add_private (ring_call_member_class,
141 sizeof (RingCallMemberPrivate));
142
143 object_class->dispose = ring_call_member_dispose;
144 object_class->finalize = ring_call_member_finalize;
145
146 object_class->get_property = ring_call_member_get_property;
147 object_class->set_property = ring_call_member_set_property;
148
149 param_spec = g_param_spec_object ("call", "Call",
150 "The base call object that contains this member",
151 RING_TYPE_BASE_CALL_CHANNEL,
152 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
153 g_object_class_install_property (object_class, PROP_CALL, param_spec);
154
155 param_spec = g_param_spec_uint ("target", "Target",
156 "the target handle of member",
157 0,
158 G_MAXUINT,
159 0,
160 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
161 g_object_class_install_property (object_class, PROP_TARGET, param_spec);
162
163 signals[FLAGS_CHANGED] =
164 g_signal_new ("flags-changed",
165 G_OBJECT_CLASS_TYPE (ring_call_member_class),
166 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
167 0,
168 NULL, NULL,
169 g_cclosure_marshal_VOID__UINT,
170 G_TYPE_NONE, 1, G_TYPE_UINT);
171
172 signals[CONTENT_ADDED] =
173 g_signal_new ("content-added",
174 G_OBJECT_CLASS_TYPE (ring_call_member_class),
175 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
176 0,
177 NULL, NULL,
178 g_cclosure_marshal_VOID__OBJECT,
179 G_TYPE_NONE, 1, G_TYPE_OBJECT);
180
181 signals[CONTENT_REMOVED] =
182 g_signal_new ("content-removed",
183 G_OBJECT_CLASS_TYPE (ring_call_member_class),
184 G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
185 0,
186 NULL, NULL,
187 g_cclosure_marshal_VOID__OBJECT,
188 G_TYPE_NONE, 1, G_TYPE_OBJECT);
189 }
190
191 void
192 ring_call_member_dispose (GObject *object)
193 {
194 RingCallMember *self = RING_CALL_MEMBER (object);
195 RingCallMemberPrivate *priv = self->priv;
196 GList *l;
197
198 if (priv->dispose_has_run)
199 return;
200
201 priv->dispose_has_run = TRUE;
202
203 for (l = priv->contents ; l != NULL; l = g_list_next (l))
204 g_object_unref (l->data);
205
206 tp_clear_pointer (&priv->contents, g_list_free);
207
208 /* release any references held by the object here */
209
210 if (G_OBJECT_CLASS (ring_call_member_parent_class)->dispose)
211 G_OBJECT_CLASS (ring_call_member_parent_class)->dispose (object);
212 }
213
214 void
215 ring_call_member_finalize (GObject *object)
216 {
217 RingCallMember *self = RING_CALL_MEMBER (object);
218 RingCallMemberPrivate *priv = self->priv;
219
220 g_free (priv->transport_ns);
221 priv->transport_ns = NULL;
222
223 G_OBJECT_CLASS (ring_call_member_parent_class)->finalize (object);
224 }
225
226 /*
227 static void
228 remote_state_changed_cb (WockyJingleSession *session, gpointer user_data)
229 {
230 RingCallMember *self = RING_CALL_MEMBER (user_data);
231 RingCallMemberPrivate *priv = self->priv;
232 TpCallMemberFlags newflags = 0;
233
234 if (wocky_jingle_session_get_remote_ringing (session))
235 newflags |= TP_CALL_MEMBER_FLAG_RINGING;
236
237 if (wocky_jingle_session_get_remote_hold (session))
238 newflags |= TP_CALL_MEMBER_FLAG_HELD;
239
240 if (priv->flags == newflags)
241 return;
242
243 priv->flags = newflags;
244
245 DEBUG ("Call members flags changed to: %d", priv->flags);
246
247 g_signal_emit (self, signals[FLAGS_CHANGED], 0, priv->flags);
248 }
249 */
250
251 /*
252 static void
253 member_content_removed_cb (RingCallMemberContent *mcontent,
254 gpointer user_data)
255 {
256 RingCallMember *self = RING_CALL_MEMBER (user_data);
257 RingCallMemberPrivate *priv = self->priv;
258
259 priv->contents = g_list_remove (priv->contents, mcontent);
260 g_signal_emit (self, signals[CONTENT_REMOVED], 0, mcontent);
261 g_object_unref (mcontent);
262 }
263
264 static void
265 ring_call_member_add_member_content (RingCallMember *self,
266 RingCallMemberContent *content)
267 {
268 RingCallMemberPrivate *priv = self->priv;
269
270 priv->contents = g_list_prepend (priv->contents, content);
271
272 ring_signal_connect_weak (content, "removed",
273 G_CALLBACK (member_content_removed_cb), G_OBJECT (self));
274
275 g_signal_emit (self, signals[CONTENT_ADDED], 0, content);
276 }
277 */
278
279 /* This function handles additional contents added by the remote side */
280 /*
281 static void
282 new_content_cb (WockyJingleSession *session,
283 WockyJingleContent *c,
284 gpointer user_data)
285 {
286 RingCallMember *self = RING_CALL_MEMBER (user_data);
287 RingCallMemberContent *content = NULL;
288
289 if (wocky_jingle_content_is_created_by_us (c))
290 return;
291
292 content = ring_call_member_content_from_jingle_content (c, self);
293
294 ring_call_member_add_member_content (self, content);
295 }
296
297 static gboolean
298 call_member_update_existing_content (RingCallMember *self,
299 WockyJingleContent *content)
300 {
301 GList *l;
302
303 for (l = self->priv->contents; l != NULL ; l = g_list_next (l))
304 {
305 RingCallMemberContent *mcontent = RING_CALL_MEMBER_CONTENT (l->data);
306
307 if (ring_call_member_content_has_jingle_content (mcontent))
308 continue;
309
310 if (!tp_strdiff (ring_call_member_content_get_name (mcontent),
311 wocky_jingle_content_get_name (content)))
312 {
313 ring_call_member_content_set_jingle_content (mcontent, content);
314 return TRUE;
315 }
316 }
317
318 return FALSE;
319 }
320
321 void
322 ring_call_member_set_session (RingCallMember *self,
323 WockyJingleSession *session)
324 {
325 RingCallMemberPrivate *priv = self->priv;
326 GList *c, *contents;
327
328 g_assert (priv->session == NULL);
329 g_assert (session != NULL);
330
331 DEBUG ("Setting session: %p -> %p\n", self, session);
332 priv->session = g_object_ref (session);
333
334 contents = wocky_jingle_session_get_contents (session);
335 for (c = contents ; c != NULL; c = g_list_next (c))
336 {
337 WockyJingleContent *content = WOCKY_JINGLE_CONTENT (c->data);
338
339 if (priv->transport_ns == NULL)
340 {
341 g_object_get (content, "transport-ns",
342 &priv->transport_ns,
343 NULL);
344 }
345
346 if (!call_member_update_existing_content (self, content))
347 {
348 RingCallMemberContent *mcontent =
349 ring_call_member_content_from_jingle_content (content,
350 self);
351
352 ring_call_member_add_member_content (self, mcontent);
353 }
354 }
355
356 g_object_notify (G_OBJECT (self), "session");
357
358 ring_signal_connect_weak (priv->session, "remote-state-changed",
359 G_CALLBACK (remote_state_changed_cb), G_OBJECT (self));
360 ring_signal_connect_weak (priv->session, "new-content",
361 G_CALLBACK (new_content_cb), G_OBJECT (self));
362
363 if (priv->accepted)
364 ring_call_member_accept (self);
365
366 g_list_free (contents);
367 }
368
369 WockyJingleSession *
370 ring_call_member_get_session (RingCallMember *self)
371 {
372 return self->priv->session;
373 }
374 */
375
376 TpCallMemberFlags
377 ring_call_member_get_flags (RingCallMember *self)
378 {
379 return self->priv->flags;
380 }
381
382 TpHandle ring_call_member_get_handle (
383 RingCallMember *self)
384 {
385 return self->priv->target;
386 }
387
388 GList *
389 ring_call_member_get_contents (RingCallMember *self)
390 {
391 RingCallMemberPrivate *priv = self->priv;
392
393 return priv->contents;
394 }
395
396 /*
397 RingCallMemberContent *
398 ring_call_member_ensure_content (RingCallMember *self,
399 const gchar *name,
400 WockyJingleMediaType mtype)
401 {
402 RingCallMemberPrivate *priv = self->priv;
403 GList *l;
404 RingCallMemberContent *content = NULL;
405
406 for (l = priv->contents ; l != NULL; l = g_list_next (l))
407 {
408 RingCallMemberContent *c = RING_CALL_MEMBER_CONTENT (l->data);
409
410 if (ring_call_member_content_get_media_type (c) == mtype &&
411 !tp_strdiff (ring_call_member_content_get_name (c), name))
412 {
413 content = c;
414 break;
415 }
416 }
417
418 if (content == NULL)
419 {
420 content = ring_call_member_content_new (name, mtype, self);
421 ring_call_member_add_member_content (self, content);
422 }
423
424 return content;
425 }
426
427 RingCallMemberContent *
428 ring_call_member_create_content (RingCallMember *self,
429 const gchar *name,
430 WockyJingleMediaType mtype,
431 WockyJingleContentSenders senders,
432 GError **error)
433 {
434 RingCallMemberPrivate *priv = self->priv;
435 const gchar *content_ns;
436 WockyJingleContent *c;
437 RingCallMemberContent *content;
438 const gchar *peer_resource;
439
440 g_assert (priv->session != NULL);
441
442 peer_resource = wocky_jingle_session_get_peer_resource (priv->session);
443
444 DEBUG ("Creating new content %s, type %d", name, mtype);
445
446 if (peer_resource != NULL)
447 DEBUG ("existing call, using peer resource %s", peer_resource);
448 else
449 DEBUG ("existing call, using bare JID");
450
451 content_ns = jingle_pick_best_content_type (ring_call_member_get_connection (self),
452 priv->target,
453 peer_resource, mtype);
454
455 if (content_ns == NULL)
456 {
457 g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
458 "Content type %d not available for this resource", mtype);
459 return NULL;
460 }
461
462 DEBUG ("Creating new jingle content with ns %s : %s",
463 content_ns, priv->transport_ns);
464
465 c = wocky_jingle_session_add_content (priv->session,
466 mtype, senders, name, content_ns, priv->transport_ns);
467
468 g_assert (c != NULL);
469
470 content = ring_call_member_content_from_jingle_content (c, self);
471
472 ring_call_member_add_member_content (self, content);
473
474 return content;
475 }
476
477 void
478 ring_call_member_accept (RingCallMember *self)
479 {
480 self->priv->accepted = TRUE;
481
482 if (self->priv->session != NULL)
483 wocky_jingle_session_accept (self->priv->session);
484 }
485 */
486
487 /**
488 * Start a new session using the existing contents for this member. For now
489 * assumes we're using the latest jingle dialect and ice-udp
490 * FIXME: make dialect and transport selection more dynamic?
491 */
492 /*
493 gboolean
494 ring_call_member_open_session (RingCallMember *self,
495 GError **error)
496 {
497 RingCallMemberPrivate *priv = self->priv;
498 RingConnection *conn = ring_call_member_get_connection (self);
499 WockyJingleFactory *jf;
500 WockyJingleSession *session;
501 gchar *jid;
502
503 jid = ring_peer_to_jid (conn, priv->target, NULL);
504
505 jf = ring_jingle_mint_get_factory (conn->jingle_mint);
506 g_return_val_if_fail (jf != NULL, FALSE);
507
508 session = wocky_jingle_factory_create_session (jf, jid, WOCKY_JINGLE_DIALECT_V032,
509 FALSE);
510 DEBUG ("Created a jingle session: %p", session);
511
512 priv->transport_ns = g_strdup (NS_JINGLE_TRANSPORT_ICEUDP);
513
514 ring_call_member_set_session (self, session);
515
516 g_free (jid);
517
518 return TRUE;
519 }
520
521 gboolean
522 ring_call_member_start_session (RingCallMember *self,
523 const gchar *audio_name,
524 const gchar *video_name,
525 GError **error)
526 {
527 RingCallMemberPrivate *priv = self->priv;
528 TpBaseChannel *base_channel = TP_BASE_CHANNEL (priv->call);
529 TpHandle target = tp_base_channel_get_target_handle (base_channel);
530 const gchar *resource;
531 WockyJingleDialect dialect;
532 gchar *jid;
533 const gchar *transport;
534 WockyJingleFactory *jf;
535 WockyJingleSession *session;
536
537 // FIXME might need to wait on capabilities, also don't need transport
538 // and dialect already
539 if (!jingle_pick_best_resource (ring_call_member_get_connection (self),
540 target, audio_name != NULL, video_name != NULL,
541 &transport, &dialect, &resource))
542 {
543 g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE,
544 "member does not have the desired audio/video capabilities");
545 return FALSE;
546 }
547
548 jid = ring_peer_to_jid (ring_call_member_get_connection (self), target, resource);
549
550 jf = ring_jingle_mint_get_factory (
551 ring_call_member_get_connection (self)->jingle_mint);
552 g_return_val_if_fail (jf != NULL, FALSE);
553
554 session = wocky_jingle_factory_create_session (jf, jid, dialect, FALSE);
555 g_free (jid);
556
557 ring_call_member_set_session (self, session);
558
559 priv->transport_ns = g_strdup (transport);
560
561 if (audio_name != NULL)
562 ring_call_member_create_content (self, audio_name,
563 WOCKY_JINGLE_MEDIA_TYPE_AUDIO, WOCKY_JINGLE_CONTENT_SENDERS_BOTH, NULL);
564
565 if (video_name != NULL)
566 ring_call_member_create_content (self, video_name,
567 WOCKY_JINGLE_MEDIA_TYPE_VIDEO, WOCKY_JINGLE_CONTENT_SENDERS_BOTH, NULL);
568
569 return TRUE;
570 }
571 */
572
573 RingConnection *
574 ring_call_member_get_connection (RingCallMember *self)
575 {
576 TpBaseChannel *base_chan = TP_BASE_CHANNEL (self->priv->call);
577
578 return RING_CONNECTION (tp_base_channel_get_connection (base_chan));
579 }
580
581 const gchar *
582 ring_call_member_get_transport_ns (RingCallMember *self)
583 {
584 return self->priv->transport_ns;
585 }
586
587 void
588 ring_call_member_shutdown (RingCallMember *self)
589 {
590 RingCallMemberPrivate *priv = self->priv;
591
592 /* removing the content will remove it from our list */
593 while (priv->contents != NULL)
594 ring_call_member_content_remove (
595 RING_CALL_MEMBER_CONTENT (priv->contents->data));
596 }
0 /*
1 * ring-call-member.h - Header for CallMember
2 * Copyright (C) 2010 Collabora Ltd.
3 * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
4 * @author Tom Swindell <t.swindell@rubyx.co.uk>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __RING_CALL_MEMBER_H__
22 #define __RING_CALL_MEMBER_H__
23
24 #include <glib-object.h>
25
26 #include <telepathy-glib/telepathy-glib.h>
27
28 G_BEGIN_DECLS
29
30 typedef struct _RingCallMember RingCallMember;
31 typedef struct _RingCallMemberPrivate RingCallMemberPrivate;
32 typedef struct _RingCallMemberClass RingCallMemberClass;
33
34 struct _RingCallMemberClass {
35 GObjectClass parent_class;
36 };
37
38 struct _RingCallMember {
39 GObject parent;
40 RingCallMemberPrivate *priv;
41 };
42
43 GType ring_call_member_get_type (void);
44
45 /* TYPE MACROS */
46 #define RING_TYPE_CALL_MEMBER \
47 (ring_call_member_get_type ())
48 #define RING_CALL_MEMBER(obj) \
49 (G_TYPE_CHECK_INSTANCE_CAST((obj), RING_TYPE_CALL_MEMBER, \
50 RingCallMember))
51 #define RING_CALL_MEMBER_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_CAST((klass), RING_TYPE_CALL_MEMBER, \
53 RingCallMemberClass))
54 #define RING_IS_CALL_MEMBER(obj) \
55 (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_TYPE_CALL_MEMBER))
56 #define RING_IS_CALL_MEMBER_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_TYPE((klass), RING_TYPE_CALL_MEMBER))
58 #define RING_CALL_MEMBER_GET_CLASS(obj) \
59 (G_TYPE_INSTANCE_GET_CLASS ((obj), RING_TYPE_CALL_MEMBER, \
60 RingCallMemberClass))
61
62 TpHandle ring_call_member_get_handle(RingCallMember *self);
63
64 TpCallMemberFlags ring_call_member_get_flags(RingCallMember *self);
65
66 RingConnection * ring_call_member_get_connection(RingCallMember *self);
67
68 void ring_call_member_shutdown(RingCallMember *self);
69
70 G_END_DECLS
71
72 #endif /* #ifndef __RING_CALL_MEMBER_H__*/
0 /*
1 * ring-call-stream.c - a Stream object owned by a RingCallContent
2 * Copyright ©2010 Collabora Ltd.
3 * Copyright ©2010 Nokia Corporation
4 * @author Will Thompson <will.thompson@collabora.co.uk>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include "ring-call-stream.h"
23
24 #define DEBUG_FLAG RING_DEBUG_MEDIA
25 #include "ring-debug.h"
26
27 static void implement_call_stream (gpointer klass, gpointer unused);
28
29 G_DEFINE_TYPE(RingCallStream, ring_call_stream,
30 TP_TYPE_BASE_MEDIA_CALL_STREAM);
31
32 static void
33 ring_call_stream_init (RingCallStream *self)
34 {
35 }
36
37 static void
38 ring_call_stream_class_init (RingCallStreamClass *klass)
39 {
40 }
41
42 RingCallStream *
43 ring_call_stream_new (RingConnection *connection,
44 const gchar *object_path)
45 {
46 return g_object_new (RING_TYPE_CALL_STREAM,
47 "connection", connection,
48 "object-path", object_path,
49 NULL);
50 }
51
52 static void
53 ring_call_stream_set_sending (
54 RingCallStream *self,
55 gboolean send,
56 DBusGMethodInvocation *context)
57 {
58 GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
59 "SetSending is not supported for cellular calls." };
60
61 /* Maybe we should put the call on hold/resume? */
62
63 dbus_g_method_return_error (context, &error);
64 }
65
66 static void
67 ring_call_stream_request_receiving (
68 RingCallStream *self,
69 TpHandle contact,
70 gboolean receive,
71 DBusGMethodInvocation *context)
72 {
73 GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
74 "RequestReceiving is not supported for cellular calls." };
75
76 dbus_g_method_return_error (context, &error);
77 }
78
79 static void
80 implement_call_stream (gpointer klass,
81 gpointer unused G_GNUC_UNUSED)
82 {
83 #define IMPLEMENT(x) ring_svc_call_stream_implement_##x (\
84 klass, ring_call_stream_##x)
85 IMPLEMENT (set_sending);
86 IMPLEMENT (request_receiving);
87 #undef IMPLEMENT
88 }
0 /*
1 * ring-call-stream.h - header for a Stream object owned by a RingCallContent
2 * Copyright ©2010 Collabora Ltd.
3 * Copyright ©2010 Nokia Corporation
4 * @author Will Thompson <will.thompson@collabora.co.uk>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef RING_CALL_STREAM_H
23 #define RING_CALL_STREAM_H
24
25 #include <glib-object.h>
26
27 #include <telepathy-glib/telepathy-glib.h>
28
29 #include "ring-connection.h"
30
31 G_BEGIN_DECLS
32
33 typedef struct _RingCallStream RingCallStream;
34 typedef struct _RingCallStreamPrivate RingCallStreamPrivate;
35 typedef struct _RingCallStreamClass RingCallStreamClass;
36
37 struct _RingCallStreamClass {
38 TpBaseMediaCallStreamClass parent_class;
39 };
40
41 struct _RingCallStream {
42 TpBaseMediaCallStream parent;
43
44 RingCallStreamPrivate *priv;
45 };
46
47 GType ring_call_stream_get_type (void);
48
49 RingCallStream *ring_call_stream_new (RingConnection *connection,
50 const gchar *object_path);
51
52 /* TYPE MACROS */
53 #define RING_TYPE_CALL_STREAM \
54 (ring_call_stream_get_type ())
55 #define RING_CALL_STREAM(obj) \
56 (G_TYPE_CHECK_INSTANCE_CAST((obj), RING_TYPE_CALL_STREAM, RingCallStream))
57 #define RING_CALL_STREAM_CLASS(klass) \
58 (G_TYPE_CHECK_CLASS_CAST((klass), RING_TYPE_CALL_STREAM,\
59 RingCallStreamClass))
60 #define RING_IS_CALL_STREAM(obj) \
61 (G_TYPE_CHECK_INSTANCE_TYPE((obj), RING_TYPE_CALL_STREAM))
62 #define RING_IS_CALL_STREAM_CLASS(klass) \
63 (G_TYPE_CHECK_CLASS_TYPE((klass), RING_TYPE_CALL_STREAM))
64 #define RING_CALL_STREAM_GET_CLASS(obj) \
65 (G_TYPE_INSTANCE_GET_CLASS ((obj), RING_TYPE_CALL_STREAM, \
66 RingCallStreamClass))
67
68 void ring_call_stream_update_member_states(RingCallStream *self);
69
70 G_END_DECLS
71
72 #endif /* RING_CALL_STREAM_H */
22 *
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 * @author Kai Vehmanen <first.surname@nokia.com>
56 *
67 * This work is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU Lesser General Public
7273
7374 struct _RingConferenceChannelPrivate
7475 {
75 ModemCallConference *cc;
76 GQueue requests[1]; /* Requests towards the modem */
7677
7778 RingInitialMembers *initial_members;
7879
8586 gulong left, joined;
8687 } signals;
8788
88 unsigned streams_created:1, closing:1, closed:1, disposed:1, :0;
89 struct stream_state {
90 guint id; /* nonzero when active, 0 otherwise */
91 TpHandle handle;
92 TpMediaStreamType type;
93 TpMediaStreamState state;
94 TpMediaStreamDirection direction;
95 TpMediaStreamPendingSend pending;
96 } audio[1];
97
98 struct {
99 gboolean state;
100 gboolean requested;
101 } hold;
102
103 unsigned streams_created:1, conf_created:1, hangup:1, closing:1, disposed:1, :0;
89104 };
90105
91106 /* properties */
92107 enum
93108 {
94109 PROP_NONE,
95 /* telepathy-glib properties */
96 PROP_CHANNEL_PROPERTIES,
97110
98111 /* o.f.T.Channel.Interfaces */
99 PROP_INTERFACES,
100112 PROP_INITIAL_CHANNELS,
101113 PROP_CHANNELS,
102 PROP_SUPPORTS_NON_MERGES,
114
115 /* KVXXX: add PROP_TONES */
116
103117 LAST_PROPERTY
104118 };
105119
106 static void ring_conference_channel_implement_media_channel(
107 RingMediaChannelClass *media_class);
108
109120 static TpDBusPropertiesMixinIfaceImpl
110121 ring_conference_channel_dbus_property_interfaces[];
111122
112 static void ring_channel_mergeable_conference_iface_init(gpointer, gpointer);
113
123 static void ring_conference_channel_dtmf_iface_init (gpointer g_iface, gpointer iface_data);
124 static void ring_conference_channel_hold_iface_init (gpointer g_iface, gpointer iface_data);
125 static void ring_conference_channel_streamed_media_iface_init (gpointer g_iface, gpointer iface_data);
126 static void ring_conference_channel_mergeable_conference_iface_init (gpointer, gpointer);
127
128 static gboolean ring_conference_channel_close (
129 RingConferenceChannel *_self, gboolean immediately);
130 static gboolean ring_conference_channel_close_impl (
131 RingConferenceChannel *self, gboolean immediately, gboolean hangup);
114132 static gboolean ring_conference_channel_add_member(
115133 GObject *obj, TpHandle handle, const char *message, GError **error);
116134 static gboolean ring_conference_channel_remove_member_with_reason(
121139 static GPtrArray *ring_conference_get_channels(
122140 RingConferenceChannel const *self);
123141
124 static GHashTable *ring_conference_channel_properties(RingConferenceChannel *self);
142 static void ring_conference_channel_fill_immutable_properties(TpBaseChannel *base,
143 GHashTable *props);
125144
126145 static void ring_conference_channel_emit_channel_merged(
127146 RingConferenceChannel *channel,
133152 unsigned cause,
134153 GError const *error);
135154
155 static gboolean ring_conference_channel_create_streams(RingConferenceChannel *_self,
156 guint handle,
157 gboolean audio,
158 gboolean video,
159 GError **error);
160
136161 /* ====================================================================== */
137162 /* GObject interface */
138163
139164 G_DEFINE_TYPE_WITH_CODE(
140 RingConferenceChannel, ring_conference_channel, RING_TYPE_MEDIA_CHANNEL,
165 RingConferenceChannel, ring_conference_channel, TP_TYPE_BASE_CHANNEL,
141166 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
142 tp_dbus_properties_mixin_iface_init)
167 tp_dbus_properties_mixin_iface_init);
168 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_DTMF,
169 ring_conference_channel_dtmf_iface_init);
170 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD,
171 ring_conference_channel_hold_iface_init);
172 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_TYPE_STREAMED_MEDIA,
173 ring_conference_channel_streamed_media_iface_init);
143174 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
144 tp_group_mixin_iface_init)
145 G_IMPLEMENT_INTERFACE(RING_TYPE_SVC_CHANNEL_INTERFACE_CONFERENCE,
146 NULL)
175 tp_group_mixin_iface_init);
176 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_CONFERENCE,
177 NULL);
147178 G_IMPLEMENT_INTERFACE(RING_TYPE_SVC_CHANNEL_INTERFACE_MERGEABLE_CONFERENCE,
148 ring_channel_mergeable_conference_iface_init));
179 ring_conference_channel_mergeable_conference_iface_init));
149180
150181 const char *ring_conference_channel_interfaces[] = {
151 RING_MEDIA_CHANNEL_INTERFACES,
182 TP_IFACE_CHANNEL_INTERFACE_DTMF,
183 TP_IFACE_CHANNEL_INTERFACE_HOLD,
152184 TP_IFACE_CHANNEL_INTERFACE_GROUP,
153 RING_IFACE_CHANNEL_INTERFACE_CONFERENCE,
185 TP_IFACE_CHANNEL_INTERFACE_CONFERENCE,
154186 RING_IFACE_CHANNEL_INTERFACE_MERGEABLE_CONFERENCE,
155187 NULL
156188 };
157189
158 static void
159 modem_call_service_join_reply(ModemCallService *service,
190 static ModemRequest *
191 ring_conference_channel_queue_request (RingConferenceChannel *self,
192 ModemRequest *request)
193 {
194 if (request)
195 g_queue_push_tail (self->priv->requests, request);
196 return request;
197 }
198
199 static ModemRequest *
200 ring_conference_channel_dequeue_request (RingConferenceChannel *self,
201 ModemRequest *request)
202 {
203 if (request)
204 g_queue_remove (self->priv->requests, request);
205 return request;
206 }
207
208 static ModemCallService *
209 ring_conference_channel_get_call_service (RingConferenceChannel *self)
210 {
211 TpBaseChannel *base = TP_BASE_CHANNEL (self);
212 TpBaseConnection *base_connection;
213 RingConnection *connection;
214 ModemOface *oface;
215
216 base_connection = tp_base_channel_get_connection (base);
217 connection = RING_CONNECTION (base_connection);
218 oface = ring_connection_get_modem_interface (connection,
219 MODEM_OFACE_CALL_MANAGER);
220
221 if (oface)
222 return MODEM_CALL_SERVICE (oface);
223 else
224 return NULL;
225 }
226
227 static void
228 modem_call_service_join_reply (ModemCallService *service,
160229 ModemRequest *request,
161230 GError *error,
162231 gpointer _self)
167236 DBusGMethodInvocation *context;
168237 GError *clearerror = NULL;
169238
170 ring_media_channel_dequeue_request(RING_MEDIA_CHANNEL(self), request);
239 ring_conference_channel_dequeue_request (self, request);
171240
172241 context = modem_request_steal_data(request, "tp-request");
173242
174243 if (!error) {
244 RingConnection *conn = RING_CONNECTION (
245 tp_base_channel_get_connection (TP_BASE_CHANNEL (self)));
246
175247 member_path = modem_request_get_data(request, "member-object-path");
176 member = ring_connection_lookup_channel(self->base.connection,
177 member_path);
248 member = ring_connection_lookup_channel(conn, member_path);
249
178250 if (ring_conference_channel_join(self, member, &error)) {
179251 ring_svc_channel_interface_mergeable_conference_return_from_merge
180252 (context);
200272
201273 DEBUG("enter");
202274
203 member = ring_connection_lookup_channel(self->base.connection,
204 channel_path);
275 member = ring_connection_lookup_channel(
276 RING_CONNECTION(tp_base_channel_get_connection(TP_BASE_CHANNEL(self))),
277 channel_path);
205278
206279 if (!member || !RING_IS_MEMBER_CHANNEL(member)) {
207280 error = g_error_new(TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
212285 }
213286 else {
214287 ModemRequest *request;
215
216 request = modem_call_request_conference(
217 self->base.call_service, modem_call_service_join_reply, self);
218
219 ring_media_channel_queue_request(RING_MEDIA_CHANNEL(self), request);
288 ModemCallService *service;
289
290 service = ring_conference_channel_get_call_service (self);
291
292 request = modem_call_request_conference (service,
293 modem_call_service_join_reply, self);
294
295 ring_conference_channel_queue_request (self, request);
220296
221297 modem_request_add_data_full(request,
222298 "member-object-path",
233309 g_clear_error(&error);
234310 }
235311
236
237 static void
238 ring_channel_mergeable_conference_iface_init(gpointer g_iface,
312 /*
313 * Telepathy.Channel.Interface.DTMF DBus interface - version 0.19.6
314 */
315
316 static RingMemberChannel *
317 ring_conference_get_first_active_member (RingConferenceChannel *self)
318 {
319 RingConferenceChannelPrivate *priv = self->priv;
320 int i;
321
322 for (i = 0; i < MODEM_MAX_CALLS; i++) {
323 RingMemberChannel *member = priv->members[i];
324 if (member && priv->is_current[i])
325 return member;
326 }
327
328 return 0;
329 }
330
331 /** DBus method StartTone ( u: stream_id, y: event ) -> nothing
332 *
333 * Start sending a DTMF tone on this stream. Where possible, the tone will
334 * continue until StopTone is called. On certain protocols, it may only be
335 * possible to send events with a predetermined length. In this case, the
336 * implementation may emit a fixed-length tone, and the StopTone method call
337 * should return NotAvailable.
338 */
339 static void
340 ring_conference_channel_dtmf_start_tone(TpSvcChannelInterfaceDTMF *iface,
341 guint stream_id,
342 guchar event,
343 DBusGMethodInvocation *context)
344 {
345 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL (iface);
346 RingMemberChannel *member = ring_conference_get_first_active_member (self);
347
348 if (member)
349 {
350 TpSvcChannelInterfaceDTMF *dtmf_if = TP_SVC_CHANNEL_INTERFACE_DTMF (member);
351 g_assert (dtmf_if != NULL);
352 return ring_media_channel_dtmf_start_tone (dtmf_if, stream_id, event, context);
353 }
354 else
355 {
356 GError error[] = {{
357 TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
358 "No member channels to send DTMFs through"
359 }};
360 dbus_g_method_return_error(context, error);
361 }
362 }
363
364 /** DBus method StopTone ( u: stream_id ) -> nothing
365 *
366 * Stop sending any DTMF tone which has been started using the StartTone
367 * method. If there is no current tone, this method will do nothing.
368 */
369 static void
370 ring_conference_channel_dtmf_stop_tone(TpSvcChannelInterfaceDTMF *iface,
371 guint stream_id,
372 DBusGMethodInvocation *context)
373 {
374 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL (iface);
375 RingMemberChannel *member = ring_conference_get_first_active_member (self);
376
377 if (member)
378 {
379 TpSvcChannelInterfaceDTMF *dtmf_if = TP_SVC_CHANNEL_INTERFACE_DTMF (member);
380 g_assert (dtmf_if != NULL);
381 return ring_media_channel_dtmf_stop_tone (dtmf_if, stream_id, context);
382 }
383 else
384 {
385 GError error[] = {{
386 TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
387 "No member channels to send DTMFs through"
388 }};
389 dbus_g_method_return_error(context, error);
390 }
391 }
392
393 static void
394 ring_conference_channel_dtmf_iface_init (gpointer g_iface, gpointer iface_data)
395 {
396 TpSvcChannelInterfaceDTMFClass *klass = (TpSvcChannelInterfaceDTMFClass *)g_iface;
397
398 #define IMPLEMENT(x) tp_svc_channel_interface_dtmf_implement_##x( \
399 klass, ring_conference_channel_dtmf_##x)
400 IMPLEMENT(start_tone);
401 IMPLEMENT(stop_tone);
402 #undef IMPLEMENT
403 }
404
405 /* ---------------------------------------------------------------------- */
406 /* Implement org.freedesktop.Telepathy.Channel.Interface.Hold */
407
408 static
409 void ring_conference_channel_get_hold_state (TpSvcChannelInterfaceHold *iface,
410 DBusGMethodInvocation *context)
411 {
412 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL (iface);
413 RingConferenceChannelPrivate *priv = self->priv;
414 guint i;
415 guint hold_state = NUM_TP_LOCAL_HOLD_STATES; /* known invalid value */
416 guint hold_reason = NUM_TP_LOCAL_HOLD_STATE_REASONS;
417 gboolean state_set = FALSE;
418
419 for (i = 0; i < MODEM_MAX_CALLS; i++)
420 {
421 RingMemberChannel *member = priv->members[i];
422 DEBUG("get_hold_state: %i/%p", i, member);
423 if (member && priv->is_current[i])
424 {
425 guint nextstate;
426 g_object_get (member, "hold-state", &nextstate, NULL);
427 if (state_set == FALSE)
428 {
429 hold_state = nextstate;
430 g_object_get (member, "hold-state-reason", &hold_reason, NULL);
431 state_set = TRUE;
432 }
433 else
434 {
435 /* note: the current modem/ofono APIs do not provide means
436 * to get notifications about conf call state (only
437 * about individual calls that might be members of
438 * a conf-call, so we have to fall back to composing
439 * the state by looking at member channel states
440 */
441 if (hold_state != nextstate)
442 {
443 ring_warning (
444 "member call hold state inconsistant (call %i %d, conf %d)\n",
445 i + 1, nextstate, hold_state);
446 }
447 }
448 }
449 }
450
451 /*
452 * As the member channels won't know about this, we have
453 * to check separately whether it was the conf channel that
454 * requested the hold.
455 */
456 if (hold_state &&
457 priv->hold.requested)
458 {
459 hold_reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
460 }
461
462 tp_svc_channel_interface_hold_return_from_get_hold_state
463 (context, hold_state, hold_reason);
464 }
465
466 static void
467 reply_to_request_swap_calls (ModemCallService *_service,
468 ModemRequest *request,
469 GError *error,
470 gpointer _self)
471 {
472 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
473 RingConferenceChannelPrivate *priv = self->priv;
474 guint hold = (priv->hold.requested == TRUE) ?
475 TP_LOCAL_HOLD_STATE_HELD : TP_LOCAL_HOLD_STATE_UNHELD;
476
477 ring_conference_channel_dequeue_request (self, request);
478
479 DEBUG("");
480
481 priv->hold.state = priv->hold.requested;
482
483 /* XXX: this can potentially confuse the client as the individual
484 * member channel states might not be yet updated...
485 * should we perhaps stay in PENDING state until all
486 * the participant calls have changed state (or failed
487 * to do so)? */
488
489 tp_svc_channel_interface_hold_emit_hold_state_changed(
490 (TpSvcChannelInterfaceHold *)self,
491 hold, TP_LOCAL_HOLD_STATE_REASON_REQUESTED);
492
493 }
494
495 static
496 void ring_conference_channel_request_hold (TpSvcChannelInterfaceHold *iface,
497 gboolean hold,
498 DBusGMethodInvocation *context)
499 {
500 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL (iface);
501 RingConferenceChannelPrivate *priv = self->priv;
502 GError *error = NULL;
503
504 DEBUG ("(%u) on %s", hold, self->nick);
505
506 if (priv->conf_created == FALSE)
507 {
508 g_set_error (&error, TP_ERRORS, TP_ERROR_DISCONNECTED,
509 "No conference call available");
510 }
511 else if (hold == priv->hold.state ||
512 hold == priv->hold.requested)
513 {
514 tp_svc_channel_interface_hold_return_from_request_hold(context);
515 return;
516 }
517 else
518 {
519 ModemCallService *service =
520 ring_conference_channel_get_call_service (self);
521 guint holdstate = (hold == TRUE) ?
522 TP_LOCAL_HOLD_STATE_PENDING_HOLD : TP_LOCAL_HOLD_STATE_PENDING_UNHOLD;
523
524 priv->hold.requested = hold;
525
526 tp_svc_channel_interface_hold_emit_hold_state_changed(
527 (TpSvcChannelInterfaceHold *)self,
528 holdstate, TP_LOCAL_HOLD_STATE_REASON_REQUESTED);
529
530 ring_conference_channel_queue_request (self,
531 modem_call_service_swap_calls(service,
532 reply_to_request_swap_calls, self));
533
534 tp_svc_channel_interface_hold_return_from_request_hold(context);
535 return;
536 }
537
538 DEBUG ("request_hold(%u) on %s: %s", hold, self->nick, error->message);
539 dbus_g_method_return_error (context, error);
540 g_clear_error (&error);
541 }
542
543 static void
544 ring_conference_channel_hold_iface_init (gpointer g_iface, gpointer iface_data)
545 {
546 TpSvcChannelInterfaceHoldClass *klass = g_iface;
547
548 #define IMPLEMENT(x) tp_svc_channel_interface_hold_implement_##x( \
549 klass, ring_conference_channel_##x)
550 IMPLEMENT(get_hold_state);
551 IMPLEMENT(request_hold);
552 #undef IMPLEMENT
553 }
554
555 /* ====================================================================== */
556
557 /**
558 * Telepathy.Channel.Type.StreamedMedia DBus interface
559 */
560
561 /*
562 * KVXXX: move most of below to a common util file
563 * (can be shared with ring-media-channel)
564 */
565
566 #define TP_CHANNEL_STREAM_TYPE \
567 (dbus_g_type_get_struct("GValueArray", \
568 G_TYPE_UINT, \
569 G_TYPE_UINT, \
570 G_TYPE_UINT, \
571 G_TYPE_UINT, \
572 G_TYPE_UINT, \
573 G_TYPE_UINT, \
574 G_TYPE_INVALID))
575
576 enum {
577 RING_MEDIA_STREAM_ID_AUDIO = 1,
578 };
579
580 /** Update media stream state.
581 *
582 * @retval 0 if nothing changed
583 * @retval 1 (or nonzero) if state changed
584 */
585 static int
586 update_media_stream(RingConferenceChannel *self,
587 TpHandle handle,
588 struct stream_state *ss,
589 guint id,
590 TpMediaStreamType type,
591 TpMediaStreamState state,
592 TpMediaStreamDirection direction,
593 TpMediaStreamPendingSend pending)
594 {
595 int changed = 0;
596
597 if (type != TP_MEDIA_STREAM_TYPE_AUDIO)
598 return 0;
599
600 if (state == TP_MEDIA_STREAM_STATE_DISCONNECTED) {
601 if (ss->id == id) {
602 changed = 1;
603 /* emit StreamRemoved */
604 tp_svc_channel_type_streamed_media_emit_stream_removed(
605 (TpSvcChannelTypeStreamedMedia *)self, id);
606 memset(ss, 0, sizeof ss);
607 }
608 return changed;
609 }
610
611 /* emit StreamAdded */
612 if (ss->id != id) {
613 if (handle == 0)
614 g_object_get(self, "peer", &handle, NULL);
615 changed = 1;
616 ss->id = id;
617 ss->handle = handle;
618 ss->type = type;
619
620 if (DEBUGGING) {
621 DEBUG("emitting StreamAdded(%u, %d, %s)",
622 id, handle,
623 type == TP_MEDIA_STREAM_TYPE_AUDIO ?
624 "AUDIO" :
625 type == TP_MEDIA_STREAM_TYPE_VIDEO ?
626 "VIDEO" : "???");
627 }
628
629 tp_svc_channel_type_streamed_media_emit_stream_added(
630 (TpSvcChannelTypeStreamedMedia *)self,
631 ss->id, ss->handle, ss->type);
632 }
633
634 /* emit StreamStateChanged */
635 if (ss->state != state) {
636 changed = 1;
637 ss->state = state;
638
639 if (DEBUGGING) {
640 DEBUG("emitting StreamStateChanged(%u, %s)",
641 ss->id,
642 state == TP_MEDIA_STREAM_STATE_DISCONNECTED ?
643 "DISCONNECTED" :
644 state == TP_MEDIA_STREAM_STATE_CONNECTING ?
645 "CONNECTING" :
646 state == TP_MEDIA_STREAM_STATE_CONNECTED ?
647 "CONNECTED" : "???");
648 }
649
650 tp_svc_channel_type_streamed_media_emit_stream_state_changed (
651 (TpSvcChannelTypeStreamedMedia *)self,
652 ss->id, state);
653 }
654
655 /* emit StreamDirectionChanged */
656 if (ss->direction != direction || ss->pending != pending) {
657 changed = 1;
658 ss->direction = direction;
659 ss->pending = pending;
660
661 if (DEBUGGING) {
662 DEBUG("emitting StreamDirectionChanged(%u, %s,%s%s%s)",
663 ss->id,
664 direction == TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL
665 ? "BIDIRECTIONAL" :
666 direction == TP_MEDIA_STREAM_DIRECTION_SEND
667 ? "SEND" :
668 direction == TP_MEDIA_STREAM_DIRECTION_RECEIVE
669 ? "RECV" :
670 "NONE",
671 pending & TP_MEDIA_STREAM_PENDING_REMOTE_SEND ?
672 " remote" : "",
673 pending & TP_MEDIA_STREAM_PENDING_LOCAL_SEND ?
674 " local" : "",
675 pending == 0 ? " 0" : "");
676 }
677
678 tp_svc_channel_type_streamed_media_emit_stream_direction_changed(
679 (TpSvcChannelTypeStreamedMedia *)self,
680 ss->id, ss->direction, ss->pending);
681 }
682
683 return changed;
684 }
685
686 static void
687 free_media_stream_list(GPtrArray *list)
688 {
689 if (list) {
690 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
691 guint i;
692
693 for (i = list->len; i-- > 0;)
694 g_boxed_free(ElementType, g_ptr_array_index(list, i));
695
696 g_ptr_array_free(list, TRUE);
697 }
698 }
699
700 /* Return a pointer to GValue with boxed stream struct */
701 static gpointer
702 describe_stream(struct stream_state *ss)
703 {
704 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
705 GValue element[1] = {{ 0 }};
706
707 g_value_init(element, ElementType);
708 g_value_take_boxed(element, dbus_g_type_specialized_construct(ElementType));
709
710 dbus_g_type_struct_set(element,
711 0, ss->id,
712 1, ss->handle,
713 2, ss->type,
714 3, ss->state,
715 4, ss->direction,
716 5, ss->pending,
717 G_MAXUINT);
718
719 return g_value_get_boxed(element);
720 }
721
722 static GPtrArray *
723 list_media_streams(RingConferenceChannel *self)
724 {
725 RingConferenceChannelPrivate *priv = self->priv;
726 GPtrArray *list;
727 size_t size;
728
729 size = (priv->audio->id != 0);
730
731 list = g_ptr_array_sized_new(size);
732
733 if (priv->audio->id)
734 g_ptr_array_add(list, describe_stream(priv->audio));
735
736 return list;
737 }
738
739 static gpointer
740 describe_null_media(TpMediaStreamType tptype)
741 {
742 struct stream_state ss[1] = {{ 0 }};
743
744 ss->type = tptype;
745
746 return describe_stream(ss);
747 }
748
749 static gboolean
750 ring_conference_channel_validate_media_handle(RingConferenceChannel *_self,
751 guint *handlep,
752 GError **error)
753 {
754 if (*handlep != 0) {
755 g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
756 "Conference channel carries a multiparty stream only");
757 return FALSE;
758 }
759
760 return TRUE;
761 }
762
763 /** DBus method ListStreams ( ) -> a(uuuuuu)
764 *
765 * Returns an array of structs representing the streams currently active
766 * within this channel. Each stream is identified by an unsigned integer
767 * which is unique for each stream within the channel.
768 *
769 * Returns
770 *
771 * a(uuuuuu)
772 * An array of structs containing:
773 *
774 * * the stream identifier
775 * * the contact handle who the stream is with
776 * (or 0 if the stream represents more than a single member)
777 * * the type of the stream
778 * * the current stream state
779 * * the current direction of the stream
780 * * the current pending send flags
781 */
782 static void
783 ring_conference_channel_list_streams(TpSvcChannelTypeStreamedMedia *iface,
784 DBusGMethodInvocation *context)
785 {
786 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(iface);
787 GPtrArray *list;
788
789 list = list_media_streams(self);
790
791 tp_svc_channel_type_streamed_media_return_from_list_streams(context, list);
792
793 free_media_stream_list(list);
794 }
795
796 /** DBus method RequestStreams ( u: contact_handle, au: types ) -> a(uuuuuu)
797 *
798 * Request that streams be established to exchange the given types of media
799 * with the given member. In general this will try and establish a
800 * bidirectional stream, but on some protocols it may not be possible to
801 * indicate to the peer that you would like to receive media, so a send-only
802 * stream will be created initially. In the cases where the stream requires
803 * remote agreement (eg you wish to receive media from them), the
804 * StreamDirectionChanged signal will be emitted with the
805 * MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again
806 * with the flag cleared when the remote end has replied.
807 *
808 */
809 static void
810 ring_conference_channel_request_streams(TpSvcChannelTypeStreamedMedia *iface,
811 guint handle,
812 const GArray *media_types,
813 DBusGMethodInvocation *context)
814 {
815 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(iface);
816 RingConferenceChannelPrivate *priv = self->priv;
817 GError *error = NULL;
818 GPtrArray *list;
819 guint i, create_audio_stream = 0;
820 struct stream_state audio[1];
821
822 DEBUG("(...) on %s", self->nick);
823
824 if (!ring_conference_channel_validate_media_handle(self, &handle, &error)) {
825 dbus_g_method_return_error(context, error);
826 g_clear_error(&error);
827 return;
828 }
829
830 *audio = *priv->audio;
831
832 /* We can create media only when call has not been initiated */
833 for (i = 0; i < media_types->len; i++) {
834 guint media_type = g_array_index(media_types, guint, i);
835
836 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO && !create_audio_stream)
837 create_audio_stream = update_media_stream(self, handle,
838 audio, RING_MEDIA_STREAM_ID_AUDIO, media_type,
839 TP_MEDIA_STREAM_STATE_CONNECTING,
840 TP_MEDIA_STREAM_DIRECTION_NONE,
841 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
842 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
843 }
844
845 if (create_audio_stream)
846 *priv->audio = *audio;
847
848 list = g_ptr_array_sized_new(media_types->len);
849
850 for (i = 0; i < media_types->len; i++) {
851 guint media_type = g_array_index(media_types, guint, i);
852 gpointer element;
853
854 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO && create_audio_stream)
855 element = describe_stream(priv->audio), create_audio_stream = 0;
856 else
857 element = describe_null_media(media_type);
858
859 g_ptr_array_add(list, element);
860 }
861
862 ring_conference_channel_create_streams(
863 self, handle, create_audio_stream, FALSE, &error);
864
865 tp_svc_channel_type_streamed_media_return_from_request_streams(
866 context, list);
867
868 free_media_stream_list(list);
869
870 DEBUG("exit");
871 }
872
873 static void
874 ring_conference_channel_streamed_media_iface_init (gpointer g_iface,
875 gpointer iface_data)
876 {
877 TpSvcChannelTypeStreamedMediaClass *klass =
878 (TpSvcChannelTypeStreamedMediaClass *)g_iface;
879
880 #define IMPLEMENT(x) tp_svc_channel_type_streamed_media_implement_##x( \
881 klass, ring_conference_channel_##x)
882 IMPLEMENT(list_streams);
883 /* IMPLEMENT(remove_streams); */
884 /* IMPLEMENT(request_stream_direction); */
885 IMPLEMENT(request_streams);
886 #undef IMPLEMENT
887 }
888
889 static void
890 ring_conference_channel_mergeable_conference_iface_init(gpointer g_iface,
239891 gpointer iface_data)
240892 {
241893 RingSvcChannelInterfaceMergeableConferenceClass *klass =
260912 ring_conference_channel_constructed(GObject *object)
261913 {
262914 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(object);
263 TpBaseConnection *connection = TP_BASE_CONNECTION(self->base.connection);
915 TpBaseChannel *base = TP_BASE_CHANNEL (self);
916 TpBaseConnection *connection =
917 tp_base_channel_get_connection(base);
918 const gchar *object_path;
919 char *nick;
264920
265921 if (G_OBJECT_CLASS(ring_conference_channel_parent_class)->constructed)
266922 G_OBJECT_CLASS(ring_conference_channel_parent_class)->constructed(object);
270926 G_STRUCT_OFFSET(RingConferenceChannel, group),
271927 tp_base_connection_get_handles(connection, TP_HANDLE_TYPE_CONTACT),
272928 connection->self_handle);
273 }
274
275 static void
276 ring_conference_channel_emit_initial(RingMediaChannel *_self)
929
930 object_path = tp_base_channel_get_object_path (base);
931 g_assert(object_path != NULL);
932
933 nick = strrchr(object_path, '/');
934 ++nick;
935 g_assert (nick != NULL);
936 self->nick = g_strdup(nick);
937
938 DEBUG("(%p) with %s", self, self->nick);
939
940 tp_base_channel_register (base);
941 }
942
943 void
944 ring_conference_channel_emit_initial(RingConferenceChannel *_self)
277945 {
278946 DEBUG("enter");
279947
280948 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
281949 RingConferenceChannelPrivate *priv = self->priv;
282 RingConnection *connection = self->base.connection;
950 RingConnection *connection =
951 RING_CONNECTION(tp_base_channel_get_connection(TP_BASE_CHANNEL(self)));
283952 TpGroupMixin *group = TP_GROUP_MIXIN(self);
284953 char const *message;
285954 TpChannelGroupChangeReason reason;
286955 TpChannelGroupFlags add = 0, del = 0;
287
288 if (priv->cc) {
289 message = "Conference created";
290 reason = TP_CHANNEL_GROUP_CHANGE_REASON_INVITED;
291 }
292 else {
293 message = "Channel created";
294 reason = TP_CHANNEL_GROUP_CHANGE_REASON_NONE;
295 }
296
297 priv->current = tp_intset_new();
298 tp_intset_add(priv->current, group->self_handle);
299 priv->pending = tp_intset_new();
300
301 if (priv->cc) {
302 char const *member_path;
303 RingMemberChannel *member;
304 int i;
305
306 for (i = 0; i < priv->initial_members->len; i++) {
307 member_path = priv->initial_members->odata[i];
308 member = ring_connection_lookup_channel(connection, member_path);
309 if (member) {
310 ring_conference_channel_emit_channel_merged(
311 self, RING_MEMBER_CHANNEL(member),
312 modem_call_is_member(RING_MEDIA_CHANNEL(member)->call_instance));
956 char const *member_path;
957 RingMemberChannel *member;
958 int i;
959
960 message = "Conference created";
961 reason = TP_CHANNEL_GROUP_CHANGE_REASON_INVITED;
962
963 priv->current = tp_intset_new ();
964 tp_intset_add (priv->current, group->self_handle);
965 priv->pending = tp_intset_new ();
966
967 for (i = 0; i < priv->initial_members->len; i++) {
968 member_path = priv->initial_members->odata[i];
969 member = ring_connection_lookup_channel (connection, member_path);
970 if (member)
971 {
972 ring_conference_channel_emit_channel_merged (
973 self, RING_MEMBER_CHANNEL(member), TRUE);
313974 }
314 else {
975 else
976 {
315977 DEBUG("No member channel %s found\n", member_path);
316978 }
317 }
318979 }
319980
320981 tp_group_mixin_change_members((GObject *)self, message,
331992 add |= TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED;
332993
333994 tp_group_mixin_change_flags((GObject *)self, add, del);
334
335 if (priv->cc)
336 ring_media_channel_set_state(RING_MEDIA_CHANNEL(self),
337 modem_call_get_state(self->base.call_instance), 0, 0);
338995 }
339996
340997 static void
3471004 RingConferenceChannelPrivate *priv = self->priv;
3481005
3491006 switch (property_id) {
350 case PROP_CHANNEL_PROPERTIES:
351 g_value_take_boxed(value, ring_conference_channel_properties(self));
352 break;
353 case PROP_INTERFACES:
354 g_value_set_boxed(value, ring_conference_channel_interfaces);
355 break;
3561007 case PROP_INITIAL_CHANNELS:
3571008 g_value_set_boxed(value, priv->initial_members);
3581009 break;
3591010 case PROP_CHANNELS:
3601011 g_value_take_boxed(value, ring_conference_get_channels(self));
361 break;
362 case PROP_SUPPORTS_NON_MERGES:
363 g_value_set_boolean (value, FALSE);
3641012 break;
3651013 default:
3661014 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, property_id, pspec);
4041052 }
4051053 }
4061054
1055 while (!g_queue_is_empty (self->priv->requests)) {
1056 modem_request_cancel (g_queue_pop_head (self->priv->requests));
1057 }
1058
4071059 ((GObjectClass *)ring_conference_channel_parent_class)->dispose(obj);
4081060 }
4091061
4171069 tp_group_mixin_finalize(obj);
4181070
4191071 g_boxed_free(TP_ARRAY_TYPE_OBJECT_PATH_LIST, priv->initial_members);
1072 g_free (self->nick);
1073
4201074 priv->initial_members = NULL;
4211075
4221076 G_OBJECT_CLASS(ring_conference_channel_parent_class)->finalize(obj);
4311085 ring_conference_channel_class_init(RingConferenceChannelClass *klass)
4321086 {
4331087 GObjectClass *object_class = G_OBJECT_CLASS(klass);
1088 TpBaseChannelClass *base_chan_class = TP_BASE_CHANNEL_CLASS (klass);
4341089
4351090 g_type_class_add_private(klass, sizeof (RingConferenceChannelPrivate));
4361091
4401095 object_class->dispose = ring_conference_channel_dispose;
4411096 object_class->finalize = ring_conference_channel_finalize;
4421097
443 ring_conference_channel_implement_media_channel(
444 RING_MEDIA_CHANNEL_CLASS(klass));
1098 base_chan_class->channel_type = TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA;
1099 base_chan_class->close = (TpBaseChannelCloseFunc) ring_conference_channel_close;
1100 base_chan_class->interfaces = ring_conference_channel_interfaces;
1101 base_chan_class->target_handle_type = TP_HANDLE_TYPE_NONE;
1102 base_chan_class->fill_immutable_properties = ring_conference_channel_fill_immutable_properties;
4451103
4461104 klass->dbus_properties_class.interfaces =
4471105 ring_conference_channel_dbus_property_interfaces;
4571115 tp_group_mixin_class_set_remove_with_reason_func(
4581116 object_class, ring_conference_channel_remove_member_with_reason);
4591117 tp_group_mixin_init_dbus_properties(object_class);
460
461 g_object_class_override_property(
462 object_class, PROP_CHANNEL_PROPERTIES, "channel-properties");
463
464 g_object_class_override_property(
465 object_class, PROP_INTERFACES, "interfaces");
4661118
4671119 g_object_class_install_property(
4681120 object_class, PROP_INITIAL_CHANNELS,
4831135 TP_ARRAY_TYPE_OBJECT_PATH_LIST,
4841136 G_PARAM_READABLE |
4851137 G_PARAM_STATIC_STRINGS));
486
487 g_object_class_install_property(
488 object_class, PROP_SUPPORTS_NON_MERGES,
489 g_param_spec_boolean("supports-non-merges",
490 "SupportsNonMerges",
491 "Whether this channel supports non-merges",
492 FALSE,
493 G_PARAM_READABLE |
494 G_PARAM_STATIC_STRINGS));
4951138 }
4961139
4971140 /* ====================================================================== */
5031146 static TpDBusPropertiesMixinPropImpl conference_properties[] = {
5041147 { "InitialChannels", "initial-channels" },
5051148 { "Channels", "channels" },
506 { "SupportsNonMerges", "supports-non-merges" },
5071149 { NULL }
5081150 };
5091151
5101152 static TpDBusPropertiesMixinIfaceImpl
5111153 ring_conference_channel_dbus_property_interfaces[] = {
5121154 {
513 RING_IFACE_CHANNEL_INTERFACE_CONFERENCE,
1155 TP_IFACE_CHANNEL_INTERFACE_CONFERENCE,
5141156 tp_dbus_properties_mixin_getter_gobject_properties,
5151157 NULL,
5161158 conference_properties,
5181160 { NULL }
5191161 };
5201162
521
522 /** Return a hash describing channel properties
523 *
524 * A channel's properties are constant for its lifetime on the bus, so
525 * this property should only change when the closed signal is emitted (so
526 * that respawned channels can reappear on the bus with different
527 * properties).
528 */
529 static GHashTable *
530 ring_conference_channel_properties(RingConferenceChannel *self)
531 {
532 return ring_channel_add_properties(
533 self, ring_media_channel_properties(RING_MEDIA_CHANNEL(self)),
534 RING_IFACE_CHANNEL_INTERFACE_CONFERENCE, "InitialChannels",
1163 static void
1164 ring_conference_channel_fill_immutable_properties(TpBaseChannel *base,
1165 GHashTable *props)
1166 {
1167 TP_BASE_CHANNEL_CLASS (ring_conference_channel_parent_class)->fill_immutable_properties (
1168 base, props);
1169
1170 tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT(base), props,
1171 TP_IFACE_CHANNEL_INTERFACE_CONFERENCE, "InitialChannels",
5351172 NULL);
5361173 }
5371174
5801217 return FALSE;
5811218 }
5821219
1220 static void
1221 reply_to_modem_call_request_hangup_conference (ModemCallService *_service,
1222 ModemRequest *request,
1223 GError *error,
1224 gpointer _self)
1225 {
1226 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
1227 RingConferenceChannelPrivate *priv = self->priv;
1228 TpBaseChannel *base = TP_BASE_CHANNEL (self);
1229
1230 ring_conference_channel_dequeue_request (self, request);
1231
1232 DEBUG("");
1233
1234 priv->conf_created = FALSE;
1235 tp_base_channel_destroyed (base);
1236 }
1237
1238 /*
1239 * Requests modem to hangup the multiparty call.
1240 */
1241 static void ring_conference_do_hangup (RingConferenceChannel *self)
1242 {
1243 RingConferenceChannelPrivate *priv = self->priv;
1244 ModemCallService *service;
1245
1246 priv->hangup = TRUE;
1247 service = ring_conference_channel_get_call_service (self);
1248 ring_conference_channel_queue_request (self,
1249 modem_call_request_hangup_conference (service,
1250 reply_to_modem_call_request_hangup_conference, self));
1251 }
5831252
5841253 static gboolean
5851254 ring_conference_channel_remove_member_with_reason(GObject *iface,
5991268 DEBUG("enter");
6001269
6011270 selfhandle = tp_base_connection_get_self_handle(
602 TP_BASE_CONNECTION(self->base.connection));
1271 tp_base_channel_get_connection(TP_BASE_CHANNEL(self)));
6031272
6041273 removing = tp_intset_new();
6051274
6061275 if (handle == selfhandle)
607 tp_intset_add(removing, handle);
1276 {
1277 tp_intset_add(removing, handle);
1278 ring_conference_do_hangup (self);
1279 }
6081280
6091281 for (i = 0; i < MODEM_MAX_CALLS; i++) {
6101282 member = priv->members[i];
6131285
6141286 g_object_get(member, "member-handle", &memberhandle, NULL);
6151287
616 if (handle == selfhandle) {
617 tp_intset_add(removing, memberhandle);
618 ring_member_channel_release(member, message, reason, NULL);
619 }
620 else if (handle == memberhandle) {
1288 if (handle == memberhandle) {
6211289 tp_intset_add(removing, memberhandle);
6221290 if (!ring_member_channel_release(member, message, reason, error))
6231291 goto error;
6831351 char *member_object_path;
6841352 GHashTable *member_map;
6851353 TpHandle member_handle;
1354 /* XXXKV: fill with correct values */
1355 GHashTable *member_props =
1356 tp_dbus_properties_mixin_make_properties_hash (G_OBJECT (member), NULL, NULL, NULL);
6861357
6871358 g_object_get(member,
6881359 "object-path", &member_object_path,
7131384 strrchr(member_object_path, '/') + 1);
7141385
7151386 /* XXX: This used to take member_map, which could be useful */
716 ring_svc_channel_interface_conference_emit_channel_merged(
717 self, member_object_path);
1387 tp_svc_channel_interface_conference_emit_channel_merged(
1388 self, member_object_path, member_handle, member_props);
7181389
7191390 emit_members_changed:
7201391 DEBUG("%s member handle %u for %s",
7671438
7681439 error:
7691440 g_hash_table_destroy(member_map);
1441 g_hash_table_destroy(member_props);
7701442 g_free(member_object_path);
7711443 }
7721444
7831455 guint i, n;
7841456 char *object_path;
7851457 TpHandle member_handle;
1458 GHashTable *details;
7861459
7871460 if (!member)
7881461 return;
8031476 if (i >= MODEM_MAX_CALLS)
8041477 return;
8051478
1479 /* note: as this function may lead to tearing down the whole
1480 * conference, keep a local self-reference */
1481 g_object_ref (self);
1482
8061483 while (member) {
8071484 TpIntSet *remove = tp_intset_new();
8081485
8171494 strrchr(object_path, '/') + 1,
8181495 actor, reason);
8191496
820 /* XXX: this used to take actor and reason which could be
821 useful */
822 ring_svc_channel_interface_conference_emit_channel_removed(
823 self, object_path);
1497 details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
1498 (GDestroyNotify) tp_g_value_slice_free);
1499
1500 g_hash_table_insert (details, "actor",
1501 tp_g_value_slice_new_uint (actor));
1502 g_hash_table_insert (details, "change-reason",
1503 tp_g_value_slice_new_uint (reason));
1504
1505 tp_svc_channel_interface_conference_emit_channel_removed(
1506 self, object_path, details);
8241507
8251508 g_free(object_path);
1509 g_hash_table_destroy(details);
8261510
8271511 ring_member_channel_left(member);
8281512
8531537 }
8541538
8551539 if (n > 2)
856 return;
1540 goto out;
8571541
8581542 DEBUG("Too few members, close channel %p", self);
8591543
860 /* Last member channel removed, close channel */
861 ring_media_channel_close(RING_MEDIA_CHANNEL(self));
1544 /*
1545 * Last member channel removed, close channel but do
1546 * not hangup.
1547 */
1548 ring_conference_channel_close_impl (self, FALSE, FALSE);
1549
1550 out:
1551 g_object_unref (self);
8621552 }
8631553
8641554
9161606 RingMemberChannel *member,
9171607 GError **error)
9181608 {
1609 RingConferenceChannelPrivate *priv = RING_CONFERENCE_CHANNEL(self)->priv;
1610 int i;
1611
9191612 if (!RING_IS_CONFERENCE_CHANNEL(self)) {
9201613 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
9211614 "Not a Conference Channel");
9261619 return FALSE;
9271620 }
9281621 #endif
1622 for (i = 0; i < MODEM_MAX_CALLS; i++) {
1623 if (member == priv->members[i]) {
1624 priv->is_current[i] = TRUE;
1625 }
1626 }
9291627 ring_conference_channel_emit_channel_merged(self, member, FALSE);
9301628
9311629 return TRUE;
932 }
933
934 static void
935 on_modem_conference_joined(ModemCallConference *cc,
936 ModemCall *ci,
937 RingConferenceChannel *self)
938 {
939 RingMemberChannel *member =
940 (RingMemberChannel *)modem_call_get_handler(ci);
941
942 DEBUG("called with ModemCall(%p) and RingMemberChannel(%p)", ci, member);
943
944 if (RING_IS_MEMBER_CHANNEL(member))
945 ring_conference_channel_emit_channel_merged(
946 RING_CONFERENCE_CHANNEL(self), member, TRUE);
947 }
948
949 void
950 on_modem_conference_left(ModemCallConference *cc,
951 ModemCall *ci,
952 RingConferenceChannel *self)
953 {
954 RingMemberChannel *member = modem_call_get_handler(ci);
955
956 DEBUG("called with ModemCall(%p) and RingMemberChannel(%p)", ci, member);
957
958 if (RING_IS_MEMBER_CHANNEL(member)) {
959 TpHandle actor = 0;
960 TpChannelGroupChangeReason reason = 0;
961 char const *message;
962
963 if (modem_call_get_state(ci) == MODEM_CALL_STATE_ACTIVE) {
964 message = "Split to private call";
965 actor = self->group.self_handle;
966 reason = TP_CHANNEL_GROUP_CHANGE_REASON_INVITED;
967 }
968 else {
969 message = "Member channel removed";
970 actor = self->group.self_handle;
971 reason = TP_CHANNEL_GROUP_CHANGE_REASON_ERROR;
972 DEBUG("got Left but member channel is not split (call in %s)",
973 modem_call_get_state_name(modem_call_get_state(ci)));
974 }
975
976 ring_conference_channel_emit_channel_removed(
977 RING_CONFERENCE_CHANNEL(self), member,
978 message, actor, reason);
979 }
9801630 }
9811631
9821632 /* ====================================================================== */
9831633 /* RingMediaChannel interface */
9841634
985 /** Close channel */
1635 /**
1636 * Implements closing the channel
1637 *
1638 * @see ring_conference_channel_close() for the interface callback
1639 */
9861640 static gboolean
987 ring_conference_channel_close(RingMediaChannel *_self,
988 gboolean immediately)
989 {
990 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
1641 ring_conference_channel_close_impl (RingConferenceChannel *self,
1642 gboolean immediately, gboolean hangup)
1643 {
9911644 RingConferenceChannelPrivate *priv = RING_CONFERENCE_CHANNEL(self)->priv;
9921645 int i;
9931646
10021655 priv->members[i] = NULL;
10031656 }
10041657
1005 return priv->closed = TRUE;
1006 }
1007
1008 static void
1009 ring_conference_channel_update_state(RingMediaChannel *_self,
1010 unsigned state,
1011 unsigned causetype,
1012 unsigned cause)
1013 {
1014 if (state != MODEM_CALL_STATE_DISCONNECTED) /* was: TERMINATED */
1015 return;
1016
1017 /* Emit MemberChanged when request to build conference fails */
1018 if (tp_handle_set_size(TP_GROUP_MIXIN(_self)->remote_pending) != 0)
1019 ring_conference_channel_release(RING_CONFERENCE_CHANNEL(_self),
1020 causetype, cause, NULL);
1021
1022 ring_media_channel_close(_self);
1658 if (hangup)
1659 {
1660 ring_conference_do_hangup (self);
1661 }
1662 else
1663 {
1664 TpBaseChannel *base = TP_BASE_CHANNEL (self);
1665 priv->conf_created = FALSE;
1666 DEBUG("emitting close without hanging up");
1667 tp_base_channel_destroyed (base);
1668 }
1669
1670 return TRUE;
1671 }
1672
1673 /**
1674 * Implements the TpBaseChannel close method.
1675 */
1676 static gboolean
1677 ring_conference_channel_close (RingConferenceChannel *self,
1678 gboolean immediately)
1679 {
1680 /**
1681 * When Close() is requested explicitly, hangup the conference
1682 * call (releases all member calls as well).
1683 */
1684 return ring_conference_channel_close_impl (self, immediately, TRUE);
10231685 }
10241686
10251687 static void
10841746
10851747 ring_util_group_change_members(self,
10861748 NULL, removed, NULL, NULL,
1087 reason ? "change-reason" : "", G_TYPE_UINT, reason,
1749 "change-reason", G_TYPE_UINT, reason,
10881750 message ? "message" : "", G_TYPE_STRING, message,
10891751 dbus_error ? "error" : "", G_TYPE_STRING, dbus_error,
10901752 "debug-message", G_TYPE_STRING, debug,
10981760 g_free(debug);
10991761 }
11001762
1101 static void
1102 ring_conference_channel_set_call_instance(RingMediaChannel *_self,
1103 ModemCall *ci)
1104 {
1105 DEBUG("(%p, %p): enter", _self, ci);
1106
1107 #if XXX
1108
1763 static void reply_to_modem_call_request_conference(ModemCallService *_service,
1764 ModemRequest *request, GError *error, gpointer _channel);
1765
1766 static gboolean
1767 ring_conference_channel_create_streams (RingConferenceChannel *_self,
1768 guint handle,
1769 gboolean audio,
1770 gboolean video,
1771 GError **error)
1772 {
11091773 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
11101774 RingConferenceChannelPrivate *priv = self->priv;
1111
1112 if (ci) {
1113 g_assert(MODEM_IS_CALL_CONFERENCE(ci));
1114
1115 priv->cc = MODEM_CALL_CONFERENCE(ci);
1116
1117 priv->streams_created = 1;
1118
1119 #define CONNECT(n, f) \
1120 g_signal_connect(priv->cc, n, G_CALLBACK(on_modem_conference_ ## f), self)
1121
1122 priv->signals.joined = CONNECT("joined", joined);
1123 priv->signals.left = CONNECT("left", left);
1124 #undef CONNECT
1125 }
1126 else {
1127 #define DISCONNECT(n) \
1128 if (priv->signals.n && \
1129 g_signal_handler_is_connected(priv->cc, priv->signals.n)) { \
1130 g_signal_handler_disconnect(priv->cc, priv->signals.n); \
1131 } (priv->signals.n = 0)
1132
1133 DISCONNECT(joined);
1134 DISCONNECT(left);
1135
1136 #undef DISCONNECT
1137
1138 priv->cc = NULL;
1139 }
1140 #endif
1141 }
1142
1143 static gboolean
1144 ring_conference_channel_validate_media_handle(RingMediaChannel *_self,
1145 guint *handlep,
1146 GError **error)
1147 {
1148 if (*handlep != 0) {
1149 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1150 "Conference channel carries a multiparty stream only");
1151 return FALSE;
1152 }
1775 ModemCallService *service;
1776 TpBaseConnection *baseconn;
1777
1778 (void)audio; (void)video;
1779
1780 if (priv->streams_created)
1781 {
1782 DEBUG("Already associated with a conference");
1783 return TRUE;
1784 }
1785
1786 priv->streams_created = 1;
1787
1788 baseconn = tp_base_channel_get_connection (TP_BASE_CHANNEL (self));
1789
1790 if (!ring_connection_validate_initial_members (RING_CONNECTION (baseconn),
1791 priv->initial_members, error))
1792 {
1793 return FALSE;
1794 }
1795
1796 service = ring_conference_channel_get_call_service (self);
1797
1798 ring_conference_channel_queue_request (self,
1799 modem_call_request_conference (service,
1800 reply_to_modem_call_request_conference, self));
11531801
11541802 return TRUE;
11551803 }
11561804
1157 static void reply_to_modem_call_request_conference(ModemCallService *_service,
1158 ModemRequest *request, GError *error, gpointer _channel);
1159
1160 static gboolean
1161 ring_conference_channel_create_streams(RingMediaChannel *_self,
1162 guint handle,
1163 gboolean audio,
1164 gboolean video,
1165 GError **error)
1166 {
1167 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
1805 void
1806 ring_conference_channel_initial_audio (RingConferenceChannel *self)
1807 {
11681808 RingConferenceChannelPrivate *priv = self->priv;
1169
1170 (void)audio; (void)video;
1171
1172 if (priv->streams_created) {
1173 DEBUG("Already associated with a conference");
1174 return TRUE;
1175 }
1809 ModemCallService *service;
1810 ModemRequest *request;
1811
1812 DEBUG ("(%p)", self);
1813
11761814 priv->streams_created = 1;
11771815
1178 if (!ring_connection_validate_initial_members(self->base.connection,
1179 priv->initial_members,
1180 error))
1181 return FALSE;
1182
1183 ring_media_channel_queue_request(RING_MEDIA_CHANNEL(self),
1184 modem_call_request_conference(self->base.call_service,
1185 reply_to_modem_call_request_conference, self));
1186
1187 return TRUE;
1188 }
1189
1190 void
1191 ring_conference_channel_initial_audio(RingConferenceChannel *self,
1192 RingMediaManager *manager,
1193 gpointer channelrequest)
1194 {
1195 RingConferenceChannelPrivate *priv = self->priv;
1196 ModemRequest *request;
1197
1198 DEBUG("%s(%p, %p, %p) called", __func__, self, manager, channelrequest);
1199
1200 priv->streams_created = 1;
1201
1202 request = modem_call_request_conference(self->base.call_service,
1203 reply_to_modem_call_request_conference,
1204 self);
1205
1206 ring_media_channel_queue_request(RING_MEDIA_CHANNEL(self), request);
1207
1208 modem_request_add_qdatas(
1209 request,
1210 g_type_qname(RING_TYPE_MEDIA_MANAGER), g_object_ref(manager), g_object_unref,
1211 /* XXX - GDestroyNotify for channelrequest */
1212 g_quark_from_static_string("RingChannelRequest"), channelrequest, NULL,
1213 NULL);
1816 service = ring_conference_channel_get_call_service (self),
1817
1818 request = modem_call_request_conference (service,
1819 reply_to_modem_call_request_conference,
1820 self);
1821
1822 ring_conference_channel_queue_request (self, request);
12141823 }
12151824
12161825 static void
12211830 {
12221831 RingConferenceChannel *self = RING_CONFERENCE_CHANNEL(_self);
12231832 RingConferenceChannelPrivate *priv = self->priv;
1224 gpointer channelrequest;
1225 ModemCallConference *cc = priv->cc;
1226 GError error0[1] = {{
1227 TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "Conference channel already exists"
1228 }};
1229
1230 ring_media_channel_dequeue_request(RING_MEDIA_CHANNEL(self), request);
1833
1834 ring_conference_channel_dequeue_request (self, request);
1835
1836 g_assert(priv->conf_created == FALSE);
12311837
12321838 if (error)
1233 DEBUG("Call.CreateMultiparty with channel %s (%p) failed: " GERROR_MSG_FMT,
1234 self->base.nick, self, GERROR_MSG_CODE(error));
1235 else
1236 DEBUG("Call.CreateMultiparty with channel %s (%p) returned",
1237 self->base.nick, self);
1238
1239 if (error == NULL && cc == NULL) {
1240 RingConferenceChannel *already;
1241
1242 cc = modem_call_service_get_conference(self->base.call_service);
1243 already = modem_call_get_handler(MODEM_CALL(cc));
1244 if (already == NULL) {
1245 g_object_set(self, "call-instance", cc, NULL);
1246 }
1247 else {
1248 DEBUG("RingConferenceChannel already exists (%p)", already);
1249 cc = NULL;
1250 error = error0;
1251 }
1252 }
1253
1254 channelrequest = modem_request_steal_data(request, "RingChannelRequest");
1255 if (channelrequest) {
1256 RingMediaManager *manager = modem_request_get_data(request, "RingMediaManager");
1257
1258 ring_media_manager_emit_new_channel(manager,
1259 channelrequest, self, error ? error0 : NULL);
1260 }
1261 else if (error) {
1262 ring_conference_channel_release(_self, 0, 0, error);
1263 ring_media_channel_close(_self);
1264 }
1265 else {
1266 ring_conference_channel_emit_initial(_self);
1267 }
1268 }
1269
1270 static void
1271 ring_conference_channel_implement_media_channel(RingMediaChannelClass *media_class)
1272 {
1273 media_class->emit_initial = ring_conference_channel_emit_initial;
1274 media_class->close = ring_conference_channel_close;
1275 media_class->update_state = ring_conference_channel_update_state;
1276 media_class->set_call_instance = ring_conference_channel_set_call_instance;
1277 media_class->validate_media_handle = ring_conference_channel_validate_media_handle;
1278 media_class->create_streams = ring_conference_channel_create_streams;
1839 {
1840 DEBUG("Call.CreateMultiparty with channel %s (%p) failed: "
1841 GERROR_MSG_FMT, self->nick, self, GERROR_MSG_CODE(error));
1842
1843 ring_conference_channel_release(_self, 0, 0, error);
1844 ring_conference_channel_close_impl(_self, FALSE, FALSE);
1845 return;
1846 }
1847
1848 priv->conf_created = TRUE;
1849 DEBUG("VoiceCallManager.CreateMultiparty with channel %s (%p) returned",
1850 self->nick, self);
12791851 }
12801852
12811853 /* ---------------------------------------------------------------------- */
2222 #define RING_CONFERENCE_CHANNEL_H
2323
2424 #include <glib-object.h>
25 #include <telepathy-glib/base-channel.h>
26 #include <telepathy-glib/group-mixin.h>
2527
2628 G_BEGIN_DECLS
2729
3133
3234 G_END_DECLS
3335
34 #include "ring-media-channel.h"
3536 #include "ring-media-manager.h"
3637 #include "ring-member-channel.h"
3738
3839 G_BEGIN_DECLS
3940
4041 struct _RingConferenceChannelClass {
41 RingMediaChannelClass base_class;
42 TpBaseChannelClass parent_class;
4243 TpGroupMixinClass group_class;
4344 TpDBusPropertiesMixinClass dbus_properties_class;
4445 };
4546
4647 struct _RingConferenceChannel {
47 RingMediaChannel base;
48 TpBaseChannel parent;
4849 TpGroupMixin group;
4950 RingConferenceChannelPrivate *priv;
51 gchar *nick;
5052 };
5153
5254 GType ring_conference_channel_get_type(void);
8385 guint actor,
8486 TpChannelGroupChangeReason reason);
8587
86 /* ---------------------------------------------------------------------- */
87 /* "initial-members" */
88 void ring_conference_channel_emit_initial(RingConferenceChannel *channel);
8889
89 gboolean ring_conference_channel_check_initial_members(
90 RingConferenceChannel const *channel,
91 RingInitialMembers const *initial);
90 gboolean ring_conference_channel_check_initial_members (
91 RingConferenceChannel const *,
92 RingInitialMembers const *);
9293
93 void ring_conference_channel_initial_audio(RingConferenceChannel *self,
94 RingMediaManager *manager,
95 gpointer request);
94 void ring_conference_channel_initial_audio (RingConferenceChannel *self);
9695
9796 G_END_DECLS
9897
0 /*
1 * ring-conference-manager.c - Manager for conference channels
2 *
3 * Copyright (C) 2007-2011 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 * @author Lassi Syrjala <first.surname@nokia.com>
6 * @author Kai Vehmanen <first.surname@nokia.com>
7 *
8 * This work is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This work is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this work; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /*
24 * Based on telepathy-glib/examples/cm/echo/factory.c with notice:
25 *
26 * """
27 * Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/>
28 * Copyright (C) 2007 Nokia Corporation
29 *
30 * Copying and distribution of this file, with or without modification,
31 * are permitted in any medium without royalty provided the copyright
32 * notice and this notice are preserved.
33 * """
34 */
35
36 #include "config.h"
37
38 #define DEBUG_FLAG RING_DEBUG_CONNECTION
39 #include "ring-debug.h"
40
41 #include "ring-conference-manager.h"
42 #include "ring-conference-channel.h"
43 #include "ring-connection.h"
44 #include "ring-param-spec.h"
45 #include "ring-util.h"
46
47 #include "ring-extensions/ring-extensions.h"
48
49 #include "modem/call.h"
50 #include "modem/tones.h"
51
52 #include <telepathy-glib/base-connection.h>
53 #include <telepathy-glib/dbus.h>
54 #include <telepathy-glib/errors.h>
55 #include <telepathy-glib/gtypes.h>
56 #include <telepathy-glib/interfaces.h>
57
58 #include <dbus/dbus-glib.h>
59
60 #include <string.h>
61
62 static void manager_iface_init (gpointer, gpointer);
63
64 G_DEFINE_TYPE_WITH_CODE (RingConferenceManager, ring_conference_manager,
65 G_TYPE_OBJECT,
66 G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, manager_iface_init));
67
68 struct _RingConferenceManagerPrivate
69 {
70 RingConnection *connection;
71 ModemCallService *call_service;
72
73 GHashTable *channels;
74
75 unsigned dispose_has_run:1, :0;
76
77 struct {
78 gulong status_changed;
79 } signals;
80 };
81
82 enum
83 {
84 PROP_NONE,
85 PROP_CONNECTION,
86 PROP_CALL_SERVICE,
87 N_PROPS
88 };
89
90 typedef enum
91 {
92 METHOD_COMPATIBLE,
93 METHOD_CREATE,
94 METHOD_ENSURE
95 } RequestotronMethod;
96
97 /* ---------------------------------------------------------------------- */
98
99 static void conference_manager_emit_new_channel (RingConferenceManager *,
100 gpointer request, gpointer channel, GError *error);
101
102 static gboolean conference_requestotron (RingConferenceManager *,
103 gpointer,
104 GHashTable *);
105
106 static void set_call_service (RingConferenceManager *, ModemCallService *);
107 static void conference_removed (gpointer _channel);
108
109 static void on_connection_status_changed (TpBaseConnection *conn,
110 guint status, guint reason,
111 RingConferenceManager *self);
112
113 #define METHOD(i, x) (i ## _ ## x)
114
115 /* ---------------------------------------------------------------------- */
116 /* GObject interface */
117
118 static void
119 ring_conference_manager_init (RingConferenceManager *self)
120 {
121 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (
122 self, RING_TYPE_CONFERENCE_MANAGER, RingConferenceManagerPrivate);
123
124 self->priv->channels = g_hash_table_new_full (g_str_hash, g_str_equal,
125 NULL, conference_removed);
126 }
127
128 static void
129 ring_conference_manager_constructed (GObject *object)
130 {
131 RingConferenceManager *self = RING_CONFERENCE_MANAGER(object);
132 RingConferenceManagerPrivate *priv = self->priv;
133
134 priv->signals.status_changed = g_signal_connect (priv->connection,
135 "status-changed", (GCallback) on_connection_status_changed, self);
136
137 if (G_OBJECT_CLASS (ring_conference_manager_parent_class)->constructed)
138 G_OBJECT_CLASS (ring_conference_manager_parent_class)->constructed (object);
139 }
140
141 static void
142 ring_conference_manager_dispose (GObject *object)
143 {
144 RingConferenceManager *self = RING_CONFERENCE_MANAGER (object);
145 RingConferenceManagerPrivate *priv = self->priv;
146
147 if (priv->dispose_has_run)
148 return;
149 priv->dispose_has_run = TRUE;
150
151 ring_signal_disconnect (priv->connection, &priv->signals.status_changed);
152
153 set_call_service (self, NULL);
154
155 ((GObjectClass *) ring_conference_manager_parent_class)->dispose (object);
156 }
157
158 static void
159 ring_conference_manager_finalize (GObject *object)
160 {
161 RingConferenceManager *self = RING_CONFERENCE_MANAGER (object);
162 RingConferenceManagerPrivate *priv = self->priv;
163
164 g_hash_table_destroy (priv->channels);
165 }
166
167 static void
168 ring_conference_manager_get_property (GObject *object,
169 guint property_id,
170 GValue *value,
171 GParamSpec *pspec)
172 {
173 RingConferenceManager *self = RING_CONFERENCE_MANAGER (object);
174 RingConferenceManagerPrivate *priv = self->priv;
175
176 switch (property_id)
177 {
178 case PROP_CONNECTION:
179 g_value_set_object (value, priv->connection);
180 break;
181 case PROP_CALL_SERVICE:
182 g_value_set_pointer (value, priv->call_service);
183 break;
184
185 default:
186 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
187 }
188 }
189
190 static void
191 ring_conference_manager_set_property (GObject *object,
192 guint property_id,
193 const GValue *value,
194 GParamSpec *pspec)
195 {
196 RingConferenceManager *self = RING_CONFERENCE_MANAGER (object);
197 RingConferenceManagerPrivate *priv = self->priv;
198
199 switch (property_id)
200 {
201 case PROP_CONNECTION:
202 /* We don't ref the connection, because it owns a reference to the
203 * factory, and it guarantees that the factory's lifetime is
204 * less than its lifetime */
205 priv->connection = g_value_get_object (value);
206 break;
207 case PROP_CALL_SERVICE:
208 set_call_service (self, g_value_get_pointer (value));
209 break;
210 default:
211 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
212 }
213 }
214
215 static void
216 ring_conference_manager_class_init (RingConferenceManagerClass *klass)
217 {
218 GObjectClass *object_class = (GObjectClass *) klass;
219
220 g_type_class_add_private (klass, sizeof (RingConferenceManagerPrivate));
221
222 object_class->constructed = ring_conference_manager_constructed;
223 object_class->dispose = ring_conference_manager_dispose;
224 object_class->finalize = ring_conference_manager_finalize;
225 object_class->get_property = ring_conference_manager_get_property;
226 object_class->set_property = ring_conference_manager_set_property;
227
228 g_object_class_install_property (object_class, PROP_CONNECTION,
229 ring_param_spec_connection ());
230
231 g_object_class_install_property (object_class, PROP_CALL_SERVICE,
232 g_param_spec_pointer ("call-service",
233 "Call Manager Object",
234 "oFono Call Manager",
235 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
236 }
237
238 /* ---------------------------------------------------------------------- */
239 /* RingConferenceManager interface */
240
241 RingConferenceChannel *
242 ring_conference_manager_lookup (RingConferenceManager *self,
243 char const *object_path)
244 {
245 g_return_val_if_fail (self != NULL, NULL);
246 g_return_val_if_fail (object_path != NULL, NULL);
247
248 return g_hash_table_lookup (self->priv->channels, object_path);
249 }
250
251 static void
252 set_call_service (RingConferenceManager *self, ModemCallService *service)
253 {
254 RingConferenceManagerPrivate *priv = self->priv;
255
256 if (priv->call_service)
257 {
258 if (priv->call_service)
259 g_object_unref (priv->call_service);
260 priv->call_service = NULL;
261 }
262
263 if (service)
264 {
265 priv->call_service = g_object_ref (MODEM_CALL_SERVICE (service));
266 }
267 }
268
269 static void
270 conference_removed (gpointer _channel)
271 {
272 if (!tp_base_channel_is_destroyed (_channel))
273 {
274 /* Ensure "Closed" has been emitted */
275 g_object_run_dispose (_channel);
276 }
277
278 g_object_unref (_channel);
279 }
280
281 static void
282 on_connection_status_changed (TpBaseConnection *conn,
283 guint status,
284 guint reason,
285 RingConferenceManager *self)
286 {
287 RingConferenceManagerPrivate *priv = self->priv;
288
289 if (status == TP_CONNECTION_STATUS_DISCONNECTED)
290 {
291 g_hash_table_remove_all (priv->channels);
292 }
293 }
294
295 /* ---------------------------------------------------------------------- */
296 /* TpChannelManagerIface interface */
297
298 static GHashTable *
299 conference_channel_fixed_properties (void)
300 {
301 static GHashTable *hash;
302
303 if (hash)
304 return hash;
305
306 hash = g_hash_table_new (g_str_hash, g_str_equal);
307
308 char const *key;
309 GValue *value;
310
311 key = TP_IFACE_CHANNEL ".ChannelType";
312 value = tp_g_value_slice_new (G_TYPE_STRING);
313 g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA);
314
315 g_hash_table_insert (hash, (gpointer)key, value);
316
317 return hash;
318 }
319
320 static char const * const conference_channel_allowed_properties[] =
321 {
322 TP_IFACE_CHANNEL ".InitialChannels",
323 TP_IFACE_CHANNEL ".TargetHandleType",
324 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
325 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo",
326 NULL
327 };
328
329 RingInitialMembers *
330 tp_asv_get_initial_members (GHashTable *properties)
331 {
332 return tp_asv_get_boxed (properties,
333 TP_IFACE_CHANNEL ".InitialChannels",
334 TP_ARRAY_TYPE_OBJECT_PATH_LIST);
335 }
336
337 static void
338 conference_manager_foreach_channel_class (TpChannelManager *_self,
339 TpChannelManagerChannelClassFunc func,
340 gpointer userdata)
341 {
342 RingConferenceManager *self = RING_CONFERENCE_MANAGER (_self);
343
344 /* If we're not connected, conferences aren't supported. */
345 if (self->priv->call_service == NULL)
346 return;
347
348 func (_self,
349 conference_channel_fixed_properties (),
350 conference_channel_allowed_properties,
351 userdata);
352 }
353
354 static void
355 conference_manager_foreach_channel (TpChannelManager *_self,
356 TpExportableChannelFunc func,
357 gpointer user_data)
358 {
359 RingConferenceManager *self = RING_CONFERENCE_MANAGER (_self);
360 GHashTableIter i[1];
361 gpointer channel;
362
363 for (g_hash_table_iter_init (i, self->priv->channels);
364 g_hash_table_iter_next (i, NULL, &channel);)
365 func (channel, user_data);
366 }
367
368 static gboolean
369 conference_manager_create_channel (TpChannelManager *_self,
370 gpointer request,
371 GHashTable *properties)
372 {
373 RingConferenceManager *self = RING_CONFERENCE_MANAGER (_self);
374
375 if (tp_asv_get_initial_members (properties) == NULL ||
376 !ring_properties_satisfy (properties,
377 conference_channel_fixed_properties (),
378 conference_channel_allowed_properties))
379 return FALSE;
380
381 return conference_requestotron (self, request, properties);
382 }
383
384 static gboolean
385 conference_manager_ensure_channel (TpChannelManager *_self,
386 gpointer request,
387 GHashTable *properties)
388 {
389 RingConferenceManager *self = RING_CONFERENCE_MANAGER (_self);
390
391 if (tp_asv_get_initial_members (properties) == NULL ||
392 !ring_properties_satisfy (properties,
393 conference_channel_fixed_properties (),
394 conference_channel_allowed_properties))
395 return FALSE;
396
397 return conference_requestotron (self, request, properties);
398 }
399
400 static void
401 manager_iface_init (gpointer ifacep, gpointer data)
402 {
403 TpChannelManagerIface *iface = ifacep;
404
405 #define IMPLEMENT(x) iface->x = conference_manager_##x
406
407 IMPLEMENT (foreach_channel);
408 IMPLEMENT (foreach_channel_class);
409 IMPLEMENT (create_channel);
410 IMPLEMENT (ensure_channel);
411
412 #undef IMPLEMENT
413 }
414
415 /* ---------------------------------------------------------------------- */
416
417 static RingConferenceChannel *
418 conference_manager_find_existing (RingConferenceManager const *self,
419 RingInitialMembers *initial)
420 {
421 RingConferenceManagerPrivate const *priv = self->priv;
422 GHashTableIter i[1];
423 gpointer existing = NULL;
424
425 g_hash_table_iter_init (i, priv->channels);
426
427 while (g_hash_table_iter_next (i, NULL, &existing))
428 {
429 if (initial->len == 0 ||
430 ring_conference_channel_check_initial_members (existing, initial))
431 return existing;
432 }
433
434 return NULL;
435 }
436
437 static char *
438 conference_manager_new_object_path (RingConferenceManager const *self)
439 {
440 RingConferenceManagerPrivate const *priv = self->priv;
441 char const *base_path = TP_BASE_CONNECTION (priv->connection)->object_path;
442
443 static unsigned object_index;
444 static unsigned object_index_init;
445
446 if (G_UNLIKELY (object_index_init == 0))
447 {
448 object_index = (guint)(time(NULL) - (41 * 365 * 24 * 60 * 60)) * 10;
449 object_index_init = 1;
450 }
451
452 /* Find an unique D-Bus object_path */
453 for (;;)
454 {
455 char *path = g_strdup_printf ("%s/conf%u", base_path, ++object_index);
456
457 if (!g_hash_table_lookup (priv->channels, path))
458 return path;
459
460 g_free (path);
461 }
462 }
463
464 static RingConferenceChannel *
465 conference_manager_new_conference (RingConferenceManager *self,
466 RingInitialMembers *initial,
467 gboolean initial_audio)
468 {
469 RingConferenceManagerPrivate *priv = self->priv;
470 char *object_path;
471 RingConferenceChannel *channel;
472
473 object_path = conference_manager_new_object_path (self);
474
475 channel = g_object_new (RING_TYPE_CONFERENCE_CHANNEL,
476 "connection", priv->connection,
477 /* KVXXX: "tones", priv->tones, */
478 "object-path", object_path,
479 "initial-channels", initial,
480 "initial-audio", initial_audio,
481 "initiator-handle", tp_base_connection_get_self_handle (
482 TP_BASE_CONNECTION (priv->connection)),
483 "requested", TRUE,
484 NULL);
485
486 g_free (object_path);
487
488 return channel;
489 }
490
491 static void
492 on_conference_channel_closed (GObject *_channel, RingConferenceManager *self)
493 {
494 gchar *object_path;
495
496 g_object_get (_channel, "object-path", &object_path, NULL);
497 g_hash_table_remove (self->priv->channels, object_path);
498 tp_channel_manager_emit_channel_closed (self, object_path);
499 g_free (object_path);
500 }
501
502 static void
503 conference_manager_emit_new_channel (RingConferenceManager *self,
504 gpointer request,
505 gpointer _channel,
506 GError *error)
507 {
508 DEBUG ("%s (%p, %p, %p, %p) called", __func__,
509 self, request, _channel, error);
510
511 RingConferenceManagerPrivate *priv = RING_CONFERENCE_MANAGER (self)->priv;
512 GSList *requests = request ? g_slist_prepend (NULL, request) : NULL;
513
514 if (error == NULL)
515 {
516 RingConferenceChannel *channel = RING_CONFERENCE_CHANNEL (_channel);
517 char *object_path = NULL;
518
519 g_signal_connect (channel, "closed",
520 G_CALLBACK (on_conference_channel_closed), self);
521
522 g_object_get (channel, "object-path", &object_path, NULL);
523
524 DEBUG ("got new channel %p nick %s type %s",
525 channel, channel->nick, G_OBJECT_TYPE_NAME (channel));
526
527 g_hash_table_insert (priv->channels, object_path, channel);
528
529 tp_channel_manager_emit_new_channel (self,
530 TP_EXPORTABLE_CHANNEL (channel), requests);
531
532 /* Emit Group and StreamedMedia signals */
533 ring_conference_channel_emit_initial (channel);
534 }
535 else
536 {
537 if (_channel)
538 {
539 RingConferenceChannel *channel = RING_CONFERENCE_CHANNEL (_channel);
540 DEBUG ("new channel %p nick %s failed with " GERROR_MSG_FMT,
541 channel, channel->nick, GERROR_MSG_CODE (error));
542 }
543
544 if (request)
545 {
546 tp_channel_manager_emit_request_failed (self,
547 request, error->domain, error->code, error->message);
548 }
549
550 if (_channel)
551 {
552 g_object_unref (_channel);
553 }
554 }
555
556 g_slist_free (requests);
557 }
558
559 static gboolean
560 conference_requestotron (RingConferenceManager *self,
561 gpointer request,
562 GHashTable *properties)
563 {
564 RingInitialMembers *initial_members;
565 gboolean initial_audio, initial_video;
566 RingConferenceChannel *channel;
567 GError *error = NULL;
568
569 if (self->priv->call_service == NULL)
570 {
571 tp_channel_manager_emit_request_failed (self, request,
572 TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
573 "Modem does not support conferences");
574 return TRUE;
575 }
576
577 initial_members = tp_asv_get_initial_members (properties);
578 initial_audio = tp_asv_get_initial_audio (properties, TRUE);
579 initial_video = tp_asv_get_initial_video (properties, FALSE);
580
581 if (initial_video)
582 {
583 tp_channel_manager_emit_request_failed (self, request,
584 TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
585 "Video calls are not supported");
586 return TRUE;
587 }
588
589 if (tp_asv_get_uint32 (properties,
590 TP_IFACE_CHANNEL ".TargetHandleType", NULL) != 0)
591 {
592 tp_channel_manager_emit_request_failed (self, request,
593 TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
594 "Invalid TargetHandleType");
595 return TRUE;
596 }
597
598 channel = conference_manager_find_existing (self, initial_members);
599 if (channel)
600 {
601 tp_channel_manager_emit_request_already_satisfied (self, request,
602 TP_EXPORTABLE_CHANNEL (channel));
603 return TRUE;
604 }
605
606 if (!ring_conference_manager_validate_initial_members (self,
607 initial_members, &error))
608 {
609 tp_channel_manager_emit_request_failed (self, request,
610 error->domain, error->code, error->message);
611 g_clear_error (&error);
612 return TRUE;
613 }
614
615 channel = conference_manager_new_conference (self,
616 initial_members, initial_audio);
617
618 if (initial_audio)
619 ring_conference_channel_initial_audio (channel);
620
621 conference_manager_emit_new_channel (self, request, channel, NULL);
622
623 return TRUE;
624 }
625
626 gboolean
627 ring_conference_manager_validate_initial_members (RingConferenceManager *self,
628 RingInitialMembers *initial,
629 GError **error)
630 {
631 RingConferenceManagerPrivate *priv = self->priv;
632 RingMemberChannel *ch1, *ch2;
633
634 if (initial == NULL) {
635 g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
636 "No initial members");
637 return FALSE;
638 }
639
640 if (initial->len != 2) {
641 g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
642 "Expecting exactly two initial members");
643 return FALSE;
644 }
645
646 ch1 = ring_connection_lookup_channel (priv->connection, initial->odata[0]);
647 ch2 = ring_connection_lookup_channel (priv->connection, initial->odata[1]);
648
649 if (ch1 == ch2) {
650 g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
651 "Expecting distinct initial members");
652 return FALSE;
653 }
654
655 if (!RING_IS_MEMBER_CHANNEL (ch1) || !RING_IS_MEMBER_CHANNEL (ch2)) {
656 g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
657 "Initial member is not a MediaStream channel");
658 return FALSE;
659 }
660
661 if (!ring_member_channel_can_become_member (ch1, error)) {
662 g_prefix_error (error, "First initial: ");
663 return FALSE;
664 }
665
666 if (!ring_member_channel_can_become_member (ch2, error)) {
667 g_prefix_error (error, "Second initial: ");
668 return FALSE;
669 }
670
671 return TRUE;
672 }
673
674 #ifdef nomore
675 static void
676 on_modem_call_conference_joined (ModemCallConference *mcc,
677 ModemCall *mc,
678 RingConferenceManager *self)
679 {
680 RingConferenceManagerPrivate *priv = RING_CONFERENCE_MANAGER (self)->priv;
681 ModemCall **members;
682 GPtrArray *initial;
683 guint i;
684
685 if (modem_call_get_handler (MODEM_CALL (mcc)))
686 return;
687
688 members = modem_call_service_get_calls (priv->call_service);
689 initial = g_ptr_array_sized_new (MODEM_MAX_CALLS + 1);
690
691 for (i = 0; members[i]; i++)
692 {
693 if (modem_call_is_member (members[i]) &&
694 modem_call_get_handler (members[i]))
695 {
696 RingMemberChannel *member;
697 char *object_path = NULL;
698
699 member = RING_MEMBER_CHANNEL (modem_call_get_handler (members[i]));
700 g_object_get (member, "object-path", &object_path, NULL);
701
702 if (object_path)
703 g_ptr_array_add (initial, object_path);
704 }
705 }
706
707 if (initial->len >= 2)
708 {
709 RingConferenceChannel *channel;
710 char *object_path;
711
712 object_path = ring_conference_manager_new_object_path (self);
713
714 channel = (RingConferenceChannel *)
715 g_object_new (RING_TYPE_CONFERENCE_CHANNEL,
716 "connection", priv->connection,
717 "call-instance", mcc,
718 /* KVXXX: "tones", priv->tones, */
719 "object-path", object_path,
720 "initial-channels", initial,
721 "initial-audio", TRUE,
722 "initiator-handle", tp_base_connection_get_self_handle (
723 TP_BASE_CONNECTION (priv->connection)),
724 "requested", TRUE,
725 NULL);
726
727 g_free (object_path);
728
729 g_assert (channel == modem_call_get_handler (MODEM_CALL (mcc)));
730
731 conference_manager_emit_new_channel (self, NULL, channel, NULL);
732 }
733
734 g_ptr_array_add (initial, NULL);
735 g_strfreev ((char **)g_ptr_array_free (initial, FALSE));
736 g_free (members);
737 }
738 #endif
0 /*
1 * ring-conference-manager.h - Manager for conference channels
2 *
3 * Copyright (C) 2007-2010 Nokia Corporation
4 * @author Pekka Pessi <first.surname@nokia.com>
5 *
6 * This work is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This work is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this work; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef RING_CONFERENCE_MANAGER_H
22 #define RING_CONFERENCE_MANAGER_H
23
24 #include <telepathy-glib/channel-manager.h>
25 #include <ring-util.h>
26 #include "modem/call.h"
27
28 G_BEGIN_DECLS
29
30 typedef struct _RingConferenceManager RingConferenceManager;
31 typedef struct _RingConferenceManagerClass RingConferenceManagerClass;
32 typedef struct _RingConferenceManagerPrivate RingConferenceManagerPrivate;
33
34 G_END_DECLS
35
36 #include <ring-conference-channel.h>
37
38 G_BEGIN_DECLS
39
40 struct _RingConferenceManagerClass {
41 GObjectClass parent_class;
42 };
43
44 struct _RingConferenceManager {
45 GObject parent;
46 RingConferenceManagerPrivate *priv;
47 };
48
49 GType ring_conference_manager_get_type (void);
50
51 /* TYPE MACROS */
52 #define RING_TYPE_CONFERENCE_MANAGER \
53 (ring_conference_manager_get_type())
54 #define RING_CONFERENCE_MANAGER(obj) \
55 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
56 RING_TYPE_CONFERENCE_MANAGER, RingConferenceManager))
57 #define RING_CONFERENCE_MANAGER_CLASS(cls) \
58 (G_TYPE_CHECK_CLASS_CAST ((cls), \
59 RING_TYPE_CONFERENCE_MANAGER, RingConferenceManagerClass))
60 #define RING_IS_CONFERENCE_MANAGER(obj) \
61 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
62 RING_TYPE_CONFERENCE_MANAGER))
63 #define RING_IS_CONFERENCE_MANAGER_CLASS(cls) \
64 (G_TYPE_CHECK_CLASS_TYPE ((cls), \
65 RING_TYPE_CONFERENCE_MANAGER))
66 #define RING_CONFERENCE_MANAGER_GET_CLASS(obj) \
67 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
68 RING_TYPE_CONFERENCE_MANAGER, RingConferenceManagerClass))
69
70 RingConferenceChannel *ring_conference_manager_lookup (RingConferenceManager *,
71 char const *object_path);
72
73 gboolean ring_conference_manager_validate_initial_members (
74 RingConferenceManager *, RingInitialMembers *, GError **error);
75
76 G_END_DECLS
77
78 #endif
4242 #include "ring-protocol.h"
4343
4444 #include "modem/service.h"
45 #include "modem/sim.h"
46 #include "modem/call.h"
47 #include "modem/sms.h"
4548
4649 #include <telepathy-glib/errors.h>
4750
98101 parent_class->new_connection = NULL;
99102 parent_class->cm_dbus_name = "ring";
100103 parent_class->protocol_params = NULL;
104
105 modem_oface_register_type (MODEM_TYPE_SIM_SERVICE);
106 modem_oface_register_type (MODEM_TYPE_SMS_SERVICE);
107 modem_oface_register_type (MODEM_TYPE_CALL_SERVICE);
101108 }
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
55 * @author Lassi Syrjala <first.surname@nokia.com>
6 * @author Tom Swindell <t.swindell@rubyx.co.uk>
67 *
78 * This work is free software; you can redistribute it and/or
89 * modify it under the terms of the GNU Lesser General Public
2425
2526 #include "ring-connection.h"
2627 #include "ring-emergency-service.h"
28
2729 #include "ring-media-manager.h"
30 #include "ring-conference-manager.h"
2831 #include "ring-text-manager.h"
2932
3033 #include "ring-param-spec.h"
5255 #include "modem/call.h"
5356 #include "modem/sms.h"
5457
55 #include <sms-glib/utils.h>
56
5758 #include <dbus/dbus-glib.h>
5859
5960 #include <stdio.h>
7475
7576 RingMediaManager *media;
7677 RingTextManager *text;
78 RingConferenceManager *conference;
7779
7880 gchar *modem_path;
7981 Modem *modem;
246248 g_object_unref(self->priv->sim);
247249
248250 G_OBJECT_CLASS(ring_connection_parent_class)->dispose(object);
249 g_assert(self->parent.self_handle == 0); /* unref'd by base class */
250251 }
251252
252253 void
370371 break;
371372 case PROP_STORED_MESSAGES:
372373 #if nomore
373 g_value_take_boxed(value, ring_text_manager_list_stored_messages(priv->text));
374 g_value_take_boxed(value,
375 ring_text_manager_list_stored_messages (priv->text));
374376 #endif
375377 break;
376378
377379 case PROP_KNOWN_SERVICE_POINTS:
378 g_value_take_boxed(value, ring_media_manager_emergency_services(priv->media));
380 g_value_take_boxed(value,
381 ring_media_manager_emergency_services (priv->media));
379382 break;
380383
381384 case PROP_ANON_MANDATORY:
808811
809812 s[j] = s[i];
810813
811 if (modem_call_is_valid_address(s) || sms_g_is_valid_sms_address(s))
814 if (modem_call_is_valid_address (s) || modem_sms_is_valid_address (s))
812815 return s;
813816
814817 if (g_utf8_strlen(input, -1) <= 11)
869872
870873 priv->media =
871874 g_object_new(RING_TYPE_MEDIA_MANAGER,
872 "connection", self,
873 "anon-modes", priv->anon_modes,
874 NULL);
875 "connection", self,
876 "anon-modes", priv->anon_modes,
877 NULL);
875878 g_ptr_array_add(channel_managers, priv->media);
879
880 priv->conference =
881 g_object_new (RING_TYPE_CONFERENCE_MANAGER,
882 "connection", self,
883 NULL);
884 g_ptr_array_add(channel_managers, priv->conference);
876885
877886 priv->text =
878887 g_object_new(RING_TYPE_TEXT_MANAGER,
931940 else if (MODEM_IS_CALL_SERVICE (oface))
932941 {
933942 g_object_set (priv->media, "call-service", oface, NULL);
943 g_object_set (priv->conference, "call-service", oface, NULL);
934944 }
935945 else if (MODEM_IS_SMS_SERVICE (oface))
936946 {
951961
952962 if (MODEM_IS_SIM_SERVICE (oface))
953963 {
954 DEBUG ("active SIM_SERVICE");
964 DEBUG ("removed SIM_SERVICE");
955965 g_object_set (self, "sim-service", NULL, NULL);
956966 }
957967 else if (MODEM_IS_CALL_SERVICE (oface))
958968 {
959 DEBUG ("active CALL_SERVICE");
969 DEBUG ("removed CALL_SERVICE");
960970 g_assert (priv->media);
961971 g_object_set (priv->media, "call-service", NULL, NULL);
972 g_object_set (priv->conference, "call-service", NULL, NULL);
962973 }
963974 else if (MODEM_IS_SMS_SERVICE (oface))
964975 {
965 DEBUG ("active SMS_SERVICE");
976 DEBUG ("removed SMS_SERVICE");
966977 g_assert (priv->text);
967978 g_object_set (priv->text, "sms-service", NULL, NULL);
968979 }
980 }
981
982 ModemOface *
983 ring_connection_get_modem_interface (RingConnection *self, char const *name)
984 {
985 return modem_get_interface (self->priv->modem, name);
969986 }
970987
971988 static void
9881005 TP_CONNECTION_STATUS_REASON_REQUESTED);
9891006 }
9901007
991 static gboolean
992 ring_connection_connecting_timeout (gpointer _self)
1008 static void
1009 ring_connection_imsi_added (ModemService *modems,
1010 Modem *modem,
1011 char const *imsi,
1012 gpointer _self)
9931013 {
9941014 RingConnection *self = RING_CONNECTION (_self);
1015 RingConnectionPrivate *priv = self->priv;
1016
1017 DEBUG ("enter with imsi=%s", imsi);
1018
1019 if (priv->modem)
1020 return;
1021
1022 if (modem_has_imsi (modem, priv->imsi))
1023 ring_connection_bind_modem (self, modem);
1024 }
1025
1026 static void
1027 ring_connection_imei_added (ModemService *modems,
1028 Modem *modem,
1029 char const *imei,
1030 gpointer _self)
1031 {
1032 RingConnection *self = RING_CONNECTION (_self);
1033 RingConnectionPrivate *priv = self->priv;
1034
1035 DEBUG ("enter with imei=%s", imei);
1036
1037 if (priv->modem)
1038 return;
1039
1040 if (modem_has_imei (modem, priv->imei))
1041 ring_connection_bind_modem (self, modem);
1042 }
1043
1044 static void
1045 ring_connection_modem_added (ModemService *modems,
1046 Modem *modem,
1047 gpointer _self)
1048 {
1049 RingConnection *self = RING_CONNECTION (_self);
1050 RingConnectionPrivate *priv = self->priv;
1051
1052 DEBUG ("enter with modem %s", modem_get_modem_path (modem));
1053
1054 if (priv->modem)
1055 return;
1056
1057 if (strcmp (priv->modem_path, modem_get_modem_path (modem)))
1058 return;
1059
1060 ring_connection_bind_modem (self, modem);
1061 }
1062
1063 static void
1064 ring_connection_modem_powered (ModemService *modems,
1065 Modem *modem,
1066 gpointer _self)
1067 {
1068 RingConnection *self = RING_CONNECTION (_self);
1069 RingConnectionPrivate *priv = self->priv;
1070
1071 DEBUG ("enter with modem %s", modem_get_modem_path (modem));
1072
1073 if (priv->modem)
1074 return;
1075
1076 ring_connection_bind_modem (self, modem);
1077 }
1078
1079 static void
1080 ring_connection_modem_removed (ModemService *modems,
1081 Modem *modem,
1082 gpointer _self)
1083 {
9951084 TpBaseConnection *base = TP_BASE_CONNECTION (_self);
996 RingConnectionPrivate *priv = self->priv;
9971085
9981086 DEBUG ("enter");
9991087
1000 priv->connecting_source = 0;
1088 if (RING_CONNECTION (_self)->priv->modem != modem)
1089 return;
10011090
10021091 if (base->status != TP_CONNECTION_STATUS_DISCONNECTED)
10031092 {
10051094 TP_CONNECTION_STATUS_DISCONNECTED,
10061095 TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
10071096 }
1008
1009 return FALSE;
1010 }
1011
1012 static void
1013 ring_connection_imsi_added (ModemService *modems,
1014 Modem *modem,
1015 char const *imsi,
1016 gpointer _self)
1017 {
1018 RingConnection *self = RING_CONNECTION (_self);
1019 RingConnectionPrivate *priv = self->priv;
1020
1021 DEBUG ("enter with imsi=%s", imsi);
1022
1023 if (priv->modem)
1024 return;
1025
1026 if (modem_has_imsi (modem, priv->imsi))
1027 ring_connection_bind_modem (self, modem);
1028 }
1029
1030 static void
1031 ring_connection_imei_added (ModemService *modems,
1032 Modem *modem,
1033 char const *imei,
1034 gpointer _self)
1035 {
1036 RingConnection *self = RING_CONNECTION (_self);
1037 RingConnectionPrivate *priv = self->priv;
1038
1039 DEBUG ("enter with imei=%s", imei);
1040
1041 if (priv->modem)
1042 return;
1043
1044 if (modem_has_imei (modem, priv->imei))
1045 ring_connection_bind_modem (self, modem);
1046 }
1047
1048 static void
1049 ring_connection_modem_added (ModemService *modems,
1050 Modem *modem,
1051 gpointer _self)
1052 {
1053 RingConnection *self = RING_CONNECTION (_self);
1054 RingConnectionPrivate *priv = self->priv;
1055
1056 DEBUG ("enter with modem %s", modem_get_modem_path (modem));
1057
1058 if (priv->modem)
1059 return;
1060
1061 if (strcmp (priv->modem_path, modem_get_modem_path (modem)))
1062 return;
1063
1064 ring_connection_bind_modem (self, modem);
1065 }
1066
1067 static void
1068 ring_connection_modem_powered (ModemService *modems,
1069 Modem *modem,
1070 gpointer _self)
1071 {
1072 RingConnection *self = RING_CONNECTION (_self);
1073 RingConnectionPrivate *priv = self->priv;
1074
1075 DEBUG ("enter with modem %s", modem_get_modem_path (modem));
1076
1077 if (priv->modem)
1078 return;
1079
1080 ring_connection_bind_modem (self, modem);
1081 }
1082
1083 static void
1084 ring_connection_modem_removed (ModemService *modems,
1085 Modem *modem,
1086 gpointer _self)
1087 {
1088 TpBaseConnection *base = TP_BASE_CONNECTION (_self);
1089
1090 DEBUG ("enter");
1091
1092 if (RING_CONNECTION (_self)->priv->modem != modem)
1093 return;
1094
1095 if (base->status != TP_CONNECTION_STATUS_DISCONNECTED)
1096 {
1097 tp_base_connection_change_status (base,
1098 TP_CONNECTION_STATUS_DISCONNECTED,
1099 TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
1100 }
11011097 }
11021098
11031099 static gboolean
11151111 g_assert(base->status == TP_INTERNAL_CONNECTION_STATUS_NEW);
11161112
11171113 error = NULL;
1118
1119 priv->connecting_source = g_timeout_add_seconds (30,
1120 ring_connection_connecting_timeout, self);
11211114
11221115 manager = modem_service ();
11231116
13041297 }
13051298
13061299 gpointer
1307 ring_connection_lookup_channel(RingConnection const *self,
1308 char const *object_path)
1309 {
1300 ring_connection_lookup_channel (RingConnection const *self,
1301 char const *object_path)
1302 {
1303 RingConnectionPrivate *priv = RING_CONNECTION(self)->priv;
13101304 gpointer channel;
13111305
1312 channel = ring_media_manager_lookup(self->priv->media, object_path);
1313 if (channel == NULL)
1314 channel = ring_text_manager_lookup(self->priv->text, object_path);
1306 channel = ring_media_manager_lookup (priv->media, object_path);
1307 if (channel)
1308 return channel;
1309
1310 channel = ring_text_manager_lookup (priv->text, object_path);
1311 if (channel)
1312 return channel;
1313
1314 channel = ring_conference_manager_lookup (priv->conference, object_path);
13151315
13161316 return channel;
13171317 }
14251425 char const **messages,
14261426 DBusGMethodInvocation *context)
14271427 {
1428 #if nomore
14291428 ring_text_manager_expunge_messages(
14301429 RING_CONNECTION(iface)->priv->text,
14311430 messages,
14321431 context);
1433 #endif
14341432 }
14351433
14361434 static void
14391437 gboolean out_of_storage,
14401438 DBusGMethodInvocation *context)
14411439 {
1442 #if nomore
14431440 ring_text_manager_set_storage_state(
14441441 RING_CONNECTION(iface)->priv->text,
14451442 out_of_storage,
14461443 context);
1447 #endif
14481444 }
14491445
14501446 static void
22 *
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
56 *
67 * This work is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU Lesser General Public
2223 #define RING_CONNECTION_H
2324
2425 #include <glib-object.h>
26
2527 #include <telepathy-glib/base-connection.h>
2628 #include <telepathy-glib/base-connection-manager.h>
2729 #include <telepathy-glib/contacts-mixin.h>
28 #include <ring-util.h>
30
31 #include "ring-util.h"
2932
3033 G_BEGIN_DECLS
3134
8689 RingInitialMembers *initial,
8790 GError **error);
8891
92 struct _ModemOface *ring_connection_get_modem_interface (RingConnection *,
93 char const *);
94
8995 G_END_DECLS
9096
9197 #endif /* #ifndef RING_CONNECTION_H */
22 *
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 * Copyright (C) 2013 Jolla Ltd
56 *
67 * This work is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU Lesser General Public
6869
6970 struct _RingMediaChannelPrivate
7071 {
71 char *object_path;
72
7372 GQueue requests[1]; /* Requests towards the modem */
7473
7574 uint8_t state;
8079 uint8_t requested; /* Hold state requested by client */
8180 } hold;
8281
83 unsigned requested:1; /* property */
8482 unsigned initial_audio:1; /* property */
8583
86 unsigned closing:1, closed:1;
84 unsigned disposed:1;
85 unsigned closing:1;
8786 unsigned :0;
8887
8988 ModemRequest *control;
9190 ModemTones *tones;
9291
9392 guint close_timer;
94
95 struct stream_state {
96 guint id; /* nonzero when active, 0 otherwise */
97 TpHandle handle;
98 TpMediaStreamType type;
99 TpMediaStreamState state;
100 TpMediaStreamDirection direction;
101 TpMediaStreamPendingSend pending;
102 } audio[1], video[1];
10393
10494 struct {
10595 ModemRequest *request;
120110 /* properties */
121111 enum {
122112 PROP_NONE,
123 /* telepathy-glib properties */
124 PROP_OBJECT_PATH,
125 PROP_CHANNEL_PROPERTIES,
126 PROP_CHANNEL_DESTROYED,
127 PROP_CHANNEL_TYPE, /* o.f.T.Channel.ChannelType */
128 PROP_TARGET, /* o.f.T.Channel.TargetHandle */
129 PROP_TARGET_ID, /* o.f.T.Channel.TargetID */
130 PROP_TARGET_TYPE, /* o.f.T.Channel.HandleType */
131113
132114 /* DBUs properties */
133 PROP_INTERFACES, /* o.f.T.Channel.Interfaces */
134
135 PROP_REQUESTED, /* o.f.T.Channel.Requested */
136 PROP_INITIATOR, /* o.f.T.Channel.InitiatorHandle */
137 PROP_INITIATOR_ID, /* o.f.T.Channel.InitiatorID */
138
139115 PROP_HOLD_STATE, /* o.f.T.Channel.Interface.Hold */
140116 PROP_HOLD_REASON, /* o.f.T.Channel.Interface.Hold */
141117
145121
146122 /* ring-specific properties */
147123 PROP_PEER,
148 PROP_CONNECTION,
149 PROP_CALL_SERVICE,
150124 PROP_CALL_INSTANCE,
151125 PROP_TONES,
152126
153127 LAST_PROPERTY
154128 };
155129
156 enum {
157 RING_MEDIA_STREAM_ID_AUDIO = 1,
158 RING_MEDIA_STREAM_ID_VIDEO = 2
159 };
160
161 static TpDBusPropertiesMixinIfaceImpl
162 ring_media_channel_dbus_property_interfaces[];
163 static void ring_media_channel_channel_iface_init(gpointer, gpointer);
164 static void ring_media_channel_streamed_media_iface_init(gpointer, gpointer);
130 static void ring_media_channel_fill_immutable_properties(TpBaseChannel *base,
131 GHashTable *props);
165132 static void ring_media_channel_dtmf_iface_init(gpointer, gpointer);
166133
167134 static void ring_channel_hold_iface_init(gpointer, gpointer);
170137 #endif
171138
172139 G_DEFINE_TYPE_WITH_CODE(
173 RingMediaChannel, ring_media_channel, G_TYPE_OBJECT,
140 RingMediaChannel, ring_media_channel, TP_TYPE_BASE_CHANNEL,
174141 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
175142 tp_dbus_properties_mixin_iface_init);
176 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL,
177 ring_media_channel_channel_iface_init);
178143 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_DTMF,
179144 ring_media_channel_dtmf_iface_init);
180145 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD,
184149 G_IMPLEMENT_INTERFACE(RTCOM_TYPE_TP_SVC_CHANNEL_INTERFACE_DIAL_STRINGS,
185150 ring_channel_dial_strings_iface_init);
186151 #endif
187 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_TYPE_STREAMED_MEDIA,
188 ring_media_channel_streamed_media_iface_init);
189 G_IMPLEMENT_INTERFACE(TP_TYPE_EXPORTABLE_CHANNEL, NULL);
190 G_IMPLEMENT_INTERFACE(TP_TYPE_CHANNEL_IFACE, NULL);
152 G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_STREAMED_MEDIA,
153 ring_streamed_media_mixin_iface_init);
191154 );
192
193 static int ring_media_channel_update_audio(RingMediaChannel *self,
194 TpHandle handle,
195 TpMediaStreamState state,
196 TpMediaStreamDirection direction,
197 TpMediaStreamPendingSend pending);
198155
199156 static void ring_media_channel_set_call_instance(RingMediaChannel *self,
200157 ModemCall *ci);
236193 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(
237194 self, RING_TYPE_MEDIA_CHANNEL, RingMediaChannelPrivate);
238195 self->priv->hold.requested = -1;
196
197 ring_streamed_media_mixin_init (G_OBJECT(self),
198 G_STRUCT_OFFSET(RingMediaChannel, streamed_media));
239199 }
240200
241201 static void
242202 ring_media_channel_constructed(GObject *object)
243203 {
244204 RingMediaChannel *self = RING_MEDIA_CHANNEL(object);
245 RingMediaChannelPrivate *priv = self->priv;
205 TpBaseChannel *base = TP_BASE_CHANNEL (self);
206 const gchar *object_path;
246207
247208 if (G_OBJECT_CLASS(ring_media_channel_parent_class)->constructed)
248209 G_OBJECT_CLASS(ring_media_channel_parent_class)->constructed(object);
249210
211 object_path = tp_base_channel_get_object_path (base);
212 g_assert(object_path != NULL);
213
214 self->nick = strrchr(object_path, '/');
215 g_assert (self->nick++ != NULL);
216
250217 DEBUG("(%p) with %s", self, self->nick);
251218
252 g_assert(self->call_service);
253
254 dbus_g_connection_register_g_object(tp_get_bus(), priv->object_path, object);
219 tp_base_channel_register (base);
255220 }
256221
257222 static void
262227 {
263228 RingMediaChannel *self = RING_MEDIA_CHANNEL(obj);
264229 RingMediaChannelPrivate *priv = self->priv;
265 guint initiator;
266 char const *id;
267230
268231 switch (property_id) {
269 case PROP_OBJECT_PATH:
270 g_value_set_string (value, priv->object_path);
271 break;
272 case PROP_CHANNEL_DESTROYED:
273 g_value_set_boolean(value, TRUE);
274 break;
275 case PROP_CHANNEL_PROPERTIES:
276 g_value_take_boxed(value, ring_media_channel_properties(self));
277 break;
278 case PROP_CHANNEL_TYPE:
279 g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA);
280 break;
281232 case PROP_PEER:
282233 g_value_set_uint(value, 0);
283234 break;
284 case PROP_TARGET:
285 g_value_set_uint(value, 0);
286 break;
287 case PROP_TARGET_TYPE:
288 g_value_set_uint(value, 0);
289 break;
290 case PROP_TARGET_ID:
291 g_value_set_static_string(value, "");
292 break;
293 case PROP_INITIATOR:
294 initiator = tp_base_connection_get_self_handle(
295 TP_BASE_CONNECTION(self->connection));
296 g_value_set_uint(value, initiator);
297 break;
298 case PROP_INITIATOR_ID:
299 initiator = tp_base_connection_get_self_handle(
300 TP_BASE_CONNECTION(self->connection));
301 id = ring_connection_inspect_contact(self->connection, initiator);
302 g_value_set_static_string(value, id);
303 break;
304 case PROP_REQUESTED:
305 g_value_set_boolean(value, priv->requested);
306 break;
307235 case PROP_HOLD_STATE:
308236 g_value_set_uint(value, priv->hold.state);
309237 break;
318246 break;
319247 case PROP_IMMUTABLE_STREAMS:
320248 g_value_set_boolean(value, TRUE);
321 break;
322 case PROP_CONNECTION:
323 g_value_set_object(value, self->connection);
324 break;
325 case PROP_CALL_SERVICE:
326 g_value_set_pointer(value, self->call_service);
327249 break;
328250 case PROP_CALL_INSTANCE:
329251 g_value_set_pointer(value, self->call_instance);
344266 RingMediaChannelPrivate *priv = self->priv;
345267
346268 switch (property_id) {
347 case PROP_OBJECT_PATH:
348 priv->object_path = g_value_dup_string(value);
349 self->nick = strrchr(priv->object_path, '/');
350 if (!self->nick++) self->nick = "";
351 DEBUG("(%p) with nick '%s'", self, self->nick);
352 break;
353 case PROP_CHANNEL_TYPE:
354 case PROP_INITIATOR:
355 case PROP_TARGET:
356 case PROP_TARGET_TYPE:
357269 case PROP_PEER:
358270 /* these property is writable in the interface, but not actually
359271 * meaningfully changable on this channel, so we do nothing */
360272 break;
361 case PROP_REQUESTED:
362 priv->requested = g_value_get_boolean(value);
363 break;
364273 case PROP_HOLD_STATE:
365274 priv->hold.state = g_value_get_uint(value);
366275 break;
369278 break;
370279 case PROP_INITIAL_AUDIO:
371280 priv->initial_audio = g_value_get_boolean(value);
372 break;
373 case PROP_CONNECTION:
374 self->connection = g_value_get_object(value);
375 break;
376 case PROP_CALL_SERVICE:
377 if (self->call_service)
378 g_object_unref (self->call_service);
379 self->call_service = g_value_get_pointer (value);
380 if (self->call_service)
381 g_object_ref (MODEM_CALL_SERVICE (self->call_service));
382281 break;
383282 case PROP_CALL_INSTANCE:
384283 ring_media_channel_set_call_instance (self, g_value_get_pointer (value));
399298 RingMediaChannel *self = RING_MEDIA_CHANNEL (object);
400299 RingMediaChannelPrivate *priv = self->priv;
401300
301 if (self->priv->disposed)
302 return;
303 self->priv->disposed = TRUE;
304
402305 ring_media_channel_close(self);
403306
404307 if (priv->close_timer)
407310 if (priv->playing)
408311 modem_tones_stop(priv->tones, priv->playing);
409312
313 /* if still holding on to a call instance, disconnect */
314 if (self->call_instance)
315 g_object_set(self, "call-instance", NULL, NULL);
316
410317 ((GObjectClass *)ring_media_channel_parent_class)->dispose(object);
411318 }
412319
416323 {
417324 RingMediaChannel *self = RING_MEDIA_CHANNEL(object);
418325 RingMediaChannelPrivate *priv = self->priv;
419
420 char const *nick = self->nick;
421 char *object_path = priv->object_path;
326 gchar *nick = g_strdup (self->nick);
327
328 ring_streamed_media_mixin_finalize (object);
422329
423330 g_free(priv->dial.string);
424331
425 memset(priv->audio, 0, sizeof *priv->audio);
426 memset(priv->video, 0, sizeof *priv->video);
427
428332 G_OBJECT_CLASS(ring_media_channel_parent_class)->finalize(object);
429333
430 DEBUG("(%p) on %s", (gpointer)object, nick);
431
432 g_free(object_path);
334 DEBUG("(%p) on %s", object, nick);
335 g_free(nick);
433336 }
434337
435338 /* ====================================================================== */
439342 ring_media_channel_class_init(RingMediaChannelClass *klass)
440343 {
441344 GObjectClass *object_class = G_OBJECT_CLASS(klass);
345 TpBaseChannelClass *base_chan_class = TP_BASE_CHANNEL_CLASS (klass);
442346
443347 g_type_class_add_private(klass, sizeof (RingMediaChannelPrivate));
444348
448352 object_class->dispose = ring_media_channel_dispose;
449353 object_class->finalize = ring_media_channel_finalize;
450354
451 klass->dbus_properties_class.interfaces =
452 ring_media_channel_dbus_property_interfaces;
453 tp_dbus_properties_mixin_class_init(object_class,
454 G_STRUCT_OFFSET(RingMediaChannelClass, dbus_properties_class));
455
456 g_object_class_override_property(
457 object_class, PROP_OBJECT_PATH, "object-path");
458
459 g_object_class_override_property(
460 object_class, PROP_CHANNEL_PROPERTIES, "channel-properties");
461
462 g_object_class_override_property(
463 object_class, PROP_CHANNEL_DESTROYED, "channel-destroyed");
464
465 g_object_class_override_property(
466 object_class, PROP_CHANNEL_TYPE, "channel-type");
467
468 g_object_class_override_property(
469 object_class, PROP_TARGET_TYPE, "handle-type");
470
471 g_object_class_override_property(
472 object_class, PROP_TARGET, "handle");
473
474 g_object_class_install_property(
475 object_class, PROP_TARGET_ID, ring_param_spec_handle_id(0));
476
477 g_object_class_install_property(
478 object_class, PROP_INTERFACES, ring_param_spec_interfaces());
479
480 g_object_class_install_property(
481 object_class, PROP_REQUESTED,
482 ring_param_spec_requested(G_PARAM_CONSTRUCT_ONLY));
483
484 g_object_class_install_property(
485 object_class, PROP_INITIATOR, ring_param_spec_initiator(0));
486
487 g_object_class_install_property(
488 object_class, PROP_INITIATOR_ID, ring_param_spec_initiator_id(0));
355 base_chan_class->channel_type = TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA;
356 base_chan_class->close = (TpBaseChannelCloseFunc) ring_media_channel_close;
357 base_chan_class->fill_immutable_properties =
358 ring_media_channel_fill_immutable_properties;
489359
490360 g_object_class_install_property(
491361 object_class, PROP_HOLD_STATE,
510380 G_PARAM_STATIC_STRINGS));
511381
512382 g_object_class_install_property(
513 object_class, PROP_CONNECTION, ring_param_spec_connection());
514
515 g_object_class_install_property(
516383 object_class, PROP_PEER,
517384 g_param_spec_uint("peer",
518385 "Peer handle",
552419 G_PARAM_STATIC_STRINGS));
553420
554421 g_object_class_install_property (object_class,
555 PROP_CALL_SERVICE,
556 g_param_spec_pointer ("call-service",
557 "ModemCallService Object",
558 "ModemCallService for this channel",
559 /* MODEM_TYPE_CALL_SERVICE, */
560 G_PARAM_READWRITE |
561 G_PARAM_CONSTRUCT_ONLY |
562 G_PARAM_STATIC_STRINGS));
563
564 g_object_class_install_property (object_class,
565422 PROP_CALL_INSTANCE,
566423 g_param_spec_pointer ("call-instance",
567424 "ModemCall Object",
586443 * org.freedesktop.DBus properties
587444 */
588445
589 /* Properties for org.freedesktop.Telepathy.Channel */
590 static TpDBusPropertiesMixinPropImpl channel_properties[] = {
591 { "ChannelType", "channel-type", NULL },
592 { "Interfaces", "interfaces", NULL },
593 { "TargetHandle", "handle", NULL },
594 { "TargetID", "handle-id", NULL },
595 { "TargetHandleType", "handle-type", NULL },
596 { "Requested", "requested" },
597 { "InitiatorHandle", "initiator" },
598 { "InitiatorID", "initiator-id" },
599 { NULL },
600 };
601
602 static TpDBusPropertiesMixinPropImpl media_properties[] = {
603 { "InitialAudio", "initial-audio", NULL },
604 { "InitialVideo", "initial-video", NULL },
605 { "ImmutableStreams", "immutable-streams", NULL },
606 { NULL }
607 };
608
609 static TpDBusPropertiesMixinIfaceImpl
610 ring_media_channel_dbus_property_interfaces[] = {
611 {
612 TP_IFACE_CHANNEL,
613 tp_dbus_properties_mixin_getter_gobject_properties,
614 NULL,
615 channel_properties,
616 },
617 {
618 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
619 tp_dbus_properties_mixin_getter_gobject_properties,
620 NULL,
621 media_properties,
622 },
623 { NULL }
624 };
625
626
627 /** Return a hash describing channel properties
628 *
629 * A channel's properties are constant for its lifetime on the bus, so
630 * this property should only change when the closed signal is emitted (so
631 * that respawned channels can reappear on the bus with different
632 * properties).
633 */
634 GHashTable *
635 ring_media_channel_properties(RingMediaChannel *self)
636 {
637 return
638 tp_dbus_properties_mixin_make_properties_hash (
639 G_OBJECT(self),
640 TP_IFACE_CHANNEL, "ChannelType",
641 TP_IFACE_CHANNEL, "Interfaces",
642 TP_IFACE_CHANNEL, "TargetHandle",
643 TP_IFACE_CHANNEL, "TargetHandleType",
644 TP_IFACE_CHANNEL, "TargetID",
645 TP_IFACE_CHANNEL, "InitiatorHandle",
646 TP_IFACE_CHANNEL, "InitiatorID",
647 TP_IFACE_CHANNEL, "Requested",
648 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "InitialAudio",
649 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "InitialVideo",
650 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "ImmutableStreams",
651 NULL);
446 static void
447 ring_media_channel_fill_immutable_properties (TpBaseChannel *base,
448 GHashTable *props)
449 {
450 TP_BASE_CHANNEL_CLASS (ring_media_channel_parent_class)->
451 fill_immutable_properties (base, props);
452
453 ring_streamed_media_mixin_fill_immutable_properties (base, props);
652454 }
653455
654456 /* ====================================================================== */
457
458 ModemCallService *
459 ring_media_channel_get_call_service (RingMediaChannel *self)
460 {
461 TpBaseChannel *base = TP_BASE_CHANNEL (self);
462 TpBaseConnection *base_connection;
463 RingConnection *connection;
464 ModemOface *oface;
465
466 base_connection = tp_base_channel_get_connection (base);
467 connection = RING_CONNECTION (base_connection);
468 oface = ring_connection_get_modem_interface (connection,
469 MODEM_OFACE_CALL_MANAGER);
470
471 if (oface)
472 return MODEM_CALL_SERVICE (oface);
473 else
474 return NULL;
475 }
655476
656477 static gboolean ring_media_channel_emit_closed(RingMediaChannel *self);
657478
664485 RING_MEDIA_CHANNEL_GET_CLASS(self)->emit_initial(self);
665486
666487 if (priv->initial_audio) {
667 ring_media_channel_update_audio(self, 0,
488 ring_streamed_media_mixin_update_audio (self, 0,
668489 TP_MEDIA_STREAM_STATE_CONNECTING,
669490 TP_MEDIA_STREAM_DIRECTION_NONE,
670491 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
673494 }
674495
675496 ModemRequest *
676 ring_media_channel_queue_request(RingMediaChannel *self,
497 ring_media_channel_queue_request (RingMediaChannel *self,
677498 ModemRequest *request)
678499 {
679500 if (request)
697518 RingMediaChannelClass *cls = RING_MEDIA_CHANNEL_GET_CLASS(self);
698519 gboolean ready = TRUE;
699520
700 if (priv->closed || priv->closing)
521 if (tp_base_channel_is_destroyed (TP_BASE_CHANNEL (self)))
522 return;
523
524 if (priv->closing)
701525 return;
702526 priv->closing = TRUE;
703527
726550 ring_media_channel_emit_closed(RingMediaChannel *self)
727551 {
728552 RingMediaChannelPrivate *priv = self->priv;
553 TpBaseChannel *base = TP_BASE_CHANNEL (self);
729554 RingMediaChannelClass *cls = RING_MEDIA_CHANNEL_GET_CLASS(self);
730555
731556 if (priv->close_timer)
732557 g_source_remove(priv->close_timer), priv->close_timer = 0;
733558
734 if (priv->closed)
559 if (tp_base_channel_is_destroyed (TP_BASE_CHANNEL (self)))
735560 return FALSE;
736 priv->closed = TRUE;
737561
738562 if (priv->playing)
739563 modem_tones_stop(priv->tones, priv->playing);
744568 if (self->call_instance)
745569 g_object_set(self, "call-instance", NULL, NULL);
746570
747 tp_svc_channel_emit_closed((TpSvcChannel *)self);
748
749 DEBUG("emit Closed on %s", self->nick);
571 tp_base_channel_destroyed (base);
572
573 DEBUG("emitted Closed on %s", self->nick);
750574
751575 return FALSE;
752 }
753
754 /* ====================================================================== */
755 /**
756 * Telepathy.Channel DBus interface
757 *
758 * Close () -> nothing
759 * GetChannelType () -> s
760 * GetHandle () -> u, u
761 * GetInterfaces () -> as
762 *
763 * Signals:
764 * -> Closed ()
765 */
766
767 /** DBus method Close ( ) -> nothing
768 *
769 * Request that the channel be closed. This is not the case until the Closed
770 * signal has been emitted, and depending on the connection manager this may
771 * simply remove you from the channel on the server, rather than causing it
772 * to stop existing entirely. Some channels such as contact list channels
773 * may not be closed.
774 */
775 void
776 ring_media_channel_method_close(TpSvcChannel *iface,
777 DBusGMethodInvocation *context)
778 {
779 DEBUG("Close() called");
780 ring_media_channel_close(RING_MEDIA_CHANNEL(iface));
781 tp_svc_channel_return_from_close(context);
782 }
783
784
785 /**DBus method GetChannelType ( ) -> s
786 *
787 * Returns the interface name for the type of this channel.
788 */
789 static void
790 ring_media_channel_method_get_channel_type(TpSvcChannel *iface,
791 DBusGMethodInvocation *context)
792 {
793 char *type = NULL;
794 g_object_get(iface, "channel-type", &type, NULL);
795 tp_svc_channel_return_from_get_channel_type(context, type);
796 g_free(type);
797 }
798
799 /** DBus method GetHandle ( ) -> u, u
800 *
801 * Returns the handle type and number if this channel represents a
802 * communication with a particular contact, room or server-stored list, or
803 * zero if it is transient and defined only by its contents.
804 */
805 static void
806 ring_media_channel_method_get_handle(TpSvcChannel *iface,
807 DBusGMethodInvocation *context)
808 {
809 guint type = 0, target = 0;
810 g_object_get(iface, "handle-type", &type, "handle", &target, NULL);
811 tp_svc_channel_return_from_get_handle(context, type, target);
812 }
813
814 /** DBus method GetInterfaces ( ) -> as
815 *
816 * Get the optional interfaces implemented by the channel.
817 */
818 static void
819 ring_media_channel_method_get_interfaces(TpSvcChannel *iface,
820 DBusGMethodInvocation *context)
821 {
822 char **interfaces = NULL;
823
824 g_object_get(iface, "interfaces", &interfaces, NULL);
825
826 tp_svc_channel_return_from_get_interfaces(
827 context, (char const **)interfaces);
828
829 g_strfreev(interfaces);
830 }
831
832 static void
833 ring_media_channel_channel_iface_init(gpointer g_iface, gpointer iface_data)
834 {
835 TpSvcChannelClass *klass = (TpSvcChannelClass *)g_iface;
836
837 #define IMPLEMENT(x) \
838 tp_svc_channel_implement_##x(klass, ring_media_channel_method_##x)
839 IMPLEMENT(close);
840 IMPLEMENT(get_channel_type);
841 IMPLEMENT(get_handle);
842 IMPLEMENT(get_interfaces);
843 #undef IMPLEMENT
844 }
845
846 /* ====================================================================== */
847
848 /**
849 * Telepathy.Channel.Type.StreamedMedia DBus interface - version 0.15
850 *
851 * Methods:
852 * ListStreams ( ) -> a(uuuuuu)
853 *
854 * Returns an array of structs representing the streams currently active
855 * within this channel. Each stream is identified by an unsigned integer
856 * which is unique for each stream within the channel.
857 *
858 * Returns
859 *
860 * a(uuuuuu)
861 * An array of structs containing:
862 *
863 * * the stream identifier
864 * * the contact handle who the stream is with
865 * (or 0 if the stream represents more than a single member)
866 * * the type of the stream
867 * * the current stream state
868 * * the current direction of the stream
869 * * the current pending send flags
870 *
871 *
872 * RemoveStreams ( au: streams ) -> nothing
873 *
874 * Request that the given streams are removed.
875 *
876 * Parameters
877 *
878 * streams - au
879 * An array of stream identifiers (as defined in ListStreams)
880 *
881 * Possible errors
882 *
883 * org.freedesktop.Telepathy.Error.InvalidArgument
884 * Raised when one of the provided arguments is invalid.
885 *
886 * RequestStreamDirection ( u: stream_id, u: stream_direction ) -> nothing
887 *
888 * Request a change in the direction of an existing stream. In particular,
889 * this might be useful to stop sending media of a particular type, or
890 * inform the peer that you are no longer using media that is being sent to
891 * you.
892 *
893 * Depending on the protocol, streams which are no longer sending in either
894 * direction should be removed and a StreamRemoved signal emitted. Some
895 * direction changes can be enforced locally (for example, BIDIRECTIONAL ->
896 * RECEIVE can be achieved by merely stopping sending), others may not be
897 * possible on some protocols, and some need agreement from the remote end.
898 * In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in
899 * the StreamDirectionChanged signal, and the signal emitted again without
900 * the flag to indicate the resulting direction when the remote end has
901 * accepted or rejected the change. Parameters
902 *
903 * stream_id - u
904 * The stream identifier (as defined in ListStreams)
905 * stream_direction - u
906 * The desired stream direction (a value of MediaStreamDirection)
907 *
908 * Possible errors
909 *
910 * org.freedesktop.Telepathy.Error.InvalidArgument
911 * Raised when one of the provided arguments is invalid.
912 * org.freedesktop.Telepathy.Error.NotAvailable
913 * Raised when the requested functionality is temporarily unavailable. (generic description)
914 *
915 * RequestStreams ( u: contact_handle, au: types ) -> a(uuuuuu)
916 *
917 * Request that streams be established to exchange the given types of media
918 * with the given member. In general this will try and establish a
919 * bidirectional stream, but on some protocols it may not be possible to
920 * indicate to the peer that you would like to receive media, so a send-only
921 * stream will be created initially. In the cases where the stream requires
922 * remote agreement (eg you wish to receive media from them), the
923 * StreamDirectionChanged signal will be emitted with the
924 * MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again
925 * with the flag cleared when the remote end has replied. Parameters
926 *
927 * contact_handle - u
928 * A contact handle with whom to establish the streams
929 * types - au
930 * An array of stream types (values of MediaStreamType)
931 *
932 * Returns
933 *
934 * a(uuuuuu)
935 * An array of structs (in the same order as the given stream types) containing:
936 *
937 * * the stream identifier
938 * * the contact handle who the stream is with (or 0 if the stream represents more than a single member)
939 * * the type of the stream
940 * * the current stream state
941 * * the current direction of the stream
942 * * the current pending send flags
943 *
944 * Possible errors
945 *
946 * org.freedesktop.Telepathy.Error.InvalidHandle
947 * The contact name specified is unknown on this channel or connection. (generic description)
948 * org.freedesktop.Telepathy.Error.InvalidArgument
949 * Raised when one of the provided arguments is invalid. (generic description)
950 * org.freedesktop.Telepathy.Error.NotAvailable
951 * Raised when the requested functionality is temporarily unavailable. (generic description)
952 *
953 * Signals:
954 * -> StreamAdded ( u: stream_id, u: contact_handle, u: stream_type )
955 *
956 * Emitted when a new stream has been added to this channel.
957 *
958 * Parameters
959 *
960 * stream_id - u
961 * The stream identifier (as defined in ListStreams)
962 * contact_handle - u
963 * The contact handle who the stream is with (or 0 if it represents more than a single member)
964 * stream_type - u
965 * The stream type (a value from MediaStreamType)
966 *
967 * -> StreamDirectionChanged ( u: stream_id, u: stream_direction, u: pending_flags )
968 *
969 * Emitted when the direction or pending flags of a stream are changed. If
970 * the MEDIA_STREAM_PENDING_LOCAL_SEND flag is set, the remote user has
971 * requested that we begin sending on this stream. RequestStreamDirection
972 * should be called to indicate whether or not this change is acceptable.
973 * Parameters
974 *
975 * stream_id - u
976 * The stream identifier (as defined in ListStreams)
977 * stream_direction - u
978 * The new stream direction (as defined in ListStreams)
979 * pending_flags - u
980 * The new pending send flags (as defined in ListStreams)
981 *
982 * StreamError ( u: stream_id, u: errno, s: message )
983 *
984 * Emitted when a stream encounters an error.
985 *
986 * Parameters
987 *
988 * stream_id - u
989 * The stream identifier (as defined in ListStreams)
990 * errno - u
991 * A stream error number, one of the values of MediaStreamError
992 * message - s
993 * A string describing the error (for debugging purposes only)
994 *
995 * StreamRemoved ( u: stream_id )
996 *
997 * Emitted when a stream has been removed from this channel.
998 *
999 * Parameters
1000 *
1001 * stream_id - u
1002 * stream_id - the stream identifier (as defined in ListStreams)
1003 *
1004 * StreamStateChanged ( u: stream_id, u: stream_state )
1005 *
1006 * Emitted when a member's stream's state changes.
1007 *
1008 * Parameters
1009 *
1010 * stream_id - u
1011 * The stream identifier (as defined in ListStreams)
1012 * stream_state - u
1013 * The new stream state (as defined in ListStreams)
1014 */
1015
1016 static int update_media_stream(RingMediaChannel *self,
1017 TpHandle handle,
1018 struct stream_state *ss,
1019 guint id,
1020 TpMediaStreamType type,
1021 TpMediaStreamState state,
1022 TpMediaStreamDirection direction,
1023 TpMediaStreamPendingSend pending);
1024 static GPtrArray *list_media_streams(RingMediaChannel *self);
1025 static void free_media_stream_list(GPtrArray *list);
1026 static gpointer describe_stream(struct stream_state *ss);
1027 static gpointer describe_null_media(TpMediaStreamType tptype);
1028
1029 #define TP_CHANNEL_STREAM_TYPE \
1030 (dbus_g_type_get_struct("GValueArray", \
1031 G_TYPE_UINT, \
1032 G_TYPE_UINT, \
1033 G_TYPE_UINT, \
1034 G_TYPE_UINT, \
1035 G_TYPE_UINT, \
1036 G_TYPE_UINT, \
1037 G_TYPE_INVALID))
1038
1039 /** DBus method ListStreams ( ) -> a(uuuuuu)
1040 *
1041 * Returns an array of structs representing the streams currently active
1042 * within this channel. Each stream is identified by an unsigned integer
1043 * which is unique for each stream within the channel.
1044 *
1045 * Returns
1046 *
1047 * a(uuuuuu)
1048 * An array of structs containing:
1049 *
1050 * * the stream identifier
1051 * * the contact handle who the stream is with
1052 * (or 0 if the stream represents more than a single member)
1053 * * the type of the stream
1054 * * the current stream state
1055 * * the current direction of the stream
1056 * * the current pending send flags
1057 */
1058 static void
1059 ring_media_channel_list_streams(TpSvcChannelTypeStreamedMedia *iface,
1060 DBusGMethodInvocation *context)
1061 {
1062 RingMediaChannel *self = RING_MEDIA_CHANNEL(iface);
1063 GPtrArray *list;
1064
1065 list = list_media_streams(self);
1066
1067 tp_svc_channel_type_streamed_media_return_from_list_streams(context, list);
1068
1069 free_media_stream_list(list);
1070 }
1071
1072 /** DBus method
1073 * RemoveStreams ( au: streams ) -> nothing
1074 *
1075 * Request that the given streams are removed.
1076 */
1077 static void
1078 ring_media_channel_remove_streams(TpSvcChannelTypeStreamedMedia *self,
1079 const GArray *streams,
1080 DBusGMethodInvocation *context)
1081 {
1082 GError error[] = {{
1083 TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
1084 "RemoveStreams not implemented"
1085 }};
1086
1087 /* Put call on hold? */
1088
1089 DEBUG("not implemented");
1090
1091 dbus_g_method_return_error(context, error);
1092 }
1093
1094 /** DBus method
1095 * RequestStreamDirection ( u: stream_id, u: stream_direction ) -> nothing
1096 *
1097 * Request a change in the direction of an existing stream. In particular,
1098 * this might be useful to stop sending media of a particular type, or
1099 * inform the peer that you are no longer using media that is being sent to
1100 * you.
1101 *
1102 * Depending on the protocol, streams which are no longer sending in either
1103 * direction should be removed and a StreamRemoved signal emitted. Some
1104 * direction changes can be enforced locally (for example, BIDIRECTIONAL ->
1105 * RECEIVE can be achieved by merely stopping sending), others may not be
1106 * possible on some protocols, and some need agreement from the remote end.
1107 * In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in
1108 * the StreamDirectionChanged signal, and the signal emitted again without
1109 * the flag to indicate the resulting direction when the remote end has
1110 * accepted or rejected the change. Parameters
1111 */
1112 static void
1113 ring_media_channel_request_stream_direction(
1114 TpSvcChannelTypeStreamedMedia *iface,
1115 guint stream_id,
1116 guint stream_direction,
1117 DBusGMethodInvocation *context)
1118 {
1119 GError error[] = {{
1120 TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
1121 "RequestStreamDirection not implemented"
1122 }};
1123
1124 /* Put call on hold, or resume? */
1125
1126 DEBUG("not implemented");
1127
1128 dbus_g_method_return_error(context, error);
1129 }
1130
1131 /** DBus method RequestStreams ( u: contact_handle, au: types ) -> a(uuuuuu)
1132 *
1133 * Request that streams be established to exchange the given types of media
1134 * with the given member. In general this will try and establish a
1135 * bidirectional stream, but on some protocols it may not be possible to
1136 * indicate to the peer that you would like to receive media, so a send-only
1137 * stream will be created initially. In the cases where the stream requires
1138 * remote agreement (eg you wish to receive media from them), the
1139 * StreamDirectionChanged signal will be emitted with the
1140 * MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again
1141 * with the flag cleared when the remote end has replied.
1142 *
1143 */
1144 static void
1145 ring_media_channel_request_streams(TpSvcChannelTypeStreamedMedia *iface,
1146 guint handle,
1147 const GArray *media_types,
1148 DBusGMethodInvocation *context)
1149 {
1150 RingMediaChannel *self = RING_MEDIA_CHANNEL(iface);
1151 RingMediaChannelClass *cls = RING_MEDIA_CHANNEL_GET_CLASS(iface);
1152 RingMediaChannelPrivate *priv = self->priv;
1153 GError *error = NULL;
1154 GPtrArray *list;
1155 guint i, create_audio_stream = 0, create_video_stream = 0;
1156 struct stream_state audio[1], video[1];
1157
1158 DEBUG("(...) on %s", self->nick);
1159
1160 if (!cls->validate_media_handle(self, &handle, &error)) {
1161 dbus_g_method_return_error(context, error);
1162 g_clear_error(&error);
1163 return;
1164 }
1165
1166 *audio = *priv->audio;
1167
1168 /* We can create media only when call has not been initiated */
1169 for (i = 0; i < media_types->len; i++) {
1170 guint media_type = g_array_index(media_types, guint, i);
1171
1172 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO && !create_audio_stream)
1173 create_audio_stream = update_media_stream(self, handle,
1174 audio, RING_MEDIA_STREAM_ID_AUDIO, media_type,
1175 TP_MEDIA_STREAM_STATE_CONNECTING,
1176 TP_MEDIA_STREAM_DIRECTION_NONE,
1177 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
1178 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
1179 else if (media_type == TP_MEDIA_STREAM_TYPE_VIDEO && !create_video_stream)
1180 create_video_stream = update_media_stream(self, handle,
1181 video, RING_MEDIA_STREAM_ID_VIDEO, media_type,
1182 TP_MEDIA_STREAM_STATE_CONNECTING,
1183 TP_MEDIA_STREAM_DIRECTION_NONE,
1184 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
1185 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
1186 }
1187
1188 if (create_audio_stream || create_video_stream) {
1189 if (!cls->create_streams(
1190 self, handle, create_audio_stream, create_video_stream, &error)) {
1191 dbus_g_method_return_error(context, error);
1192 g_clear_error(&error);
1193 return;
1194 }
1195 *priv->audio = *audio;
1196 }
1197
1198 list = g_ptr_array_sized_new(media_types->len);
1199
1200 for (i = 0; i < media_types->len; i++) {
1201 guint media_type = g_array_index(media_types, guint, i);
1202 gpointer element;
1203
1204 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO && create_audio_stream)
1205 element = describe_stream(priv->audio), create_audio_stream = 0;
1206 else if (media_type == TP_MEDIA_STREAM_TYPE_VIDEO && create_video_stream)
1207 element = describe_stream(priv->video), create_video_stream = 0;
1208 else
1209 element = describe_null_media(media_type);
1210
1211 g_ptr_array_add(list, element);
1212 }
1213
1214 tp_svc_channel_type_streamed_media_return_from_request_streams(
1215 context, list);
1216
1217 free_media_stream_list(list);
1218
1219 DEBUG("exit");
1220 }
1221
1222
1223 /** Update audio state.
1224 *
1225 * @retval 0 if nothing changed
1226 * @retval 1 (or nonzero) if state changed
1227 */
1228 static int
1229 ring_media_channel_update_audio(RingMediaChannel *self,
1230 TpHandle handle,
1231 TpMediaStreamState state,
1232 TpMediaStreamDirection direction,
1233 TpMediaStreamPendingSend pending)
1234 {
1235 return update_media_stream(self, handle, self->priv->audio,
1236 RING_MEDIA_STREAM_ID_AUDIO,
1237 TP_MEDIA_STREAM_TYPE_AUDIO, state, direction, pending);
1238 }
1239
1240 /** Update media stream state.
1241 *
1242 * @retval 0 if nothing changed
1243 * @retval 1 (or nonzero) if state changed
1244 */
1245 static int
1246 update_media_stream(RingMediaChannel *self,
1247 TpHandle handle,
1248 struct stream_state *ss,
1249 guint id,
1250 TpMediaStreamType type,
1251 TpMediaStreamState state,
1252 TpMediaStreamDirection direction,
1253 TpMediaStreamPendingSend pending)
1254 {
1255 int changed = 0;
1256
1257 if (type != TP_MEDIA_STREAM_TYPE_AUDIO)
1258 return 0;
1259
1260 if (state == TP_MEDIA_STREAM_STATE_DISCONNECTED) {
1261 if (ss->id == id) {
1262 changed = 1;
1263 /* emit StreamRemoved */
1264 tp_svc_channel_type_streamed_media_emit_stream_removed(
1265 (TpSvcChannelTypeStreamedMedia *)self, id);
1266 memset(ss, 0, sizeof ss);
1267 }
1268 return changed;
1269 }
1270
1271 /* emit StreamAdded */
1272 if (ss->id != id) {
1273 if (handle == 0)
1274 g_object_get(self, "peer", &handle, NULL);
1275 changed = 1;
1276 ss->id = id;
1277 ss->handle = handle;
1278 ss->type = type;
1279
1280 if (DEBUGGING) {
1281 DEBUG("emitting StreamAdded(%u, %d, %s)",
1282 id, handle,
1283 type == TP_MEDIA_STREAM_TYPE_AUDIO ?
1284 "AUDIO" :
1285 type == TP_MEDIA_STREAM_TYPE_VIDEO ?
1286 "VIDEO" : "???");
1287 }
1288
1289 tp_svc_channel_type_streamed_media_emit_stream_added(
1290 (TpSvcChannelTypeStreamedMedia *)self,
1291 ss->id, ss->handle, ss->type);
1292 }
1293
1294 /* emit StreamStateChanged */
1295 if (ss->state != state) {
1296 changed = 1;
1297 ss->state = state;
1298
1299 if (DEBUGGING) {
1300 DEBUG("emitting StreamStateChanged(%u, %s)",
1301 ss->id,
1302 state == TP_MEDIA_STREAM_STATE_DISCONNECTED ?
1303 "DISCONNECTED" :
1304 state == TP_MEDIA_STREAM_STATE_CONNECTING ?
1305 "CONNECTING" :
1306 state == TP_MEDIA_STREAM_STATE_CONNECTED ?
1307 "CONNECTED" : "???");
1308 }
1309
1310 tp_svc_channel_type_streamed_media_emit_stream_state_changed (
1311 (TpSvcChannelTypeStreamedMedia *)self,
1312 ss->id, state);
1313 }
1314
1315 /* emit StreamDirectionChanged */
1316 if (ss->direction != direction || ss->pending != pending) {
1317 changed = 1;
1318 ss->direction = direction;
1319 ss->pending = pending;
1320
1321 if (DEBUGGING) {
1322 DEBUG("emitting StreamDirectionChanged(%u, %s,%s%s%s)",
1323 ss->id,
1324 direction == TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL
1325 ? "BIDIRECTIONAL" :
1326 direction == TP_MEDIA_STREAM_DIRECTION_SEND
1327 ? "SEND" :
1328 direction == TP_MEDIA_STREAM_DIRECTION_RECEIVE
1329 ? "RECV" :
1330 "NONE",
1331 pending & TP_MEDIA_STREAM_PENDING_REMOTE_SEND ?
1332 " remote" : "",
1333 pending & TP_MEDIA_STREAM_PENDING_LOCAL_SEND ?
1334 " local" : "",
1335 pending == 0 ? " 0" : "");
1336 }
1337
1338 tp_svc_channel_type_streamed_media_emit_stream_direction_changed(
1339 (TpSvcChannelTypeStreamedMedia *)self,
1340 ss->id, ss->direction, ss->pending);
1341 }
1342
1343 return changed;
1344 }
1345
1346 static GPtrArray *
1347 list_media_streams(RingMediaChannel *self)
1348 {
1349 RingMediaChannelPrivate *priv = self->priv;
1350 GPtrArray *list;
1351 size_t size;
1352
1353 size = (priv->audio->id != 0) + (priv->video->id != 0);
1354
1355 list = g_ptr_array_sized_new(size);
1356
1357 if (priv->audio->id)
1358 g_ptr_array_add(list, describe_stream(priv->audio));
1359 if (priv->video->id)
1360 g_ptr_array_add(list, describe_stream(priv->video));
1361
1362 return list;
1363 }
1364
1365 static void
1366 free_media_stream_list(GPtrArray *list)
1367 {
1368 if (list) {
1369 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
1370 guint i;
1371
1372 for (i = list->len; i-- > 0;)
1373 g_boxed_free(ElementType, g_ptr_array_index(list, i));
1374
1375 g_ptr_array_free(list, TRUE);
1376 }
1377 }
1378
1379 /* Return a pointer to GValue with boxed stream struct */
1380 static gpointer
1381 describe_stream(struct stream_state *ss)
1382 {
1383 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
1384 GValue element[1] = {{ 0 }};
1385
1386 g_value_init(element, ElementType);
1387 g_value_take_boxed(element, dbus_g_type_specialized_construct(ElementType));
1388
1389 dbus_g_type_struct_set(element,
1390 0, ss->id,
1391 1, ss->handle,
1392 2, ss->type,
1393 3, ss->state,
1394 4, ss->direction,
1395 5, ss->pending,
1396 G_MAXUINT);
1397
1398 return g_value_get_boxed(element);
1399 }
1400
1401 static gpointer
1402 describe_null_media(TpMediaStreamType tptype)
1403 {
1404 struct stream_state ss[1] = {{ 0 }};
1405
1406 ss->type = tptype;
1407
1408 return describe_stream(ss);
1409 }
1410
1411 static void
1412 ring_media_channel_streamed_media_iface_init(gpointer g_iface,
1413 gpointer iface_data)
1414 {
1415 TpSvcChannelTypeStreamedMediaClass *klass =
1416 (TpSvcChannelTypeStreamedMediaClass *)g_iface;
1417
1418 #define IMPLEMENT(x) tp_svc_channel_type_streamed_media_implement_##x( \
1419 klass, ring_media_channel_##x)
1420 IMPLEMENT(list_streams);
1421 IMPLEMENT(remove_streams);
1422 IMPLEMENT(request_stream_direction);
1423 IMPLEMENT(request_streams);
1424 #undef IMPLEMENT
1425576 }
1426577
1427578 /* ====================================================================== */
1446597 * implementation may emit a fixed-length tone, and the StopTone method call
1447598 * should return NotAvailable.
1448599 */
1449 static void
600 void
1450601 ring_media_channel_dtmf_start_tone(TpSvcChannelInterfaceDTMF *iface,
1451602 guint stream_id,
1452603 guchar event,
1459610
1460611 DEBUG("(%u, %u) on %s", stream_id, event, self->nick);
1461612
1462 if (stream_id == 0 || priv->audio->id != stream_id) {
1463 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
613 if (stream_id == 0 /* XXXX || priv->audio->id != stream_id */) {
614 g_set_error(&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
1464615 "invalid stream id %u", stream_id);
1465616 }
1466617 else if (event >= 16) {
1467 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
618 g_set_error(&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
1468619 "event %u is not a known DTMF event", event);
1469620 }
1470621 else if (self->call_instance == NULL) {
1471 g_set_error(&error, TP_ERRORS, TP_ERROR_DISCONNECTED,
622 g_set_error(&error, TP_ERROR, TP_ERROR_DISCONNECTED,
1472623 "Channel is not connected");
1473624 }
1474625 else {
1498649 return;
1499650 }
1500651
1501 g_set_error(&error, TP_ERRORS, TP_ERROR_NETWORK_ERROR,
652 g_set_error(&error, TP_ERROR, TP_ERROR_NETWORK_ERROR,
1502653 "Failed to send request to modem");
1503654 }
1504655
1527678
1528679 priv->dtmf.digit = dtmf;
1529680
681 #if 0 /* No local DTMF playback (handled by UI) */
1530682 if (event) {
1531683 ring_media_channel_play_tone(self,
1532684 event - ring_media_channel_dtmf_events,
1533685 -6, 20000);
1534686 }
687 #endif
1535688
1536689 tp_svc_channel_interface_dtmf_return_from_start_tone(context);
1537690 }
1545698 * Stop sending any DTMF tone which has been started using the StartTone
1546699 * method. If there is no current tone, this method will do nothing.
1547700 */
1548 static void
701 void
1549702 ring_media_channel_dtmf_stop_tone(TpSvcChannelInterfaceDTMF *iface,
1550703 guint stream_id,
1551704 DBusGMethodInvocation *context)
1552705 {
1553706 RingMediaChannel *self = RING_MEDIA_CHANNEL(iface);
1554 RingMediaChannelPrivate *priv = self->priv;
1555707
1556708 GError *error = NULL;
1557709
1558710 DEBUG("(%u) on %s", stream_id, self->nick);
1559711
1560 if (stream_id == 0 || priv->audio->id != stream_id) {
1561 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
712 if (ring_streamed_media_mixin_is_audio_stream (iface, stream_id)) {
713 g_set_error(&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
1562714 "invalid stream id %u", stream_id);
1563715 }
1564716 else if (self->call_instance == NULL) {
1565 g_set_error(&error, TP_ERRORS, TP_ERROR_DISCONNECTED,
717 g_set_error(&error, TP_ERROR, TP_ERROR_DISCONNECTED,
1566718 "Channel is not connected");
1567719 }
1568720 else {
1578730 return;
1579731 }
1580732
1581 g_set_error(&error, TP_ERRORS, TP_ERROR_NETWORK_ERROR,
733 g_set_error(&error, TP_ERROR, TP_ERROR_NETWORK_ERROR,
1582734 "Failed to send request to modem");
1583735 }
1584736
1628780 /* ---------------------------------------------------------------------- */
1629781 /* Implement org.freedesktop.Telepathy.Channel.Interface.Hold */
1630782
783 static int ring_update_hold (RingMediaChannel *self, int hold, int reason);
784
1631785 static
1632786 void get_hold_state(TpSvcChannelInterfaceHold *iface,
1633787 DBusGMethodInvocation *context)
1635789 RingMediaChannel *self = RING_MEDIA_CHANNEL(iface);
1636790 RingMediaChannelPrivate *priv = self->priv;
1637791
792 if (self->call_instance == NULL)
793 {
794 GError *error = NULL;
795 g_set_error(&error, TP_ERROR, TP_ERROR_DISCONNECTED,
796 "Channel is not connected");
797 dbus_g_method_return_error(context, error);
798 g_error_free(error);
799 }
800 else
801 {
802 tp_svc_channel_interface_hold_return_from_get_hold_state (context,
803 priv->hold.state, priv->hold.reason);
804 }
805 }
806
807 static ModemCallReply response_to_hold;
808
809 static
810 void request_hold (TpSvcChannelInterfaceHold *iface,
811 gboolean hold,
812 DBusGMethodInvocation *context)
813 {
814 RingMediaChannel *self = RING_MEDIA_CHANNEL (iface);
815 RingMediaChannelPrivate *priv = self->priv;
816 ModemCall *instance = self->call_instance;
817
1638818 GError *error = NULL;
1639
1640 if (self->call_instance == NULL) {
1641 g_set_error(&error, TP_ERRORS, TP_ERROR_DISCONNECTED,
1642 "Channel is not connected");
1643 }
1644 else {
1645 tp_svc_channel_interface_hold_return_from_get_hold_state
1646 (context, priv->hold.state, priv->hold.reason);
1647 return;
1648 }
1649
1650 dbus_g_method_return_error(context, error);
1651 g_error_free(error);
1652 }
1653
1654 static ModemCallReply response_to_hold;
1655
1656 static
1657 void request_hold(TpSvcChannelInterfaceHold *iface,
1658 gboolean hold,
1659 DBusGMethodInvocation *context)
1660 {
1661 RingMediaChannel *self = RING_MEDIA_CHANNEL(iface);
1662 RingMediaChannelPrivate *priv = self->priv;
1663 ModemCall *instance = self->call_instance;
1664
1665 GError *error = NULL;
1666
1667 DEBUG("(%u) on %s", hold, self->nick);
1668
1669 hold = hold != 0;
1670
1671 if (instance == NULL) {
1672 g_set_error(&error, TP_ERRORS, TP_ERROR_DISCONNECTED,
1673 "Channel is not connected");
1674 }
1675 else if (hold == priv->hold.state) {
1676 priv->hold.reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
1677 tp_svc_channel_interface_hold_return_from_request_hold(context);
1678 return;
1679 }
1680 else if (hold ? priv->state != MODEM_CALL_STATE_ACTIVE :
1681 priv->state != MODEM_CALL_STATE_HELD) {
1682 priv->hold.reason =
1683 TP_LOCAL_HOLD_STATE_REASON_RESOURCE_NOT_AVAILABLE;
1684 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1685 "Invalid call state %s",
1686 modem_call_get_state_name(priv->state));
1687 }
1688 else if (priv->control) {
1689 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1690 "Invalid call state %s",
1691 modem_call_get_state_name(priv->state));
1692 }
1693 else {
1694 g_object_ref (self);
1695 priv->hold.requested = hold;
1696 priv->control = modem_call_request_hold(instance, hold, response_to_hold, self);
1697 ring_media_channel_queue_request(self, priv->control);
1698 modem_request_add_data_full(priv->control, "tp-request", context,
1699 ring_method_return_internal_error);
1700 return;
1701 }
1702
1703 DEBUG("request_hold(%u) on %s: %s", hold, self->nick, error->message);
1704 dbus_g_method_return_error(context, error);
1705 g_clear_error(&error);
1706 }
1707
1708 static void
1709 response_to_hold(ModemCall *ci,
1710 ModemRequest *request,
1711 GError *error,
1712 gpointer _self)
1713 {
1714 RingMediaChannel *self = RING_MEDIA_CHANNEL(_self);
1715 RingMediaChannelPrivate *priv = self->priv;
1716
1717 gpointer _context = modem_request_steal_data(request, "tp-request");
819 uint8_t state, next;
820 ModemCallState expect;
821
822 DEBUG ("(%u) on %s", hold, self->nick);
823
824 if (hold)
825 {
826 expect = MODEM_CALL_STATE_ACTIVE;
827 state = TP_LOCAL_HOLD_STATE_HELD;
828 next = TP_LOCAL_HOLD_STATE_PENDING_HOLD;
829 }
830 else
831 {
832 expect = MODEM_CALL_STATE_HELD;
833 state = TP_LOCAL_HOLD_STATE_UNHELD;
834 next = TP_LOCAL_HOLD_STATE_PENDING_UNHOLD;
835 }
836
837 if (instance == NULL)
838 {
839 g_set_error(&error, TP_ERROR, TP_ERROR_DISCONNECTED,
840 "Channel is not connected");
841 }
842 else if (state == priv->hold.state || next == priv->hold.state)
843 {
844 priv->hold.reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
845 tp_svc_channel_interface_hold_return_from_request_hold(context);
846 return;
847 }
848 else if (priv->state != expect)
849 {
850 g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
851 "Invalid call state %s",
852 modem_call_get_state_name(priv->state));
853 }
854 else if (priv->control)
855 {
856 g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
857 "Call control operation pending");
858 }
859 else
860 {
861 tp_svc_channel_interface_hold_return_from_request_hold(context);
862
863 g_object_ref (self);
864
865 priv->control = modem_call_request_hold (instance, hold,
866 response_to_hold, self);
867 ring_media_channel_queue_request (self, priv->control);
868
869 priv->hold.requested = state;
870
871 ring_update_hold (self, next, TP_LOCAL_HOLD_STATE_REASON_REQUESTED);
872 return;
873 }
874
875 DEBUG ("request_hold(%u) on %s: %s", hold, self->nick, error->message);
876 dbus_g_method_return_error (context, error);
877 g_clear_error (&error);
878 }
879
880 static void
881 response_to_hold (ModemCall *ci,
882 ModemRequest *request,
883 GError *error,
884 gpointer _self)
885 {
886 RingMediaChannel *self = RING_MEDIA_CHANNEL (_self);
887 RingMediaChannelPrivate *priv = self->priv;
1718888
1719889 if (priv->control == request)
1720890 priv->control = NULL;
1721891
1722 ring_media_channel_dequeue_request(self, request);
1723
1724 if (!error) {
1725 tp_svc_channel_interface_hold_return_from_request_hold(_context);
1726 }
1727 else {
1728 GError *tperror = NULL;
1729 g_set_error(&tperror, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1730 "%s: %s", "Hold", error->message);
1731 dbus_g_method_return_error(_context, tperror);
1732 g_clear_error(&tperror);
1733 priv->hold.requested = -1;
1734 }
1735
1736 g_object_unref(self);
1737 }
1738
892 ring_media_channel_dequeue_request (self, request);
893
894 if (error && priv->hold.requested != -1)
895 {
896 uint8_t next;
897
898 DEBUG ("%s: %s", self->nick, error->message);
899
900 if (priv->hold.requested)
901 next = TP_LOCAL_HOLD_STATE_UNHELD;
902 else
903 next = TP_LOCAL_HOLD_STATE_HELD;
904
905 ring_update_hold (self, next,
906 TP_LOCAL_HOLD_STATE_REASON_RESOURCE_NOT_AVAILABLE);
907
908 priv->hold.requested = -1;
909 }
910
911 ring_update_hold(self, priv->hold.requested, 0);
912 g_object_unref (self);
913 }
1739914
1740915 static void
1741916 ring_channel_hold_iface_init(gpointer g_iface, gpointer iface_data)
1750925 }
1751926
1752927 static int
1753 ring_update_hold(RingMediaChannel *self,
1754 int hold,
1755 int reason)
928 ring_update_hold (RingMediaChannel *self,
929 int hold,
930 int reason)
1756931 {
1757932 RingMediaChannelPrivate *priv = self->priv;
1758933 unsigned old = priv->hold.state;
1788963 break;
1789964 case TP_LOCAL_HOLD_STATE_PENDING_HOLD:
1790965 name = "Pending_Hold";
1791 if (priv->hold.requested == TP_LOCAL_HOLD_STATE_HELD)
1792 reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
1793 else
1794 reason = TP_LOCAL_HOLD_STATE_REASON_NONE;
1795966 break;
1796967 case TP_LOCAL_HOLD_STATE_PENDING_UNHOLD:
1797968 name = "Pending_Unhold";
1798 if (priv->hold.requested == TP_LOCAL_HOLD_STATE_UNHELD)
1799 reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
1800 else
1801 reason = TP_LOCAL_HOLD_STATE_REASON_NONE;
1802969 break;
1803970 default:
1804971 name = "Unknown";
18831050 DEBUG("(%u) for %s", id, self->nick);
18841051
18851052 if (id != priv->audio->id) {
1886 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1053 g_set_error(&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
18871054 "Invalid stream");
18881055 }
18891056 else if (priv->audio->state != TP_MEDIA_STREAM_STATE_CONNECTED) {
1890 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1057 g_set_error(&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
18911058 "Stream is not connected");
18921059 }
18931060 else if (!priv->dial.string) {
1894 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1061 g_set_error(&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
18951062 "Already sending a dial string");
18961063 }
18971064 else if (modem_call_stop_dtmf(self->call_instance, NULL, NULL) < 0) {
1898 g_set_error(&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1065 g_set_error(&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
18991066 "Channel error");
19001067 }
19011068 else {
20121179 (void)duration;
20131180 (void)pause;
20141181
2015 if (id != priv->audio->id) {
2016 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1182 if (ring_streamed_media_mixin_is_audio_stream (self, id)) {
1183 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
20171184 "Invalid stream");
20181185 return FALSE;
20191186 }
20201187 else if (self->call_instance == NULL ||
2021 priv->audio->state != TP_MEDIA_STREAM_STATE_CONNECTED) {
2022 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1188 !ring_streamed_media_mixin_is_stream_connected (self, id)) {
1189 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
20231190 "Channel is not connected");
20241191 return FALSE;
20251192 }
20261193 else if (priv->dial.string) {
2027 g_set_error(error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
1194 g_set_error(error, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
20281195 "Already sending a dial string");
20291196 return FALSE;
20301197 }
20311198 else if (modem_call_send_dtmf(self->call_instance, dialstring, NULL, NULL) < 0) {
2032 g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
1199 g_set_error(error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
20331200 "Bad dial string");
20341201 return FALSE;
20351202 }
21001267 ModemCallState state,
21011268 RingMediaChannel *self)
21021269 {
1270 guint causetype = 0;
1271 guint cause = 0;
1272
1273 if (state == MODEM_CALL_STATE_DISCONNECTED) {
1274 GValue causetype_value = G_VALUE_INIT;
1275 g_value_init (&causetype_value, G_TYPE_UINT);
1276 g_object_get_property(ci, "causetype", &causetype_value);
1277 causetype = g_value_get_uint(&causetype_value);
1278 GValue cause_value = G_VALUE_INIT;
1279 g_value_init (&cause_value, G_TYPE_UINT);
1280 g_object_get_property(ci, "cause", &cause_value);
1281 cause = g_value_get_uint(&cause_value);
1282 DEBUG("Call disconnected: causetype=%d, cause=%d", causetype, cause);
1283 }
1284
21031285 ring_media_channel_set_state(
2104 RING_MEDIA_CHANNEL(self), state, 0, 0);
1286 RING_MEDIA_CHANNEL(self), state, causetype, cause);
21051287 }
21061288
21071289 void
21291311
21301312 static void on_modem_call_state_incoming(RingMediaChannel *self)
21311313 {
2132 ring_media_channel_update_audio(self, 0,
1314 ring_streamed_media_mixin_update_audio (self, 0,
21331315 TP_MEDIA_STREAM_STATE_CONNECTING,
21341316 TP_MEDIA_STREAM_DIRECTION_NONE,
21351317 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
21391321 static void
21401322 on_modem_call_state_dialing(RingMediaChannel *self)
21411323 {
2142 ring_media_channel_update_audio(self, 0,
1324 ring_streamed_media_mixin_update_audio (self, 0,
21431325 TP_MEDIA_STREAM_STATE_CONNECTING,
21441326 TP_MEDIA_STREAM_DIRECTION_NONE,
21451327 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
21491331 static void
21501332 on_modem_call_state_mo_alerting(RingMediaChannel *self)
21511333 {
2152 ring_media_channel_update_audio(self, 0,
1334 ring_streamed_media_mixin_update_audio (self, 0,
21531335 TP_MEDIA_STREAM_STATE_CONNECTED,
21541336 TP_MEDIA_STREAM_DIRECTION_RECEIVE,
21551337 TP_MEDIA_STREAM_PENDING_LOCAL_SEND);
21601342 on_modem_call_state_mt_alerting(RingMediaChannel *self)
21611343 {
21621344 /* Audio has been connected - at least locally */
2163 ring_media_channel_update_audio(self, 0,
1345 ring_streamed_media_mixin_update_audio (self, 0,
21641346 TP_MEDIA_STREAM_STATE_CONNECTED,
21651347 TP_MEDIA_STREAM_DIRECTION_SEND,
21661348 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
21711353 on_modem_call_state_waiting(RingMediaChannel *self)
21721354 {
21731355 /* Audio has been connected - at least locally */
2174 ring_media_channel_update_audio(self, 0,
1356 ring_streamed_media_mixin_update_audio (self, 0,
21751357 TP_MEDIA_STREAM_STATE_CONNECTED,
21761358 TP_MEDIA_STREAM_DIRECTION_NONE,
21771359 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
21831365 on_modem_call_state_answered(RingMediaChannel *self)
21841366 {
21851367 /* Call has been answered we might not have radio channel */
2186 ring_media_channel_update_audio(self, 0,
1368 ring_streamed_media_mixin_update_audio (self, 0,
21871369 TP_MEDIA_STREAM_STATE_CONNECTED,
21881370 TP_MEDIA_STREAM_DIRECTION_SEND,
21891371 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
21941376 on_modem_call_state_active(RingMediaChannel *self)
21951377 {
21961378 /* Call should be active now and media channels open. */
2197 ring_media_channel_update_audio(self, 0,
1379 ring_streamed_media_mixin_update_audio (self, 0,
21981380 TP_MEDIA_STREAM_STATE_CONNECTED,
21991381 TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL,
22001382 0);
22021384 ring_update_hold(self, TP_LOCAL_HOLD_STATE_UNHELD, 0);
22031385 }
22041386
2205 #if nomore
2206 static void
2207 on_modem_call_state_hold_initiated(RingMediaChannel *self)
2208 {
2209 ring_media_channel_update_audio(self, 0,
2210 TP_MEDIA_STREAM_STATE_CONNECTED,
2211 TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL,
2212 0);
2213
2214 ring_update_hold(self, TP_LOCAL_HOLD_STATE_PENDING_HOLD, 0);
2215 }
2216 #endif
2217
22181387 static void
22191388 on_modem_call_state_held(RingMediaChannel *self)
22201389 {
2221 ring_media_channel_update_audio(self, 0,
1390 ring_streamed_media_mixin_update_audio (self, 0,
22221391 TP_MEDIA_STREAM_STATE_CONNECTED,
22231392 TP_MEDIA_STREAM_DIRECTION_NONE,
22241393 0);
22261395 ring_update_hold(self, TP_LOCAL_HOLD_STATE_HELD, 0);
22271396 }
22281397
1398 static void
1399 on_modem_call_state_release(RingMediaChannel *self)
1400 {
1401 }
22291402
22301403 #if nomore
22311404 static void
2232 on_modem_call_state_retrieve_initiated(RingMediaChannel *self)
2233 {
2234 ring_media_channel_update_audio(self, 0,
2235 TP_MEDIA_STREAM_STATE_CONNECTED,
2236 TP_MEDIA_STREAM_DIRECTION_NONE,
2237 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
2238 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
2239
2240 ring_update_hold(self, TP_LOCAL_HOLD_STATE_PENDING_UNHOLD, 0);
2241 }
2242 #endif
2243
2244
2245 static void
2246 on_modem_call_state_release(RingMediaChannel *self)
2247 {
2248 }
2249
2250 #if nomore
2251 static void
22521405 on_modem_call_state_terminated(RingMediaChannel *self)
22531406 {
2254 ring_media_channel_update_audio(self, 0,
1407 ring_streamed_media_mixin_update_audio (self, 0,
22551408 TP_MEDIA_STREAM_STATE_DISCONNECTED,
22561409 TP_MEDIA_STREAM_DIRECTION_NONE,
22571410 0);
22991452 return;
23001453
23011454 if (0 <= tone && tone <= 14) {
1455 #if 0 /* No local DTMF playback (handled by UI) */
23021456 ring_media_channel_play_tone(RING_MEDIA_CHANNEL(self), tone, -6, 2000);
1457 #endif
23031458 }
23041459 else {
23051460 ring_media_channel_stop_playing(RING_MEDIA_CHANNEL(self), FALSE);
23221477 if (priv->closing)
23231478 return;
23241479
2325 if (1)
2326 /* XXX - no tones so far */
2327 return;
1480 DEBUG("play tone %d for %u ms at %d dBm0", tone, duration, volume);
23281481
23291482 if ((tone >= 0 && !modem_tones_is_playing(priv->tones, 0))
23301483 || priv->playing) {
2222 #define RING_MEDIA_CHANNEL_H
2323
2424 #include <glib-object.h>
25 #include <telepathy-glib/group-mixin.h>
25
26 #include <telepathy-glib/base-channel.h>
2627 #include <telepathy-glib/dbus-properties-mixin.h>
28 #include <telepathy-glib/svc-channel.h>
29 #include <ring-streamed-media-mixin.h>
2730
2831 G_BEGIN_DECLS
2932
4043 G_BEGIN_DECLS
4144
4245 struct _RingMediaChannelClass {
43 GObjectClass parent_class;
44 TpDBusPropertiesMixinClass dbus_properties_class;
46 TpBaseChannelClass parent_class;
47
48 RingStreamedMediaMixinClass streamed_media_class;
4549
4650 void (*emit_initial)(RingMediaChannel *self);
4751 void (*update_state)(RingMediaChannel *self, guint status, guint causetype, guint cause);
4852 gboolean (*close)(RingMediaChannel *, gboolean immediately);
4953 void (*set_call_instance)(RingMediaChannel *self, ModemCall *ci);
50 gboolean (*validate_media_handle)(RingMediaChannel *, guint *, GError **);
51 gboolean (*create_streams)(RingMediaChannel *,
52 guint handle, gboolean audio, gboolean video,
53 GError **);
5454 };
5555
5656 struct _RingMediaChannel {
57 GObject parent;
57 TpBaseChannel parent;
58 RingStreamedMediaMixin streamed_media;
59
5860 /* Read-only */
59 RingConnection *connection;
60 ModemCallService *call_service;
6161 ModemCall *call_instance;
62 char const *nick;
62 char *nick;
6363
6464 RingMediaChannelPrivate *priv;
6565 };
9999
100100 void ring_media_channel_close(RingMediaChannel *self);
101101
102 ModemCallService *ring_media_channel_get_call_service (RingMediaChannel *);
103
102104 ModemRequest *ring_media_channel_queue_request(RingMediaChannel *self,
103105 ModemRequest *request);
104106
126128 guint causetype,
127129 guint cause);
128130
129 GHashTable *ring_media_channel_properties(RingMediaChannel *self);
131 void ring_media_channel_dtmf_start_tone(TpSvcChannelInterfaceDTMF *iface,
132 guint stream_id,
133 guchar event,
134 DBusGMethodInvocation *context);
135 void ring_media_channel_dtmf_stop_tone(TpSvcChannelInterfaceDTMF *iface,
136 guint stream_id,
137 DBusGMethodInvocation *context);
130138
131139 G_END_DECLS
132140
4040 #include "ring-media-manager.h"
4141 #include "ring-media-channel.h"
4242 #include "ring-call-channel.h"
43 #include "ring-conference-channel.h"
4443 #include "ring-connection.h"
4544 #include "ring-param-spec.h"
4645 #include "ring-util.h"
47
48 #include "sms-glib/deliver.h"
4946
5047 #include "ring-extensions/ring-extensions.h"
5148
9794
9895 static void ring_media_manager_disconnect(RingMediaManager *self);
9996
97 static void on_connection_status_changed (TpBaseConnection *conn,
98 guint status, guint reason,
99 RingMediaManager *self);
100
100101 static gboolean ring_media_requestotron(RingMediaManager *,
101102 gpointer,
102103 GHashTable *,
112113 char const *emergency,
113114 gboolean initial_audio);
114115
115 static gboolean ring_media_manager_conference(RingMediaManager *self,
116 gpointer request,
117 RingInitialMembers *initial,
118 gboolean initial_audio,
119 GError **error);
120
121116 static void on_media_channel_closed(GObject *chan, RingMediaManager *self);
117
118 static void foreach_dispose (gpointer, gpointer, gpointer);
122119
123120 static gpointer ring_media_manager_lookup_by_peer(RingMediaManager *self,
124121 TpHandle handle);
137134 char const *destination,
138135 RingMediaManager *self);
139136
140 #if nomore
141 static void on_modem_call_conference_joined(ModemCallConference *mcc,
142 ModemCall *mc,
143 RingMediaManager *self);
144 #endif
145
146 static void on_modem_call_user_connection(ModemCallService *call_service,
147 gboolean active,
148 RingMediaManager *self);
149
150137 static void on_modem_call_removed (ModemCallService *, ModemCall *,
151138 RingMediaManager *);
152139
164151 /* Hash by object path */
165152 GHashTable *channels;
166153
167 RingMediaChannel *conference; /* Special channel for conference */
168
169154 ModemCallService *call_service;
170155 ModemTones *tones;
171156
172157 struct {
173158 gulong incoming, created, removed;
174 gulong emergency_numbers, joined, user_connection;
159 gulong emergency_numbers, joined;
160 gulong status_changed;
175161 } signals;
176162
177163 unsigned dispose_has_run:1, :0;
183169 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(
184170 self, RING_TYPE_MEDIA_MANAGER, RingMediaManagerPrivate);
185171
186 self->priv->channels = g_hash_table_new_full(g_str_hash, g_str_equal,
187 NULL, g_object_unref);
172 self->priv->channels = g_hash_table_new_full (g_str_hash, g_str_equal,
173 NULL, g_object_unref);
188174
189175 self->priv->tones = g_object_new(MODEM_TYPE_TONES, NULL);
190176 }
192178 static void
193179 ring_media_manager_constructed(GObject *object)
194180 {
181 RingMediaManager *self = RING_MEDIA_MANAGER(object);
182 RingMediaManagerPrivate *priv = self->priv;
183
184 priv->signals.status_changed = g_signal_connect (priv->connection,
185 "status-changed", (GCallback) on_connection_status_changed, self);
186
195187 if (G_OBJECT_CLASS(ring_media_manager_parent_class)->constructed)
196188 G_OBJECT_CLASS(ring_media_manager_parent_class)->constructed(object);
197189 }
206198 return;
207199 priv->dispose_has_run = TRUE;
208200
209 g_object_set (object, "call-service", NULL, NULL);
201 ring_signal_disconnect (priv->connection, &priv->signals.status_changed);
202
203 ring_media_manager_disconnect (self);
204
210205 g_object_run_dispose (G_OBJECT (priv->tones));
211206
212207 ((GObjectClass *) ring_media_manager_parent_class)->dispose(object);
261256 switch (property_id) {
262257 case PROP_CONNECTION:
263258 /* We don't ref the connection, because it owns a reference to the
264 * factory, and it guarantees that the factory's lifetime is
259 * manager, and it guarantees that the manager's lifetime is
265260 * less than its lifetime */
266261 priv->connection = g_value_get_object(value);
267262 break;
351346 g_signal_connect(priv->call_service, "removed",
352347 G_CALLBACK(on_modem_call_removed), self);
353348
354 priv->signals.user_connection =
355 g_signal_connect(priv->call_service, "user-connection",
356 G_CALLBACK(on_modem_call_user_connection), self);
357
358349 priv->signals.emergency_numbers =
359350 g_signal_connect(priv->call_service, "notify::emergency-numbers",
360351 G_CALLBACK(on_modem_call_emergency_numbers_changed), self);
367358 ring_media_manager_disconnect(RingMediaManager *self)
368359 {
369360 RingMediaManagerPrivate *priv = self->priv;
370 ModemCallConference *mcc;
371 GHashTableIter iter[1];
372 GObject *channel;
373361
374362 ring_signal_disconnect (priv->call_service, &priv->signals.incoming);
375363 ring_signal_disconnect (priv->call_service, &priv->signals.created);
376 ring_signal_disconnect (priv->call_service, &priv->signals.user_connection);
377364 ring_signal_disconnect (priv->call_service, &priv->signals.emergency_numbers);
378365
379 mcc = modem_call_service_get_conference (priv->call_service);
380 ring_signal_disconnect (mcc, &priv->signals.joined);
381
382 for (g_hash_table_iter_init (iter, priv->channels);
383 g_hash_table_iter_next (iter, NULL, (gpointer)&channel);)
384 {
385 g_object_run_dispose (channel);
386 }
387
366 g_hash_table_foreach (priv->channels, foreach_dispose, NULL);
388367 g_hash_table_remove_all (priv->channels);
389368
390369 if (priv->call_service)
396375 ring_media_manager_is_connected (RingMediaManager *self)
397376 {
398377 return RING_IS_MEDIA_MANAGER (self) && self->priv->call_service != NULL;
378 }
379
380 static void
381 on_connection_status_changed (TpBaseConnection *conn,
382 guint status,
383 guint reason,
384 RingMediaManager *self)
385 {
386 if (status == TP_CONNECTION_STATUS_DISCONNECTED)
387 {
388 ring_media_manager_disconnect (self);
389 }
390 }
391
392 static void
393 foreach_dispose (gpointer key,
394 gpointer _channel,
395 gpointer user_data)
396 {
397 /* Ensure "closed" has been emitted */
398 if (!tp_base_channel_is_destroyed (_channel))
399 {
400 g_object_run_dispose (_channel);
401 }
399402 }
400403
401404 /* ---------------------------------------------------------------------- */
480483 }
481484
482485 /* ---------------------------------------------------------------------- */
483 /* Initial media stuff */
484
485 static gboolean
486 tp_asv_get_initial_audio(GHashTable *properties, gboolean default_value)
487 {
488 GValue *value = g_hash_table_lookup(properties,
489 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio");
490
491 if (value && G_VALUE_HOLDS_BOOLEAN(value))
492 return g_value_get_boolean(value);
493 else
494 return default_value;
495 }
496
497 static gboolean
498 tp_asv_get_initial_video (GHashTable *properties, gboolean default_value)
499 {
500 GValue *value = g_hash_table_lookup (properties,
501 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo");
502
503 if (value && G_VALUE_HOLDS_BOOLEAN (value))
504 return g_value_get_boolean (value);
505 else
506 return default_value;
507 }
508
509 /* ---------------------------------------------------------------------- */
510486 /* TpChannelManagerIface interface */
511487
512488 static GHashTable *
540516 static char const * const ring_call_channel_allowed_properties[] =
541517 {
542518 TP_IFACE_CHANNEL ".TargetHandle",
519 TP_IFACE_CHANNEL ".TargetID",
543520 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
544521 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo",
545522 NULL
577554 {
578555 NULL
579556 };
580
581 static GHashTable *
582 ring_conference_channel_fixed_properties(void)
583 {
584 static GHashTable *hash;
585
586 if (hash)
587 return hash;
588
589 hash = g_hash_table_new(g_str_hash, g_str_equal);
590
591 char const *key;
592 GValue *value;
593
594 key = TP_IFACE_CHANNEL ".ChannelType";
595 value = tp_g_value_slice_new(G_TYPE_STRING);
596 g_value_set_static_string(value, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA);
597
598 g_hash_table_insert(hash, (gpointer)key, value);
599
600 return hash;
601 }
602
603 static char const * const ring_conference_channel_allowed_properties[] =
604 {
605 RING_IFACE_CHANNEL_INTERFACE_CONFERENCE ".InitialChannels",
606 TP_IFACE_CHANNEL ".TargetHandleType",
607 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
608 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo",
609 NULL
610 };
611
612557
613558 static void
614559 ring_media_manager_foreach_channel_class(TpChannelManager *_self,
633578 ring_anon_channel_allowed_properties,
634579 userdata);
635580 #endif
636
637 func(_self,
638 ring_conference_channel_fixed_properties(),
639 ring_conference_channel_allowed_properties,
640 userdata);
641
642581 }
643582
644583 static void
719658
720659 handle = tp_asv_get_uint32 (properties,
721660 TP_IFACE_CHANNEL ".TargetHandle", NULL);
722
723 if (handle == priv->connection->parent.self_handle ||
724 handle == priv->connection->anon_handle)
725 return FALSE;
726661
727662 if (kind == METHOD_COMPATIBLE &&
728663 handle == 0 &&
756691 g_error_free(error);
757692 return TRUE;
758693 }
759 /* We do not yes support 'w' */
694 /* We do not yet support 'w' */
760695 else if (strchr(target_id, 'w')) {
761696 tp_channel_manager_emit_request_failed(
762697 self, request,
781716 tp_asv_get_initial_audio(properties, FALSE));
782717 }
783718
784 if (ring_properties_satisfy(properties,
785 ring_conference_channel_fixed_properties(),
786 ring_conference_channel_allowed_properties)) {
787 RingInitialMembers *initial = tp_asv_get_boxed(
788 properties,
789 RING_IFACE_CHANNEL_INTERFACE_CONFERENCE ".InitialChannels",
790 TP_ARRAY_TYPE_OBJECT_PATH_LIST);
791
792 if (initial == NULL)
793 return FALSE;
794
795 GError *error = NULL;
796
797 if (tp_asv_get_uint32(properties,
798 TP_IFACE_CHANNEL ".TargetHandleType", NULL) != 0) {
799 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
800 "Invalid TargetHandleType");
801 }
802 else if (ring_media_manager_conference(self, request, initial,
803 tp_asv_get_initial_audio(properties, TRUE),
804 &error)) {
805 return TRUE;
806 }
807
808 DEBUG("failing request: " GERROR_MSG_FMT, GERROR_MSG_CODE(error));
809 tp_channel_manager_emit_request_failed(
810 self, request,
811 error->domain, error->code, error->message);
812 g_clear_error(&error);
813
814 return TRUE;
815 }
816
817719 return FALSE;
818720 }
819721
861763 g_prefix_error(error, "Second initial: ");
862764 return FALSE;
863765 }
864
865 return TRUE;
866 }
867
868 static gboolean
869 ring_media_manager_conference(RingMediaManager *self,
870 gpointer request,
871 RingInitialMembers *initial,
872 gboolean initial_audio,
873 GError **error)
874 {
875 RingMediaManagerPrivate *priv = self->priv;
876 RingConferenceChannel *channel;
877 GHashTableIter i[1];
878 gpointer existing = NULL;
879
880 for (g_hash_table_iter_init(i, priv->channels);
881 g_hash_table_iter_next(i, NULL, &existing);) {
882 if (!RING_IS_CONFERENCE_CHANNEL(existing))
883 continue;
884
885 if (initial->len == 0 ||
886 ring_conference_channel_check_initial_members(existing, initial)) {
887 tp_channel_manager_emit_request_already_satisfied(
888 self, request, TP_EXPORTABLE_CHANNEL(existing));
889 return TRUE;
890 }
891 }
892
893 if (!ring_media_manager_validate_initial_members(self, initial, error)) {
894 return FALSE;
895 }
896
897 char *object_path = ring_media_manager_new_object_path(self, "conf");
898
899 channel = (RingConferenceChannel *)
900 g_object_new(RING_TYPE_CONFERENCE_CHANNEL,
901 "connection", priv->connection,
902 "call-service", priv->call_service,
903 "tones", priv->tones,
904 "object-path", object_path,
905 "initial-channels", initial,
906 "initial-audio", initial_audio,
907 "requested", TRUE,
908 NULL);
909
910 g_free(object_path);
911
912 if (initial_audio)
913 ring_conference_channel_initial_audio(channel, self, request);
914 else
915 ring_media_manager_emit_new_channel(self, request, channel, NULL);
916766
917767 return TRUE;
918768 }
942792 }
943793 }
944794
795 static const gchar*
796 get_nick(TpBaseChannel *channel)
797 {
798 return RING_MEDIA_CHANNEL (channel)->nick;
799 }
800
945801 void
946802 ring_media_manager_emit_new_channel(RingMediaManager *self,
947803 gpointer request,
951807 DEBUG("%s(%p, %p, %p, %p) called", __func__, self, request, _channel, error);
952808
953809 RingMediaManagerPrivate *priv = RING_MEDIA_MANAGER(self)->priv;
954 RingMediaChannel *channel = _channel ? RING_MEDIA_CHANNEL(_channel) : NULL;
810 TpBaseChannel *channel = _channel ? TP_BASE_CHANNEL (_channel) : NULL;
955811 GSList *requests = request ? g_slist_prepend(NULL, request) : NULL;
956812
957813 if (error == NULL) {
963819 g_object_get(channel, "object-path", &object_path, NULL);
964820
965821 DEBUG("got new channel %p nick %s type %s",
966 channel, channel->nick, G_OBJECT_TYPE_NAME(channel));
822 channel, get_nick (channel), G_OBJECT_TYPE_NAME (channel));
967823
968824 g_hash_table_insert(priv->channels, object_path, channel);
969825
971827 TP_EXPORTABLE_CHANNEL(channel), requests);
972828
973829 /* Emit Group and StreamedMedia signals */
974 ring_media_channel_emit_initial(channel);
830 ring_media_channel_emit_initial(RING_MEDIA_CHANNEL (channel));
975831 }
976832 else {
977833 DEBUG("new channel %p nick %s type %s failed with " GERROR_MSG_FMT,
978 channel, channel ? channel->nick : "<NULL>", G_OBJECT_TYPE_NAME(channel),
834 channel, get_nick (channel), G_OBJECT_TYPE_NAME (channel),
979835 GERROR_MSG_CODE(error));
980836
981837 if (request) {
1010866 channel = (RingCallChannel *)
1011867 g_object_new(RING_TYPE_CALL_CHANNEL,
1012868 "connection", priv->connection,
1013 "call-service", priv->call_service,
1014869 "tones", priv->tones,
1015870 "object-path", object_path,
1016 "initiator", initiator,
871 "initiator-handle", initiator,
1017872 "handle-type", htype,
1018873 "handle", target,
1019874 "peer", target,
1038893 on_media_channel_closed(GObject *chan, RingMediaManager *self)
1039894 {
1040895 if (self->priv->channels != NULL) {
1041 char const *object_path;
1042 g_object_get(chan, "object-path", &object_path, NULL);
1043 g_hash_table_remove(self->priv->channels, object_path);
896 gchar *object_path;
897
898 g_object_get (chan, "object-path", &object_path, NULL);
899 g_hash_table_remove (self->priv->channels, object_path);
900 tp_channel_manager_emit_channel_closed (self, object_path);
901 g_free (object_path);
1044902 }
1045903 }
1046904
1118976 channel = (RingCallChannel *)
1119977 g_object_new(RING_TYPE_CALL_CHANNEL,
1120978 "connection", priv->connection,
1121 "call-service", priv->call_service,
1122979 "tones", priv->tones,
1123980 "object-path", object_path,
1124 "initiator", handle,
981 "initiator-handle", handle,
1125982 "handle-type", TP_HANDLE_TYPE_CONTACT,
1126983 "handle", handle,
1127984 "peer", handle,
11491006 TpHandleRepoIface *repo;
11501007 RingCallChannel *channel;
11511008 TpHandle handle;
1009 TpHandle initiator;
11521010 char const *sos;
11531011 GError *error = NULL;
11541012
11761034 return;
11771035 }
11781036
1037 initiator = tp_base_connection_get_self_handle(
1038 TP_BASE_CONNECTION(priv->connection));
1039
11791040 sos = modem_call_get_emergency_service(priv->call_service, destination);
11801041
11811042 char *object_path = ring_media_manager_new_object_path(self, "created");
11831044 channel = (RingCallChannel *)
11841045 g_object_new(RING_TYPE_CALL_CHANNEL,
11851046 "connection", priv->connection,
1186 "call-service", priv->call_service,
11871047 "tones", priv->tones,
11881048 "object-path", object_path,
1189 "initiator", tp_base_connection_get_self_handle(
1190 TP_BASE_CONNECTION(priv->connection)),
11911049 "handle-type", TP_HANDLE_TYPE_CONTACT,
11921050 "handle", handle,
1051 "initiator-handle", initiator,
11931052 "peer", handle,
11941053 "requested", TRUE,
11951054 "initial-remote", handle,
12071066 MODEM_CALL_STATE_DIALING, 0, 0);
12081067 }
12091068
1210 #ifdef nomore
1211 static void
1212 on_modem_call_conference_joined(ModemCallConference *mcc,
1213 ModemCall *mc,
1214 RingMediaManager *self)
1215 {
1216 RingMediaManagerPrivate *priv = RING_MEDIA_MANAGER(self)->priv;
1217 ModemCall **members;
1218 GPtrArray *initial;
1219 guint i;
1220
1221 if (modem_call_get_handler(MODEM_CALL(mcc)))
1222 return;
1223
1224 members = modem_call_service_get_calls(priv->call_service);
1225 initial = g_ptr_array_sized_new(MODEM_MAX_CALLS + 1);
1226
1227 for (i = 0; members[i]; i++) {
1228 if (modem_call_is_member(members[i]) &&
1229 modem_call_get_handler(members[i])) {
1230 RingMemberChannel *member;
1231 char *object_path = NULL;
1232
1233 member = RING_MEMBER_CHANNEL(modem_call_get_handler(members[i]));
1234 g_object_get(member, "object-path", &object_path, NULL);
1235
1236 if (object_path)
1237 g_ptr_array_add(initial, object_path);
1238 }
1239 }
1240
1241 if (initial->len >= 2) {
1242 RingConferenceChannel *channel;
1243 char *object_path;
1244
1245 object_path = ring_media_manager_new_object_path(self, "cconf");
1246
1247 channel = (RingConferenceChannel *)
1248 g_object_new(RING_TYPE_CONFERENCE_CHANNEL,
1249 "connection", priv->connection,
1250 "call-service", priv->call_service,
1251 "call-instance", mcc,
1252 "tones", priv->tones,
1253 "object-path", object_path,
1254 "initial-channels", initial,
1255 "initial-audio", TRUE,
1256 "requested", TRUE,
1257 NULL);
1258
1259 g_free(object_path);
1260
1261 g_assert(channel == modem_call_get_handler(MODEM_CALL(mcc)));
1262
1263 ring_media_manager_emit_new_channel(self, NULL, channel, NULL);
1264 }
1265
1266 g_ptr_array_add(initial, NULL);
1267 g_strfreev((char **)g_ptr_array_free(initial, FALSE));
1268 g_free(members);
1269 }
1270 #endif
1271
12721069 static void
12731070 on_modem_call_removed (ModemCallService *call_service,
12741071 ModemCall *modem_call,
12801077 if (channel)
12811078 g_object_set (channel, "call-instance", NULL, NULL);
12821079 }
1283 /* ---------------------------------------------------------------------- */
1284
1285 static void
1286 on_modem_call_user_connection(ModemCallService *call_service,
1287 gboolean active,
1288 RingMediaManager *self)
1289 {
1290 DEBUG("user-connection %s", active ? "attached" : "detached");
1291 modem_tones_user_connection(RING_MEDIA_MANAGER(self)->priv->tones, active);
1292 }
2121 #ifndef RING_MEDIA_MANAGER_H
2222 #define RING_MEDIA_MANAGER_H
2323
24 #include <telepathy-glib/channel-factory-iface.h>
25
2624 G_BEGIN_DECLS
2725
28 typedef struct _RingMediaFactory RingMediaManager;
29 typedef struct _RingMediaFactoryClass RingMediaManagerClass;
26 typedef struct _RingMediaManager RingMediaManager;
27 typedef struct _RingMediaManagerClass RingMediaManagerClass;
3028 typedef struct _RingMediaManagerPrivate RingMediaManagerPrivate;
3129
3230 G_END_DECLS
3331
32 #include <telepathy-glib/channel-manager.h>
3433 #include <ring-media-channel.h>
3534 #include <ring-emergency-service.h>
3635 #include <ring-util.h>
3837
3938 G_BEGIN_DECLS
4039
41 struct _RingMediaFactoryClass {
40 struct _RingMediaManagerClass {
4241 GObjectClass parent_class;
4342 };
4443
45 struct _RingMediaFactory {
44 struct _RingMediaManager {
4645 GObject parent;
4746 RingMediaManagerPrivate *priv;
4847 };
4242 "Member Handle",
4343 "Handle representing the channel target in conference",
4444 0, G_MAXUINT, 0,
45 G_PARAM_READWRITE |
45 G_PARAM_READABLE |
4646 G_PARAM_STATIC_STRINGS));
4747
4848 g_object_interface_install_property(
0 /*
1 * ring-streamed-media-mixin.c - Source for RingStreamedMediaMixin
2 * Copyright © 2011 Nokia Corporation
3 *
4 * This library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of the
7 * License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
17 * USA
18 */
19
20 #include "config.h"
21
22 #define DEBUG_FLAG RING_DEBUG_MEDIA
23 #include "ring-debug.h"
24
25 #include <ring-streamed-media-mixin.h>
26 #include "ring-util.h"
27
28 #include <dbus/dbus-glib-lowlevel.h>
29 #include <dbus/dbus-glib.h>
30
31 #include <telepathy-glib/dbus.h>
32 #include <telepathy-glib/enums.h>
33 #include <telepathy-glib/errors.h>
34 #include <telepathy-glib/gtypes.h>
35 #include <telepathy-glib/svc-channel.h>
36 #include <telepathy-glib/interfaces.h>
37
38 #include <string.h>
39
40 struct _RingStreamedMediaMixinPrivate
41 {
42 struct stream_state {
43 guint id; /* nonzero when active, 0 otherwise */
44 TpHandle handle;
45 TpMediaStreamType type;
46 TpMediaStreamState state;
47 TpMediaStreamDirection direction;
48 TpMediaStreamPendingSend pending;
49 } audio[1], video[1];
50 };
51
52 enum {
53 RING_MEDIA_STREAM_ID_AUDIO = 1,
54 RING_MEDIA_STREAM_ID_VIDEO = 2
55 };
56
57 static TpDBusPropertiesMixinPropImpl streamed_media_properties[] = {
58 { "InitialAudio", "initial-audio", NULL },
59 { "InitialVideo", "initial-video", NULL },
60 { "ImmutableStreams", "immutable-streams", NULL },
61 { NULL }
62 };
63
64 void
65 ring_streamed_media_mixin_fill_immutable_properties (gpointer iface,
66 GHashTable *properties)
67 {
68 tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (iface),
69 properties,
70 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "InitialAudio",
71 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "InitialVideo",
72 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, "ImmutableStreams",
73 NULL);
74 }
75
76 GQuark
77 ring_streamed_media_mixin_class_get_offset_quark (void)
78 {
79 static GQuark quark = 0;
80
81 if (G_UNLIKELY (quark == 0))
82 quark = g_quark_from_static_string ("RingStreamedMediaMixinClassOffset");
83
84 return quark;
85 }
86
87 GQuark
88 ring_streamed_media_mixin_get_offset_quark (void)
89 {
90 static GQuark quark = 0;
91
92 if (G_UNLIKELY (quark == 0))
93 quark = g_quark_from_static_string ("RingStreamedMediaMixinOffset");
94
95 return quark;
96 }
97
98 RingStreamedMediaMixinClass *
99 ring_streamed_media_mixin_class (GObjectClass *object_class)
100 {
101 return RING_STREAMED_MEDIA_MIXIN_CLASS (object_class);
102 }
103
104 void
105 ring_streamed_media_mixin_class_init (GObjectClass *object_class, glong offset,
106 RingStreamedMediaMixinValidateMediaHandle validate_handle,
107 RingStreamedMediaMixinCreateStreams create_streams)
108 {
109 RingStreamedMediaMixinClass *mixin_class;
110
111 g_assert (G_IS_OBJECT_CLASS (object_class));
112 g_assert (create_streams != NULL);
113 g_assert (validate_handle != NULL);
114
115 g_type_set_qdata (G_OBJECT_CLASS_TYPE (object_class),
116 RING_STREAMED_MEDIA_MIXIN_CLASS_OFFSET_QUARK,
117 GINT_TO_POINTER (offset));
118
119 tp_dbus_properties_mixin_implement_interface (object_class,
120 TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA,
121 tp_dbus_properties_mixin_getter_gobject_properties,
122 NULL,
123 streamed_media_properties);
124
125 mixin_class = RING_STREAMED_MEDIA_MIXIN_CLASS (object_class);
126
127 mixin_class->validate_handle = validate_handle;
128 mixin_class->create_streams = create_streams;
129 }
130
131 void
132 ring_streamed_media_mixin_init (GObject *object, gsize offset)
133 {
134 RingStreamedMediaMixin *mixin;
135
136 g_type_set_qdata (G_OBJECT_TYPE (object),
137 RING_STREAMED_MEDIA_MIXIN_OFFSET_QUARK,
138 GSIZE_TO_POINTER (offset));
139
140 mixin = RING_STREAMED_MEDIA_MIXIN (object);
141
142 mixin->priv = g_slice_new0 (RingStreamedMediaMixinPrivate);
143 }
144
145 /**
146 * ring_streamed_media_mixin_finalize: (skip)
147 * @obj: An object with this mixin.
148 *
149 * Free resources held by the contacts mixin.
150 *
151 * Since: 0.7.14
152 *
153 */
154 void
155 ring_streamed_media_mixin_finalize (GObject *object)
156 {
157 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (object);
158 RingStreamedMediaMixinPrivate *priv = mixin->priv;
159
160 DEBUG ("%p", object);
161
162 /* free any data held directly by the object here */
163
164 memset (priv->audio, 0, sizeof *priv->audio);
165 memset (priv->video, 0, sizeof *priv->video);
166
167 g_slice_free (RingStreamedMediaMixinPrivate, priv);
168 }
169
170 /**
171 * Telepathy.Channel.Type.StreamedMedia DBus interface - version 0.15
172 *
173 * Methods:
174 * ListStreams ( ) -> a(uuuuuu)
175 *
176 * Returns an array of structs representing the streams currently active
177 * within this channel. Each stream is identified by an unsigned integer
178 * which is unique for each stream within the channel.
179 *
180 * Returns
181 *
182 * a(uuuuuu)
183 * An array of structs containing:
184 *
185 * * the stream identifier
186 * * the contact handle who the stream is with
187 * (or 0 if the stream represents more than a single member)
188 * * the type of the stream
189 * * the current stream state
190 * * the current direction of the stream
191 * * the current pending send flags
192 *
193 *
194 * RemoveStreams ( au: streams ) -> nothing
195 *
196 * Request that the given streams are removed.
197 *
198 * Parameters
199 *
200 * streams - au
201 * An array of stream identifiers (as defined in ListStreams)
202 *
203 * Possible errors
204 *
205 * org.freedesktop.Telepathy.Error.InvalidArgument
206 * Raised when one of the provided arguments is invalid.
207 *
208 * RequestStreamDirection ( u: stream_id, u: stream_direction ) -> nothing
209 *
210 * Request a change in the direction of an existing stream. In particular,
211 * this might be useful to stop sending media of a particular type, or
212 * inform the peer that you are no longer using media that is being sent to
213 * you.
214 *
215 * Depending on the protocol, streams which are no longer sending in either
216 * direction should be removed and a StreamRemoved signal emitted. Some
217 * direction changes can be enforced locally (for example, BIDIRECTIONAL ->
218 * RECEIVE can be achieved by merely stopping sending), others may not be
219 * possible on some protocols, and some need agreement from the remote end.
220 * In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in
221 * the StreamDirectionChanged signal, and the signal emitted again without
222 * the flag to indicate the resulting direction when the remote end has
223 * accepted or rejected the change. Parameters
224 *
225 * stream_id - u
226 * The stream identifier (as defined in ListStreams)
227 * stream_direction - u
228 * The desired stream direction (a value of MediaStreamDirection)
229 *
230 * Possible errors
231 *
232 * org.freedesktop.Telepathy.Error.InvalidArgument
233 * Raised when one of the provided arguments is invalid.
234 * org.freedesktop.Telepathy.Error.NotAvailable
235 * Raised when the requested functionality is temporarily
236 * unavailable. (generic description)
237 *
238 * RequestStreams ( u: contact_handle, au: types ) -> a(uuuuuu)
239 *
240 * Request that streams be established to exchange the given types of media
241 * with the given member. In general this will try and establish a
242 * bidirectional stream, but on some protocols it may not be possible to
243 * indicate to the peer that you would like to receive media, so a send-only
244 * stream will be created initially. In the cases where the stream requires
245 * remote agreement (eg you wish to receive media from them), the
246 * StreamDirectionChanged signal will be emitted with the
247 * MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again
248 * with the flag cleared when the remote end has replied. Parameters
249 *
250 * contact_handle - u
251 * A contact handle with whom to establish the streams
252 * types - au
253 * An array of stream types (values of MediaStreamType)
254 *
255 * Returns
256 *
257 * a(uuuuuu)
258 * An array of structs (in the same order as the given stream types)
259 * containing:
260 *
261 * * the stream identifier
262 * * the contact handle who the stream is with
263 * (or 0 if the stream represents more than a single member)
264 * * the type of the stream
265 * * the current stream state
266 * * the current direction of the stream
267 * * the current pending send flags
268 *
269 * Possible errors
270 *
271 * org.freedesktop.Telepathy.Error.InvalidHandle
272 * The contact name specified is unknown on this channel or
273 * connection. (generic description)
274 * org.freedesktop.Telepathy.Error.InvalidArgument
275 * Raised when one of the provided arguments is invalid. (generic
276 * description)
277 * org.freedesktop.Telepathy.Error.NotAvailable
278 * Raised when the requested functionality is temporarily
279 * unavailable. (generic description)
280 *
281 * Signals:
282 * -> StreamAdded ( u: stream_id, u: contact_handle, u: stream_type )
283 *
284 * Emitted when a new stream has been added to this channel.
285 *
286 * Parameters
287 *
288 * stream_id - u
289 * The stream identifier (as defined in ListStreams)
290 * contact_handle - u
291 * The contact handle who the stream is with (or 0 if it represents more than a single member)
292 * stream_type - u
293 * The stream type (a value from MediaStreamType)
294 *
295 * -> StreamDirectionChanged ( u: stream_id, u: stream_direction, u: pending_flags )
296 *
297 * Emitted when the direction or pending flags of a stream are changed. If
298 * the MEDIA_STREAM_PENDING_LOCAL_SEND flag is set, the remote user has
299 * requested that we begin sending on this stream. RequestStreamDirection
300 * should be called to indicate whether or not this change is acceptable.
301 * Parameters
302 *
303 * stream_id - u
304 * The stream identifier (as defined in ListStreams)
305 * stream_direction - u
306 * The new stream direction (as defined in ListStreams)
307 * pending_flags - u
308 * The new pending send flags (as defined in ListStreams)
309 *
310 * StreamError ( u: stream_id, u: errno, s: message )
311 *
312 * Emitted when a stream encounters an error.
313 *
314 * Parameters
315 *
316 * stream_id - u
317 * The stream identifier (as defined in ListStreams)
318 * errno - u
319 * A stream error number, one of the values of MediaStreamError
320 * message - s
321 * A string describing the error (for debugging purposes only)
322 *
323 * StreamRemoved ( u: stream_id )
324 *
325 * Emitted when a stream has been removed from this channel.
326 *
327 * Parameters
328 *
329 * stream_id - u
330 * stream_id - the stream identifier (as defined in ListStreams)
331 *
332 * StreamStateChanged ( u: stream_id, u: stream_state )
333 *
334 * Emitted when a member's stream's state changes.
335 *
336 * Parameters
337 *
338 * stream_id - u
339 * The stream identifier (as defined in ListStreams)
340 * stream_state - u
341 * The new stream state (as defined in ListStreams)
342 */
343
344 #define TP_CHANNEL_STREAM_TYPE \
345 (dbus_g_type_get_struct("GValueArray", \
346 G_TYPE_UINT, \
347 G_TYPE_UINT, \
348 G_TYPE_UINT, \
349 G_TYPE_UINT, \
350 G_TYPE_UINT, \
351 G_TYPE_UINT, \
352 G_TYPE_INVALID))
353
354 /* Return a pointer to GValue with boxed stream struct */
355 static gpointer
356 describe_stream (struct stream_state *ss)
357 {
358 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
359 GValue element[1] = {{ 0 }};
360
361 g_value_init (element, ElementType);
362 g_value_take_boxed (element, dbus_g_type_specialized_construct (ElementType));
363
364 dbus_g_type_struct_set (element,
365 0, ss->id,
366 1, ss->handle,
367 2, ss->type,
368 3, ss->state,
369 4, ss->direction,
370 5, ss->pending,
371 G_MAXUINT);
372
373 return g_value_get_boxed (element);
374 }
375
376 static gpointer
377 describe_null_media (TpMediaStreamType tptype)
378 {
379 struct stream_state ss[1] = {{ 0 }};
380
381 ss->type = tptype;
382
383 return describe_stream (ss);
384 }
385
386 static GPtrArray *
387 list_media_streams (TpSvcChannelTypeStreamedMedia *iface)
388 {
389 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (iface);
390 RingStreamedMediaMixinPrivate *priv = mixin->priv;
391 GPtrArray *list;
392 size_t size;
393
394 size = (priv->audio->id != 0) + (priv->video->id != 0);
395
396 list = g_ptr_array_sized_new(size);
397
398 if (priv->audio->id)
399 g_ptr_array_add(list, describe_stream(priv->audio));
400 if (priv->video->id)
401 g_ptr_array_add(list, describe_stream(priv->video));
402
403 return list;
404 }
405
406 static void
407 free_media_stream_list (GPtrArray *list)
408 {
409 const GType ElementType = TP_CHANNEL_STREAM_TYPE;
410 guint i;
411
412 if (list)
413 {
414 for (i = list->len; i-- > 0;)
415 g_boxed_free(ElementType, g_ptr_array_index(list, i));
416
417 g_ptr_array_free(list, TRUE);
418 }
419 }
420
421 /** DBus method ListStreams ( ) -> a(uuuuuu)
422 *
423 * Returns an array of structs representing the streams currently active
424 * within this channel. Each stream is identified by an unsigned integer
425 * which is unique for each stream within the channel.
426 *
427 * Returns
428 *
429 * a(uuuuuu)
430 * An array of structs containing:
431 *
432 * * the stream identifier
433 * * the contact handle who the stream is with
434 * (or 0 if the stream represents more than a single member)
435 * * the type of the stream
436 * * the current stream state
437 * * the current direction of the stream
438 * * the current pending send flags
439 */
440 static void
441 ring_streamed_media_list_streams (TpSvcChannelTypeStreamedMedia *iface,
442 DBusGMethodInvocation *context)
443 {
444 GPtrArray *list = list_media_streams (iface);
445
446 tp_svc_channel_type_streamed_media_return_from_list_streams (context, list);
447
448 free_media_stream_list (list);
449 }
450
451 /** Update media stream state.
452 *
453 * @retval 0 if nothing changed
454 * @retval 1 (or nonzero) if state changed
455 */
456 static int
457 update_media_stream (TpSvcChannelTypeStreamedMedia *iface,
458 TpHandle handle,
459 guint id,
460 TpMediaStreamType type,
461 TpMediaStreamState state,
462 TpMediaStreamDirection direction,
463 TpMediaStreamPendingSend pending)
464 {
465 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (iface);
466 RingStreamedMediaMixinPrivate *priv = mixin->priv;
467 struct stream_state *ss;
468 int changed = 0;
469
470 if (id == TP_MEDIA_STREAM_TYPE_AUDIO)
471 ss = priv->audio;
472 else if (id == TP_MEDIA_STREAM_TYPE_VIDEO)
473 ss = priv->video;
474 else
475 return 0;
476
477 if (state == TP_MEDIA_STREAM_STATE_DISCONNECTED)
478 {
479 if (ss->id != id)
480 return 0;
481
482 /* emit StreamRemoved */
483 tp_svc_channel_type_streamed_media_emit_stream_removed (iface, id);
484 memset (ss, 0, sizeof ss);
485
486 return 1;
487 }
488
489 /* emit StreamAdded */
490 if (ss->id != id)
491 {
492 changed = 1;
493
494 if (handle == 0)
495 {
496 g_object_get (iface, "peer", &handle, NULL);
497 }
498
499 ss->id = id;
500 ss->handle = handle;
501 ss->type = type;
502
503 DEBUG ("emitting StreamAdded(%u, %d, %s)",
504 id, handle,
505 type == TP_MEDIA_STREAM_TYPE_AUDIO ? "AUDIO" :
506 type == TP_MEDIA_STREAM_TYPE_VIDEO ? "VIDEO" : "???");
507
508 tp_svc_channel_type_streamed_media_emit_stream_added (iface,
509 id, handle, type);
510 }
511
512 /* emit StreamStateChanged */
513 if (ss->state != state)
514 {
515 changed = 1;
516 ss->state = state;
517
518 DEBUG("emitting StreamStateChanged(%u, %s)",
519 ss->id,
520 state == TP_MEDIA_STREAM_STATE_DISCONNECTED ? "DISCONNECTED" :
521 state == TP_MEDIA_STREAM_STATE_CONNECTING ? "CONNECTING" :
522 state == TP_MEDIA_STREAM_STATE_CONNECTED ? "CONNECTED" : "???");
523
524 tp_svc_channel_type_streamed_media_emit_stream_state_changed (iface,
525 ss->id, state);
526 }
527
528 /* emit StreamDirectionChanged */
529 if (ss->direction != direction || ss->pending != pending)
530 {
531 changed = 1;
532 ss->direction = direction;
533 ss->pending = pending;
534
535 DEBUG("emitting StreamDirectionChanged(%u, %s,%s%s%s)",
536 ss->id,
537 direction == TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL
538 ? "BIDIRECTIONAL" :
539 direction == TP_MEDIA_STREAM_DIRECTION_SEND ? "SEND" :
540 direction == TP_MEDIA_STREAM_DIRECTION_RECEIVE ? "RECV" : "NONE",
541 pending & TP_MEDIA_STREAM_PENDING_REMOTE_SEND ? " remote" : "",
542 pending & TP_MEDIA_STREAM_PENDING_LOCAL_SEND ? " local" : "",
543 pending == 0 ? " 0" : "");
544
545 tp_svc_channel_type_streamed_media_emit_stream_direction_changed (iface,
546 ss->id, ss->direction, ss->pending);
547 }
548
549 return changed;
550 }
551
552 /** DBus method RequestStreams ( u: contact_handle, au: types ) -> a(uuuuuu)
553 *
554 * Request that streams be established to exchange the given types of media
555 * with the given member. In general this will try and establish a
556 * bidirectional stream, but on some protocols it may not be possible to
557 * indicate to the peer that you would like to receive media, so a send-only
558 * stream will be created initially. In the cases where the stream requires
559 * remote agreement (eg you wish to receive media from them), the
560 * StreamDirectionChanged signal will be emitted with the
561 * MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again
562 * with the flag cleared when the remote end has replied.
563 *
564 */
565 static void
566 ring_streamed_media_request_streams (TpSvcChannelTypeStreamedMedia *iface,
567 guint handle,
568 const GArray *media_types,
569 DBusGMethodInvocation *context)
570 {
571 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (iface);
572 RingStreamedMediaMixinPrivate *priv = mixin->priv;
573 RingStreamedMediaMixinClass *klass;
574 GError *error = NULL;
575 GPtrArray *list;
576 guint i, create_audio_stream = 0, create_video_stream = 0;
577
578 DEBUG("()");
579
580 klass = RING_STREAMED_MEDIA_MIXIN_GET_CLASS (iface);
581 g_assert (klass->validate_handle != NULL);
582 g_assert (klass->create_streams != NULL);
583
584 if (!klass->validate_handle (iface, &handle, &error))
585 {
586 dbus_g_method_return_error (context, error);
587 g_clear_error (&error);
588 return;
589 }
590
591 /* We can create media only when call has not been initiated */
592 for (i = 0; i < media_types->len; i++)
593 {
594 guint media_type = g_array_index(media_types, guint, i);
595
596 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO)
597 {
598 if (priv->audio->id == 0)
599 continue;
600
601 if (!klass->create_streams (iface, handle, TRUE, FALSE, &error))
602 {
603 dbus_g_method_return_error(context, error);
604 g_clear_error(&error);
605 return;
606 }
607
608 create_audio_stream = TRUE;
609
610 update_media_stream (iface, handle,
611 RING_MEDIA_STREAM_ID_AUDIO, TP_MEDIA_STREAM_TYPE_AUDIO,
612 TP_MEDIA_STREAM_STATE_CONNECTING,
613 TP_MEDIA_STREAM_DIRECTION_NONE,
614 TP_MEDIA_STREAM_PENDING_LOCAL_SEND |
615 TP_MEDIA_STREAM_PENDING_REMOTE_SEND);
616 }
617 }
618
619 list = g_ptr_array_sized_new (media_types->len);
620
621 for (i = 0; i < media_types->len; i++) {
622 guint media_type = g_array_index(media_types, guint, i);
623 gpointer element;
624
625 if (media_type == TP_MEDIA_STREAM_TYPE_AUDIO && create_audio_stream)
626 element = describe_stream(priv->audio), create_audio_stream = 0;
627 else if (media_type == TP_MEDIA_STREAM_TYPE_VIDEO && create_video_stream)
628 element = describe_stream(priv->video), create_video_stream = 0;
629 else
630 element = describe_null_media(media_type);
631
632 g_ptr_array_add(list, element);
633 }
634
635 tp_svc_channel_type_streamed_media_return_from_request_streams (context,
636 list);
637
638 free_media_stream_list (list);
639
640 DEBUG("exit");
641 }
642
643 void
644 ring_streamed_media_mixin_iface_init (gpointer g_iface, gpointer iface_data)
645 {
646 TpSvcChannelTypeStreamedMediaClass *klass =
647 (TpSvcChannelTypeStreamedMediaClass *)g_iface;
648
649 #define IMPLEMENT(x) tp_svc_channel_type_streamed_media_implement_##x (klass, \
650 ring_streamed_media_##x)
651 IMPLEMENT (list_streams);
652 IMPLEMENT (request_streams);
653 #undef IMPLEMENT
654 }
655
656 /** Update audio state.
657 *
658 * @retval 0 if nothing changed
659 * @retval 1 (or nonzero) if state changed
660 */
661 int
662 ring_streamed_media_mixin_update_audio (gpointer _self,
663 TpHandle handle,
664 TpMediaStreamState state,
665 TpMediaStreamDirection direction,
666 TpMediaStreamPendingSend pending)
667 {
668 return update_media_stream (TP_SVC_CHANNEL_TYPE_STREAMED_MEDIA (_self),
669 handle, RING_MEDIA_STREAM_ID_AUDIO,
670 TP_MEDIA_STREAM_TYPE_AUDIO, state, direction, pending);
671 }
672
673 gboolean
674 ring_streamed_media_mixin_is_audio_stream (gpointer iface,
675 guint stream_id)
676 {
677 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (iface);
678
679 return stream_id != 0 && stream_id == mixin->priv->audio->id;
680 }
681
682 gboolean
683 ring_streamed_media_mixin_is_stream_connected (gpointer iface,
684 guint stream_id)
685 {
686 RingStreamedMediaMixin *mixin = RING_STREAMED_MEDIA_MIXIN (iface);
687
688 if (stream_id == 0)
689 return FALSE;
690
691 if (stream_id == mixin->priv->audio->id)
692 return mixin->priv->audio->state == TP_MEDIA_STREAM_STATE_CONNECTED;
693
694 if (stream_id == mixin->priv->video->id)
695 return mixin->priv->video->state == TP_MEDIA_STREAM_STATE_CONNECTED;
696
697 return FALSE;
698 }
0 /*
1 * ring-streamed-media-mixin.h - Header for RingStreamedMediaMixin
2 *
3 * Copyright (C) 2011 Nokia Corporation
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18 * USA
19 */
20
21 #ifndef RING_STREAMED_MEDIA_MIXIN_H
22 #define RING_STREAMED_MEDIA_MIXIN_H
23
24 #include <telepathy-glib/svc-connection.h>
25 #include <telepathy-glib/handle-repo.h>
26
27 G_BEGIN_DECLS
28
29 typedef struct _RingStreamedMediaMixinClass RingStreamedMediaMixinClass;
30 typedef struct _RingStreamedMediaMixin RingStreamedMediaMixin;
31 typedef struct _RingStreamedMediaMixinPrivate RingStreamedMediaMixinPrivate;
32
33 typedef gboolean (*RingStreamedMediaMixinValidateMediaHandle) (gpointer,
34 guint *handle, GError **);
35 typedef gboolean (*RingStreamedMediaMixinCreateStreams) (gpointer,
36 guint handle, gboolean audio, gboolean video, GError **);
37
38 struct _RingStreamedMediaMixinClass {
39 RingStreamedMediaMixinValidateMediaHandle validate_handle;
40 RingStreamedMediaMixinCreateStreams create_streams;
41 };
42
43 struct _RingStreamedMediaMixin {
44 RingStreamedMediaMixinPrivate *priv;
45 };
46
47 /* TYPE MACROS */
48
49 #define RING_STREAMED_MEDIA_MIXIN_CLASS_OFFSET_QUARK \
50 (ring_streamed_media_mixin_class_get_offset_quark ())
51
52 #define RING_STREAMED_MEDIA_MIXIN_CLASS_OFFSET(klass) \
53 (tp_mixin_class_get_offset (klass, \
54 RING_STREAMED_MEDIA_MIXIN_CLASS_OFFSET_QUARK))
55
56 #define RING_STREAMED_MEDIA_MIXIN_CLASS(klass) \
57 ((RingStreamedMediaMixinClass *) \
58 tp_mixin_offset_cast (klass, \
59 RING_STREAMED_MEDIA_MIXIN_CLASS_OFFSET (klass)))
60
61 #define RING_STREAMED_MEDIA_MIXIN_GET_CLASS(object) \
62 ring_streamed_media_mixin_class (G_OBJECT_GET_CLASS (object))
63
64 GQuark ring_streamed_media_mixin_class_get_offset_quark (void);
65 void ring_streamed_media_mixin_class_init (GObjectClass *klass, glong offset,
66 RingStreamedMediaMixinValidateMediaHandle validate_handle,
67 RingStreamedMediaMixinCreateStreams create_streams);
68
69 #define RING_STREAMED_MEDIA_MIXIN_OFFSET_QUARK \
70 (ring_streamed_media_mixin_get_offset_quark ())
71
72 #define RING_STREAMED_MEDIA_MIXIN_OFFSET(object) \
73 (tp_mixin_instance_get_offset (object, \
74 RING_STREAMED_MEDIA_MIXIN_OFFSET_QUARK))
75
76 #define RING_STREAMED_MEDIA_MIXIN(object) \
77 ((RingStreamedMediaMixin *) \
78 tp_mixin_offset_cast (object, \
79 RING_STREAMED_MEDIA_MIXIN_OFFSET (object)))
80
81 GQuark ring_streamed_media_mixin_get_offset_quark (void);
82
83 void ring_streamed_media_mixin_init (GObject *object, gsize offset);
84 void ring_streamed_media_mixin_finalize (GObject *object);
85
86 void ring_streamed_media_mixin_iface_init (gpointer iface, gpointer data);
87
88 /* RingStreamedMediaMixin interface */
89
90 void ring_streamed_media_mixin_fill_immutable_properties (gpointer iface,
91 GHashTable *properties);
92
93 int ring_streamed_media_mixin_update_audio (gpointer iface,
94 TpHandle handle,
95 TpMediaStreamState state,
96 TpMediaStreamDirection direction,
97 TpMediaStreamPendingSend pending);
98
99 gboolean ring_streamed_media_mixin_is_audio_stream (gpointer iface,
100 guint stream_id);
101
102 gboolean ring_streamed_media_mixin_is_stream_connected (gpointer iface,
103 guint stream_id);
104
105 G_END_DECLS
106
107 #endif /* #ifndef RING_STREAMED_MEDIA_MIXIN_H */
4343 #include <modem/errors.h>
4444 #include <modem/call.h>
4545
46 #if nomore
4647 #include <sms-glib/enums.h>
4748 #include <sms-glib/errors.h>
4849 #include <sms-glib/submit.h>
4950 #include <sms-glib/message.h>
5051 #include <sms-glib/deliver.h>
5152 #include <sms-glib/utils.h>
53 #endif
5254
5355 #include <string.h>
5456
55 static void channel_iface_init(gpointer iface, gpointer data);
5657 static void ring_text_channel_destroyable_iface_init(gpointer, gpointer);
5758
58 G_DEFINE_TYPE_WITH_CODE(
59 RingTextChannel,
60 ring_text_channel,
61 G_TYPE_OBJECT,
62 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
63 tp_dbus_properties_mixin_iface_init);
64 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL, channel_iface_init);
65 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_TYPE_TEXT,
66 tp_message_mixin_text_iface_init);
67 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE,
68 ring_text_channel_destroyable_iface_init);
69 G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES,
70 tp_message_mixin_messages_iface_init);
71 #if nomore
72 G_IMPLEMENT_INTERFACE(RTCOM_TYPE_TP_SVC_CHANNEL_INTERFACE_SMS, NULL);
73 #endif
74 G_IMPLEMENT_INTERFACE(TP_TYPE_EXPORTABLE_CHANNEL, NULL);
75 G_IMPLEMENT_INTERFACE(TP_TYPE_CHANNEL_IFACE, NULL));
59 G_DEFINE_TYPE_WITH_CODE (RingTextChannel, ring_text_channel,
60 TP_TYPE_BASE_CHANNEL,
61 G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT,
62 tp_message_mixin_text_iface_init);
63 G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE,
64 ring_text_channel_destroyable_iface_init);
65 G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_SMS, NULL);
66 G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES,
67 tp_message_mixin_messages_iface_init));
7668
7769 static const char * const ring_text_channel_interfaces[] = {
7870 TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE,
7971 TP_IFACE_CHANNEL_INTERFACE_MESSAGES,
80 #if nomore
81 RTCOM_TP_IFACE_CHANNEL_INTERFACE_SMS,
82 #endif
72 TP_IFACE_CHANNEL_INTERFACE_SMS,
8373 NULL
8474 };
8575
8878 enum
8979 {
9080 PROP_NONE,
91 PROP_OBJECT_PATH,
92 PROP_CHANNEL_PROPERTIES,
93 PROP_CHANNEL_DESTROYED,
94 PROP_CHANNEL_TYPE,
95 PROP_INTERFACES,
96 PROP_HANDLE_TYPE,
97 PROP_HANDLE,
98 PROP_TARGET_ID,
99
100 PROP_REQUESTED,
101 PROP_INITIATOR,
102 PROP_INITIATOR_ID,
10381
10482 PROP_SMS_FLASH,
105 PROP_TARGET_MATCH,
106
107 PROP_SMS_SERVICE,
108 PROP_CONNECTION,
83 PROP_SMS_CHANNEL,
84
10985 N_PROPS
11086 };
11187
11288 struct _RingTextChannelPrivate
11389 {
114 RingConnection *connection; /* property */
115 ModemSMSService *sms_service; /* property */
116
117 char *object_path; /* property */
118 TpHandle handle; /* property */
119 char const *target_id; /* property */
90 char *destination;
91
12092 GQueue sending[1];
12193
122 TpHandle initiator; /* property */
123
124 unsigned requested:1; /* property */
125
126 unsigned destroyed:1; /* property */
127
12894 unsigned sms_flash:1; /* c.n.T.Channel.Interface.SMS.Flash */
129
130 unsigned disposed:1;
131
13295 unsigned :0;
133 char *destination;
96
13497 };
13598
13699 /* ---------------------------------------------------------------------- */
137100
138 static void ring_text_channel_close(RingTextChannel *self);
139 static void ring_text_channel_destroy(RingTextChannel *self);
140
141 static void ring_text_channel_set_target_match(GValue *, char const *, int);
142
101 static void ring_text_base_channel_class_init (RingTextChannelClass *klass);
102 static void ring_text_channel_close (TpBaseChannel *base);
103
104 #if nomore
143105 static void ring_text_channel_set_receive_timestamps(RingTextChannel *self,
144106 TpMessage *msg,
145107 gpointer sms);
146
108 #endif
147109 /* Sending */
148110
149111 static void modem_sms_request_send_reply(ModemSMSService *,
157119 TpMessageSendingFlags flags);
158120
159121 /* ---------------------------------------------------------------------- */
160 /* Supported D-Bus properties */
161
162 /* Properties for org.freedesktop.Telepathy.Channel */
163 static TpDBusPropertiesMixinPropImpl channel_properties[] = {
164 { "TargetHandle", "handle", NULL },
165 { "TargetID", "handle-id", NULL },
166 { "TargetHandleType", "handle-type", NULL },
167 { "ChannelType", "channel-type", NULL },
168 { "Interfaces", "interfaces", NULL },
169 { "InitiatorHandle", "initiator", NULL },
170 { "InitiatorID", "initiator-id", NULL },
171 { "Requested", "requested", NULL },
172 { NULL }
173 };
174
175 #if nomore
176 /* Properties for c.n.T.Channel.Interface.SMS. */
177 static TpDBusPropertiesMixinPropImpl sms_properties[] = {
178 { "Flash", "sms-flash", NULL },
179 { "TargetMatch", "target-match", NULL },
180 { NULL }
181 };
182 #endif
183
184 /** Return a hash describing channel properties
185 *
186 * A channel's properties are constant for its lifetime on the bus, so
187 * this property should only change when the closed signal is emitted (so
188 * that respawned channels can reappear on the bus with different
189 * properties).
190 */
191 GHashTable *
192 ring_text_channel_properties(RingTextChannel *self)
193 {
194 return
195 tp_dbus_properties_mixin_make_properties_hash (
196 G_OBJECT(self),
197 TP_IFACE_CHANNEL, "ChannelType",
198 TP_IFACE_CHANNEL, "Interfaces",
199 TP_IFACE_CHANNEL, "TargetHandle",
200 TP_IFACE_CHANNEL, "TargetHandleType",
201 TP_IFACE_CHANNEL, "TargetID",
202 TP_IFACE_CHANNEL, "InitiatorHandle",
203 TP_IFACE_CHANNEL, "InitiatorID",
204 TP_IFACE_CHANNEL, "Requested",
205 #if nomore
206 RTCOM_TP_IFACE_CHANNEL_INTERFACE_SMS, "TargetMatch",
207 RTCOM_TP_IFACE_CHANNEL_INTERFACE_SMS, "Flash",
208 #endif
209 NULL);
210 }
211
212 static TpDBusPropertiesMixinIfaceImpl
213 ring_text_channel_dbus_property_interfaces[] = {
214 {
215 TP_IFACE_CHANNEL,
216 tp_dbus_properties_mixin_getter_gobject_properties,
217 NULL,
218 channel_properties,
219 },
220 #if nomore
221 {
222 RTCOM_TP_IFACE_CHANNEL_INTERFACE_SMS,
223 tp_dbus_properties_mixin_getter_gobject_properties,
224 NULL,
225 sms_properties,
226 },
227 #endif
228 { NULL }
229 };
230
231 /* ---------------------------------------------------------------------- */
232122
233123 /* Message types to send on this channel */
234124 static TpChannelTextMessageType
235125 ring_text_channel_message_types[] = {
236126 TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
237 /* TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT */
238127 };
239128
240129 static char const text_plain[] = "text/plain";
272161 ring_text_channel_constructed(GObject *object)
273162 {
274163 RingTextChannel *self = RING_TEXT_CHANNEL(object);
164 TpBaseChannel *base = TP_BASE_CHANNEL (self);
275165 RingTextChannelPrivate *priv = self->priv;
276 TpBaseConnection *connection = TP_BASE_CONNECTION(priv->connection);
277 TpHandleRepoIface *repo = tp_base_connection_get_handles(
278 connection, TP_HANDLE_TYPE_CONTACT);
279 void (*send)(GObject *, TpMessage *, TpMessageSendingFlags) =
280 ring_text_channel_send;
281
282 DEBUG("(%p) with %s", self, priv->object_path);
166 TpBaseConnection *connection = tp_base_channel_get_connection (base);
167 TpHandle target = tp_base_channel_get_target_handle (base);
168 TpHandleRepoIface *repo;
169 char const *target_id;
170 gboolean valid;
171
172 DEBUG ("(%p)", self);
173 if (G_OBJECT_TYPE (object) != RING_TYPE_TEXT_CHANNEL)
174 DEBUG ("Initializing derived text channel %s",
175 G_OBJECT_TYPE_NAME (object));
283176
284177 if (G_OBJECT_CLASS(ring_text_channel_parent_class)->constructed)
285178 G_OBJECT_CLASS(ring_text_channel_parent_class)->constructed(object);
286179
287 tp_handle_ref(repo, priv->handle);
288 priv->target_id = tp_handle_inspect(repo, priv->handle);
289 tp_handle_ref(repo, priv->initiator);
290
291 priv->destination = ring_text_channel_destination(priv->target_id);
292
293 dbus_g_connection_register_g_object(tp_get_bus(), priv->object_path, object);
294
295 tp_message_mixin_init(object, G_STRUCT_OFFSET(RingTextChannel, message),
296 connection);
297
298 if (G_OBJECT_TYPE(object) != RING_TYPE_TEXT_CHANNEL) {
299 DEBUG("Initializing derived text channel %s", G_OBJECT_TYPE_NAME(object));
300 }
301
302 /* Invalid destination - allow channel creation, but refuse sending */
303 if (!sms_g_is_valid_sms_address(priv->destination)) {
304 DEBUG("Destination '%s' invalid", priv->destination);
305 send = NULL;
306 }
307
308 /* Flash channel for SMS Class 0 messages */
309 if (priv->sms_flash) {
310 send = NULL;
311 }
312
313 tp_message_mixin_implement_sending(object,
314 send,
315 send ? G_N_ELEMENTS(ring_text_channel_message_types) : 0,
316 ring_text_channel_message_types,
317 0, /* No attachments */
318 send
319 ? TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES
320 | TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_SUCCESSES
321 : 0,
322 ring_text_get_content_types());
180 repo = tp_base_connection_get_handles (connection, TP_HANDLE_TYPE_CONTACT);
181 target_id = tp_handle_inspect (repo, target);
182 priv->destination = ring_text_channel_destination (target_id);
183
184 valid = modem_sms_is_valid_address (priv->destination);
185 if (!valid)
186 /* Invalid destination - allow channel creation, but refuse sending */
187 DEBUG ("Destination '%s' invalid", priv->destination);
188
189 tp_message_mixin_init (object,
190 G_STRUCT_OFFSET (RingTextChannel, message),
191 connection);
192
193 if (valid && !priv->sms_flash)
194 {
195 tp_message_mixin_implement_sending (object,
196 ring_text_channel_send,
197 G_N_ELEMENTS (ring_text_channel_message_types),
198 ring_text_channel_message_types,
199 0, /* No attachments */
200 TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES |
201 TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_SUCCESSES,
202 ring_text_get_content_types ());
203 }
204 else
205 {
206 tp_message_mixin_implement_sending (object, NULL,
207 0, NULL, 0, 0, ring_text_get_content_types ());
208 }
209
210 tp_base_channel_register (base);
323211 }
324212
325213
331219 {
332220 RingTextChannel *self = RING_TEXT_CHANNEL (object);
333221 RingTextChannelPrivate *priv = self->priv;
334 char const *id;
335222
336223 switch (property_id) {
337 case PROP_OBJECT_PATH:
338 g_value_set_string (value, priv->object_path);
339 break;
340 case PROP_CHANNEL_DESTROYED:
341 g_value_set_boolean(value, priv->destroyed);
342 break;
343 case PROP_CHANNEL_PROPERTIES:
344 g_value_take_boxed(value, ring_text_channel_properties(self));
345 break;
346 case PROP_CHANNEL_TYPE:
347 g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_TEXT);
348 break;
349 case PROP_INTERFACES:
350 g_value_set_boxed (value, ring_text_channel_interfaces);
351 break;
352 case PROP_HANDLE_TYPE:
353 g_value_set_uint (value, TP_HANDLE_TYPE_CONTACT);
354 break;
355 case PROP_HANDLE:
356 g_value_set_uint (value, priv->handle);
357 break;
358 case PROP_TARGET_ID:
359 g_value_set_string (value, priv->target_id);
360 break;
361 case PROP_REQUESTED:
362 g_value_set_boolean(value, priv->requested);
363 break;
364 case PROP_INITIATOR:
365 g_value_set_uint (value, priv->initiator);
366 break;
367 case PROP_INITIATOR_ID:
368 id = ring_connection_inspect_contact(priv->connection, priv->initiator);
369 g_value_set_string(value, id);
370 break;
371224 case PROP_SMS_FLASH:
372225 g_value_set_boolean(value, priv->sms_flash);
373226 break;
374 case PROP_TARGET_MATCH:
375 ring_text_channel_set_target_match(value, priv->destination, priv->sms_flash);
376 break;
377 case PROP_SMS_SERVICE:
378 g_value_set_pointer (value, priv->sms_service);
379 break;
380 case PROP_CONNECTION:
381 g_value_set_object (value, priv->connection);
227 case PROP_SMS_CHANNEL:
228 g_value_set_boolean (value, TRUE);
382229 break;
383230 default:
384231 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
397244
398245 switch (property_id)
399246 {
400 case PROP_OBJECT_PATH:
401 priv->object_path = g_value_dup_string (value);
402 break;
403 case PROP_REQUESTED:
404 priv->requested = g_value_get_boolean(value);
405 break;
406 case PROP_HANDLE:
407 /* we don't ref handles here because we don't necessarily have access to the
408 * contact repo yet - instead we ref it in the constructed.
409 */
410 priv->handle = g_value_get_uint(value);
411 break;
412 case PROP_INITIATOR:
413 priv->initiator = g_value_get_uint(value);
414 break;
415
416 case PROP_HANDLE_TYPE:
417 case PROP_CHANNEL_TYPE:
418 case PROP_INTERFACES:
419 /* these properties are writable in the interface, but not actually
420 * meaningfully changable on this channel, so we do nothing */
421 break;
422
423247 case PROP_SMS_FLASH:
424248 priv->sms_flash = g_value_get_boolean(value);
425249 break;
426250
427 case PROP_SMS_SERVICE:
428 if (priv->sms_service)
429 g_object_unref (priv->sms_service);
430 priv->sms_service = g_value_get_pointer (value);
431 if (priv->sms_service)
432 g_object_ref (priv->sms_service);
433 break;
434
435 case PROP_CONNECTION:
436 /* Connection owns channel object, no reference needed */
437 priv->connection = g_value_get_object (value);
438 break;
439
440251 default:
441252 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
442253 break;
447258 ring_text_channel_dispose(GObject *object)
448259 {
449260 RingTextChannel *self = RING_TEXT_CHANNEL (object);
450
451 if (self->priv->disposed)
452 return;
453
454 self->priv->disposed = TRUE;
455
456 ring_text_channel_destroy(self);
457
458 ((GObjectClass *) ring_text_channel_parent_class)->dispose(object);
261 RingTextChannelPrivate *priv = self->priv;
262
263 while (!g_queue_is_empty (priv->sending))
264 modem_request_cancel (g_queue_pop_head (priv->sending));
265
266 ((GObjectClass *)ring_text_channel_parent_class)->dispose (object);
459267 }
460268
461269 static void
463271 {
464272 RingTextChannel *self = RING_TEXT_CHANNEL (object);
465273 RingTextChannelPrivate *priv = self->priv;
466 TpBaseConnection *connection = TP_BASE_CONNECTION(priv->connection);
467 TpHandleRepoIface *contact_repo = tp_base_connection_get_handles(
468 connection, TP_HANDLE_TYPE_CONTACT);
469
470 priv->target_id = NULL;
471 tp_handle_unref(contact_repo, priv->handle), priv->handle = 0;
472 tp_handle_unref(contact_repo, priv->initiator), priv->initiator = 0;
473
474 g_free(priv->object_path), priv->object_path = NULL;
274
475275 g_free(priv->destination), priv->destination = NULL;
476276
477277 while (!g_queue_is_empty(priv->sending))
479279
480280 tp_message_mixin_finalize(object);
481281
482 priv->sms_service = NULL;
483 priv->connection = NULL;
484
485282 ((GObjectClass *)ring_text_channel_parent_class)->finalize (object);
486283 }
487284
285 /* Properties for o.f.T.Channel.Interface.SMS */
286 static TpDBusPropertiesMixinPropImpl sms_properties[] = {
287 { "Flash", "sms-flash" },
288 #if HAVE_TP_SMS_CHANNEL
289 { "SMSChannel", "sms-channel" },
290 #endif
291 { NULL }
292 };
293
294 static TpDBusPropertiesMixinIfaceImpl
295 ring_text_channel_dbus_property_interfaces[] = {
296 {
297 TP_IFACE_CHANNEL_INTERFACE_SMS,
298 tp_dbus_properties_mixin_getter_gobject_properties,
299 NULL,
300 sms_properties,
301 },
302 { NULL }
303 };
304
488305 static void
489306 ring_text_channel_class_init(RingTextChannelClass *klass)
490307 {
491308 GObjectClass *object_class = (GObjectClass *) klass;
492
309 static gboolean properties_initialized = FALSE;
493310 g_type_class_add_private(klass, sizeof (RingTextChannelPrivate));
494311
495312 object_class->constructed = ring_text_channel_constructed;
498315 object_class->dispose = ring_text_channel_dispose;
499316 object_class->finalize = ring_text_channel_finalize;
500317
501 g_object_class_override_property(
502 object_class, PROP_OBJECT_PATH, "object-path");
503 g_object_class_override_property(
504 object_class, PROP_CHANNEL_PROPERTIES, "channel-properties");
505 g_object_class_override_property(
506 object_class, PROP_CHANNEL_DESTROYED, "channel-destroyed");
507
508 g_object_class_override_property(
509 object_class, PROP_CHANNEL_TYPE, "channel-type");
510 g_object_class_override_property(
511 object_class, PROP_HANDLE_TYPE, "handle-type");
512 g_object_class_override_property(
513 object_class, PROP_HANDLE, "handle");
514 g_object_class_install_property(
515 object_class, PROP_TARGET_ID, ring_param_spec_handle_id(0));
516
517 g_object_class_install_property(
518 object_class, PROP_INTERFACES, ring_param_spec_interfaces());
519
520 g_object_class_install_property(
521 object_class, PROP_REQUESTED,
522 ring_param_spec_requested(G_PARAM_CONSTRUCT));
523 g_object_class_install_property(
524 object_class, PROP_INITIATOR,
525 ring_param_spec_initiator(0));
526 g_object_class_install_property(
527 object_class, PROP_INITIATOR_ID,
528 ring_param_spec_initiator_id(0));
529
530 g_object_class_install_property(
531 object_class, PROP_SMS_FLASH,
318 g_object_class_install_property(object_class, PROP_SMS_FLASH,
532319 g_param_spec_boolean("sms-flash",
533320 "Channel for Flash SMS Messages",
534321 "This channel is only used to receive "
537324 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
538325 G_PARAM_STATIC_STRINGS));
539326
540 g_object_class_install_property(object_class,
541 PROP_TARGET_MATCH,
542 g_param_spec_string("target-match",
543 "Fuzzy target match",
544 "Value used to fuzzily match channels from same person but different "
545 "contact handle",
546 "",
547 G_PARAM_READABLE |
548 G_PARAM_STATIC_STRINGS));
549
550 g_object_class_install_property(
551 object_class, PROP_CONNECTION, ring_param_spec_connection());
552327 g_object_class_install_property (object_class,
553 PROP_SMS_SERVICE, ring_param_spec_sms_service (0));
328 PROP_SMS_CHANNEL,
329 g_param_spec_boolean ("sms-channel",
330 "This channel is used with SMS",
331 "Messages sent and received on this channel are transmitted via SMS",
332 TRUE,
333 G_PARAM_READABLE |
334 G_PARAM_STATIC_STRINGS));
335
336 ring_text_base_channel_class_init (klass);
337
338 if (properties_initialized)
339 return;
340 properties_initialized = TRUE;
554341
555342 klass->dbus_properties_class.interfaces =
556343 ring_text_channel_dbus_property_interfaces;
344
557345 tp_dbus_properties_mixin_class_init (object_class,
558 G_STRUCT_OFFSET (RingTextChannelClass, dbus_properties_class));
559
560 tp_message_mixin_init_dbus_properties(object_class);
346 G_STRUCT_OFFSET (RingTextChannelClass, dbus_properties_class));
347
348 tp_message_mixin_init_dbus_properties (object_class);
561349 }
562350
563351 /* ---------------------------------------------------------------------- */
564352
565353 static void
566 ring_text_channel_close(RingTextChannel *self)
567 {
568 if (!self->priv->destroyed) {
569 gboolean pending;
570
571 pending = tp_message_mixin_has_pending_messages((gpointer)self, NULL);
572
573 if (pending) {
574 tp_message_mixin_set_rescued((gpointer)self);
575 }
576 else {
577 self->priv->destroyed = TRUE;
578 }
579
580 tp_svc_channel_emit_closed(self);
581 }
582 }
583
584 static void
585 ring_text_channel_destroy(RingTextChannel *self)
586 {
587 RingTextChannelPrivate *priv = self->priv;
588
589 if (!priv->destroyed) {
590 priv->destroyed = TRUE;
591
592 tp_message_mixin_clear((gpointer)self);
593
594 while (!g_queue_is_empty(priv->sending))
595 modem_request_cancel(g_queue_pop_head(priv->sending));
596
597 tp_svc_channel_emit_closed(self);
598 }
599 }
600
601
602 /* ---------------------------------------------------------------------- */
603 /* org.freedesktop.Telepathy.Channel interface */
604 static void
605 ring_text_channel_method_close(TpSvcChannel *iface,
606 DBusGMethodInvocation *context)
607 {
608 ring_text_channel_close(RING_TEXT_CHANNEL(iface));
609 tp_svc_channel_return_from_close(context);
610 }
611
612 static void
613 ring_text_channel_method_get_channel_type(TpSvcChannel *iface,
614 DBusGMethodInvocation *context)
615 {
616 tp_svc_channel_return_from_get_channel_type(context,
617 TP_IFACE_CHANNEL_TYPE_TEXT);
618 }
619
620 static void
621 ring_text_channel_method_get_handle(TpSvcChannel *iface,
622 DBusGMethodInvocation *context)
623 {
624 RingTextChannel *self = RING_TEXT_CHANNEL(iface);
625
626 tp_svc_channel_return_from_get_handle(context, TP_HANDLE_TYPE_CONTACT,
627 self->priv->handle);
628 }
629
630 static void
631 ring_text_channel_method_get_interfaces(TpSvcChannel *iface,
632 DBusGMethodInvocation *context)
633 {
634 char const ** interfaces = (gchar const **)ring_text_channel_interfaces;
635
636 tp_svc_channel_return_from_get_interfaces(context, interfaces);
637 }
638
639 static void
640 channel_iface_init(gpointer iface,
641 gpointer data)
642 {
643 TpSvcChannelClass *klass = iface;
644
645 #define IMPLEMENT(x) tp_svc_channel_implement_##x(klass, ring_text_channel_method_##x)
646 IMPLEMENT(close);
647 IMPLEMENT(get_channel_type);
648 IMPLEMENT(get_handle);
649 IMPLEMENT(get_interfaces);
650 #undef IMPLEMENT
354 ring_text_channel_close (TpBaseChannel *base)
355 {
356 if (tp_message_mixin_has_pending_messages ((gpointer)base, NULL))
357 {
358 DEBUG ("Resurrecting because of pending messages");
359 tp_message_mixin_set_rescued ((gpointer)base);
360 tp_base_channel_reopened (base, tp_base_channel_get_target_handle (base));
361 }
362 else
363 {
364 tp_base_channel_destroyed (base);
365 }
366 }
367
368 static void
369 ring_text_channel_fill_immutable_properties (TpBaseChannel *base,
370 GHashTable *properties)
371 {
372 TpBaseChannelClass *base_class =
373 TP_BASE_CHANNEL_CLASS (ring_text_channel_parent_class);
374
375 base_class->fill_immutable_properties (base, properties);
376
377 tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (base),
378 properties,
379 TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessagePartSupportFlags",
380 #if HAVE_TP_MESSAGE_MIXIN_WITH_DELI
381 TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "DeliveryReportingSupport",
382 #endif
383 TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes",
384 TP_IFACE_CHANNEL_INTERFACE_SMS, "Flash",
385 #if HAVE_TP_SMS_CHANNEL
386 TP_IFACE_CHANNEL_INTERFACE_SMS, "SMSChannel",
387 #endif
388 NULL);
389 }
390
391 static void
392 ring_text_base_channel_class_init (RingTextChannelClass *klass)
393 {
394 TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass);
395
396 base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT;
397 base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
398 base_class->interfaces = (gchar const **)ring_text_channel_interfaces;
399 base_class->close = ring_text_channel_close;
400 base_class->fill_immutable_properties =
401 ring_text_channel_fill_immutable_properties;
651402 }
652403
653404 /* ====================================================================== */
654405 /* Channel.Interface.Destroyable */
655406
656407 static void
408 ring_text_channel_destroy (RingTextChannel *self)
409 {
410 tp_message_mixin_clear ((gpointer)self);
411
412 ring_text_channel_close (TP_BASE_CHANNEL (self));
413 }
414
415 static void
657416 ring_text_channel_method_destroy(TpSvcChannelInterfaceDestroyable *iface,
658417 DBusGMethodInvocation *context)
659418 {
662421 }
663422
664423 static void
665 ring_text_channel_destroyable_iface_init(gpointer iface,
666 gpointer data)
424 ring_text_channel_destroyable_iface_init (gpointer iface,
425 gpointer data)
667426 {
668427 TpSvcChannelInterfaceDestroyableClass *klass = iface;
669428
755514 }
756515 }
757516
758 static void
759 ring_text_channel_set_target_match(GValue *value, char const *id, int flash)
760 {
761 size_t idlen = strlen(id);
762
763 /* sms_g_is_valid_sms_address() fails for IA5 names */
764 if (idlen <= 6 || !sms_g_is_valid_sms_address(id))
765 ;
517 static ModemSMSService *
518 ring_text_channel_get_sms_service (RingTextChannel *self)
519 {
520 TpBaseChannel *base = TP_BASE_CHANNEL (self);
521 TpBaseConnection *base_connection;
522 RingConnection *connection;
523 ModemOface *oface;
524
525 base_connection = tp_base_channel_get_connection (base);
526 connection = RING_CONNECTION (base_connection);
527 oface = ring_connection_get_modem_interface (connection, MODEM_OFACE_SMS);
528
529 if (oface)
530 return MODEM_SMS_SERVICE (oface);
766531 else
767 id = id + idlen - 6;
768
769 if (flash)
770 g_value_take_string(value, g_strdup_printf("sms-class-0-%s", id));
771 else
772 g_value_set_string(value, id);
532 return NULL;
773533 }
774534
775535 static void
779539 {
780540 RingTextChannel *self = RING_TEXT_CHANNEL(_self);
781541 RingTextChannelPrivate *priv = self->priv;
542 ModemSMSService *sms_service = ring_text_channel_get_sms_service (self);
782543 #if nomore
783544 gboolean srr;
784545 guint32 sms_class;
802563 return;
803564 }
804565
805 if (priv->sms_service == NULL) {
806 GError failed = { TP_ERRORS, TP_ERROR_NETWORK_ERROR,
807 "Modem connection failed" };
808 tp_message_mixin_sent(_self, msg, flags, NULL, &failed);
809 return;
810 }
566 if (sms_service == NULL)
567 {
568 GError failed = {
569 TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "SMS service is not available"
570 };
571 tp_message_mixin_sent (_self, msg, flags, NULL, &failed);
572 return;
573 }
811574
812575 /* The nomore'd stuff is currently not supported by Ofono */
813576 #if nomore
831594
832595 if (g_strcasecmp(type, text_plain) == 0) {
833596 DEBUG("Send(destination = %s," /*class = %u,*/ "text = \"%s\")",
834 priv->target_id, /*sms_class,*/ text);
597 priv->destination, /*sms_class,*/ text);
835598 }
836599 #if nomore
837600 else if (g_strcasecmp(type, "text/x-vcard") == 0 ||
854617 g_set_error(&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown content type");
855618 }
856619
857 request = modem_sms_request_send(priv->sms_service,
858 priv->target_id, text,
859 modem_sms_request_send_reply, self);
620 request = modem_sms_request_send (sms_service,
621 priv->destination, text,
622 modem_sms_request_send_reply, self);
860623
861624 if (request == NULL) {
862625 GError failed = { TP_ERRORS, TP_ERROR_NETWORK_ERROR,
909672 /* ------------------------------------------------------------------------ */
910673 /* RingTextChannel interface */
911674
675 #if nomore
676
912677 gboolean
913678 ring_text_channel_can_handle(gpointer sms)
914679 {
919684 ring_text_channel_receive_deliver(RingTextChannel *self,
920685 gpointer sms)
921686 {
687 TpBaseChannel *base = TP_BASE_CHANNEL (self);
688 TpBaseConnection *connection = tp_base_channel_get_connection (base);
689 char const *message_token = sms_g_deliver_get_message_token(sms);
922690 TpMessage *msg;
923 char const *message_token = sms_g_deliver_get_message_token(sms);
924691 guint id;
925692
926693 DEBUG("enter");
927694
928695 g_assert (ring_text_channel_can_handle(sms));
929696
930 msg = tp_message_new((TpBaseConnection *)self->priv->connection, 2, 2);
931
932 tp_message_set_handle(msg, 0, "message-sender",
933 TP_HANDLE_TYPE_CONTACT,
934 self->priv->handle);
697 msg = tp_message_new (connection, 2, 2);
698
699 tp_message_set_handle (msg, 0, "message-sender",
700 TP_HANDLE_TYPE_CONTACT, tp_base_channel_get_target_handle (base));
935701 tp_message_set_string(msg, 0, "message-token", message_token);
936702
937703 ring_text_channel_set_receive_timestamps(self, msg, sms);
943709
944710 tp_message_set_string(msg, 0, "sms-service-centre", sms_g_deliver_get_smsc(sms));
945711
712 #if nomore
946713 {
947714 char *mwi_type = NULL;
948715 guint mwi_line = 0, mwi_messages = 0;
960727 if (mwi_type) {
961728 msg_type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE;
962729
963 #if nomore
964730 /* XXX: waiting for upstream tp-glib to get these */
965731 if (g_str_equal(mwi_type, "voice"))
966732 tp_message_set_string(msg, 0, NOKIA_VOICEMAIL_TYPE, "tel");
983749 mwi_discard);
984750 }
985751 }
986 #endif
987752 g_free(mwi_type);
988753 }
989754 else {
992757
993758 tp_message_set_uint32(msg, 0, "message-type", msg_type);
994759 }
760 #endif
761
762 tp_message_set_uint32(msg, 0, "message-type",
763 TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL);
995764
996765 gboolean string = FALSE, bytes = FALSE;
997766
1041810 DEBUG("message mixin received with id=%u", id);
1042811 }
1043812
813 #endif
814
815 void
816 ring_text_channel_receive_text (RingTextChannel *self,
817 gchar const *message_token,
818 gchar const *message,
819 gint64 message_sent,
820 gint64 message_received,
821 guint32 sms_class)
822 {
823 TpBaseChannel *base = TP_BASE_CHANNEL (self);
824 TpBaseConnection *connection = tp_base_channel_get_connection (base);
825 TpMessage *msg;
826 guint id;
827
828 DEBUG("enter");
829
830 msg = tp_message_new (connection, 2, 2);
831
832 tp_message_set_handle (msg, 0, "message-sender",
833 TP_HANDLE_TYPE_CONTACT, tp_base_channel_get_target_handle (base));
834 tp_message_set_string (msg, 0, "message-token", message_token);
835 tp_message_set_uint32 (msg, 0, "message-type",
836 TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL);
837
838 tp_message_set_int64 (msg, 0, "message-sent", message_sent);
839 tp_message_set_int64 (msg, 0, "message-received", message_received);
840
841 if (0 <= sms_class && sms_class <= 3)
842 {
843 tp_message_set_uint32 (msg, 0, "sms-class", sms_class);
844 }
845
846 tp_message_set_string (msg, 1, "content-type", text_plain);
847 tp_message_set_string (msg, 1, "type", text_plain);
848 tp_message_set_string (msg, 1, "content", message);
849
850 id = tp_message_mixin_take_received ((GObject *) self, msg);
851
852 DEBUG("message mixin received with id=%u", id);
853 }
854
1044855 static void
1045856 ring_text_channel_delivery_report(RingTextChannel *self,
1046857 char const *token,
1048859 gpointer sr,
1049860 GError const *error)
1050861 {
862 TpBaseChannel *base = TP_BASE_CHANNEL (self);
863 TpBaseConnection *connection = tp_base_channel_get_connection (base);
1051864 TpMessage *msg;
1052865 guint id;
1053866
1054 msg = tp_message_new((TpBaseConnection *)self->priv->connection, 1, 1);
1055
1056 tp_message_set_handle(msg, 0, "message-sender", TP_HANDLE_TYPE_CONTACT, self->priv->handle);
1057 tp_message_set_uint32(msg, 0, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT);
867 msg = tp_message_new (connection, 1, 1);
868
869 tp_message_set_handle (msg, 0, "message-sender",
870 TP_HANDLE_TYPE_CONTACT, tp_base_channel_get_target_handle (base));
871 tp_message_set_uint32 (msg, 0, "message-type",
872 TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT);
1058873
1059874 tp_message_set_string(msg, 0, "delivery-token", token);
1060875
1062877 tp_message_set_uint32(msg, 0, "delivery-status", delivery_status);
1063878
1064879 if (sr) {
880 #if nomore
1065881 char const *message_token = sms_g_status_report_get_message_token(sr);
1066882 guint8 failure_cause = sms_g_status_report_get_status(sr);
1067883
1070886 tp_message_set_uint32(msg, 0, "sms-failure-cause", failure_cause);
1071887
1072888 ring_text_channel_set_receive_timestamps(self, msg, sr);
889 #endif
1073890 }
1074891 else {
1075892 GTimeVal gt[1];
1112929 DEBUG("delivery report received with id=%u", id);
1113930 }
1114931
932 #if nomore
1115933
1116934 static void
1117935 ring_text_channel_set_receive_timestamps(RingTextChannel *self,
1120938 {
1121939 g_return_if_fail(SMS_G_IS_MESSAGE(sms));
1122940
941 ModemSMSService *sms_service = ring_text_channel_get_sms_service (self);
1123942 gint64 sent = 0, received = 0, delivered = 0;
1124943 gint64 now = (gint64)time(NULL);
1125944
1136955 }
1137956 else {
1138957 tp_message_set_uint64(msg, 0, "stored-message-received", delivered);
1139 if (delivered > modem_sms_service_time_connected(self->priv->sms_service))
958 if (delivered > modem_sms_service_time_connected (sms_service))
1140959 tp_message_set_boolean(msg, 0, "rescued", TRUE);
1141960 }
1142961
1143962 g_object_set(sms, "time-delivered", now, NULL);
1144963 }
1145964
965 #endif
1146966
1147967 void
1148968 ring_text_channel_outgoing_sms_complete(RingTextChannel *self,
1170990 ring_text_channel_delivery_report(self, token, delivery_status, NULL, error);
1171991 }
1172992
1173
1174993 void
1175994 ring_text_channel_receive_status_report(RingTextChannel *self,
1176 gpointer sr)
1177 {
1178 guint delivery_status;
1179
1180 if (sms_g_status_report_is_status_completed(sr))
1181 delivery_status = TP_DELIVERY_STATUS_DELIVERED;
1182 else if (sms_g_status_report_is_status_permanent(sr))
1183 delivery_status = TP_DELIVERY_STATUS_PERMANENTLY_FAILED;
1184 else if (sms_g_status_report_is_status_temporary(sr))
1185 delivery_status = TP_DELIVERY_STATUS_TEMPORARILY_FAILED;
1186 else
1187 delivery_status = TP_DELIVERY_STATUS_UNKNOWN;
1188
1189 char const *token = sms_g_status_report_get_delivery_token(sr);
1190
1191 if (token == NULL)
1192 token = sms_g_status_report_get_message_token(sr);
1193
1194 ring_text_channel_delivery_report(self, token, delivery_status, sr, NULL);
1195 }
995 char const *token,
996 gboolean success)
997 {
998 guint delivery_status = success ?
999 TP_DELIVERY_STATUS_DELIVERED : TP_DELIVERY_STATUS_PERMANENTLY_FAILED;
1000 ring_text_channel_delivery_report(self, token, delivery_status, NULL, NULL);
1001 }
1002
2424 #include <glib-object.h>
2525 #include <telepathy-glib/dbus-properties-mixin.h>
2626 #include <telepathy-glib/message-mixin.h>
27
28 #include <sms-glib/deliver.h>
29 #include <sms-glib/status-report.h>
27 #include <telepathy-glib/base-channel.h>
3028
3129 G_BEGIN_DECLS
3230
3533 typedef struct _RingTextChannelPrivate RingTextChannelPrivate;
3634
3735 struct _RingTextChannelClass {
38 GObjectClass parent_class;
36 TpBaseChannelClass parent_class;
3937 TpDBusPropertiesMixinClass dbus_properties_class;
4038 };
4139
4240 struct _RingTextChannel {
43 GObject parent;
41 TpBaseChannel parent;
42
4443 TpMessageMixin message;
4544
4645 RingTextChannelPrivate *priv;
6665
6766 char *ring_text_channel_destination(char const *inspection);
6867
68 #if nomore
69
6970 /* FIXME: the gpointers are temporary hacks */
7071 gboolean ring_text_channel_can_handle(gpointer);
7172 void ring_text_channel_receive_deliver(RingTextChannel *, gpointer);
73
7274 void ring_text_channel_receive_status_report(RingTextChannel *, gpointer);
75
76 #endif
77
78 void ring_text_channel_receive_text (RingTextChannel *self,
79 gchar const *message_token,
80 gchar const *message,
81 gint64 message_sent,
82 gint64 message_received,
83 guint32 sms_class);
7384
7485 void ring_text_channel_outgoing_sms_complete(RingTextChannel *,
7586 char const *token);
4343 #include "ring-param-spec.h"
4444 #include "ring-util.h"
4545
46 #include <sms-glib/utils.h>
4746 #include <modem/sms.h>
4847 #include <modem/oface.h>
4948
5352 #include <telepathy-glib/dbus.h>
5453 #include <telepathy-glib/errors.h>
5554 #include <telepathy-glib/interfaces.h>
55
56 #include <uuid/uuid.h>
5657
5758 #include <string.h>
5859
9495 guint sms_reduced_charset :1;
9596
9697 struct {
97 gulong receiving_sms_deliver, receiving_sms_status_report;
98 gulong incoming_message, immediate_message;
9899 gulong outgoing_sms_complete, outgoing_sms_error;
100 gulong receiving_sms_status_report;
101 #if nomore
102 gulong receiving_sms_deliver;
103 #endif
104 gulong status_changed;
99105 } signals;
100106 };
101107
107113 static void ring_text_manager_connected(RingTextManager *self);
108114
109115 static void ring_text_manager_disconnect(RingTextManager *self);
116
117 static void on_connection_status_changed (TpBaseConnection *conn,
118 guint status, guint reason,
119 RingTextManager *self);
110120
111121 static gboolean ring_text_requestotron(RingTextManager *self,
112122 gpointer request,
120130 gboolean require_mine,
121131 gboolean class0);
122132
133 static gboolean tp_asv_get_sms_channel (GHashTable *properties);
134
123135 static void on_text_channel_closed(RingTextChannel *, RingTextManager *);
124136
125 static void on_sms_service_deliver(ModemSMSService *,
126 SMSGDeliver *, gpointer _self);
127 #if nomore
128137 static void on_sms_service_outgoing_complete(ModemSMSService *,
129138 char const *token,
130139 char const *destination,
131140 gpointer _self);
141
132142 static void on_sms_service_outgoing_error(ModemSMSService *,
133143 char const *token,
134144 char const *destination,
135145 GError const *error,
136146 gpointer _self);
147
137148 static void on_sms_service_status_report(ModemSMSService *,
138 SMSGStatusReport *, gpointer _self);
139 #endif
140
149 char const *destination,
150 char const *token,
151 gboolean const *success,
152 gpointer _self);
153
154 static void ring_text_manager_receive_status_report(RingTextManager *self,
155 char const *destination,
156 char const *token,
157 gboolean const *success);
158
159 #if nomore
160 static void on_sms_service_deliver(ModemSMSService *,
161 SMSGDeliver *, gpointer _self);
141162 static void ring_text_manager_receive_deliver(
142163 RingTextManager *, SMSGDeliver *);
143
144 #if nomore
145164 static void ring_text_manager_receive_status_report(
146165 RingTextManager *, SMSGStatusReport *);
147166 #endif
148167
168 static void on_incoming_message (ModemSMSService *,
169 gchar const *message,
170 GHashTable *info,
171 gpointer user_data);
172 static void on_immediate_message (ModemSMSService *,
173 gchar const *message,
174 GHashTable *info,
175 gpointer user_data);
176
149177 /* ------------------------------------------------------------------------ */
150178 /* GObject interface */
151179
152180 static void
153181 ring_text_manager_constructed(GObject *object)
154182 {
183 RingTextManager *self = RING_TEXT_MANAGER(object);
184 RingTextManagerPrivate *priv = self->priv;
185
186 priv->signals.status_changed = g_signal_connect (priv->connection,
187 "status-changed", (GCallback) on_connection_status_changed, self);
188
155189 if (G_OBJECT_CLASS(ring_text_manager_parent_class)->constructed)
156190 G_OBJECT_CLASS(ring_text_manager_parent_class)->constructed(object);
157191 }
162196 self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self, RING_TYPE_TEXT_MANAGER,
163197 RingTextManagerPrivate);
164198
165 self->priv->channels = g_hash_table_new_full(g_str_hash, g_str_equal,
166 NULL, g_object_unref);
199 self->priv->channels = g_hash_table_new_full (g_str_hash, g_str_equal,
200 NULL, g_object_unref);
167201 }
168202
169203 static void
172206 RingTextManager *self = RING_TEXT_MANAGER(object);
173207 RingTextManagerPrivate *priv = self->priv;
174208
175 ring_text_manager_disconnect(self);
176
177 if (priv->sms_service)
178 g_object_unref((GObject *)priv->sms_service);
179 priv->sms_service = NULL;
180
181 g_hash_table_remove_all (priv->channels);
209 ring_signal_disconnect (priv->connection, &priv->signals.status_changed);
210
211 ring_text_manager_disconnect (self);
212
213 tp_clear_pointer (&self->priv->channels, g_hash_table_unref);
182214
183215 G_OBJECT_CLASS(ring_text_manager_parent_class)->dispose(object);
184216 }
191223
192224 /* Free any data held directly by the object here */
193225 g_free(priv->smsc);
194 g_hash_table_destroy (priv->channels);
195226
196227 G_OBJECT_CLASS(ring_text_manager_parent_class)->finalize(object);
197228 }
339370 {
340371 RingTextManagerPrivate *priv = self->priv;
341372 ModemSMSService *sms = priv->sms_service;
342 GHashTableIter iter[1];
343 RingTextChannel *channel;
344
345 priv->signals.receiving_sms_deliver =
346 modem_sms_connect_to_deliver (sms, on_sms_service_deliver, self);
347
348 #if nomore
373
374 priv->signals.incoming_message =
375 modem_sms_connect_to_incoming_message (sms,
376 on_incoming_message, self);
377 priv->signals.immediate_message =
378 modem_sms_connect_to_immediate_message (sms,
379 on_immediate_message, self);
380
349381 priv->signals.outgoing_sms_complete =
350382 modem_sms_connect_to_outgoing_complete (sms,
351383 on_sms_service_outgoing_complete, self);
357389 priv->signals.receiving_sms_status_report =
358390 modem_sms_connect_to_status_report (sms,
359391 on_sms_service_status_report, self);
392
393 #if nomore
394 priv->signals.receiving_sms_deliver =
395 modem_sms_connect_to_deliver (sms, on_sms_service_deliver, self);
396
360397 #endif
361
362 for (g_hash_table_iter_init (iter, priv->channels);
363 g_hash_table_iter_next (iter, NULL, (gpointer)&channel);)
364 {
365 g_object_set (channel, "sms-service", sms, NULL);
366 }
367398 }
368399
369400 static void
371402 {
372403 RingTextManagerPrivate *priv = self->priv;
373404 ModemSMSService *sms = priv->sms_service;
374 GHashTableIter iter[1];
375 RingTextChannel *channel;
376
405
406 ring_signal_disconnect (sms, &priv->signals.incoming_message);
407 ring_signal_disconnect (sms, &priv->signals.immediate_message);
408 ring_signal_disconnect (sms, &priv->signals.outgoing_sms_complete);
409 ring_signal_disconnect (sms, &priv->signals.outgoing_sms_error);
410 ring_signal_disconnect (sms, &priv->signals.receiving_sms_status_report);
411
412 #if nomore
377413 ring_signal_disconnect (sms, &priv->signals.receiving_sms_deliver);
378414 ring_signal_disconnect (sms, &priv->signals.outgoing_sms_complete);
379415 ring_signal_disconnect (sms, &priv->signals.outgoing_sms_error);
380 ring_signal_disconnect (sms, &priv->signals.receiving_sms_status_report);
381
382 for (g_hash_table_iter_init (iter, priv->channels);
383 g_hash_table_iter_next (iter, NULL, (gpointer)&channel);)
416 #endif
417
418 if (priv->sms_service)
419 g_object_unref (priv->sms_service);
420 priv->sms_service = NULL;
421 }
422
423 static void
424 on_connection_status_changed (TpBaseConnection *conn,
425 guint status,
426 guint reason,
427 RingTextManager *self)
428 {
429 if (status == TP_CONNECTION_STATUS_DISCONNECTED)
384430 {
385 g_object_set (channel, "sms-service", NULL, NULL);
431 ring_text_manager_dispose (G_OBJECT (self));
386432 }
387
388 g_object_unref (priv->sms_service);
389 priv->sms_service = NULL;
390433 }
391434
392435 /* ---------------------------------------------------------------------- */
411454
412455 destination = ring_text_channel_destination(id);
413456
414 if (handle == selfhandle || sms_g_is_valid_sms_address(destination)) {
457 if (handle == selfhandle || modem_sms_is_valid_address (destination)) {
415458 g_ptr_array_add(returns,
416459 ring_contact_capability_new(handle,
417460 TP_IFACE_CHANNEL_TYPE_TEXT,
435478 static char const * const ring_text_channel_allowed_properties[] =
436479 {
437480 TP_IFACE_CHANNEL ".TargetHandle",
481 TP_IFACE_CHANNEL ".TargetID",
482 #if HAVE_TP_SMS_CHANNEL
483 TP_IFACE_CHANNEL_INTERFACE_SMS ".SMSChannel",
484 #endif
438485 NULL
439486 };
440487
558605 ring_text_channel_allowed_properties))
559606 return FALSE;
560607
608 if (!tp_asv_get_sms_channel (properties))
609 return FALSE;
610
561611 ring_text_manager_request(self, request, initiator, target, require_mine, 0);
562612 return TRUE;
563613 }
614
615 static gboolean tp_asv_get_sms_channel (GHashTable *properties)
616 {
617 GValue *value = g_hash_table_lookup (properties,
618 TP_IFACE_CHANNEL_INTERFACE_SMS ".SMSChannel");
619
620 if (value == NULL)
621 return TRUE;
622 else if (!G_VALUE_HOLDS_BOOLEAN (value))
623 return FALSE;
624 else
625 return g_value_get_boolean (value);
626 }
627
564628
565629 /* ---------------------------------------------------------------------- */
566630 /* RingTextManager interface */
584648 RingTextManagerPrivate *priv = self->priv;
585649 RingTextChannel *channel;
586650 char *object_path;
587 ModemSMSService *sms_service = priv->sms_service;
588651
589652 object_path = g_strdup_printf("%s/%s%u",
590653 priv->connection->parent.object_path,
623686 "object-path", object_path,
624687 "handle-type", TP_HANDLE_TYPE_CONTACT,
625688 "handle", handle,
626 "initiator", initiator,
689 "initiator-handle", initiator,
627690 "requested", request != NULL,
628691 "sms-flash", class0,
629 "sms-service", sms_service,
630692 NULL);
631693 g_free(object_path);
632694
697759 TpHandle handle, initiator;
698760 GError *error = NULL;
699761
762 g_return_val_if_fail (address != NULL, NULL);
763
700764 repo = tp_base_connection_get_handles(
701765 (TpBaseConnection *)self->priv->connection, TP_HANDLE_TYPE_CONTACT);
702766
721785 }
722786
723787 static void
724 on_sms_service_deliver(ModemSMSService *sms_service,
725 SMSGDeliver *deliver,
726 gpointer _self)
727 {
728 ring_text_manager_receive_deliver(RING_TEXT_MANAGER(_self), deliver);
729 }
730
731 #if nomore
732 static void
733788 on_sms_service_outgoing_complete(ModemSMSService *service,
734789 char const *destination,
735790 char const *token,
755810
756811 static void
757812 on_sms_service_outgoing_error(ModemSMSService *service,
813 char const *destination,
758814 char const *token,
759 char const *destination,
760815 GError const *error,
761816 gpointer _self)
762817 {
779834
780835 static void
781836 on_sms_service_status_report(ModemSMSService *sms_service,
782 SMSGStatusReport *status_report,
837 char const *destination,
838 char const *token,
839 gboolean const *success,
783840 gpointer _self)
784841 {
785842 ring_text_manager_receive_status_report(
786 RING_TEXT_MANAGER(_self), status_report);
787 }
843 RING_TEXT_MANAGER(_self), destination, token, success);
844 }
845
846 #if nomore
847 static void
848 on_sms_service_deliver(ModemSMSService *sms_service,
849 SMSGDeliver *deliver,
850 gpointer _self)
851 {
852 ring_text_manager_receive_deliver(RING_TEXT_MANAGER(_self), deliver);
853 }
854
855
788856 #endif
789857
790858 /* ---------------------------------------------------------------------- */
791859
792860 static void
793 ring_text_manager_receive_deliver(RingTextManager *self,
794 SMSGDeliver *deliver)
861 ring_text_manager_receive_status_report(RingTextManager *self,
862 char const *destination,
863 char const *token,
864 gboolean const *success)
795865 {
796866 RingTextManagerPrivate *priv = self->priv;
797867 RingTextChannel *channel;
798
799 char const *originator = sms_g_deliver_get_originator(deliver);
800 glong delivered = sms_g_deliver_get_delivered(deliver);
801
802 DEBUG("SMS-DELIVER from %s%s", originator, delivered ? " from spool" : "");
803
804 if (!ring_text_channel_can_handle(deliver)) {
805 DEBUG("cannot handle, ignoring");
806 return;
807 }
808
809 if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
810 DEBUG("not yet connected, ignoring");
811 return;
812 }
813
814 int class0 = sms_g_deliver_get_sms_class(deliver) == 0;
815
816 channel = get_text_channel(self, originator, class0, 0);
817
818 if (channel)
819 ring_text_channel_receive_deliver(channel, deliver);
820 }
821
822 #if nomore
823 static void
824 ring_text_manager_receive_status_report(RingTextManager *self,
825 SMSGStatusReport *status_report)
826 {
827 RingTextManagerPrivate *priv = self->priv;
828 RingTextChannel *channel;
829
830 char const *recipient = sms_g_status_report_get_recipient(status_report);
831
832 DEBUG("SMS-STATUS_REPORT for %s", recipient);
833868
834869 if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
835870 /* Uh-oh */
837872 return;
838873 }
839874
840 channel = get_text_channel(self, recipient, 0, 0);
875 channel = get_text_channel(self, destination, 0, 0);
841876
842877 if (channel)
843 ring_text_channel_receive_status_report(channel, status_report);
844 }
878 ring_text_channel_receive_status_report(channel, token, success);
879 }
880
881 #if nomore
882 static void
883 ring_text_manager_receive_deliver(RingTextManager *self,
884 SMSGDeliver *deliver)
885 {
886 RingTextManagerPrivate *priv = self->priv;
887 RingTextChannel *channel;
888
889 char const *originator = sms_g_deliver_get_originator(deliver);
890 glong delivered = sms_g_deliver_get_delivered(deliver);
891
892 DEBUG("SMS-DELIVER from %s%s", originator, delivered ? " from spool" : "");
893
894 if (!ring_text_channel_can_handle(deliver)) {
895 DEBUG("cannot handle, ignoring");
896 return;
897 }
898
899 if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
900 DEBUG("not yet connected, ignoring");
901 return;
902 }
903
904 int class0 = sms_g_deliver_get_sms_class(deliver) == 0;
905
906 channel = get_text_channel(self, originator, class0, 0);
907
908 if (channel)
909 ring_text_channel_receive_deliver(channel, deliver);
910 }
911
845912 #endif
913
914 static char *
915 generate_token (void)
916 {
917 char *token;
918 uuid_t uu;
919
920 token = g_new (gchar, 37);
921 uuid_generate_random (uu);
922 uuid_unparse_lower (uu, token);
923
924 return token;
925 }
926
927 static void
928 receive_text (RingTextManager *self,
929 RingTextChannel *channel,
930 gchar const *message,
931 GHashTable *info,
932 guint32 sms_class)
933 {
934 char const *sent;
935 char *token;
936 gint64 message_sent = 0;
937 gint64 message_received = (gint64) time(NULL);
938
939 sent = tp_asv_get_string (info, "SentTime");
940 if (sent)
941 message_sent = modem_sms_parse_time (sent);
942 if (!message_sent)
943 message_sent = message_received;
944
945 token = generate_token ();
946 ring_text_channel_receive_text (channel,
947 token, message, message_sent, message_received, sms_class);
948 g_free (token);
949 }
950
951 static void
952 on_incoming_message (ModemSMSService *sms,
953 gchar const *message,
954 GHashTable *info,
955 gpointer _self)
956 {
957 RingTextManager *self = RING_TEXT_MANAGER (_self);
958 char const *sender;
959 RingTextChannel *channel;
960
961 g_return_if_fail (info != NULL);
962 g_return_if_fail (message != NULL);
963
964 sender = tp_asv_get_string (info, "Sender");
965 g_return_if_fail (sender != NULL);
966
967 channel = get_text_channel (self, sender, 0, 0);
968 g_return_if_fail (channel != NULL);
969
970 receive_text (self, channel, message, info, G_MAXUINT32);
971 }
972
973 static void
974 on_immediate_message (ModemSMSService *sms,
975 gchar const *message,
976 GHashTable *info,
977 gpointer _self)
978 {
979 RingTextManager *self = RING_TEXT_MANAGER (_self);
980 char const *sender;
981 RingTextChannel *channel;
982
983 g_return_if_fail (info != NULL);
984 g_return_if_fail (message != NULL);
985
986 sender = tp_asv_get_string (info, "Sender");
987 g_return_if_fail (sender != NULL);
988
989 channel = get_text_channel (self, sender, TRUE, 0);
990 g_return_if_fail (channel != NULL);
991
992 receive_text (self, channel, message, info, 0);
993 }
846994
847995 /* ---------------------------------------------------------------------- */
848996 /* StoredMessages interface */
8551003 { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "SMS service is not available" };
8561004 dbus_g_method_return_error(context, &error);
8571005 }
858 #endif
8591006
8601007 void
8611008 ring_text_manager_deliver_stored_messages(RingTextManager *self,
8951042 #endif
8961043 }
8971044
898 #if nomore
8991045 void
9001046 ring_text_manager_expunge_messages(RingTextManager *self,
9011047 char const **messages,
5959 gpointer ring_text_manager_lookup(RingTextManager *self,
6060 char const *object_path);
6161
62 #if nomore
6263 void ring_text_manager_deliver_stored_messages(RingTextManager *,
6364 char const **messages,
6465 gpointer context);
7374
7475 char **ring_text_manager_list_stored_messages(RingTextManager const *);
7576
77 #endif
78
7679 void ring_text_manager_add_capabilities(RingTextManager *self,
7780 guint handle, GPtrArray *returns);
7881
22 *
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
56 *
67 * This work is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU Lesser General Public
2829 #include <telepathy-glib/base-connection.h>
2930 #include <telepathy-glib/dbus-properties-mixin.h>
3031 #include <telepathy-glib/group-mixin.h>
32 #include <telepathy-glib/interfaces.h>
3133
3234 #include <string.h>
3335
210212 DEBUG("*** expecting %u for %s, got %u",
211213 g_value_get_boolean(fixed), (char *)keyp, g_value_get_boolean(requested));
212214 }
213 else if (G_VALUE_HOLDS(requested, G_TYPE_STRING)) {
214 if (!tp_strdiff(g_value_get_string(fixed), g_value_get_string(requested)))
215 continue;
216 DEBUG("*** expecting \"%s\" for %s, got \"%s\"",
217 g_value_get_string(fixed), (char *)keyp, g_value_get_string(requested));
218 }
219 else {
220 g_warning("*** fixed-properties contains %s ***", G_VALUE_TYPE_NAME(fixed));
221 }
215 else if (G_VALUE_HOLDS (requested, G_TYPE_STRING))
216 {
217 char const *fixed_string = g_value_get_string (fixed);
218 char const *requested_string = g_value_get_string (requested);
219
220 if (!tp_strdiff (fixed_string, requested_string))
221 continue;
222
223 if (tp_strdiff (keyp, "org.freedesktop.Telepathy.Channel.ChannelType"))
224 {
225 DEBUG ("*** expecting \"%s\" for %s, got \"%s\"",
226 fixed_string, (char *)keyp, requested_string);
227 }
228 }
229 else
230 {
231 g_warning ("*** fixed-properties contains %s ***",
232 G_VALUE_TYPE_NAME (fixed));
233 }
222234
223235 return 0;
224236 }
464476
465477 return TP_CHANNEL_GROUP_CHANGE_REASON_ERROR;
466478 }
479
480 /* ---------------------------------------------------------------------- */
481 /* Initial media stuff */
482
483 gboolean
484 tp_asv_get_initial_audio (GHashTable *properties, gboolean default_value)
485 {
486 GValue *value = g_hash_table_lookup (properties,
487 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio");
488
489 if (value && G_VALUE_HOLDS_BOOLEAN (value))
490 return g_value_get_boolean (value);
491 else
492 return default_value;
493 }
494
495 gboolean
496 tp_asv_get_initial_video (GHashTable *properties, gboolean default_value)
497 {
498 GValue *value = g_hash_table_lookup (properties,
499 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo");
500
501 if (value && G_VALUE_HOLDS_BOOLEAN (value))
502 return g_value_get_boolean (value);
503 else
504 return default_value;
505 }
506
00 /*
1 * ring-util.c - Miscellaneous utility functions
1 -util.c - Miscellaneous utility functions
22 *
33 * Copyright (C) 2007-2010 Nokia Corporation
44 * @author Pekka Pessi <first.surname@nokia.com>
5 *
5 * @author Tom Swindell <t.swindell@rubyx.co.uk>
66 * This work is free software; you can redistribute it and/or
77 * modify it under the terms of the GNU Lesser General Public
88 * License as published by the Free Software Foundation; either
9292 *id = 0;
9393 }
9494
95 #define tp_asv_get_initial_audio ring_tp_asv_get_initial_audio
96 #define tp_asv_get_initial_video ring_tp_asv_get_initial_video
97
98 gboolean tp_asv_get_initial_audio (GHashTable *asv, gboolean default_value);
99 gboolean tp_asv_get_initial_video (GHashTable *asv, gboolean default_value);
100
95101 G_END_DECLS
96102
97103 #endif /* #ifndef __RING_UTIL_H__*/
0 /*
1 * util.c - Source for Ring utility functions
2 * Copyright (C) 2006-2007 Collabora Ltd.
3 * Copyright (C) 2006-2007 Nokia Corporation
4 * @author Robert McQueen <robert.mcqueen@collabora.co.uk>
5 * @author Simon McVittie <simon.mcvittie@collabora.co.uk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include "config.h"
23 #include "util.h"
24
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include <gobject/gvaluecollector.h>
31
32 #include <telepathy-glib/telepathy-glib.h>
33 #include <telepathy-glib/telepathy-glib-dbus.h>
34
35 #define DEBUG_FLAG RING_DEBUG_JID
36
37 #include "ring-connection.h"
38
39 gchar *
40 sha1_hex (const gchar *bytes,
41 guint len)
42 {
43 gchar *hex = g_compute_checksum_for_string (G_CHECKSUM_SHA1, bytes, len);
44 guint i;
45
46 for (i = 0; i < SHA1_HASH_SIZE * 2; i++)
47 {
48 g_assert (hex[i] != '\0');
49 hex[i] = g_ascii_tolower (hex[i]);
50 }
51
52 g_assert (hex[SHA1_HASH_SIZE * 2] == '\0');
53
54 return hex;
55 }
56
57 void
58 sha1_bin (const gchar *bytes,
59 guint len,
60 guchar out[SHA1_HASH_SIZE])
61 {
62 GChecksum *checksum = g_checksum_new (G_CHECKSUM_SHA1);
63 gsize out_len = SHA1_HASH_SIZE;
64
65 g_assert (g_checksum_type_get_length (G_CHECKSUM_SHA1) == SHA1_HASH_SIZE);
66 g_checksum_update (checksum, (const guchar *) bytes, len);
67 g_checksum_get_digest (checksum, out, &out_len);
68 g_assert (out_len == SHA1_HASH_SIZE);
69 g_checksum_free (checksum);
70 }
71
72
73 /** ring_generate_id:
74 *
75 * RFC4122 version 4 compliant random UUIDs generator.
76 *
77 * Returns: A string with RFC41122 version 4 random UUID, must be freed with
78 * g_free().
79 */
80 gchar *
81 ring_generate_id (void)
82 {
83 GRand *grand;
84 gchar *str;
85 struct {
86 guint32 time_low;
87 guint16 time_mid;
88 guint16 time_hi_and_version;
89 guint8 clock_seq_hi_and_rsv;
90 guint8 clock_seq_low;
91 guint16 node_hi;
92 guint32 node_low;
93 } uuid;
94
95 /* Fill with random. Every new GRand are seede with 128 bit read from
96 * /dev/urandom (or the current time on non-unix systems). This makes the
97 * random source good enough for our usage, but may not be suitable for all
98 * situation outside Ring. */
99 grand = g_rand_new ();
100 uuid.time_low = g_rand_int (grand);
101 uuid.time_mid = (guint16) g_rand_int_range (grand, 0, G_MAXUINT16);
102 uuid.time_hi_and_version = (guint16) g_rand_int_range (grand, 0, G_MAXUINT16);
103 uuid.clock_seq_hi_and_rsv = (guint8) g_rand_int_range (grand, 0, G_MAXUINT8);
104 uuid.clock_seq_low = (guint8) g_rand_int_range (grand, 0, G_MAXUINT8);
105 uuid.node_hi = (guint16) g_rand_int_range (grand, 0, G_MAXUINT16);
106 uuid.node_low = g_rand_int (grand);
107 g_rand_free (grand);
108
109 /* Set the two most significant bits (bits 6 and 7) of the
110 * clock_seq_hi_and_rsv to zero and one, respectively. */
111 uuid.clock_seq_hi_and_rsv = (uuid.clock_seq_hi_and_rsv & 0x3F) | 0x80;
112
113 /* Set the four most significant bits (bits 12 through 15) of the
114 * time_hi_and_version field to 4 */
115 uuid.time_hi_and_version = (uuid.time_hi_and_version & 0x0fff) | 0x4000;
116
117 str = g_strdup_printf ("%08x-%04x-%04x-%02x%02x-%04x%08x",
118 uuid.time_low,
119 uuid.time_mid,
120 uuid.time_hi_and_version,
121 uuid.clock_seq_hi_and_rsv,
122 uuid.clock_seq_low,
123 uuid.node_hi,
124 uuid.node_low);
125
126 return str;
127 }
128
129 /**
130 * ring_get_room_handle_from_jid:
131 * @room_repo: The %TP_HANDLE_TYPE_ROOM handle repository
132 * @jid: A JID
133 *
134 * Given a JID seen in the from="" attribute on a stanza, work out whether
135 * it's something to do with a MUC, and if so, return its handle.
136 *
137 * Returns: The handle of the MUC, if the JID refers to either a MUC
138 * we're in, or a contact's channel-specific JID inside a MUC.
139 * Returns 0 if the JID is either invalid, or nothing to do with a
140 * known MUC (typically this will mean it's the global JID of a contact).
141 */
142 TpHandle
143 ring_get_room_handle_from_jid (TpHandleRepoIface *room_repo,
144 const gchar *jid)
145 {
146 TpHandle handle;
147 gchar *room;
148
149 room = ring_remove_resource (jid);
150 if (room == NULL)
151 return 0;
152
153 handle = tp_handle_lookup (room_repo, room, NULL, NULL);
154 g_free (room);
155 return handle;
156 }
157
158 #define INVALID_HANDLE(e, f, ...) \
159 G_STMT_START { \
160 DEBUG (f, ##__VA_ARGS__); \
161 g_set_error (e, TP_ERROR, TP_ERROR_INVALID_HANDLE, f, ##__VA_ARGS__);\
162 } G_STMT_END
163
164 gchar *
165 ring_remove_resource (const gchar *jid)
166 {
167 char *slash = strchr (jid, '/');
168 gchar *buf;
169
170 if (slash == NULL)
171 return g_strdup (jid);
172
173 /* The user and domain parts can't contain '/', assuming it's valid */
174 buf = g_malloc (slash - jid + 1);
175 strncpy (buf, jid, slash - jid);
176 buf[slash - jid] = '\0';
177
178 return buf;
179 }
180
181 gchar *
182 ring_encode_jid (
183 const gchar *node,
184 const gchar *domain,
185 const gchar *resource)
186 {
187 gchar *tmp, *ret;
188
189 g_return_val_if_fail (domain != NULL, NULL);
190
191 if (node != NULL && resource != NULL)
192 tmp = g_strdup_printf ("%s@%s/%s", node, domain, resource);
193 else if (node != NULL)
194 tmp = g_strdup_printf ("%s@%s", node, domain);
195 else if (resource != NULL)
196 tmp = g_strdup_printf ("%s/%s", domain, resource);
197 else
198 tmp = g_strdup (domain);
199
200 ret = g_utf8_normalize (tmp, -1, G_NORMALIZE_NFKC);
201 g_free (tmp);
202 return ret;
203 }
204
205 typedef struct {
206 GObject *instance;
207 GObject *user_data;
208 gulong handler_id;
209 } WeakHandlerCtx;
210
211 static WeakHandlerCtx *
212 whc_new (GObject *instance,
213 GObject *user_data)
214 {
215 WeakHandlerCtx *ctx = g_slice_new0 (WeakHandlerCtx);
216
217 ctx->instance = instance;
218 ctx->user_data = user_data;
219
220 return ctx;
221 }
222
223 static void
224 whc_free (WeakHandlerCtx *ctx)
225 {
226 g_slice_free (WeakHandlerCtx, ctx);
227 }
228
229 static void user_data_destroyed_cb (gpointer, GObject *);
230
231 static void
232 instance_destroyed_cb (gpointer ctx_,
233 GObject *where_the_instance_was)
234 {
235 WeakHandlerCtx *ctx = ctx_;
236
237 /* No need to disconnect the signal here, the instance has gone away. */
238 g_object_weak_unref (ctx->user_data, user_data_destroyed_cb, ctx);
239 whc_free (ctx);
240 }
241
242 static void
243 user_data_destroyed_cb (gpointer ctx_,
244 GObject *where_the_user_data_was)
245 {
246 WeakHandlerCtx *ctx = ctx_;
247
248 g_signal_handler_disconnect (ctx->instance, ctx->handler_id);
249 g_object_weak_unref (ctx->instance, instance_destroyed_cb, ctx);
250 whc_free (ctx);
251 }
252
253 /**
254 * ring_signal_connect_weak:
255 * @instance: the instance to connect to.
256 * @detailed_signal: a string of the form "signal-name::detail".
257 * @c_handler: the GCallback to connect.
258 * @user_data: an object to pass as data to c_handler calls.
259 *
260 * Connects a #GCallback function to a signal for a particular object, as if
261 * with g_signal_connect(). Additionally, arranges for the signal handler to be
262 * disconnected if @user_data is destroyed.
263 *
264 * This is intended to be a convenient way for objects to use themselves as
265 * user_data for callbacks without having to explicitly disconnect all the
266 * handlers in their finalizers.
267 */
268 void
269 ring_signal_connect_weak (gpointer instance,
270 const gchar *detailed_signal,
271 GCallback c_handler,
272 GObject *user_data)
273 {
274 GObject *instance_obj = G_OBJECT (instance);
275 WeakHandlerCtx *ctx = whc_new (instance_obj, user_data);
276
277 ctx->handler_id = g_signal_connect (instance, detailed_signal, c_handler,
278 user_data);
279
280 g_object_weak_ref (instance_obj, instance_destroyed_cb, ctx);
281 g_object_weak_ref (user_data, user_data_destroyed_cb, ctx);
282 }
283
284 typedef struct {
285 GSourceFunc function;
286 GObject *object;
287 guint source_id;
288 } WeakIdleCtx;
289
290 static void
291 idle_weak_ref_notify (gpointer data,
292 GObject *dead_object)
293 {
294 g_source_remove (GPOINTER_TO_UINT (data));
295 }
296
297 static void
298 idle_removed (gpointer data)
299 {
300 WeakIdleCtx *ctx = (WeakIdleCtx *) data;
301
302 g_slice_free (WeakIdleCtx, ctx);
303 }
304
305 static gboolean
306 idle_callback (gpointer data)
307 {
308 WeakIdleCtx *ctx = (WeakIdleCtx *) data;
309
310 if (ctx->function ((gpointer) ctx->object))
311 {
312 return TRUE;
313 }
314 else
315 {
316 g_object_weak_unref (
317 ctx->object, idle_weak_ref_notify, GUINT_TO_POINTER (ctx->source_id));
318 return FALSE;
319 }
320 }
321
322 /* Like g_idle_add(), but cancel the callback if the provided object is
323 * finalized.
324 */
325 guint
326 ring_idle_add_weak (GSourceFunc function,
327 GObject *object)
328 {
329 WeakIdleCtx *ctx;
330
331 ctx = g_slice_new0 (WeakIdleCtx);
332 ctx->function = function;
333 ctx->object = object;
334 ctx->source_id = g_idle_add_full (
335 G_PRIORITY_DEFAULT_IDLE, idle_callback, ctx, idle_removed);
336
337 g_object_weak_ref (
338 object, idle_weak_ref_notify, GUINT_TO_POINTER (ctx->source_id));
339 return ctx->source_id;
340 }
341
342 GPtrArray *
343 ring_g_ptr_array_copy (GPtrArray *source)
344 {
345 GPtrArray *ret = g_ptr_array_sized_new (source->len);
346 guint i;
347
348 for (i = 0; i < source->len; i++)
349 g_ptr_array_add (ret, g_ptr_array_index (source, i));
350
351 return ret;
352 }
353
354 gchar *
355 ring_peer_to_jid (RingConnection *conn,
356 TpHandle peer,
357 const gchar *resource)
358 {
359 TpHandleRepoIface *repo = tp_base_connection_get_handles (
360 TP_BASE_CONNECTION (conn), TP_HANDLE_TYPE_CONTACT);
361 const gchar *target = tp_handle_inspect (repo, peer);
362
363 if (resource == NULL)
364 return g_strdup (target);
365
366 return g_strdup_printf ("%s/%s", target, resource);
367 }
368
369 /* Like wocky_enum_from_nick, but for GFlagsValues instead. */
370 gboolean
371 ring_flag_from_nick (GType flag_type,
372 const gchar *nick,
373 guint *value)
374 {
375 GFlagsClass *klass = g_type_class_ref (flag_type);
376 GFlagsValue *flag_value;
377
378 g_return_val_if_fail (klass != NULL, FALSE);
379 g_return_val_if_fail (value != NULL, FALSE);
380
381 flag_value = g_flags_get_value_by_nick (klass, nick);
382 g_type_class_unref (klass);
383
384 if (flag_value != NULL)
385 {
386 *value = flag_value->value;
387 return TRUE;
388 }
389 else
390 {
391 return FALSE;
392 }
393 }
394
395 /**
396 * ring_simple_async_succeed_or_fail_in_idle:
397 * @self: the source object for an asynchronous function
398 * @callback: a callback to call when @todo things have been done
399 * @user_data: user data for the callback
400 * @source_tag: the source tag for a #GSimpleAsyncResult
401 * @error: (allow-none): %NULL to indicate success, or an error on failure
402 *
403 * Create a new #GSimpleAsyncResult and schedule it to call its callback
404 * in an idle. If @error is %NULL, report success with
405 * tp_simple_async_report_success_in_idle(); if @error is non-%NULL,
406 * use g_simple_async_report_gerror_in_idle().
407 */
408 void
409 ring_simple_async_succeed_or_fail_in_idle (gpointer self,
410 GAsyncReadyCallback callback,
411 gpointer user_data,
412 gpointer source_tag,
413 const GError *error)
414 {
415 if (error == NULL)
416 {
417 tp_simple_async_report_success_in_idle (self, callback, user_data,
418 source_tag);
419 }
420 else
421 {
422 /* not const-correct yet: GNOME #622004 */
423 g_simple_async_report_gerror_in_idle (self, callback, user_data,
424 (GError *) error);
425 }
426 }
427
428 /**
429 * ring_simple_async_countdown_new:
430 * @self: the source object for an asynchronous function
431 * @callback: a callback to call when @todo things have been done
432 * @user_data: user data for the callback
433 * @source_tag: the source tag for a #GSimpleAsyncResult
434 * @todo: number of things to do before calling @callback (at least 1)
435 *
436 * Create a new #GSimpleAsyncResult that will call its callback when a number
437 * of asynchronous operations have happened.
438 *
439 * An internal counter is initialized to @todo, incremented with
440 * ring_simple_async_countdown_inc() or decremented with
441 * ring_simple_async_countdown_dec().
442 *
443 * When that counter reaches zero, if an error has been set with
444 * g_simple_async_result_set_from_error() or similar, the operation fails;
445 * otherwise, it succeeds.
446 *
447 * The caller must not use the operation result functions, such as
448 * g_simple_async_result_get_op_res_gssize() - this async result is only
449 * suitable for "void" async methods which return either success or a #GError,
450 * i.e. the same signature as g_async_initable_init_async().
451 *
452 * Returns: (transfer full): a counter
453 */
454 GSimpleAsyncResult *
455 ring_simple_async_countdown_new (gpointer self,
456 GAsyncReadyCallback callback,
457 gpointer user_data,
458 gpointer source_tag,
459 gssize todo)
460 {
461 GSimpleAsyncResult *simple;
462
463 g_return_val_if_fail (todo >= 1, NULL);
464
465 simple = g_simple_async_result_new (self, callback, user_data, source_tag);
466 /* We (ab)use the op_res member as a count of things to do. When
467 * it reaches zero, the operation completes with any error that has been
468 * set, or with success. */
469 g_simple_async_result_set_op_res_gssize (simple, todo);
470
471 /* we keep one extra reference as long as the counter is nonzero */
472 g_object_ref (simple);
473
474 return simple;
475 }
476
477 /**
478 * ring_simple_async_countdown_inc:
479 * @simple: a result created by ring_simple_async_countdown_new()
480 *
481 * Increment the counter in @simple, indicating that an additional async
482 * operation has been started. An additional call to
483 * ring_simple_async_countdown_dec() will be needed to make @simple
484 * call its callback.
485 */
486 void
487 ring_simple_async_countdown_inc (GSimpleAsyncResult *simple)
488 {
489 gssize todo = g_simple_async_result_get_op_res_gssize (simple);
490
491 g_return_if_fail (todo >= 1);
492 g_simple_async_result_set_op_res_gssize (simple, todo + 1);
493 }
494
495 /**
496 * ring_simple_async_countdown_dec:
497 * @simple: a result created by ring_simple_async_countdown_new()
498 *
499 * Decrement the counter in @simple. If the number of things to do has
500 * reached zero, schedule @simple to call its callback in an idle, then
501 * unref it.
502 *
503 * When one of the asynchronous operations needed for @simple succeeds,
504 * this should be signalled by a call to this function.
505 *
506 * When one of the asynchronous operations needed for @simple fails,
507 * this should be signalled by a call to g_simple_async_result_set_from_error()
508 * (or one of the similar functions), followed by a call to this function.
509 * If more than one async operation fails in this way, the #GError from the
510 * last failure will be used.
511 */
512 void
513 ring_simple_async_countdown_dec (GSimpleAsyncResult *simple)
514 {
515 gssize todo = g_simple_async_result_get_op_res_gssize (simple);
516
517 g_simple_async_result_set_op_res_gssize (simple, --todo);
518
519 if (todo <= 0)
520 {
521 g_simple_async_result_complete_in_idle (simple);
522 g_object_unref (simple);
523 }
524 }
0 /*
1 * util.h - Headers for Ring utility functions
2 * Copyright (C) 2006 Collabora Ltd.
3 * Copyright (C) 2006 Nokia Corporation
4 * @author Robert McQueen <robert.mcqueen@collabora.co.uk>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __GABBLE_UTIL_H__
22 #define __GABBLE_UTIL_H__
23
24 #include <config.h>
25
26 #include <glib.h>
27 #include <telepathy-glib/telepathy-glib.h>
28
29 #include "ring-connection.h"
30
31 /* Guarantees that the resulting hash is in lower-case */
32 gchar *sha1_hex (const gchar *bytes, guint len);
33
34 /* A SHA1 digest is 20 bytes long */
35 #define SHA1_HASH_SIZE 20
36 void sha1_bin (const gchar *bytes, guint len, guchar out[SHA1_HASH_SIZE]);
37
38 gchar *ring_generate_id (void);
39
40 G_GNUC_WARN_UNUSED_RESULT
41 gchar *ring_encode_jid (const gchar *node, const gchar *domain,
42 const gchar *resource);
43
44 gchar *ring_remove_resource (const gchar *jid);
45 gchar *ring_normalize_room (TpHandleRepoIface *repo, const gchar *jid,
46 gpointer context, GError **error);
47 TpHandle ring_get_room_handle_from_jid (TpHandleRepoIface *room_repo,
48 const gchar *jid);
49
50 void ring_signal_connect_weak (gpointer instance, const gchar *detailed_signal,
51 GCallback c_handler, GObject *user_data);
52 guint ring_idle_add_weak (GSourceFunc function, GObject *object);
53
54 GPtrArray *ring_g_ptr_array_copy (GPtrArray *source);
55
56 gchar * ring_peer_to_jid (RingConnection *conn,
57 TpHandle peer,
58 const gchar *resource);
59
60 gboolean
61 ring_flag_from_nick (GType flag_type, const gchar *nick,
62 guint *value);
63
64 void ring_simple_async_succeed_or_fail_in_idle (gpointer self,
65 GAsyncReadyCallback callback,
66 gpointer user_data,
67 gpointer source_tag,
68 const GError *error);
69
70 GSimpleAsyncResult *ring_simple_async_countdown_new (gpointer self,
71 GAsyncReadyCallback callback,
72 gpointer user_data,
73 gpointer source_tag,
74 gssize todo);
75 void ring_simple_async_countdown_inc (GSimpleAsyncResult *simple);
76 void ring_simple_async_countdown_dec (GSimpleAsyncResult *simple);
77
78 /* Boilerplate for telling servers which implement XEP-0079 not to store these
79 * messages for delivery later. Include it in your call to wocky_stanza_build()
80 * like so:
81 *
82 * wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
83 * NULL, jid,
84 * '(', "close",
85 * ':', NS_TUBES,
86 * '@', "tube", id_str,
87 * ')',
88 * RING_AMP_DO_NOT_STORE_SPEC,
89 * NULL);
90 *
91 * Every 1000th user will win a Marshall amplifier!
92 */
93 #define RING_AMP_DO_NOT_STORE_SPEC \
94 '(', "amp", \
95 ':', NS_AMP, \
96 '(', "rule", \
97 '@', "condition", "deliver-at", \
98 '@', "value", "stored", \
99 '@', "action", "error", \
100 ')', \
101 '(', "rule", \
102 '@', "condition", "match-resource", \
103 '@', "value", "exact", \
104 '@', "action", "error", \
105 ')', \
106 ')'
107
108
109 #endif /* __GABBLE_UTIL_H__ */
0 SUBDIRS = twisted
1
02 AM_CFLAGS = $(ERROR_CFLAGS) \
13 @GLIB_CFLAGS@ @DBUS_CFLAGS@ \
24 -I$(top_srcdir) @CHECK_CFLAGS@
5
6 dist_noinst_SCRIPTS = ring-monitor
37
48 noinst_LTLIBRARIES = libtestcommon.la
59
913 tools_dir = $(top_srcdir)/tools
1014
1115 MOSTLYCLEANFILES = $(BUILT_SOURCES)
16
17 test_DATA = tests.xml
+0
-519
tests/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = tests
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 LTLIBRARIES = $(noinst_LTLIBRARIES)
50 libtestcommon_la_LIBADD =
51 am_libtestcommon_la_OBJECTS = test-common.lo
52 libtestcommon_la_OBJECTS = $(am_libtestcommon_la_OBJECTS)
53 AM_V_lt = $(am__v_lt_$(V))
54 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
55 am__v_lt_0 = --silent
56 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
57 depcomp = $(SHELL) $(top_srcdir)/depcomp
58 am__depfiles_maybe = depfiles
59 am__mv = mv -f
60 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
61 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
62 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
63 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
64 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
65 $(AM_CFLAGS) $(CFLAGS)
66 AM_V_CC = $(am__v_CC_$(V))
67 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
68 am__v_CC_0 = @echo " CC " $@;
69 AM_V_at = $(am__v_at_$(V))
70 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
71 am__v_at_0 = @
72 CCLD = $(CC)
73 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
74 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
75 $(AM_LDFLAGS) $(LDFLAGS) -o $@
76 AM_V_CCLD = $(am__v_CCLD_$(V))
77 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
78 am__v_CCLD_0 = @echo " CCLD " $@;
79 AM_V_GEN = $(am__v_GEN_$(V))
80 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
81 am__v_GEN_0 = @echo " GEN " $@;
82 SOURCES = $(libtestcommon_la_SOURCES)
83 DIST_SOURCES = $(libtestcommon_la_SOURCES)
84 ETAGS = etags
85 CTAGS = ctags
86 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
87 ACLOCAL = @ACLOCAL@
88 AMTAR = @AMTAR@
89 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
90 AR = @AR@
91 AUTOCONF = @AUTOCONF@
92 AUTOHEADER = @AUTOHEADER@
93 AUTOMAKE = @AUTOMAKE@
94 AWK = @AWK@
95 CC = @CC@
96 CCDEPMODE = @CCDEPMODE@
97 CFLAGS = @CFLAGS@
98 CHECK_CFLAGS = @CHECK_CFLAGS@
99 CHECK_LIBS = @CHECK_LIBS@
100 CPP = @CPP@
101 CPPFLAGS = @CPPFLAGS@
102 CYGPATH_W = @CYGPATH_W@
103 DATADIR = @DATADIR@
104 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
105 DBUS_CFLAGS = @DBUS_CFLAGS@
106 DBUS_LIBS = @DBUS_LIBS@
107 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
108 DEFS = @DEFS@
109 DEPDIR = @DEPDIR@
110 DSYMUTIL = @DSYMUTIL@
111 DUMPBIN = @DUMPBIN@
112 ECHO_C = @ECHO_C@
113 ECHO_N = @ECHO_N@
114 ECHO_T = @ECHO_T@
115 EGREP = @EGREP@
116 ERROR_CFLAGS = @ERROR_CFLAGS@
117 EXEEXT = @EXEEXT@
118 FGREP = @FGREP@
119 GLIB_CFLAGS = @GLIB_CFLAGS@
120 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
121 GLIB_LIBS = @GLIB_LIBS@
122 GREP = @GREP@
123 INSTALL = @INSTALL@
124 INSTALL_DATA = @INSTALL_DATA@
125 INSTALL_PROGRAM = @INSTALL_PROGRAM@
126 INSTALL_SCRIPT = @INSTALL_SCRIPT@
127 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
128 LD = @LD@
129 LDFLAGS = @LDFLAGS@
130 LIBOBJS = @LIBOBJS@
131 LIBS = @LIBS@
132 LIBTOOL = @LIBTOOL@
133 LIPO = @LIPO@
134 LN_S = @LN_S@
135 LTLIBOBJS = @LTLIBOBJS@
136 MAINT = @MAINT@
137 MAKEINFO = @MAKEINFO@
138 MKDIR_P = @MKDIR_P@
139 NM = @NM@
140 NMEDIT = @NMEDIT@
141 OBJDUMP = @OBJDUMP@
142 OBJEXT = @OBJEXT@
143 OTOOL = @OTOOL@
144 OTOOL64 = @OTOOL64@
145 PACKAGE = @PACKAGE@
146 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
147 PACKAGE_NAME = @PACKAGE_NAME@
148 PACKAGE_STRING = @PACKAGE_STRING@
149 PACKAGE_TARNAME = @PACKAGE_TARNAME@
150 PACKAGE_URL = @PACKAGE_URL@
151 PACKAGE_VERSION = @PACKAGE_VERSION@
152 PATH_SEPARATOR = @PATH_SEPARATOR@
153 PKG_CONFIG = @PKG_CONFIG@
154 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
155 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
156 PYTHON = @PYTHON@
157 RANLIB = @RANLIB@
158 SED = @SED@
159 SET_MAKE = @SET_MAKE@
160 SHELL = @SHELL@
161 STRIP = @STRIP@
162 TP_CFLAGS = @TP_CFLAGS@
163 TP_LIBS = @TP_LIBS@
164 UUID_CFLAGS = @UUID_CFLAGS@
165 UUID_LIBS = @UUID_LIBS@
166 VERSION = @VERSION@
167 XSLTPROC = @XSLTPROC@
168 abs_builddir = @abs_builddir@
169 abs_srcdir = @abs_srcdir@
170 abs_top_builddir = @abs_top_builddir@
171 abs_top_srcdir = @abs_top_srcdir@
172 ac_ct_CC = @ac_ct_CC@
173 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
174 am__include = @am__include@
175 am__leading_dot = @am__leading_dot@
176 am__quote = @am__quote@
177 am__tar = @am__tar@
178 am__untar = @am__untar@
179 bindir = @bindir@
180 build = @build@
181 build_alias = @build_alias@
182 build_cpu = @build_cpu@
183 build_os = @build_os@
184 build_vendor = @build_vendor@
185 builddir = @builddir@
186 datadir = @datadir@
187 datarootdir = @datarootdir@
188 docdir = @docdir@
189 dvidir = @dvidir@
190 exec_prefix = @exec_prefix@
191 host = @host@
192 host_alias = @host_alias@
193 host_cpu = @host_cpu@
194 host_os = @host_os@
195 host_vendor = @host_vendor@
196 htmldir = @htmldir@
197 includedir = @includedir@
198 includemodemdir = @includemodemdir@
199 includesmsdir = @includesmsdir@
200 infodir = @infodir@
201 install_sh = @install_sh@
202 libdir = @libdir@
203 libexecdir = @libexecdir@
204 localedir = @localedir@
205 localstatedir = @localstatedir@
206 lt_ECHO = @lt_ECHO@
207 mandir = @mandir@
208 mkdir_p = @mkdir_p@
209 oldincludedir = @oldincludedir@
210 pdfdir = @pdfdir@
211 prefix = @prefix@
212 program_transform_name = @program_transform_name@
213 psdir = @psdir@
214 sbindir = @sbindir@
215 sharedstatedir = @sharedstatedir@
216 srcdir = @srcdir@
217 sysconfdir = @sysconfdir@
218 target_alias = @target_alias@
219 testdir = @testdir@
220 top_build_prefix = @top_build_prefix@
221 top_builddir = @top_builddir@
222 top_srcdir = @top_srcdir@
223 AM_CFLAGS = $(ERROR_CFLAGS) \
224 @GLIB_CFLAGS@ @DBUS_CFLAGS@ \
225 -I$(top_srcdir) @CHECK_CFLAGS@
226
227 noinst_LTLIBRARIES = libtestcommon.la
228 libtestcommon_la_SOURCES = \
229 test-common.c test-common.h
230
231 tools_dir = $(top_srcdir)/tools
232 MOSTLYCLEANFILES = $(BUILT_SOURCES)
233 all: all-am
234
235 .SUFFIXES:
236 .SUFFIXES: .c .lo .o .obj
237 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
238 @for dep in $?; do \
239 case '$(am__configure_deps)' in \
240 *$$dep*) \
241 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
242 && { if test -f $@; then exit 0; else break; fi; }; \
243 exit 1;; \
244 esac; \
245 done; \
246 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
247 $(am__cd) $(top_srcdir) && \
248 $(AUTOMAKE) --foreign tests/Makefile
249 .PRECIOUS: Makefile
250 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
251 @case '$?' in \
252 *config.status*) \
253 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
254 *) \
255 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
256 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
257 esac;
258
259 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
260 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
261
262 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
263 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
264 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
265 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
266 $(am__aclocal_m4_deps):
267
268 clean-noinstLTLIBRARIES:
269 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
270 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
271 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
272 test "$$dir" != "$$p" || dir=.; \
273 echo "rm -f \"$${dir}/so_locations\""; \
274 rm -f "$${dir}/so_locations"; \
275 done
276 libtestcommon.la: $(libtestcommon_la_OBJECTS) $(libtestcommon_la_DEPENDENCIES)
277 $(AM_V_CCLD)$(LINK) $(libtestcommon_la_OBJECTS) $(libtestcommon_la_LIBADD) $(LIBS)
278
279 mostlyclean-compile:
280 -rm -f *.$(OBJEXT)
281
282 distclean-compile:
283 -rm -f *.tab.c
284
285 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-common.Plo@am__quote@
286
287 .c.o:
288 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
289 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
290 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
291 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
292 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
293 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
294
295 .c.obj:
296 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
297 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
298 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
299 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
300 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
301 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
302
303 .c.lo:
304 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
305 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
306 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
307 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
308 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
309 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
310
311 mostlyclean-libtool:
312 -rm -f *.lo
313
314 clean-libtool:
315 -rm -rf .libs _libs
316
317 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
318 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
319 unique=`for i in $$list; do \
320 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
321 done | \
322 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
323 END { if (nonempty) { for (i in files) print i; }; }'`; \
324 mkid -fID $$unique
325 tags: TAGS
326
327 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
328 $(TAGS_FILES) $(LISP)
329 set x; \
330 here=`pwd`; \
331 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
332 unique=`for i in $$list; do \
333 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
334 done | \
335 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
336 END { if (nonempty) { for (i in files) print i; }; }'`; \
337 shift; \
338 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
339 test -n "$$unique" || unique=$$empty_fix; \
340 if test $$# -gt 0; then \
341 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
342 "$$@" $$unique; \
343 else \
344 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
345 $$unique; \
346 fi; \
347 fi
348 ctags: CTAGS
349 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
350 $(TAGS_FILES) $(LISP)
351 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
352 unique=`for i in $$list; do \
353 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
354 done | \
355 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
356 END { if (nonempty) { for (i in files) print i; }; }'`; \
357 test -z "$(CTAGS_ARGS)$$unique" \
358 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
359 $$unique
360
361 GTAGS:
362 here=`$(am__cd) $(top_builddir) && pwd` \
363 && $(am__cd) $(top_srcdir) \
364 && gtags -i $(GTAGS_ARGS) "$$here"
365
366 distclean-tags:
367 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
368
369 distdir: $(DISTFILES)
370 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
371 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
372 list='$(DISTFILES)'; \
373 dist_files=`for file in $$list; do echo $$file; done | \
374 sed -e "s|^$$srcdirstrip/||;t" \
375 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
376 case $$dist_files in \
377 */*) $(MKDIR_P) `echo "$$dist_files" | \
378 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
379 sort -u` ;; \
380 esac; \
381 for file in $$dist_files; do \
382 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
383 if test -d $$d/$$file; then \
384 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
385 if test -d "$(distdir)/$$file"; then \
386 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
387 fi; \
388 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
389 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
390 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
391 fi; \
392 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
393 else \
394 test -f "$(distdir)/$$file" \
395 || cp -p $$d/$$file "$(distdir)/$$file" \
396 || exit 1; \
397 fi; \
398 done
399 check-am: all-am
400 check: check-am
401 all-am: Makefile $(LTLIBRARIES)
402 installdirs:
403 install: install-am
404 install-exec: install-exec-am
405 install-data: install-data-am
406 uninstall: uninstall-am
407
408 install-am: all-am
409 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
410
411 installcheck: installcheck-am
412 install-strip:
413 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
414 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
415 `test -z '$(STRIP)' || \
416 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
417 mostlyclean-generic:
418 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
419
420 clean-generic:
421
422 distclean-generic:
423 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
424 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
425
426 maintainer-clean-generic:
427 @echo "This command is intended for maintainers to use"
428 @echo "it deletes files that may require special tools to rebuild."
429 clean: clean-am
430
431 clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
432 mostlyclean-am
433
434 distclean: distclean-am
435 -rm -rf ./$(DEPDIR)
436 -rm -f Makefile
437 distclean-am: clean-am distclean-compile distclean-generic \
438 distclean-tags
439
440 dvi: dvi-am
441
442 dvi-am:
443
444 html: html-am
445
446 html-am:
447
448 info: info-am
449
450 info-am:
451
452 install-data-am:
453
454 install-dvi: install-dvi-am
455
456 install-dvi-am:
457
458 install-exec-am:
459
460 install-html: install-html-am
461
462 install-html-am:
463
464 install-info: install-info-am
465
466 install-info-am:
467
468 install-man:
469
470 install-pdf: install-pdf-am
471
472 install-pdf-am:
473
474 install-ps: install-ps-am
475
476 install-ps-am:
477
478 installcheck-am:
479
480 maintainer-clean: maintainer-clean-am
481 -rm -rf ./$(DEPDIR)
482 -rm -f Makefile
483 maintainer-clean-am: distclean-am maintainer-clean-generic
484
485 mostlyclean: mostlyclean-am
486
487 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
488 mostlyclean-libtool
489
490 pdf: pdf-am
491
492 pdf-am:
493
494 ps: ps-am
495
496 ps-am:
497
498 uninstall-am:
499
500 .MAKE: install-am install-strip
501
502 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
503 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
504 distclean-compile distclean-generic distclean-libtool \
505 distclean-tags distdir dvi dvi-am html html-am info info-am \
506 install install-am install-data install-data-am install-dvi \
507 install-dvi-am install-exec install-exec-am install-html \
508 install-html-am install-info install-info-am install-man \
509 install-pdf install-pdf-am install-ps install-ps-am \
510 install-strip installcheck installcheck-am installdirs \
511 maintainer-clean maintainer-clean-generic mostlyclean \
512 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
513 pdf pdf-am ps ps-am tags uninstall uninstall-am
514
515
516 # Tell versions [3.59,3.63) of GNU make to not export all variables.
517 # Otherwise a system limit (for SysV at least) may be exceeded.
518 .NOEXPORT:
0 To run all tests:
1
2 make check
3
4 == Twisted tests ==
5
6 To run all Twisted tests:
7
8 make check-twisted
9
10 To run an individual Twisted test:
11
12 make -C tests/twisted check-twisted TWISTED_TESTS=connect/connect-success.py
13
14 or:
15
16 cd tests/twisted
17 sh tools/with-session-bus.sh --config-file=tools/servicedir-uninstalled/tmp-session-bus.conf \
18 -- python connect/test-success.py
19
20 To run with debug information:
21
22 make -C tests/twisted check-twisted TWISTED_TESTS=connect/test-success.py \
23 CHECK_TWISTED_VERBOSE=1
24
25 or:
26
27 cd tests/twisted
28 sh tools/with-session-bus.sh --config-file=tools/servicedir-uninstalled/tmp-session-bus.conf \
29 -- python connect/test-success.py -v
30
31 To debug an individual test you can set one of the following env variable:
32
33 * RING_TEST_VALGRIND : to run Ring inside valgrind. The report is
34 added to tools/ring-testing.log.
35 export RING_TEST_VALGRIND=1
36
37 * RING_TEST_REFDBG : to run Ring inside refdbg. The report is written
38 to tools/refdbg.log. You can change RING_WRAPPER to use an alternative
39 refdbg and change REFDBG_OPTIONS to set your own parameters. Example:
40 export RING_TEST_REFDBG=1
41 export RING_WRAPPER="/path/to/refdbg"
42 export REFDBG_OPTIONS="btnum=16"
43
44 * RING_WRAPPER="nemiver" : to run Ring inside the graphical debugger
45 nemiver. You'll be able to set up breakpoints; then hit the "continue"
46 button to launch Ring.
47
48 * RING_TEST_BUSTLE : to run bustle-dbus-monitor in the temporary
49 bus daemon. The logs are saved to tools/*bustle-logs.
50 export RING_TEST_BUSTLE=1
0 #! /bin/sh
1
2 exec dbus-monitor "$@" sender=org.freedesktop.Telepathy.ConnectionManager.ring destination=org.freedesktop.Telepathy.ConnectionManager.ring
0 <?xml version="1.0" encoding="UTF-8"?>
1 <testdefinition version="1.0">
2 <suite name="telepathy-ring-tests" domain="Phone">
3 <description>Telepathy-Ring unit tests</description>
4 <set name="telepathy-ring_test-modem" feature="Modem">
5 <description>Telepathy-Ring modem tests</description>
6 <case name="telepathy-ring-test-modem">
7 <step>/opt/tests/telepathy-ring/test-modem</step>
8 </case>
9 </set>
10 <set name="telepathy-ring_test-ring" feature="Ring">
11 <description>Telepathy-Ring ring tests</description>
12 <case name="telepathy-ring-test-ring">
13 <step>/opt/tests/telepathy-ring/test-ring</step>
14 </case>
15 </set>
16 </suite>
17 </testdefinition>
0 #!/bin/sh
1
2 filter="
3
4 interface='com.Nokia.Telepathy.Channel.Interface.DialStrings'
5 interface='com.Nokia.Telepathy.Connection.Interface.Forwarding'
6 interface='com.nokia.Telepathy.Channel.Interface.Emergency'
7 interface='com.nokia.Telepathy.Connection.Interface.Emergency'
8 interface='com.nokia.Telepathy.Connection.Interface.StoredMessages'
9 interface='org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT'
10 interface='org.freedesktop.Telepathy.Channel.Interface.MergeableConference.DRAFT'
11 interface='org.freedesktop.Telepathy.Channel.Interface.Splittable.DRAFT'
12
13 interface='org.freedesktop.Telepathy.Channel'
14 interface='org.freedesktop.Telepathy.Channel.Interface.ChatState'
15 interface='org.freedesktop.Telepathy.Channel.Interface.DTMF'
16 interface='org.freedesktop.Telepathy.Channel.Interface.Group'
17 interface='org.freedesktop.Telepathy.Channel.Interface.Hold'
18 interface='org.freedesktop.Telepathy.Channel.Interface.Hold'
19 interface='org.freedesktop.Telepathy.Channel.Interface.MediaSignalling'
20 interface='org.freedesktop.Telepathy.Channel.Interface.Messages'
21 interface='org.freedesktop.Telepathy.Channel.Interface.Password'
22 interface='org.freedesktop.Telepathy.Channel.Interface.Transfer'
23 interface='org.freedesktop.Telepathy.Channel.Type.ContactList'
24 interface='org.freedesktop.Telepathy.Channel.Type.ContactSearch'
25 interface='org.freedesktop.Telepathy.Channel.Type.RoomList'
26 interface='org.freedesktop.Telepathy.Channel.Type.StreamedMedia'
27 interface='org.freedesktop.Telepathy.Channel.Type.Text'
28 interface='org.freedesktop.Telepathy.Channel.Type.Tubes'
29 interface='org.freedesktop.Telepathy.ChannelHandler'
30 interface='org.freedesktop.Telepathy.Connection'
31 interface='org.freedesktop.Telepathy.Connection.Interface.Aliasing'
32 interface='org.freedesktop.Telepathy.Connection.Interface.Avatars'
33 interface='org.freedesktop.Telepathy.Connection.Interface.Capabilities'
34 interface='org.freedesktop.Telepathy.Connection.Interface.ContactInfo'
35 interface='org.freedesktop.Telepathy.Connection.Interface.Forwarding'
36 interface='org.freedesktop.Telepathy.Connection.Interface.Presence'
37 interface='org.freedesktop.Telepathy.Connection.Interface.Privacy'
38 interface='org.freedesktop.Telepathy.Connection.Interface.Renaming'
39 interface='org.freedesktop.Telepathy.Connection.Interface.Requests'
40 interface='org.freedesktop.Telepathy.ConnectionManager'
41 interface='org.freedesktop.Telepathy.Media.SessionHandler'
42 interface='org.freedesktop.Telepathy.Media.StreamHandler'
43 interface='org.freedesktop.Telepathy.MissionControl'
44 interface='org.freedesktop.Telepathy.Properties'
45 "
46
47 dbus-monitor "$@" $filter
0 TWISTED_TESTS = \
1 cm/protocol.py \
2 connect/connect-success.py \
3 $(NULL)
4
5 config.py: Makefile
6 $(AM_V_GEN) { \
7 echo "PACKAGE_STRING = \"$(PACKAGE_STRING)\""; \
8 } > $@
9
10 if WANT_TWISTED_TESTS
11
12 check-local: check-twisted
13
14 CHECK_TWISTED_SLEEP=0
15
16 check-twisted: $(BUILT_SOURCES)
17 $(MAKE) -C tools
18 if test "x$(CHECK_TWISTED_SLEEP)" = x0; then \
19 ring_test_sleep= ; \
20 else \
21 ring_test_sleep=--sleep=$(CHECK_TWISTED_SLEEP); \
22 fi; \
23 RING_TEST_UNINSTALLED=1 \
24 RING_ABS_TOP_SRCDIR=@abs_top_srcdir@ \
25 RING_ABS_TOP_BUILDDIR=@abs_top_builddir@ \
26 RING_TEST_SLEEP=$$ring_test_sleep \
27 ./run-test.sh "$(TWISTED_TESTS)"
28
29 ring-twisted-tests.list: Makefile
30 $(AM_V_GEN)echo $(TWISTED_TESTS) > $@
31
32 BUILT_SOURCES = \
33 config.py \
34 ring-twisted-tests.list \
35 run-test.sh \
36 $(NULL)
37
38 # We don't really use ringtestsdir yet - we only support uninstalled testing
39 # so far - but I'm substituting it to keep the script more similar to Gabble's.
40 # ${pkglibexecdir}/tests is what GNOME's InstalledTests goal recommends.
41 run-test.sh: run-test.sh.in Makefile
42 $(AM_V_GEN)sed \
43 -e 's![@]ringtestsdir[@]!${pkglibexecdir}/tests!' \
44 -e 's![@]TEST_PYTHON[@]!$(TEST_PYTHON)!' \
45 < $< > $@.tmp && \
46 chmod +x $@.tmp && \
47 mv $@.tmp $@
48
49 endif
50
51 EXTRA_DIST = \
52 $(TWISTED_TESTS) \
53 run-test.sh.in \
54 servicetest.py \
55 ringtest.py \
56 constants.py \
57 $(NULL)
58
59 CLEANFILES = \
60 $(BUILT_SOURCES) \
61 ring-[1-9]*.log \
62 *.pyc \
63 */*.pyc \
64 $(NULL)
65
66 SUBDIRS = tools
0 """
1 Test Ring's o.fd.T.Protocol implementation
2 """
3
4 import dbus
5 from servicetest import unwrap, tp_path_prefix, assertEquals, assertContains
6 from ringtest import exec_test
7 import constants as cs
8
9 def test(q, bus, conn):
10 cm = bus.get_object(cs.CM + '.ring',
11 tp_path_prefix + '/ConnectionManager/ring')
12 cm_iface = dbus.Interface(cm, cs.CM)
13 cm_prop_iface = dbus.Interface(cm, cs.PROPERTIES_IFACE)
14
15 protocols = unwrap(cm_prop_iface.Get(cs.CM, 'Protocols'))
16 assertEquals(set(['tel']), set(protocols.keys()))
17
18 protocol_names = unwrap(cm_iface.ListProtocols())
19 assertEquals(set(['tel']), set(protocol_names))
20
21 cm_params = cm_iface.GetParameters('tel')
22 local_props = protocols['tel']
23 local_params = local_props[cs.PROTOCOL + '.Parameters']
24 assertEquals(cm_params, local_params)
25
26 proto = bus.get_object(cm.bus_name, cm.object_path + '/tel')
27 proto_prop_iface = dbus.Interface(proto, cs.PROPERTIES_IFACE)
28 proto_props = unwrap(proto_prop_iface.GetAll(cs.PROTOCOL))
29
30 for key in ['Parameters', 'Interfaces', 'ConnectionInterfaces',
31 'RequestableChannelClasses', u'VCardField', u'EnglishName', u'Icon']:
32 a = local_props[cs.PROTOCOL + '.' + key]
33 b = proto_props[key]
34 assertEquals(a, b)
35
36 assertEquals('tel', proto_props['VCardField'])
37 assertEquals('Mobile Telephony', proto_props['EnglishName'])
38 assertEquals('im-tel', proto_props['Icon'])
39
40 assertContains(cs.CONN_IFACE_REQUESTS, proto_props['ConnectionInterfaces'])
41
42 if __name__ == '__main__':
43 exec_test(test)
0
1 """
2 Test connecting to a server.
3 """
4
5 from ringtest import exec_test
6 from servicetest import EventPattern, call_async
7 import constants as cs
8
9 def test(q, bus, conn):
10 conn.Connect()
11 q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
12 q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
13
14 call_async(q, conn, 'Disconnect')
15 q.expect_many(
16 EventPattern('dbus-signal', signal='StatusChanged', args=[2, cs.CSR_REQUESTED]),
17 EventPattern('dbus-return', method='Disconnect'))
18
19 if __name__ == '__main__':
20 exec_test(test)
21
0 # Copyright (C) 2009 Nokia Corporation
1 # Copyright (C) 2009-2013 Collabora Ltd.
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16 # 02110-1301 USA
17
18 """
19 Some handy constants for other tests to share and enjoy.
20 """
21
22 from dbus import PROPERTIES_IFACE, INTROSPECTABLE_IFACE
23
24 PREFIX = "org.freedesktop.Telepathy"
25 PATH_PREFIX = '/' + PREFIX.replace('.', '/')
26
27 tp_name_prefix = PREFIX
28 tp_path_prefix = PATH_PREFIX
29
30 CM = PREFIX + ".ConnectionManager"
31
32 HT_NONE = 0
33 HT_CONTACT = 1
34 HT_ROOM = 2
35 HT_LIST = 3
36 HT_GROUP = 4
37
38 CHANNEL = PREFIX + ".Channel"
39
40 CHANNEL_IFACE_CALL_STATE = CHANNEL + ".Interface.CallState"
41 CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState'
42 CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable"
43 CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF"
44 CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group"
45 CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold"
46 CHANNEL_IFACE_MEDIA_SIGNALLING = CHANNEL + ".Interface.MediaSignalling"
47 CHANNEL_IFACE_MESSAGES = CHANNEL + ".Interface.Messages"
48 CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password"
49 CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube"
50 CHANNEL_IFACE_SASL_AUTH = CHANNEL + ".Interface.SASLAuthentication"
51 CHANNEL_IFACE_CONFERENCE = CHANNEL + '.Interface.Conference'
52 CHANNEL_IFACE_ROOM = CHANNEL + '.Interface.Room2'
53 CHANNEL_IFACE_ROOM_CONFIG = CHANNEL + '.Interface.RoomConfig1'
54 CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject2'
55 CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata'
56 CHANNEL_IFACE_SMS = CHANNEL + '.Interface.SMS'
57
58 CHANNEL_TYPE_CALL = CHANNEL + ".Type.Call1"
59 CHANNEL_TYPE_CONTACT_LIST = CHANNEL + ".Type.ContactList"
60 CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch"
61 CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text"
62 CHANNEL_TYPE_TUBES = CHANNEL + ".Type.Tubes"
63 CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube"
64 CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube"
65 CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text"
66 CHANNEL_TYPE_FILE_TRANSFER = CHANNEL + ".Type.FileTransfer"
67 CHANNEL_TYPE_ROOM_LIST = CHANNEL + ".Type.RoomList"
68 CHANNEL_TYPE_SERVER_AUTHENTICATION = \
69 CHANNEL + ".Type.ServerAuthentication"
70 CHANNEL_TYPE_SERVER_TLS_CONNECTION = \
71 CHANNEL + ".Type.ServerTLSConnection"
72
73 TP_AWKWARD_PROPERTIES = PREFIX + ".Properties"
74 PROPERTY_FLAG_READ = 1
75 PROPERTY_FLAG_WRITE = 2
76 PROPERTY_FLAGS_RW = PROPERTY_FLAG_READ | PROPERTY_FLAG_WRITE
77
78 CHANNEL_TYPE = CHANNEL + '.ChannelType'
79 TARGET_HANDLE_TYPE = CHANNEL + '.TargetHandleType'
80 TARGET_HANDLE = CHANNEL + '.TargetHandle'
81 TARGET_ID = CHANNEL + '.TargetID'
82 REQUESTED = CHANNEL + '.Requested'
83 INITIATOR_HANDLE = CHANNEL + '.InitiatorHandle'
84 INITIATOR_ID = CHANNEL + '.InitiatorID'
85 INTERFACES = CHANNEL + '.Interfaces'
86
87 CALL_CONTENTS = CHANNEL_TYPE_CALL + '.Contents'
88 CALL_CALL_STATE_DETAILS = CHANNEL_TYPE_CALL + '.CallStateDetails'
89 CALL_CALL_STATE = CHANNEL_TYPE_CALL + '.CallState'
90 CALL_CALL_FLAGS = CHANNEL_TYPE_CALL + '.CallFlags'
91 CALL_CALL_STATE_REASON = CHANNEL_TYPE_CALL + '.CallStateReason'
92 CALL_HARDWARE_STREAMING = CHANNEL_TYPE_CALL + '.HardwareStreaming'
93 CALL_CALL_MEMBERS = CHANNEL_TYPE_CALL + '.CallMembers'
94 CALL_MEMBER_IDENTIFIERS = CHANNEL_TYPE_CALL + '.MemberIdentifiers'
95 CALL_INITIAL_TRANSPORT = CHANNEL_TYPE_CALL + '.InitialTransport'
96 CALL_INITIAL_AUDIO = CHANNEL_TYPE_CALL + '.InitialAudio'
97 CALL_INITIAL_AUDIO_NAME = CHANNEL_TYPE_CALL + '.InitialAudioName'
98 CALL_INITIAL_VIDEO = CHANNEL_TYPE_CALL + '.InitialVideo'
99 CALL_INITIAL_VIDEO_NAME = CHANNEL_TYPE_CALL + '.InitialVideoName'
100 CALL_MUTABLE_CONTENTS = CHANNEL_TYPE_CALL + '.MutableContents'
101
102 CALL_CONTENT = PREFIX + '.Call1.Content'
103 CALL_CONTENT_IFACE_MEDIA = CALL_CONTENT + '.Interface.Media'
104 CALL_CONTENT_IFACE_DTMF = CALL_CONTENT + '.Interface.DTMF'
105
106 CALL_CONTENT_MEDIA_DESCRIPTION = CALL_CONTENT + '.MediaDescription'
107
108 CALL_STREAM = PREFIX + '.Call1.Stream'
109 CALL_STREAM_IFACE_MEDIA = CALL_STREAM + '.Interface.Media'
110
111 CALL_STREAM_ENDPOINT = CALL_STREAM + '.Endpoint'
112
113 CALL_MEDIA_TYPE_AUDIO = 0
114 CALL_MEDIA_TYPE_VIDEO = 1
115
116 CALL_CONTENT_PACKETIZATION_RTP = 0
117 CALL_CONTENT_PACKETIZATION_RAW = 1
118 CALL_CONTENT_PACKETIZATION_MSN_WEBCAM = 2
119
120 CALL_STREAM_TRANSPORT_UNKNOWN = 0
121 CALL_STREAM_TRANSPORT_RAW_UDP = 1
122 CALL_STREAM_TRANSPORT_ICE = 2
123 CALL_STREAM_TRANSPORT_GTALK_P2P = 3
124 CALL_STREAM_TRANSPORT_WLM_2009 = 4
125 CALL_STREAM_TRANSPORT_SHM = 5
126 CALL_STREAM_TRANSPORT_MULTICAST = 6
127
128 CALL_STATE_UNKNOWN = 0
129 CALL_STATE_PENDING_INITIATOR = 1
130 CALL_STATE_INITIALISING = 2
131 CALL_STATE_INITIALISED = 3
132 CALL_STATE_ACCEPTED = 4
133 CALL_STATE_ACTIVE = 5
134 CALL_STATE_ENDED = 6
135
136 CALL_FLAG_LOCALLY_HELD = 1
137 CALL_FLAG_LOCALLY_RINGING = 2
138 CALL_FLAG_LOCALLY_QUEUED = 4
139 CALL_FLAG_FORWARDED = 8
140 CALL_FLAG_CLEARING = 16
141
142 CALL_MEMBER_FLAG_RINGING = 1
143 CALL_MEMBER_FLAG_HELD = 2
144
145 CALL_DISPOSITION_NONE = 0
146 CALL_DISPOSITION_INITIAL = 1
147
148 CALL_SENDING_STATE_NONE = 0
149 CALL_SENDING_STATE_PENDING_SEND = 1
150 CALL_SENDING_STATE_SENDING = 2
151 CALL_SENDING_STATE_PENDING_STOP_SENDING = 3
152
153 CALL_STREAM_FLOW_STATE_STOPPED = 0
154 CALL_STREAM_FLOW_STATE_PENDING_START = 1
155 CALL_STREAM_FLOW_STATE_PENDING_STOP = 2
156 CALL_STREAM_FLOW_STATE_STARTED = 3
157
158 CALL_STREAM_ENDPOINT_STATE_CONNECTING = 0
159 CALL_STREAM_ENDPOINT_STATE_PROVISIONALLY_CONNECTED = 1
160 CALL_STREAM_ENDPOINT_STATE_FULLY_CONNECTED = 2
161 CALL_STREAM_ENDPOINT_STATE_EXHAUSTED_CANDIDATES = 3
162 CALL_STREAM_ENDPOINT_STATE_FAILED = 4
163
164 CALL_STREAM_CANDIDATE_TYPE_HOST = 1
165 CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE = 2
166 CALL_STREAM_CANDIDATE_TYPE_RELAY = 4
167
168 CALL_STATE_CHANGE_REASON_UNKNOWN = 0
169 CALL_STATE_CHANGE_REASON_PROGRESS_MADE = 1
170 CALL_STATE_CHANGE_REASON_USER_REQUESTED = 2
171 CALL_STATE_CHANGE_REASON_FORWARDED = 3
172 CALL_STATE_CHANGE_REASON_REJECTED = 4
173 CALL_STATE_CHANGE_REASON_NO_ANSWER = 5
174 CALL_STATE_CHANGE_REASON_INVALID_CONTACT = 6
175 CALL_STATE_CHANGE_REASON_PERMISSION_DENIED = 7
176 CALL_STATE_CHANGE_REASON_BUSY = 8
177 CALL_STATE_CHANGE_REASON_INTERNAL_ERROR = 9
178 CALL_STATE_CHANGE_REASON_SERVICE_ERROR = 10
179 CALL_STATE_CHANGE_REASON_NETWORK_ERROR = 11
180 CALL_STATE_CHANGE_REASON_MEDIA_ERROR = 12
181 CALL_STATE_CHANGE_REASON_CONNECTIVITY_ERROR = 13
182
183 CALL_STREAM_COMPONENT_UNKNOWN = 0
184 CALL_STREAM_COMPONENT_DATA = 1
185 CALL_STREAM_COMPONENT_CONTROL = 2
186
187 SUBSCRIPTION_STATE_UNKNOWN = 0
188 SUBSCRIPTION_STATE_NO = 1
189 SUBSCRIPTION_STATE_REMOVED_REMOTELY = 2
190 SUBSCRIPTION_STATE_ASK = 3
191 SUBSCRIPTION_STATE_YES = 4
192
193 CONTACT_LIST_STATE_NONE = 0
194 CONTACT_LIST_STATE_WAITING = 1
195 CONTACT_LIST_STATE_FAILURE = 2
196 CONTACT_LIST_STATE_SUCCESS = 3
197
198 CONN = PREFIX + ".Connection"
199 CONN_IFACE_AVATARS = CONN + '.Interface.Avatars'
200 CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing'
201 CONN_IFACE_CAPS = CONN + '.Interface.Capabilities'
202 CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts'
203 CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities'
204 CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo"
205 CONN_IFACE_PRESENCE = CONN + '.Interface.Presence'
206 CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence'
207 CONN_IFACE_REQUESTS = CONN + '.Interface.Requests'
208 CONN_IFACE_LOCATION = CONN + '.Interface.Location'
209 CONN_IFACE_GABBLE_DECLOAK = CONN + '.Interface.Gabble.Decloak'
210 CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification'
211 CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList'
212 CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups'
213 CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes'
214 CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving'
215 CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking'
216 CONN_IFACE_ADDRESSING = CONN + '.Interface.Addressing1'
217 CONN_IFACE_SERVICE_POINT = CONN + '.Interface.ServicePoint'
218
219 ATTR_ALIAS = CONN_IFACE_ALIASING + '/alias'
220 ATTR_AVATAR_TOKEN = CONN_IFACE_AVATARS + '/token'
221 ATTR_CLIENT_TYPES = CONN_IFACE_CLIENT_TYPES + '/client-types'
222 ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities'
223 ATTR_CONTACT_ID = CONN + '/contact-id'
224 ATTR_CONTACT_INFO = CONN_IFACE_CONTACT_INFO + '/info'
225 ATTR_GROUPS = CONN_IFACE_CONTACT_GROUPS + '/groups'
226 ATTR_LOCATION = CONN_IFACE_LOCATION + '/location'
227 ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence'
228 ATTR_PUBLISH = CONN_IFACE_CONTACT_LIST + '/publish'
229 ATTR_SUBSCRIBE = CONN_IFACE_CONTACT_LIST + '/subscribe'
230
231 STREAM_HANDLER = PREFIX + '.Media.StreamHandler'
232
233 ERROR = PREFIX + '.Error'
234 INVALID_ARGUMENT = ERROR + '.InvalidArgument'
235 NOT_IMPLEMENTED = ERROR + '.NotImplemented'
236 NOT_AVAILABLE = ERROR + '.NotAvailable'
237 PERMISSION_DENIED = ERROR + '.PermissionDenied'
238 OFFLINE = ERROR + '.Offline'
239 NOT_CAPABLE = ERROR + '.NotCapable'
240 CONNECTION_REFUSED = ERROR + '.ConnectionRefused'
241 CONNECTION_FAILED = ERROR + '.ConnectionFailed'
242 CONNECTION_LOST = ERROR + '.ConnectionLost'
243 CANCELLED = ERROR + '.Cancelled'
244 NOT_YOURS = ERROR + '.NotYours'
245 DISCONNECTED = ERROR + '.Disconnected'
246 REGISTRATION_EXISTS = ERROR + '.RegistrationExists'
247 AUTHENTICATION_FAILED = ERROR + '.AuthenticationFailed'
248 CONNECTION_REPLACED = ERROR + '.ConnectionReplaced'
249 ALREADY_CONNECTED = ERROR + '.AlreadyConnected'
250 NETWORK_ERROR = ERROR + '.NetworkError'
251 NOT_YET = ERROR + '.NotYet'
252 INVALID_HANDLE = ERROR + '.InvalidHandle'
253 CERT_UNTRUSTED = ERROR + '.Cert.Untrusted'
254 SERVICE_BUSY = ERROR + '.ServiceBusy'
255 SERVICE_CONFUSED = ERROR + '.ServiceConfused'
256 SOFTWARE_UPGRADE_REQUIRED = ERROR + '.SoftwareUpgradeRequired'
257
258 BANNED = ERROR + '.Channel.Banned'
259
260 DBUS_ERROR_UNKNOWN_METHOD = 'org.freedesktop.DBus.Error.UnknownMethod'
261 DBUS_ERROR_NO_REPLY = 'org.freedesktop.DBus.Error.NoReply'
262
263 TUBE_PARAMETERS = CHANNEL_IFACE_TUBE + '.Parameters'
264 TUBE_STATE = CHANNEL_IFACE_TUBE + '.State'
265 STREAM_TUBE_SERVICE = CHANNEL_TYPE_STREAM_TUBE + '.Service'
266 DBUS_TUBE_SERVICE_NAME = CHANNEL_TYPE_DBUS_TUBE + '.ServiceName'
267 DBUS_TUBE_DBUS_NAMES = CHANNEL_TYPE_DBUS_TUBE + '.DBusNames'
268 DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS = CHANNEL_TYPE_DBUS_TUBE + '.SupportedAccessControls'
269 STREAM_TUBE_SUPPORTED_SOCKET_TYPES = CHANNEL_TYPE_STREAM_TUBE + '.SupportedSocketTypes'
270
271 CONFERENCE_INITIAL_CHANNELS = CHANNEL_IFACE_CONFERENCE + '.InitialChannels'
272 CONFERENCE_INITIAL_INVITEE_HANDLES = CHANNEL_IFACE_CONFERENCE + '.InitialInviteeHandles'
273 CONFERENCE_INITIAL_INVITEE_IDS = CHANNEL_IFACE_CONFERENCE + '.InitialInviteeIDs'
274
275 CONTACT_SEARCH_ASK = CHANNEL_TYPE_CONTACT_SEARCH + '.AvailableSearchKeys'
276 CONTACT_SEARCH_SERVER = CHANNEL_TYPE_CONTACT_SEARCH + '.Server'
277 CONTACT_SEARCH_STATE = CHANNEL_TYPE_CONTACT_SEARCH + '.SearchState'
278
279 SEARCH_NOT_STARTED = 0
280 SEARCH_IN_PROGRESS = 1
281 SEARCH_MORE_AVAILABLE = 2
282 SEARCH_COMPLETED = 3
283 SEARCH_FAILED = 4
284
285 TUBE_CHANNEL_STATE_LOCAL_PENDING = 0
286 TUBE_CHANNEL_STATE_REMOTE_PENDING = 1
287 TUBE_CHANNEL_STATE_OPEN = 2
288 TUBE_CHANNEL_STATE_NOT_OFFERED = 3
289
290 MEDIA_STREAM_TYPE_AUDIO = 0
291 MEDIA_STREAM_TYPE_VIDEO = 1
292
293 MEDIA_STREAM_BASE_PROTO_UDP = 0
294 MEDIA_STREAM_BASE_PROTO_TCP = 1
295
296 MEDIA_STREAM_TRANSPORT_TYPE_LOCAL = 0
297 MEDIA_STREAM_TRANSPORT_TYPE_DERIVED = 1
298 MEDIA_STREAM_TRANSPORT_TYPE_RELAY = 2
299
300 SOCKET_ADDRESS_TYPE_UNIX = 0
301 SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX = 1
302 SOCKET_ADDRESS_TYPE_IPV4 = 2
303 SOCKET_ADDRESS_TYPE_IPV6 = 3
304
305 SOCKET_ACCESS_CONTROL_LOCALHOST = 0
306 SOCKET_ACCESS_CONTROL_PORT = 1
307 SOCKET_ACCESS_CONTROL_NETMASK = 2
308 SOCKET_ACCESS_CONTROL_CREDENTIALS = 3
309
310 TUBE_STATE_LOCAL_PENDING = 0
311 TUBE_STATE_REMOTE_PENDING = 1
312 TUBE_STATE_OPEN = 2
313 TUBE_STATE_NOT_OFFERED = 3
314
315 TUBE_TYPE_DBUS = 0
316 TUBE_TYPE_STREAM = 1
317
318 MEDIA_STREAM_DIRECTION_NONE = 0
319 MEDIA_STREAM_DIRECTION_SEND = 1
320 MEDIA_STREAM_DIRECTION_RECEIVE = 2
321 MEDIA_STREAM_DIRECTION_BIDIRECTIONAL = 3
322
323 MEDIA_STREAM_PENDING_LOCAL_SEND = 1
324 MEDIA_STREAM_PENDING_REMOTE_SEND = 2
325
326 MEDIA_STREAM_TYPE_AUDIO = 0
327 MEDIA_STREAM_TYPE_VIDEO = 1
328
329 MEDIA_STREAM_STATE_DISCONNECTED = 0
330 MEDIA_STREAM_STATE_CONNECTING = 1
331 MEDIA_STREAM_STATE_CONNECTED = 2
332
333 MEDIA_STREAM_DIRECTION_NONE = 0
334 MEDIA_STREAM_DIRECTION_SEND = 1
335 MEDIA_STREAM_DIRECTION_RECEIVE = 2
336 MEDIA_STREAM_DIRECTION_BIDIRECTIONAL = 3
337
338 FT_STATE_NONE = 0
339 FT_STATE_PENDING = 1
340 FT_STATE_ACCEPTED = 2
341 FT_STATE_OPEN = 3
342 FT_STATE_COMPLETED = 4
343 FT_STATE_CANCELLED = 5
344
345 FT_STATE_CHANGE_REASON_NONE = 0
346 FT_STATE_CHANGE_REASON_REQUESTED = 1
347 FT_STATE_CHANGE_REASON_LOCAL_STOPPED = 2
348 FT_STATE_CHANGE_REASON_REMOTE_STOPPED = 3
349 FT_STATE_CHANGE_REASON_LOCAL_ERROR = 4
350 FT_STATE_CHANGE_REASON_REMOTE_ERROR = 5
351
352 FILE_HASH_TYPE_NONE = 0
353 FILE_HASH_TYPE_MD5 = 1
354 FILE_HASH_TYPE_SHA1 = 2
355 FILE_HASH_TYPE_SHA256 = 3
356
357 FT_STATE = CHANNEL_TYPE_FILE_TRANSFER + '.State'
358 FT_CONTENT_TYPE = CHANNEL_TYPE_FILE_TRANSFER + '.ContentType'
359 FT_FILENAME = CHANNEL_TYPE_FILE_TRANSFER + '.Filename'
360 FT_SIZE = CHANNEL_TYPE_FILE_TRANSFER + '.Size'
361 FT_CONTENT_HASH_TYPE = CHANNEL_TYPE_FILE_TRANSFER + '.ContentHashType'
362 FT_CONTENT_HASH = CHANNEL_TYPE_FILE_TRANSFER + '.ContentHash'
363 FT_DESCRIPTION = CHANNEL_TYPE_FILE_TRANSFER + '.Description'
364 FT_DATE = CHANNEL_TYPE_FILE_TRANSFER + '.Date'
365 FT_AVAILABLE_SOCKET_TYPES = CHANNEL_TYPE_FILE_TRANSFER + '.AvailableSocketTypes'
366 FT_TRANSFERRED_BYTES = CHANNEL_TYPE_FILE_TRANSFER + '.TransferredBytes'
367 FT_INITIAL_OFFSET = CHANNEL_TYPE_FILE_TRANSFER + '.InitialOffset'
368 FT_FILE_COLLECTION = CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE.FileCollection'
369 FT_URI = CHANNEL_TYPE_FILE_TRANSFER + '.URI'
370 FT_SERVICE_NAME = CHANNEL_IFACE_FILE_TRANSFER_METADATA + '.ServiceName'
371 FT_METADATA = CHANNEL_IFACE_FILE_TRANSFER_METADATA + '.Metadata'
372
373 GF_CAN_ADD = 1
374 GF_CAN_REMOVE = 2
375 GF_CAN_RESCIND = 4
376 GF_MESSAGE_ADD = 8
377 GF_MESSAGE_REMOVE = 16
378 GF_MESSAGE_ACCEPT = 32
379 GF_MESSAGE_REJECT = 64
380 GF_MESSAGE_RESCIND = 128
381 GF_CHANNEL_SPECIFIC_HANDLES = 256
382 GF_ONLY_ONE_GROUP = 512
383 GF_HANDLE_OWNERS_NOT_AVAILABLE = 1024
384 GF_PROPERTIES = 2048
385 GF_MEMBERS_CHANGED_DETAILED = 4096
386
387 GC_REASON_NONE = 0
388 GC_REASON_OFFLINE = 1
389 GC_REASON_KICKED = 2
390 GC_REASON_BUSY = 3
391 GC_REASON_INVITED = 4
392 GC_REASON_BANNED = 5
393 GC_REASON_ERROR = 6
394 GC_REASON_INVALID_CONTACT = 7
395 GC_REASON_NO_ANSWER = 8
396 GC_REASON_RENAMED = 9
397 GC_REASON_PERMISSION_DENIED = 10
398 GC_REASON_SEPARATED = 11
399
400 HS_UNHELD = 0
401 HS_HELD = 1
402 HS_PENDING_HOLD = 2
403 HS_PENDING_UNHOLD = 3
404
405 HSR_NONE = 0
406 HSR_REQUESTED = 1
407 HSR_RESOURCE_NOT_AVAILABLE = 2
408
409 CONN_STATUS_CONNECTED = 0
410 CONN_STATUS_CONNECTING = 1
411 CONN_STATUS_DISCONNECTED = 2
412
413 CSR_NONE_SPECIFIED = 0
414 CSR_REQUESTED = 1
415 CSR_NETWORK_ERROR = 2
416 CSR_AUTHENTICATION_FAILED = 3
417 CSR_ENCRYPTION_ERROR = 4
418 CSR_NAME_IN_USE = 5
419 CSR_CERT_NOT_PROVIDED = 6
420 CSR_CERT_UNTRUSTED = 7
421 CSR_CERT_EXPIRED = 8
422 CSR_CERT_NOT_ACTIVATED = 9
423 CSR_CERT_HOSTNAME_MISMATCH = 10
424 CSR_CERT_FINGERPRINT_MISMATCH = 11
425 CSR_CERT_SELF_SIGNED = 12
426 CSR_CERT_OTHER_ERROR = 13
427
428 BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
429 ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
430
431 CHAT_STATE_GONE = 0
432 CHAT_STATE_INACTIVE = 1
433 CHAT_STATE_ACTIVE = 2
434 CHAT_STATE_PAUSED = 3
435 CHAT_STATE_COMPOSING = 4
436
437 # Channel_Media_Capabilities
438 MEDIA_CAP_AUDIO = 1
439 MEDIA_CAP_VIDEO = 2
440 MEDIA_CAP_STUN = 4
441 MEDIA_CAP_GTALKP2P = 8
442 MEDIA_CAP_ICEUDP = 16
443 MEDIA_CAP_IMMUTABLE_STREAMS = 32
444
445 CLIENT = PREFIX + '.Client'
446
447 PRESENCE_UNSET = 0
448 PRESENCE_OFFLINE = 1
449 PRESENCE_AVAILABLE = 2
450 PRESENCE_AWAY = 3
451 PRESENCE_EXTENDED_AWAY = 4
452 PRESENCE_HIDDEN = 5
453 PRESENCE_BUSY = 6
454 PRESENCE_UNKNOWN = 7
455 PRESENCE_ERROR = 8
456
457 CONTACT_INFO_FLAG_CAN_SET = 1
458 CONTACT_INFO_FLAG_PUSH = 2
459 CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT = 1
460 CONTACT_INFO_FIELD_FLAG_OVERWRITTEN_BY_NICKNAME = 2
461
462 # Channel_Interface_SaslAuthentication
463 SASL_STATUS_NOT_STARTED = 0
464 SASL_STATUS_IN_PROGRESS = 1
465 SASL_STATUS_SERVER_SUCCEEDED = 2
466 SASL_STATUS_CLIENT_ACCEPTED = 3
467 SASL_STATUS_SUCCEEDED = 4
468 SASL_STATUS_SERVER_FAILED = 5
469 SASL_STATUS_CLIENT_FAILED = 6
470
471 SASL_ABORT_REASON_INVALID_CHALLENGE = 0
472 SASL_ABORT_REASON_USER_ABORT = 1
473
474 AUTH_METHOD = CHANNEL_TYPE_SERVER_AUTHENTICATION + ".AuthenticationMethod"
475 SASL_AVAILABLE_MECHANISMS = CHANNEL_IFACE_SASL_AUTH + ".AvailableMechanisms"
476 SASL_STATUS = CHANNEL_IFACE_SASL_AUTH + ".SASLStatus"
477 SASL_ERROR = CHANNEL_IFACE_SASL_AUTH + ".SASLError"
478 SASL_ERROR_DETAILS = CHANNEL_IFACE_SASL_AUTH + ".SASLErrorDetails"
479 SASL_CONTEXT = CHANNEL_IFACE_SASL_AUTH + ".SASLContext"
480 SASL_AUTHORIZATION_IDENTITY = CHANNEL_IFACE_SASL_AUTH + ".AuthorizationIdentity"
481 SASL_DEFAULT_REALM = CHANNEL_IFACE_SASL_AUTH + ".DefaultRealm"
482 SASL_DEFAULT_USERNAME = CHANNEL_IFACE_SASL_AUTH + ".DefaultUsername"
483
484 # Channel_Type_ServerTLSConnection
485 TLS_CERT_PATH = CHANNEL_TYPE_SERVER_TLS_CONNECTION + ".ServerCertificate"
486 TLS_HOSTNAME = CHANNEL_TYPE_SERVER_TLS_CONNECTION + ".Hostname"
487 TLS_REFERENCE_IDENTITIES = \
488 CHANNEL_TYPE_SERVER_TLS_CONNECTION + ".ReferenceIdentities"
489
490 # Connection.Interface.Location
491
492 LOCATION_FEATURE_CAN_SET = 1
493
494 # Channel.Type.Text
495
496 MT_NORMAL = 0
497 MT_ACTION = 1
498 MT_NOTICE = 2
499 MT_AUTO_REPLY = 3
500 MT_DELIVERY_REPORT = 4
501
502 class MessageFlag(object):
503 TRUNCATED = 1
504 NON_TEXT_CONTENT = 2
505 SCROLLBACK = 4
506 RESCUED = 8
507
508 class SendError(object):
509 UNKNOWN = 0
510 OFFLINE = 1
511 INVALID_CONTACT = 2
512 PERMISSION_DENIED = 3
513 TOO_LONG = 4
514 NOT_IMPLEMENTED = 5
515
516 PROTOCOL = PREFIX + '.Protocol'
517 PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence'
518 PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing'
519 PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars'
520
521 PARAM_REQUIRED = 1
522 PARAM_REGISTER = 2
523 PARAM_HAS_DEFAULT = 4
524 PARAM_SECRET = 8
525 PARAM_DBUS_PROPERTY = 16
526
527 AUTHENTICATION = PREFIX + '.Authentication'
528 AUTH_TLS_CERT = AUTHENTICATION + ".TLSCertificate"
529
530 TLS_CERT_STATE_PENDING = 0
531 TLS_CERT_STATE_ACCEPTED = 1
532 TLS_CERT_STATE_REJECTED = 2
533
534 TLS_REJECT_REASON_UNKNOWN = 0
535 TLS_REJECT_REASON_UNTRUSTED = 1
536
537 # Channel.Interface.Messages
538
539 MESSAGE_PART_SUPPORT_FLAGS = CHANNEL_IFACE_MESSAGES + '.MessagePartSupportFlags'
540 DELIVERY_REPORTING_SUPPORT = CHANNEL_IFACE_MESSAGES + '.DeliveryReportingSupport'
541 SUPPORTED_CONTENT_TYPES = CHANNEL_IFACE_MESSAGES + '.SupportedContentTypes'
542
543 MSG_SENDING_FLAGS_REPORT_DELIVERY = 1
544 MSG_SENDING_FLAGS_REPORT_READ = 2
545 MSG_SENDING_FLAGS_REPORT_DELETED = 4
546
547 DELIVERY_REPORTING_SUPPORT_FLAGS_RECEIVE_FAILURES = 1
548 DELIVERY_REPORTING_SUPPORT_FLAGS_RECEIVE_SUCCESSES = 2
549 DELIVERY_REPORTING_SUPPORT_FLAGS_RECEIVE_READ = 4
550 DELIVERY_REPORTING_SUPPORT_FLAGS_RECEIVE_DELETED = 8
551
552 DELIVERY_STATUS_UNKNOWN = 0
553 DELIVERY_STATUS_DELIVERED = 1
554 DELIVERY_STATUS_TEMPORARILY_FAILED = 2
555 DELIVERY_STATUS_PERMANENTLY_FAILED = 3
556 DELIVERY_STATUS_ACCEPTED = 4
557 DELIVERY_STATUS_READ = 5
558 DELIVERY_STATUS_DELETED = 6
559
560 MEDIA_STREAM_ERROR_UNKNOWN = 0
561 MEDIA_STREAM_ERROR_EOS = 1
562 MEDIA_STREAM_ERROR_CODEC_NEGOTIATION_FAILED = 2
563 MEDIA_STREAM_ERROR_CONNECTION_FAILED = 3
564 MEDIA_STREAM_ERROR_NETWORK_ERROR = 4
565 MEDIA_STREAM_ERROR_NO_CODECS = 5
566 MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR = 6
567 MEDIA_STREAM_ERROR_MEDIA_ERROR = 7
568
569 PASSWORD_FLAG_PROVIDE = 8
570
571 # Channel.Interface.Room
572 ROOM_NAME = CHANNEL_IFACE_ROOM + '.RoomName'
573 ROOM_SERVER = CHANNEL_IFACE_ROOM + '.Server'
574
575 # Channel.Interface.Subject
576 SUBJECT = CHANNEL_IFACE_ROOM + '.Subject'
577 SUBJECT_PRESENT = 1
578 SUBJECT_CAN_SET = 2
579
580 DEBUG_IFACE = PREFIX + '.Debug'
581 DEBUG_PATH = PATH_PREFIX + '/debug'
582
583 SERVICE_POINT_TYPE_NONE = 0
584 SERVICE_POINT_TYPE_EMERGENCY = 1
585 SERVICE_POINT_TYPE_COUNSELING = 2
586
587 CLIENT = PREFIX + '.Client'
588 CLIENT_PATH = PATH_PREFIX + '/Client'
589 OBSERVER = PREFIX + '.Client.Observer'
590 APPROVER = PREFIX + '.Client.Approver'
591 HANDLER = PREFIX + '.Client.Handler'
592 CLIENT_IFACE_REQUESTS = CLIENT + '.Interface.Requests'
593
594 ACCOUNT = PREFIX + '.Account'
595 ACCOUNT_IFACE_AVATAR = ACCOUNT + '.Interface.Avatar'
596 ACCOUNT_IFACE_ADDRESSING = ACCOUNT + '.Interface.Addressing'
597 ACCOUNT_IFACE_HIDDEN = ACCOUNT + '.Interface.Hidden.DRAFT1'
598 ACCOUNT_IFACE_NOKIA_CONDITIONS = 'com.nokia.Account.Interface.Conditions'
599 ACCOUNT_PATH_PREFIX = PATH_PREFIX + '/Account/'
600
601 AM = PREFIX + '.AccountManager'
602 AM_IFACE_HIDDEN = AM + '.Interface.Hidden.DRAFT1'
603 AM_PATH = PATH_PREFIX + '/AccountManager'
604
605 CR = PREFIX + '.ChannelRequest'
606 CDO = PREFIX + '.ChannelDispatchOperation'
607
608 CD = PREFIX + '.ChannelDispatcher'
609 CD_IFACE_OP_LIST = PREFIX + '.ChannelDispatcher.Interface.OperationList'
610 CD_PATH = PATH_PREFIX + '/ChannelDispatcher'
611 CD_REDISPATCH = CD + '.Interface.Redispatch.DRAFT'
612
613 MC = PREFIX + '.MissionControl5'
614 MC_PATH = PATH_PREFIX + '/MissionControl5'
615
616 DTMF_CURRENTLY_SENDING_TONES = CHANNEL_IFACE_DTMF + '.CurrentlySendingTones'
617 DTMF_INITIAL_TONES = CHANNEL_IFACE_DTMF + '.InitialTones'
618 DTMF_DEFERRED_TONES = CHANNEL_IFACE_DTMF + '.DeferredTones'
619
620 TESTDOT = PREFIX + ".Test."
621 TESTSLASH = PATH_PREFIX + "/Test/"
622
623 TEST_DBUS_ACCOUNT_SERVICE = TESTDOT + "DBusAccountService"
624 TEST_DBUS_ACCOUNT_SERVICE_PATH = TESTSLASH + "DBusAccountService"
625 TEST_DBUS_ACCOUNT_SERVICE_IFACE = TEST_DBUS_ACCOUNT_SERVICE
626
627 TEST_DBUS_ACCOUNT_PLUGIN_PATH = TESTSLASH + "DBusAccountPlugin"
628 TEST_DBUS_ACCOUNT_PLUGIN_IFACE = TESTDOT + "DBusAccountPlugin"
629
630 # Channel.Interface.SMS
631 SMS_FLASH = CHANNEL_IFACE_SMS + '.Flash'
632 SMS_CHANNEL = CHANNEL_IFACE_SMS + '.SMSChannel'
0
1 """
2 Infrastructure code for testing Ring
3 """
4
5 import os
6 import sys
7 import dbus
8 import servicetest
9 import time
10 from servicetest import (unwrap, Event)
11 from twisted.internet import reactor
12
13 def install_colourer():
14 def red(s):
15 return '\x1b[31m%s\x1b[0m' % s
16
17 def green(s):
18 return '\x1b[32m%s\x1b[0m' % s
19
20 patterns = {
21 'handled': green,
22 'not handled': red,
23 }
24
25 class Colourer:
26 def __init__(self, fh, patterns):
27 self.fh = fh
28 self.patterns = patterns
29
30 def write(self, s):
31 f = self.patterns.get(s, lambda x: x)
32 self.fh.write(f(s))
33
34 sys.stdout = Colourer(sys.stdout, patterns)
35 return sys.stdout
36
37 class Simulator(object):
38 def __init__(self):
39 self.bus = dbus.SystemBus()
40
41 try:
42 manager = dbus.Interface(self.bus.get_object('org.ofono', '/'),
43 dbus_interface='org.ofono.Manager')
44 except dbus.exceptions.DBusException:
45 print " Ofono needs to be running to execute tests"
46 os._exit(1)
47
48 def make_connection(bus, event_func, params=None):
49 default_params = {
50 'modem': dbus.ObjectPath('/phonesim'),
51 }
52
53 if params:
54 default_params.update(params)
55
56 return servicetest.make_connection(bus, event_func, 'ring', 'tel',
57 default_params)
58
59 def exec_test_deferred (funs, params, protocol=None, timeout=None):
60 colourer = None
61
62 if sys.stdout.isatty():
63 colourer = install_colourer()
64
65 queue = servicetest.IteratingEventQueue(timeout)
66 queue.verbose = (
67 os.environ.get('CHECK_TWISTED_VERBOSE', '') != ''
68 or '-v' in sys.argv)
69
70 bus = dbus.SessionBus()
71
72 sim = Simulator()
73
74 bus.add_signal_receiver(
75 lambda *args, **kw:
76 queue.append(
77 Event('dbus-signal',
78 path=unwrap(kw['path']),
79 signal=kw['member'], args=map(unwrap, args),
80 interface=kw['interface'])),
81 None, # signal name
82 None, # interface
83 None,
84 path_keyword='path',
85 member_keyword='member',
86 interface_keyword='interface',
87 byte_arrays=True
88 )
89
90 try:
91 for f in funs:
92 conn = make_connection(bus, queue.append, params)
93 f(queue, bus, conn)
94 except Exception:
95 import traceback
96 traceback.print_exc()
97
98 try:
99 if colourer:
100 sys.stdout = colourer.fh
101 reactor.crash()
102
103 # force Disconnect in case the test crashed and didn't disconnect
104 # properly. We need to call this async because the BaseIRCServer
105 # class must do something in response to the Disconnect call and if we
106 # call it synchronously, we're blocking ourself from responding to the
107 # quit method.
108 servicetest.call_async(queue, conn, 'Disconnect')
109
110 if 'RING_TEST_REFDBG' in os.environ:
111 # we have to wait for the timeout so the process is properly
112 # exited and refdbg can generate its report
113 time.sleep(5.5)
114
115 except dbus.DBusException:
116 pass
117
118 def exec_tests(funs, params=None, protocol=None, timeout=None):
119 reactor.callWhenRunning (exec_test_deferred, funs, params, protocol, timeout)
120 reactor.run()
121
122 def exec_test(fun, params=None, protocol=None, timeout=None):
123 exec_tests([fun], params, protocol, timeout)
124
0 #!/bin/sh
1
2 if test "x$RING_TEST_UNINSTALLED" = x; then
3 script_fullname=`readlink -e "@ringtestsdir@/twisted/run-test.sh"`
4 if [ `readlink -e "$0"` != "$script_fullname" ] ; then
5 echo "This script is meant to be installed at $script_fullname" >&2
6 exit 1
7 fi
8
9 test_src="@ringtestsdir@"
10 test_build="@ringtestsdir@"
11 config_file="@ringtestsdir@/twisted/tools/servicedir/tmp-session-bus.conf"
12
13 PYTHONPATH="@ringtestsdir@/twisted"
14 export PYTHONPATH
15
16 RING_TWISTED_PATH="@ringtestsdir@/twisted"
17 export RING_TWISTED_PATH
18 else
19 if test -z "$RING_ABS_TOP_SRCDIR"; then
20 echo "RING_ABS_TOP_SRCDIR must be set" >&2
21 exit 1
22 fi
23 if test -z "$RING_ABS_TOP_BUILDDIR"; then
24 echo "RING_ABS_TOP_BUILDDIR must be set" >&2
25 exit 1
26 fi
27
28 test_src="${RING_ABS_TOP_SRCDIR}/tests"
29 test_build="${RING_ABS_TOP_BUILDDIR}/tests"
30 config_file="${test_build}/twisted/tools/tmp-session-bus.conf"
31
32 PYTHONPATH="${test_src}/twisted:${test_build}/twisted"
33 export PYTHONPATH
34
35 RING_TWISTED_PATH="${test_src}/twisted"
36 export RING_TWISTED_PATH
37 fi
38
39 if [ -n "$1" ] ; then
40 list="$1"
41 else
42 list=$(cat "${test_build}"/twisted/ring-twisted-tests.list)
43 fi
44
45 any_failed=0
46 for i in $list ; do
47 echo "Testing $i ..."
48 sh "${test_src}/twisted/tools/with-session-bus.sh" \
49 ${RING_TEST_SLEEP} \
50 --config-file="${config_file}" \
51 -- \
52 @TEST_PYTHON@ -u "${test_src}/twisted/$i"
53 e=$?
54 case "$e" in
55 (0)
56 echo "PASS: $i"
57 ;;
58 (77)
59 echo "SKIP: $i"
60 ;;
61 (*)
62 any_failed=1
63 echo "FAIL: $i ($e)"
64 ;;
65 esac
66 done
67
68 exit $any_failed
0 # Copyright (C) 2009 Nokia Corporation
1 # Copyright (C) 2009-2013 Collabora Ltd.
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16 # 02110-1301 USA
17
18 """
19 Infrastructure code for testing Telepathy services.
20 """
21
22 from twisted.internet import glib2reactor
23 from twisted.internet.protocol import Protocol, Factory, ClientFactory
24 glib2reactor.install()
25 import sys
26 import time
27 import os
28
29 import pprint
30 import unittest
31
32 import dbus
33 import dbus.lowlevel
34 from dbus.mainloop.glib import DBusGMainLoop
35 DBusGMainLoop(set_as_default=True)
36
37 from twisted.internet import reactor
38
39 import constants as cs
40
41 tp_name_prefix = cs.PREFIX
42 tp_path_prefix = cs.PATH_PREFIX
43
44 class DictionarySupersetOf (object):
45 """Utility class for expecting "a dictionary with at least these keys"."""
46 def __init__(self, dictionary):
47 self._dictionary = dictionary
48 def __repr__(self):
49 return "DictionarySupersetOf(%s)" % self._dictionary
50 def __eq__(self, other):
51 """would like to just do:
52 return set(other.items()).issuperset(self._dictionary.items())
53 but it turns out that this doesn't work if you have another dict
54 nested in the values of your dicts"""
55 try:
56 for k,v in self._dictionary.items():
57 if k not in other or other[k] != v:
58 return False
59 return True
60 except TypeError: # other is not iterable
61 return False
62
63 class Event(object):
64 def __init__(self, type, **kw):
65 self.__dict__.update(kw)
66 self.type = type
67 (self.subqueue, self.subtype) = type.split ("-", 1)
68
69 def __str__(self):
70 return '\n'.join([ str(type(self)) ] + format_event(self))
71
72 def format_event(event):
73 ret = ['- type %s' % event.type]
74
75 for key in sorted(dir(event)):
76 if key != 'type' and not key.startswith('_'):
77 ret.append('- %s: %s' % (
78 key, pprint.pformat(getattr(event, key))))
79
80 if key == 'error':
81 ret.append('%s' % getattr(event, key))
82
83 return ret
84
85 class EventPattern:
86 def __init__(self, type, **properties):
87 self.type = type
88 self.predicate = None
89 if 'predicate' in properties:
90 self.predicate = properties['predicate']
91 del properties['predicate']
92 self.properties = properties
93 (self.subqueue, self.subtype) = type.split ("-", 1)
94
95 def __repr__(self):
96 properties = dict(self.properties)
97
98 if self.predicate is not None:
99 properties['predicate'] = self.predicate
100
101 return '%s(%r, **%r)' % (
102 self.__class__.__name__, self.type, properties)
103
104 def match(self, event):
105 if event.type != self.type:
106 return False
107
108 for key, value in self.properties.iteritems():
109 try:
110 if getattr(event, key) != value:
111 return False
112 except AttributeError:
113 return False
114
115 if self.predicate is None or self.predicate(event):
116 return True
117
118 return False
119
120
121 class TimeoutError(Exception):
122 pass
123
124 class ForbiddenEventOccurred(Exception):
125 def __init__(self, event):
126 Exception.__init__(self)
127 self.event = event
128
129 def __str__(self):
130 return '\n' + '\n'.join(format_event(self.event))
131
132 class BaseEventQueue:
133 """Abstract event queue base class.
134
135 Implement the wait() method to have something that works.
136 """
137
138 def __init__(self, timeout=None):
139 self.verbose = False
140 self.forbidden_events = set()
141 self.event_queues = {}
142
143 if timeout is None:
144 self.timeout = 5
145 else:
146 self.timeout = timeout
147
148 def log(self, s):
149 if self.verbose:
150 print s
151
152 def log_queues(self, queues):
153 self.log ("Waiting for event on: %s" % ", ".join(queues))
154
155 def log_event(self, event):
156 self.log('got event:')
157
158 if self.verbose:
159 map(self.log, format_event(event))
160
161 def forbid_events(self, patterns):
162 """
163 Add patterns (an iterable of EventPattern) to the set of forbidden
164 events. If a forbidden event occurs during an expect or expect_many,
165 the test will fail.
166 """
167 self.forbidden_events.update(set(patterns))
168
169 def unforbid_events(self, patterns):
170 """
171 Remove 'patterns' (an iterable of EventPattern) from the set of
172 forbidden events. These must be the same EventPattern pointers that
173 were passed to forbid_events.
174 """
175 self.forbidden_events.difference_update(set(patterns))
176
177 def unforbid_all(self):
178 """
179 Remove all patterns from the set of forbidden events.
180 """
181 self.forbidden_events.clear()
182
183 def _check_forbidden(self, event):
184 for e in self.forbidden_events:
185 if e.match(event):
186 raise ForbiddenEventOccurred(event)
187
188 def expect(self, type, **kw):
189 """
190 Waits for an event matching the supplied pattern to occur, and returns
191 it. For example, to await a D-Bus signal with particular arguments:
192
193 e = q.expect('dbus-signal', signal='Badgers', args=["foo", 42])
194 """
195 pattern = EventPattern(type, **kw)
196 t = time.time()
197
198 while True:
199 try:
200 event = self.wait([pattern.subqueue])
201 except TimeoutError:
202 self.log('timeout')
203 self.log('still expecting:')
204 self.log(' - %r' % pattern)
205 raise
206
207 self._check_forbidden(event)
208
209 if pattern.match(event):
210 self.log('handled, took %0.3f ms'
211 % ((time.time() - t) * 1000.0) )
212 self.log('')
213 return event
214
215 self.log('not handled')
216 self.log('')
217
218 def expect_many(self, *patterns):
219 """
220 Waits for events matching all of the supplied EventPattern instances to
221 return, and returns a list of events in the same order as the patterns
222 they matched. After a pattern is successfully matched, it is not
223 considered for future events; if more than one unsatisfied pattern
224 matches an event, the first "wins".
225
226 Note that the expected events may occur in any order. If you're
227 expecting a series of events in a particular order, use repeated calls
228 to expect() instead.
229
230 This method is useful when you're awaiting a number of events which may
231 happen in any order. For instance, in telepathy-gabble, calling a D-Bus
232 method often causes a value to be returned immediately, as well as a
233 query to be sent to the server. Since these events may reach the test
234 in either order, the following is incorrect and will fail if the IQ
235 happens to reach the test first:
236
237 ret = q.expect('dbus-return', method='Foo')
238 query = q.expect('stream-iq', query_ns=ns.FOO)
239
240 The following would be correct:
241
242 ret, query = q.expect_many(
243 EventPattern('dbus-return', method='Foo'),
244 EventPattern('stream-iq', query_ns=ns.FOO),
245 )
246 """
247 ret = [None] * len(patterns)
248 t = time.time()
249
250 while None in ret:
251 try:
252 queues = set()
253 for i, pattern in enumerate(patterns):
254 if ret[i] is None:
255 queues.add(pattern.subqueue)
256 event = self.wait(queues)
257 except TimeoutError:
258 self.log('timeout')
259 self.log('still expecting:')
260 for i, pattern in enumerate(patterns):
261 if ret[i] is None:
262 self.log(' - %r' % pattern)
263 raise
264 self._check_forbidden(event)
265
266 for i, pattern in enumerate(patterns):
267 if ret[i] is None and pattern.match(event):
268 self.log('handled, took %0.3f ms'
269 % ((time.time() - t) * 1000.0) )
270 self.log('')
271 ret[i] = event
272 break
273 else:
274 self.log('not handled')
275 self.log('')
276
277 return ret
278
279 def demand(self, type, **kw):
280 pattern = EventPattern(type, **kw)
281
282 event = self.wait([pattern.subqueue])
283
284 if pattern.match(event):
285 self.log('handled')
286 self.log('')
287 return event
288
289 self.log('not handled')
290 raise RuntimeError('expected %r, got %r' % (pattern, event))
291
292 def queues_available(self, queues):
293 if queues == None:
294 return self.event_queues.keys()
295 else:
296 available = self.event_queues.keys()
297 return filter(lambda x: x in available, queues)
298
299
300 def pop_next(self, queue):
301 events = self.event_queues[queue]
302 e = events.pop(0)
303 if not events:
304 self.event_queues.pop (queue)
305 return e
306
307 def append(self, event):
308 self.log ("Adding to queue")
309 self.log_event (event)
310 self.event_queues[event.subqueue] = \
311 self.event_queues.get(event.subqueue, []) + [event]
312
313 class IteratingEventQueue(BaseEventQueue):
314 """Event queue that works by iterating the Twisted reactor."""
315
316 def __init__(self, timeout=None):
317 BaseEventQueue.__init__(self, timeout)
318 self._dbus_method_impls = []
319 self._buses = []
320 # a message filter which will claim we handled everything
321 self._dbus_dev_null = \
322 lambda bus, message: dbus.lowlevel.HANDLER_RESULT_HANDLED
323
324 def wait(self, queues=None):
325 stop = [False]
326
327 def later():
328 stop[0] = True
329
330 delayed_call = reactor.callLater(self.timeout, later)
331
332 self.log_queues(queues)
333
334 qa = self.queues_available(queues)
335 while not qa and (not stop[0]):
336 reactor.iterate(0.01)
337 qa = self.queues_available(queues)
338
339 if qa:
340 delayed_call.cancel()
341 e = self.pop_next (qa[0])
342 self.log_event (e)
343 return e
344 else:
345 raise TimeoutError
346
347 def add_dbus_method_impl(self, cb, bus=None, **kwargs):
348 if bus is None:
349 bus = self._buses[0]
350
351 self._dbus_method_impls.append(
352 (EventPattern('dbus-method-call', **kwargs), cb))
353
354 def dbus_emit(self, path, iface, name, *a, **k):
355 bus = k.pop('bus', self._buses[0])
356 assert 'signature' in k, k
357 message = dbus.lowlevel.SignalMessage(path, iface, name)
358 message.append(*a, **k)
359 bus.send_message(message)
360
361 def dbus_return(self, in_reply_to, *a, **k):
362 bus = k.pop('bus', self._buses[0])
363 assert 'signature' in k, k
364 reply = dbus.lowlevel.MethodReturnMessage(in_reply_to)
365 reply.append(*a, **k)
366 bus.send_message(reply)
367
368 def dbus_raise(self, in_reply_to, name, message=None, bus=None):
369 if bus is None:
370 bus = self._buses[0]
371
372 reply = dbus.lowlevel.ErrorMessage(in_reply_to, name, message)
373 bus.send_message(reply)
374
375 def attach_to_bus(self, bus):
376 if not self._buses:
377 # first-time setup
378 self._dbus_filter_bound_method = self._dbus_filter
379
380 self._buses.append(bus)
381
382 # Only subscribe to messages on the first bus connection (assumed to
383 # be the shared session bus connection used by the simulated connection
384 # manager and most of the test suite), not on subsequent bus
385 # connections (assumed to represent extra clients).
386 #
387 # When we receive a method call on the other bus connections, ignore
388 # it - the eavesdropping filter installed on the first bus connection
389 # will see it too.
390 #
391 # This is highly counter-intuitive, but it means our messages are in
392 # a guaranteed order (we don't have races between messages arriving on
393 # various connections).
394 if len(self._buses) > 1:
395 bus.add_message_filter(self._dbus_dev_null)
396 return
397
398 try:
399 # for dbus > 1.5
400 bus.add_match_string("eavesdrop=true,type='signal'")
401 except dbus.DBusException:
402 bus.add_match_string("type='signal'")
403 bus.add_match_string("type='method_call'")
404 else:
405 bus.add_match_string("eavesdrop=true,type='method_call'")
406
407 bus.add_message_filter(self._dbus_filter_bound_method)
408
409 bus.add_signal_receiver(
410 lambda *args, **kw:
411 self.append(
412 Event('dbus-signal',
413 path=unwrap(kw['path']),
414 signal=kw['member'],
415 args=map(unwrap, args),
416 interface=kw['interface'])),
417 None,
418 None,
419 None,
420 path_keyword='path',
421 member_keyword='member',
422 interface_keyword='interface',
423 byte_arrays=True,
424 )
425
426 def cleanup(self):
427 if self._buses:
428 self._buses[0].remove_message_filter(self._dbus_filter_bound_method)
429 for bus in self._buses[1:]:
430 bus.remove_message_filter(self._dbus_dev_null)
431
432 self._buses = []
433 self._dbus_method_impls = []
434
435 def _dbus_filter(self, bus, message):
436 if isinstance(message, dbus.lowlevel.MethodCallMessage):
437
438 destination = message.get_destination()
439 sender = message.get_sender()
440
441 if (destination == 'org.freedesktop.DBus' or
442 sender == self._buses[0].get_unique_name()):
443 # suppress reply and don't make an Event
444 return dbus.lowlevel.HANDLER_RESULT_HANDLED
445
446 e = Event('dbus-method-call', message=message,
447 interface=message.get_interface(), path=message.get_path(),
448 raw_args=message.get_args_list(byte_arrays=True),
449 args=map(unwrap, message.get_args_list(byte_arrays=True)),
450 destination=str(destination),
451 method=message.get_member(),
452 sender=message.get_sender(),
453 handled=False)
454
455 for pair in self._dbus_method_impls:
456 pattern, cb = pair
457 if pattern.match(e):
458 cb(e)
459 e.handled = True
460 break
461
462 self.append(e)
463
464 return dbus.lowlevel.HANDLER_RESULT_HANDLED
465
466 return dbus.lowlevel.HANDLER_RESULT_NOT_YET_HANDLED
467
468 class TestEventQueue(BaseEventQueue):
469 def __init__(self, events):
470 BaseEventQueue.__init__(self)
471 for e in events:
472 self.append (e)
473
474 def wait(self, queues = None):
475 qa = self.queues_available(queues)
476
477 if qa:
478 return self.pop_next (qa[0])
479 else:
480 raise TimeoutError
481
482 class EventQueueTest(unittest.TestCase):
483 def test_expect(self):
484 queue = TestEventQueue([Event('test-foo'), Event('test-bar')])
485 assert queue.expect('test-foo').type == 'test-foo'
486 assert queue.expect('test-bar').type == 'test-bar'
487
488 def test_expect_many(self):
489 queue = TestEventQueue([Event('test-foo'),
490 Event('test-bar')])
491 bar, foo = queue.expect_many(
492 EventPattern('test-bar'),
493 EventPattern('test-foo'))
494 assert bar.type == 'test-bar'
495 assert foo.type == 'test-foo'
496
497 def test_expect_many2(self):
498 # Test that events are only matched against patterns that haven't yet
499 # been matched. This tests a regression.
500 queue = TestEventQueue([Event('test-foo', x=1), Event('test-foo', x=2)])
501 foo1, foo2 = queue.expect_many(
502 EventPattern('test-foo'),
503 EventPattern('test-foo'))
504 assert foo1.type == 'test-foo' and foo1.x == 1
505 assert foo2.type == 'test-foo' and foo2.x == 2
506
507 def test_expect_queueing(self):
508 queue = TestEventQueue([Event('foo-test', x=1),
509 Event('foo-test', x=2)])
510
511 queue.append(Event('bar-test', x=1))
512 queue.append(Event('bar-test', x=2))
513
514 queue.append(Event('baz-test', x=1))
515 queue.append(Event('baz-test', x=2))
516
517 for x in xrange(1,2):
518 e = queue.expect ('baz-test')
519 assertEquals (x, e.x)
520
521 e = queue.expect ('bar-test')
522 assertEquals (x, e.x)
523
524 e = queue.expect ('foo-test')
525 assertEquals (x, e.x)
526
527 def test_timeout(self):
528 queue = TestEventQueue([])
529 self.assertRaises(TimeoutError, queue.expect, 'test-foo')
530
531 def test_demand(self):
532 queue = TestEventQueue([Event('test-foo'), Event('test-bar')])
533 foo = queue.demand('test-foo')
534 assert foo.type == 'test-foo'
535
536 def test_demand_fail(self):
537 queue = TestEventQueue([Event('test-foo'), Event('test-bar')])
538 self.assertRaises(RuntimeError, queue.demand, 'test-bar')
539
540 def unwrap(x):
541 """Hack to unwrap D-Bus values, so that they're easier to read when
542 printed."""
543
544 if isinstance(x, list):
545 return map(unwrap, x)
546
547 if isinstance(x, tuple):
548 return tuple(map(unwrap, x))
549
550 if isinstance(x, dict):
551 return dict([(unwrap(k), unwrap(v)) for k, v in x.iteritems()])
552
553 if isinstance(x, dbus.Boolean):
554 return bool(x)
555
556 for t in [unicode, str, long, int, float]:
557 if isinstance(x, t):
558 return t(x)
559
560 return x
561
562 def call_async(test, proxy, method, *args, **kw):
563 """Call a D-Bus method asynchronously and generate an event for the
564 resulting method return/error."""
565
566 def reply_func(*ret):
567 test.append(Event('dbus-return', method=method,
568 value=unwrap(ret)))
569
570 def error_func(err):
571 test.append(Event('dbus-error', method=method, error=err,
572 name=err.get_dbus_name(), message=str(err)))
573
574 method_proxy = getattr(proxy, method)
575 kw.update({'reply_handler': reply_func, 'error_handler': error_func})
576 method_proxy(*args, **kw)
577
578 def sync_dbus(bus, q, proxy):
579 # Dummy D-Bus method call. We can't use DBus.Peer.Ping() because libdbus
580 # replies to that message immediately, rather than handing it up to
581 # dbus-glib and thence the application, which means that Ping()ing the
582 # application doesn't ensure that it's processed all D-Bus messages prior
583 # to our ping.
584 call_async(q, dbus.Interface(proxy, 'org.freedesktop.Telepathy.Tests'),
585 'DummySyncDBus')
586 q.expect('dbus-error', method='DummySyncDBus')
587
588 class ProxyWrapper:
589 def __init__(self, object, default, others={}):
590 self.object = object
591 self.default_interface = dbus.Interface(object, default)
592 self.Properties = dbus.Interface(object, dbus.PROPERTIES_IFACE)
593 self.TpProperties = \
594 dbus.Interface(object, tp_name_prefix + '.Properties')
595 self.interfaces = dict([
596 (name, dbus.Interface(object, iface))
597 for name, iface in others.iteritems()])
598
599 def __getattr__(self, name):
600 if name in self.interfaces:
601 return self.interfaces[name]
602
603 if name in self.object.__dict__:
604 return getattr(self.object, name)
605
606 return getattr(self.default_interface, name)
607
608 class ConnWrapper(ProxyWrapper):
609 def inspect_contact_sync(self, handle):
610 return self.inspect_contacts_sync([handle])[0]
611
612 def inspect_contacts_sync(self, handles):
613 h2asv = self.Contacts.GetContactAttributes(handles, [], True)
614 ret = []
615 for h in handles:
616 ret.append(h2asv[h][cs.ATTR_CONTACT_ID])
617 return ret
618
619 def get_contact_handle_sync(self, identifier):
620 return self.Contacts.GetContactByID(identifier, [])[0]
621
622 def get_contact_handles_sync(self, ids):
623 return [self.get_contact_handle_sync(i) for i in ids]
624
625 def wrap_connection(conn):
626 return ConnWrapper(conn, tp_name_prefix + '.Connection',
627 dict([
628 (name, tp_name_prefix + '.Connection.Interface.' + name)
629 for name in ['Aliasing', 'Avatars', 'Capabilities', 'Contacts',
630 'SimplePresence', 'Requests']] +
631 [('Peer', 'org.freedesktop.DBus.Peer'),
632 ('ContactCapabilities', cs.CONN_IFACE_CONTACT_CAPS),
633 ('ContactInfo', cs.CONN_IFACE_CONTACT_INFO),
634 ('Location', cs.CONN_IFACE_LOCATION),
635 ('Future', tp_name_prefix + '.Connection.FUTURE'),
636 ('MailNotification', cs.CONN_IFACE_MAIL_NOTIFICATION),
637 ('ContactList', cs.CONN_IFACE_CONTACT_LIST),
638 ('ContactGroups', cs.CONN_IFACE_CONTACT_GROUPS),
639 ('ContactBlocking', cs.CONN_IFACE_CONTACT_BLOCKING),
640 ('PowerSaving', cs.CONN_IFACE_POWER_SAVING),
641 ('Addressing', cs.CONN_IFACE_ADDRESSING),
642 ('ClientTypes', cs.CONN_IFACE_CLIENT_TYPES),
643 ]))
644
645 class ChannelWrapper(ProxyWrapper):
646 def send_msg_sync(self, txt):
647 message = [
648 { 'message-type': cs.MT_NORMAL, },
649 { 'content-type': 'text/plain',
650 'content': txt
651 }]
652 self.Messages.SendMessage(message, 0)
653
654 def wrap_channel(chan, type_, extra=None):
655 interfaces = {
656 type_: tp_name_prefix + '.Channel.Type.' + type_,
657 'Channel': cs.CHANNEL,
658 'Group': cs.CHANNEL_IFACE_GROUP,
659 'Hold': cs.CHANNEL_IFACE_HOLD,
660 'Messages': cs.CHANNEL_IFACE_MESSAGES,
661 'RoomConfig1': cs.CHANNEL_IFACE_ROOM_CONFIG,
662 'ChatState': cs.CHANNEL_IFACE_CHAT_STATE,
663 'Destroyable': cs.CHANNEL_IFACE_DESTROYABLE,
664 'Password': cs.CHANNEL_IFACE_PASSWORD,
665 }
666
667 if extra:
668 interfaces.update(dict([
669 (name, tp_name_prefix + '.Channel.Interface.' + name)
670 for name in extra]))
671
672 return ChannelWrapper(chan, tp_name_prefix + '.Channel', interfaces)
673
674
675 def wrap_content(chan, extra=None):
676 interfaces = {
677 'DTMF': cs.CALL_CONTENT_IFACE_DTMF,
678 'Media': cs.CALL_CONTENT_IFACE_MEDIA,
679 }
680
681 if extra:
682 interfaces.update(dict([
683 (name, tp_name_prefix + '.Call1.Content.Interface.' + name)
684 for name in extra]))
685
686 return ProxyWrapper(chan, tp_name_prefix + '.Call1.Content', interfaces)
687
688 def make_connection(bus, event_func, name, proto, params):
689 cm = bus.get_object(
690 tp_name_prefix + '.ConnectionManager.%s' % name,
691 tp_path_prefix + '/ConnectionManager/%s' % name,
692 introspect=False)
693 cm_iface = dbus.Interface(cm, tp_name_prefix + '.ConnectionManager')
694
695 connection_name, connection_path = cm_iface.RequestConnection(
696 proto, dbus.Dictionary(params, signature='sv'))
697 conn = wrap_connection(bus.get_object(connection_name, connection_path))
698
699 return conn
700
701 def make_channel_proxy(conn, path, iface):
702 bus = dbus.SessionBus()
703 chan = bus.get_object(conn.object.bus_name, path)
704 chan = dbus.Interface(chan, tp_name_prefix + '.' + iface)
705 return chan
706
707 # block_reading can be used if the test want to choose when we start to read
708 # data from the socket.
709 class EventProtocol(Protocol):
710 def __init__(self, queue=None, block_reading=False):
711 self.queue = queue
712 self.block_reading = block_reading
713
714 def dataReceived(self, data):
715 if self.queue is not None:
716 self.queue.append(Event('socket-data', protocol=self,
717 data=data))
718
719 def sendData(self, data):
720 self.transport.write(data)
721
722 def connectionMade(self):
723 if self.block_reading:
724 self.transport.stopReading()
725
726 def connectionLost(self, reason=None):
727 if self.queue is not None:
728 self.queue.append(Event('socket-disconnected', protocol=self))
729
730 class EventProtocolFactory(Factory):
731 def __init__(self, queue, block_reading=False):
732 self.queue = queue
733 self.block_reading = block_reading
734
735 def _create_protocol(self):
736 return EventProtocol(self.queue, self.block_reading)
737
738 def buildProtocol(self, addr):
739 proto = self._create_protocol()
740 self.queue.append(Event('socket-connected', protocol=proto))
741 return proto
742
743 class EventProtocolClientFactory(EventProtocolFactory, ClientFactory):
744 pass
745
746 def watch_tube_signals(q, tube):
747 def got_signal_cb(*args, **kwargs):
748 q.append(Event('tube-signal',
749 path=kwargs['path'],
750 signal=kwargs['member'],
751 args=map(unwrap, args),
752 tube=tube))
753
754 tube.add_signal_receiver(got_signal_cb,
755 path_keyword='path', member_keyword='member',
756 byte_arrays=True)
757
758 def pretty(x):
759 return pprint.pformat(unwrap(x))
760
761 def assertEquals(expected, value):
762 if expected != value:
763 raise AssertionError(
764 "expected:\n%s\ngot:\n%s" % (pretty(expected), pretty(value)))
765
766 def assertSameSets(expected, value):
767 exp_set = set(expected)
768 val_set = set(value)
769
770 if exp_set != val_set:
771 raise AssertionError(
772 "expected contents:\n%s\ngot:\n%s" % (
773 pretty(exp_set), pretty(val_set)))
774
775 def assertNotEquals(expected, value):
776 if expected == value:
777 raise AssertionError(
778 "expected something other than:\n%s" % pretty(value))
779
780 def assertContains(element, value):
781 if element not in value:
782 raise AssertionError(
783 "expected:\n%s\nin:\n%s" % (pretty(element), pretty(value)))
784
785 def assertDoesNotContain(element, value):
786 if element in value:
787 raise AssertionError(
788 "expected:\n%s\nnot in:\n%s" % (pretty(element), pretty(value)))
789
790 def assertLength(length, value):
791 if len(value) != length:
792 raise AssertionError("expected: length %d, got length %d:\n%s" % (
793 length, len(value), pretty(value)))
794
795 def assertFlagsSet(flags, value):
796 masked = value & flags
797 if masked != flags:
798 raise AssertionError(
799 "expected flags %u, of which only %u are set in %u" % (
800 flags, masked, value))
801
802 def assertFlagsUnset(flags, value):
803 masked = value & flags
804 if masked != 0:
805 raise AssertionError(
806 "expected none of flags %u, but %u are set in %u" % (
807 flags, masked, value))
808
809 def assertDBusError(name, error):
810 if error.get_dbus_name() != name:
811 raise AssertionError(
812 "expected DBus error named:\n %s\ngot:\n %s\n(with message: %s)"
813 % (name, error.get_dbus_name(), error.message))
814
815 def install_colourer():
816 def red(s):
817 return '\x1b[31m%s\x1b[0m' % s
818
819 def green(s):
820 return '\x1b[32m%s\x1b[0m' % s
821
822 patterns = {
823 'handled': green,
824 'not handled': red,
825 }
826
827 class Colourer:
828 def __init__(self, fh, patterns):
829 self.fh = fh
830 self.patterns = patterns
831
832 def write(self, s):
833 for p, f in self.patterns.items():
834 if s.startswith(p):
835 self.fh.write(f(p) + s[len(p):])
836 return
837
838 self.fh.write(s)
839
840 sys.stdout = Colourer(sys.stdout, patterns)
841 return sys.stdout
842
843 # this is just to shut up unittest.
844 class DummyStream(object):
845 def write(self, s):
846 if 'CHECK_TWISTED_VERBOSE' in os.environ:
847 print s,
848
849 def flush(self):
850 pass
851
852 if __name__ == '__main__':
853 stream = DummyStream()
854 runner = unittest.TextTestRunner(stream=stream)
855 unittest.main(testRunner=runner)
0 exec-with-log.sh: exec-with-log.sh.in
1 sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \
2 -e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" $< > $@
3 chmod +x $@
4
5 %.conf: %.conf.in
6 sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
7
8 # We don't use the full filename for the .in because > 99 character filenames
9 # in tarballs are non-portable (and automake 1.8 doesn't let us build
10 # non-archaic tarballs)
11 org.freedesktop.Telepathy.ConnectionManager.%.service: %.service.in
12 sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
13
14 # D-Bus service file for testing
15 service_in_files = ring.service.in
16 service_files = org.freedesktop.Telepathy.ConnectionManager.ring.service
17
18 # D-Bus config file for testing
19 conf_in_files = tmp-session-bus.conf.in
20 conf_files = $(conf_in_files:.conf.in=.conf)
21
22 BUILT_SOURCES = $(service_files) $(conf_files) exec-with-log.sh
23
24 EXTRA_DIST = \
25 $(service_in_files) \
26 $(conf_in_files) \
27 exec-with-log.sh.in \
28 with-session-bus.sh
29
30 CLEANFILES = \
31 $(BUILT_SOURCES) \
32 ring-testing.log
0 #!/bin/sh
1
2 cd "@abs_top_builddir@/tests/twisted/tools"
3
4 export RING_DEBUG=all RING_HTFU=seriously
5 G_MESSAGES_DEBUG=all
6 export G_MESSAGES_DEBUG
7 ulimit -c unlimited
8 exec >> ring-testing.log 2>&1
9
10 if test -n "$RING_TEST_VALGRIND"; then
11 export G_DEBUG=${G_DEBUG:+"${G_DEBUG},"}gc-friendly
12 export G_SLICE=always-malloc
13 RING_WRAPPER="valgrind --leak-check=full --num-callers=20"
14 RING_WRAPPER="$RING_WRAPPER --show-reachable=yes"
15 RING_WRAPPER="$RING_WRAPPER --gen-suppressions=all"
16 RING_WRAPPER="$RING_WRAPPER --child-silent-after-fork=yes"
17 RING_WRAPPER="$RING_WRAPPER --suppressions=@abs_top_srcdir@/tests/twisted/tools/tp-glib.supp"
18 elif test -n "$RING_TEST_REFDBG"; then
19 if test -z "$REFDBG_OPTIONS" ; then
20 export REFDBG_OPTIONS="btnum=10"
21 fi
22 if test -z "$RING_WRAPPER" ; then
23 RING_WRAPPER="refdbg"
24 fi
25 fi
26
27 export G_DEBUG=fatal-warnings" ${G_DEBUG}"
28 exec @abs_top_builddir@/libtool --mode=execute $RING_WRAPPER @abs_top_builddir@/src/telepathy-ring
0 [D-BUS Service]
1 Name=org.freedesktop.Telepathy.ConnectionManager.ring
2 Exec=@abs_top_builddir@/tests/twisted/tools/exec-with-log.sh
0 <!-- This configuration file controls the per-user-login-session message bus.
1 Add a session-local.conf and edit that rather than changing this
2 file directly. -->
3
4 <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
5 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
6 <busconfig>
7 <!-- Our well-known bus type, don't change this -->
8 <type>session</type>
9
10 <listen>unix:tmpdir=/tmp</listen>
11
12 <servicedir>@abs_top_builddir@/tests/twisted/tools</servicedir>
13
14 <policy context="default">
15 <!-- Allow everything to be sent -->
16 <allow send_destination="*" eavesdrop="true"/>
17 <!-- Allow everything to be received -->
18 <allow eavesdrop="true"/>
19 <!-- Allow anyone to own anything -->
20 <allow own="*"/>
21 </policy>
22
23 <!-- This is included last so local configuration can override what's
24 in this standard file -->
25 </busconfig>
0 #!/bin/sh
1 # with-session-bus.sh - run a program with a temporary D-Bus session daemon
2 #
3 # The canonical location of this program is the telepathy-glib tools/
4 # directory, please synchronize any changes with that copy.
5 #
6 # Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
7 #
8 # Copying and distribution of this file, with or without modification,
9 # are permitted in any medium without royalty provided the copyright
10 # notice and this notice are preserved.
11
12 set -e
13
14 me=with-session-bus
15
16 dbus_daemon_args="--print-address=5 --print-pid=6 --fork"
17 sleep=0
18
19 usage ()
20 {
21 echo "usage: $me [options] -- program [program_options]" >&2
22 echo "Requires write access to the current directory." >&2
23 echo "" >&2
24 echo "If \$WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor" >&2
25 echo "with the arguments in \$WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT." >&2
26 echo "The output of dbus-monitor is saved in $me-<pid>.dbus-monitor-logs" >&2
27 exit 2
28 }
29
30 while test "z$1" != "z--"; do
31 case "$1" in
32 --sleep=*)
33 sleep="$1"
34 sleep="${sleep#--sleep=}"
35 shift
36 ;;
37 --session)
38 dbus_daemon_args="$dbus_daemon_args --session"
39 shift
40 ;;
41 --config-file=*)
42 # FIXME: assumes config file doesn't contain any special characters
43 dbus_daemon_args="$dbus_daemon_args $1"
44 shift
45 ;;
46 --also-for-system)
47 with_system_bus=1
48 shift
49 ;;
50 *)
51 usage
52 ;;
53 esac
54 done
55 shift
56 if test "z$1" = "z"; then usage; fi
57
58 exec 5> $me-$$.address
59 exec 6> $me-$$.pid
60
61 cleanup ()
62 {
63 pid=`head -n1 $me-$$.pid`
64 if test -n "$pid" ; then
65 if [ -n "$CHECK_TWISTED_VERBOSE" ] || [ -n "$VERBOSE_TESTS" ]; then
66 echo "Killing temporary bus daemon: $pid" >&2
67 fi
68 kill -INT "$pid"
69 fi
70 rm -f $me-$$.address
71 rm -f $me-$$.pid
72 }
73
74 trap cleanup INT HUP TERM
75 dbus-daemon $dbus_daemon_args
76
77 if [ -n "$CHECK_TWISTED_VERBOSE" ] || [ -n "$VERBOSE_TESTS" ]; then
78 { echo -n "Temporary bus daemon is "; cat $me-$$.address; } >&2
79 { echo -n "Temporary bus daemon PID is "; head -n1 $me-$$.pid; } >&2
80 fi
81
82 e=0
83
84 # These might be non-null when run from e.g. gnome-terminal 3.8, which uses
85 # an activatable service for its windows; we don't want to inherit them either
86 unset DBUS_STARTER_ADDRESS
87 unset DBUS_STARTER_BUS_TYPE
88
89 DBUS_SESSION_BUS_ADDRESS="`cat $me-$$.address`"
90 export DBUS_SESSION_BUS_ADDRESS
91
92 if [ -n "$with_system_bus" ] ; then
93 DBUS_SYSTEM_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS"
94 export DBUS_SYSTEM_BUS_ADDRESS
95 fi
96
97 if [ -n "$WITH_SESSION_BUS_FORK_DBUS_MONITOR" ] ; then
98 DBUS_MONITOR_LOG_FILE="$me-$$.dbus-monitor-logs"
99 echo "Running dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2
100 echo "Its output will be in $DBUS_MONITOR_LOG_FILE" >&2
101 dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT \
102 > $DBUS_MONITOR_LOG_FILE 2>&1 &
103 fi
104
105 if [ -n "$RING_TEST_BUSTLE" ]; then
106 BUSTLE_LOG_FILE="tools/$me-$$.bustle-logs"
107 echo "Running bustle-dbus-monitor; log file $BUSTLE_LOG_FILE" >&2
108 bustle-dbus-monitor > $BUSTLE_LOG_FILE 2>&1 &
109 fi
110
111 "$@" || e=$?
112
113 if test $sleep != 0; then
114 sleep $sleep
115 fi
116
117 trap - INT HUP TERM
118 cleanup
119
120 exit $e
0 from unittest import *
1
2 class CheckResult (TestResult):
3
4 successes = () # Immutable
5
6 def addSuccess(self, test):
7 if not self.successes:
8 self.successes = []
9 self.successes.append(test)
10
11
12 class _CheckCase:
13
14 def defaultTestResult(self):
15 return CheckResult()
16
17
18 class CheckCase (_CheckCase, TestCase):
19 pass
20
21
22 class FunctionCheckCase (_CheckCase, FunctionTestCase):
23 pass
+0
-435
tools/Makefile.in less more
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
6 # This Makefile.in is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 @SET_MAKE@
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 pkglibdir = $(libdir)/@PACKAGE@
21 pkglibexecdir = $(libexecdir)/@PACKAGE@
22 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23 install_sh_DATA = $(install_sh) -c -m 644
24 install_sh_PROGRAM = $(install_sh) -c
25 install_sh_SCRIPT = $(install_sh) -c
26 INSTALL_HEADER = $(INSTALL_DATA)
27 transform = $(program_transform_name)
28 NORMAL_INSTALL = :
29 PRE_INSTALL = :
30 POST_INSTALL = :
31 NORMAL_UNINSTALL = :
32 PRE_UNINSTALL = :
33 POST_UNINSTALL = :
34 build_triplet = @build@
35 host_triplet = @host@
36 subdir = tools
37 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
40 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
41 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
42 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
43 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 $(ACLOCAL_M4)
45 mkinstalldirs = $(install_sh) -d
46 CONFIG_HEADER = $(top_builddir)/config.h
47 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_VPATH_FILES =
49 SCRIPTS = $(noinst_SCRIPTS)
50 AM_V_GEN = $(am__v_GEN_$(V))
51 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
52 am__v_GEN_0 = @echo " GEN " $@;
53 AM_V_at = $(am__v_at_$(V))
54 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
55 am__v_at_0 = @
56 SOURCES =
57 DIST_SOURCES =
58 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
59 ACLOCAL = @ACLOCAL@
60 AMTAR = @AMTAR@
61 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
62 AR = @AR@
63 AUTOCONF = @AUTOCONF@
64 AUTOHEADER = @AUTOHEADER@
65 AUTOMAKE = @AUTOMAKE@
66 AWK = @AWK@
67 CC = @CC@
68 CCDEPMODE = @CCDEPMODE@
69 CFLAGS = @CFLAGS@
70 CHECK_CFLAGS = @CHECK_CFLAGS@
71 CHECK_LIBS = @CHECK_LIBS@
72 CPP = @CPP@
73 CPPFLAGS = @CPPFLAGS@
74 CYGPATH_W = @CYGPATH_W@
75 DATADIR = @DATADIR@
76 DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@
77 DBUS_CFLAGS = @DBUS_CFLAGS@
78 DBUS_LIBS = @DBUS_LIBS@
79 DBUS_SERVICES_DIR = @DBUS_SERVICES_DIR@
80 DEFS = @DEFS@
81 DEPDIR = @DEPDIR@
82 DSYMUTIL = @DSYMUTIL@
83 DUMPBIN = @DUMPBIN@
84 ECHO_C = @ECHO_C@
85 ECHO_N = @ECHO_N@
86 ECHO_T = @ECHO_T@
87 EGREP = @EGREP@
88 ERROR_CFLAGS = @ERROR_CFLAGS@
89 EXEEXT = @EXEEXT@
90 FGREP = @FGREP@
91 GLIB_CFLAGS = @GLIB_CFLAGS@
92 GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
93 GLIB_LIBS = @GLIB_LIBS@
94 GREP = @GREP@
95 INSTALL = @INSTALL@
96 INSTALL_DATA = @INSTALL_DATA@
97 INSTALL_PROGRAM = @INSTALL_PROGRAM@
98 INSTALL_SCRIPT = @INSTALL_SCRIPT@
99 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
100 LD = @LD@
101 LDFLAGS = @LDFLAGS@
102 LIBOBJS = @LIBOBJS@
103 LIBS = @LIBS@
104 LIBTOOL = @LIBTOOL@
105 LIPO = @LIPO@
106 LN_S = @LN_S@
107 LTLIBOBJS = @LTLIBOBJS@
108 MAINT = @MAINT@
109 MAKEINFO = @MAKEINFO@
110 MKDIR_P = @MKDIR_P@
111 NM = @NM@
112 NMEDIT = @NMEDIT@
113 OBJDUMP = @OBJDUMP@
114 OBJEXT = @OBJEXT@
115 OTOOL = @OTOOL@
116 OTOOL64 = @OTOOL64@
117 PACKAGE = @PACKAGE@
118 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
119 PACKAGE_NAME = @PACKAGE_NAME@
120 PACKAGE_STRING = @PACKAGE_STRING@
121 PACKAGE_TARNAME = @PACKAGE_TARNAME@
122 PACKAGE_URL = @PACKAGE_URL@
123 PACKAGE_VERSION = @PACKAGE_VERSION@
124 PATH_SEPARATOR = @PATH_SEPARATOR@
125 PKG_CONFIG = @PKG_CONFIG@
126 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
127 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
128 PYTHON = @PYTHON@
129 RANLIB = @RANLIB@
130 SED = @SED@
131 SET_MAKE = @SET_MAKE@
132 SHELL = @SHELL@
133 STRIP = @STRIP@
134 TP_CFLAGS = @TP_CFLAGS@
135 TP_LIBS = @TP_LIBS@
136 UUID_CFLAGS = @UUID_CFLAGS@
137 UUID_LIBS = @UUID_LIBS@
138 VERSION = @VERSION@
139 XSLTPROC = @XSLTPROC@
140 abs_builddir = @abs_builddir@
141 abs_srcdir = @abs_srcdir@
142 abs_top_builddir = @abs_top_builddir@
143 abs_top_srcdir = @abs_top_srcdir@
144 ac_ct_CC = @ac_ct_CC@
145 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
146 am__include = @am__include@
147 am__leading_dot = @am__leading_dot@
148 am__quote = @am__quote@
149 am__tar = @am__tar@
150 am__untar = @am__untar@
151 bindir = @bindir@
152 build = @build@
153 build_alias = @build_alias@
154 build_cpu = @build_cpu@
155 build_os = @build_os@
156 build_vendor = @build_vendor@
157 builddir = @builddir@
158 datadir = @datadir@
159 datarootdir = @datarootdir@
160 docdir = @docdir@
161 dvidir = @dvidir@
162 exec_prefix = @exec_prefix@
163 host = @host@
164 host_alias = @host_alias@
165 host_cpu = @host_cpu@
166 host_os = @host_os@
167 host_vendor = @host_vendor@
168 htmldir = @htmldir@
169 includedir = @includedir@
170 includemodemdir = @includemodemdir@
171 includesmsdir = @includesmsdir@
172 infodir = @infodir@
173 install_sh = @install_sh@
174 libdir = @libdir@
175 libexecdir = @libexecdir@
176 localedir = @localedir@
177 localstatedir = @localstatedir@
178 lt_ECHO = @lt_ECHO@
179 mandir = @mandir@
180 mkdir_p = @mkdir_p@
181 oldincludedir = @oldincludedir@
182 pdfdir = @pdfdir@
183 prefix = @prefix@
184 program_transform_name = @program_transform_name@
185 psdir = @psdir@
186 sbindir = @sbindir@
187 sharedstatedir = @sharedstatedir@
188 srcdir = @srcdir@
189 sysconfdir = @sysconfdir@
190 target_alias = @target_alias@
191 testdir = @testdir@
192 top_build_prefix = @top_build_prefix@
193 top_builddir = @top_builddir@
194 top_srcdir = @top_srcdir@
195 noinst_SCRIPTS = telepathy-glib-env
196 EXTRA_DIST = \
197 c-constants-gen.py \
198 check-coding-style.mk \
199 check-c-style.sh \
200 check-misc.sh \
201 check-whitespace.sh \
202 doc-generator.xsl \
203 glib-client-gen.py \
204 glib-client-marshaller-gen.py \
205 glib-errors-enum-body-gen.py \
206 glib-errors-enum-header-gen.py \
207 glib-ginterface-gen.py \
208 glib-gtypes-generator.py \
209 glib-interfaces-gen.py \
210 glib-signals-marshal-gen.py \
211 gobject-foo.py \
212 identity.xsl \
213 libglibcodegen.py \
214 libtpcodegen.py \
215 make-version-script.py \
216 telepathy-glib-env.in \
217 with-session-bus.sh \
218 xincludator.py
219
220 CLEANFILES = libtpcodegen.pyc libtpcodegen.pyo libglibcodegen.pyc libglibcodegen.pyo $(noinst_SCRIPTS)
221 all: all-am
222
223 .SUFFIXES:
224 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
225 @for dep in $?; do \
226 case '$(am__configure_deps)' in \
227 *$$dep*) \
228 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
229 && { if test -f $@; then exit 0; else break; fi; }; \
230 exit 1;; \
231 esac; \
232 done; \
233 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
234 $(am__cd) $(top_srcdir) && \
235 $(AUTOMAKE) --foreign tools/Makefile
236 .PRECIOUS: Makefile
237 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
238 @case '$?' in \
239 *config.status*) \
240 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
241 *) \
242 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
243 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
244 esac;
245
246 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
247 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
248
249 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
250 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
251 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
252 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
253 $(am__aclocal_m4_deps):
254
255 mostlyclean-libtool:
256 -rm -f *.lo
257
258 clean-libtool:
259 -rm -rf .libs _libs
260 tags: TAGS
261 TAGS:
262
263 ctags: CTAGS
264 CTAGS:
265
266
267 distdir: $(DISTFILES)
268 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
269 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
270 list='$(DISTFILES)'; \
271 dist_files=`for file in $$list; do echo $$file; done | \
272 sed -e "s|^$$srcdirstrip/||;t" \
273 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
274 case $$dist_files in \
275 */*) $(MKDIR_P) `echo "$$dist_files" | \
276 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
277 sort -u` ;; \
278 esac; \
279 for file in $$dist_files; do \
280 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
281 if test -d $$d/$$file; then \
282 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
283 if test -d "$(distdir)/$$file"; then \
284 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
285 fi; \
286 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
287 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
288 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
289 fi; \
290 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
291 else \
292 test -f "$(distdir)/$$file" \
293 || cp -p $$d/$$file "$(distdir)/$$file" \
294 || exit 1; \
295 fi; \
296 done
297 check-am: all-am
298 check: check-am
299 all-am: Makefile $(SCRIPTS)
300 installdirs:
301 install: install-am
302 install-exec: install-exec-am
303 install-data: install-data-am
304 uninstall: uninstall-am
305
306 install-am: all-am
307 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
308
309 installcheck: installcheck-am
310 install-strip:
311 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
312 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
313 `test -z '$(STRIP)' || \
314 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
315 mostlyclean-generic:
316
317 clean-generic:
318 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
319
320 distclean-generic:
321 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
322 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
323
324 maintainer-clean-generic:
325 @echo "This command is intended for maintainers to use"
326 @echo "it deletes files that may require special tools to rebuild."
327 clean: clean-am
328
329 clean-am: clean-generic clean-libtool mostlyclean-am
330
331 distclean: distclean-am
332 -rm -f Makefile
333 distclean-am: clean-am distclean-generic
334
335 dvi: dvi-am
336
337 dvi-am:
338
339 html: html-am
340
341 html-am:
342
343 info: info-am
344
345 info-am:
346
347 install-data-am:
348
349 install-dvi: install-dvi-am
350
351 install-dvi-am:
352
353 install-exec-am:
354
355 install-html: install-html-am
356
357 install-html-am:
358
359 install-info: install-info-am
360
361 install-info-am:
362
363 install-man:
364
365 install-pdf: install-pdf-am
366
367 install-pdf-am:
368
369 install-ps: install-ps-am
370
371 install-ps-am:
372
373 installcheck-am:
374
375 maintainer-clean: maintainer-clean-am
376 -rm -f Makefile
377 maintainer-clean-am: distclean-am maintainer-clean-generic
378
379 mostlyclean: mostlyclean-am
380
381 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
382
383 pdf: pdf-am
384
385 pdf-am:
386
387 ps: ps-am
388
389 ps-am:
390
391 uninstall-am:
392
393 .MAKE: install-am install-strip
394
395 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
396 distclean distclean-generic distclean-libtool distdir dvi \
397 dvi-am html html-am info info-am install install-am \
398 install-data install-data-am install-dvi install-dvi-am \
399 install-exec install-exec-am install-html install-html-am \
400 install-info install-info-am install-man install-pdf \
401 install-pdf-am install-ps install-ps-am install-strip \
402 installcheck installcheck-am installdirs maintainer-clean \
403 maintainer-clean-generic mostlyclean mostlyclean-generic \
404 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
405
406
407 telepathy-glib-env: telepathy-glib-env.in Makefile
408 $(AM_V_GEN)sed -e 's![@]abs_top_builddir[@]!$(abs_top_builddir)!' $< > $@
409 $(AM_V_at)chmod +x $@
410
411 all: $(EXTRA_DIST)
412
413 libglibcodegen.py: libtpcodegen.py
414 touch $@
415 c-constants-gen.py: libglibcodegen.py
416 touch $@
417 glib-client-marshaller-gen.py: libglibcodegen.py
418 touch $@
419 glib-errors-enum-body-gen.py: libglibcodegen.py
420 touch $@
421 glib-errors-enum-header-gen.py: libglibcodegen.py
422 touch $@
423 glib-ginterface-gen.py: libglibcodegen.py
424 touch $@
425 glib-gtypes-generator.py: libglibcodegen.py
426 touch $@
427 glib-interfaces-gen.py: libglibcodegen.py
428 touch $@
429 glib-signals-marshal-gen.py: libglibcodegen.py
430 touch $@
431
432 # Tell versions [3.59,3.63) of GNU make to not export all variables.
433 # Otherwise a system limit (for SysV at least) may be exceeded.
434 .NOEXPORT: