summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-12-10 10:39:30 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-12-10 10:39:30 +0900
commitaadb32eda60936992049705b896d1a5e553a7328 (patch)
treea2bcf0bef096b4fce8806929eb598dc22a2cb7af
expansion: initial addition of expansion.HEADmaster
The goal of this tool is to provide an EFL based self extracting installer for any kind of payload that would work with all target supported by EFL.
-rw-r--r--AUTHORS1
-rw-r--r--COPYING674
-rw-r--r--ChangeLog0
-rw-r--r--GPLv2.txt344
-rw-r--r--INSTALL370
-rw-r--r--Makefile.am55
-rw-r--r--NEWS0
-rw-r--r--README0
-rw-r--r--TODO0
-rwxr-xr-xautogen.sh15
-rw-r--r--configure.ac68
-rw-r--r--data/Makefile.am3
-rw-r--r--data/images/Makefile.am7
-rw-r--r--data/images/logo.pngbin0 -> 82822 bytes
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/expansion.184
-rw-r--r--m4/codeset.m421
-rw-r--r--m4/efl_attribute.m456
-rw-r--r--m4/efl_binary.m471
-rw-r--r--m4/efl_compiler_flag.m457
-rw-r--r--m4/efl_path_max.m436
-rw-r--r--m4/elm_quicklaunch.m424
-rw-r--r--m4/fcntl-o.m481
-rw-r--r--m4/gettext.m4383
-rw-r--r--m4/glibc2.m430
-rw-r--r--m4/glibc21.m430
-rw-r--r--m4/iconv.m4214
-rw-r--r--m4/intdiv0.m484
-rw-r--r--m4/intl.m4294
-rw-r--r--m4/intldir.m419
-rw-r--r--m4/intlmacosx.m451
-rw-r--r--m4/intmax.m433
-rw-r--r--m4/inttypes-pri.m436
-rw-r--r--m4/inttypes_h.m426
-rw-r--r--m4/lcmessage.m431
-rw-r--r--m4/lib-ld.m4110
-rw-r--r--m4/lib-link.m4774
-rw-r--r--m4/lib-prefix.m4224
-rw-r--r--m4/lock.m437
-rw-r--r--m4/longlong.m4106
-rw-r--r--m4/nls.m432
-rw-r--r--m4/po.m4449
-rw-r--r--m4/printf-posix.m445
-rw-r--r--m4/progtest.m492
-rw-r--r--m4/size_max.m475
-rw-r--r--m4/stdint_h.m426
-rw-r--r--m4/threadlib.m4347
-rw-r--r--m4/uintmax_t.m430
-rw-r--r--m4/visibility.m474
-rw-r--r--m4/wchar_t.m420
-rw-r--r--m4/wint_t.m428
-rw-r--r--m4/xsize.m413
-rw-r--r--po/ChangeLog6
-rw-r--r--po/Makevars41
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/Makefile.am4
-rw-r--r--src/bin/Makefile.am19
-rw-r--r--src/bin/expansion_data.c107
-rw-r--r--src/bin/expansion_main.c570
-rw-r--r--src/bin/expansion_private.h52
-rw-r--r--src/bin/expansion_setup_main.c10
-rw-r--r--src/bin/gettext.h280
62 files changed, 6774 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..7782478
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Cedric BAIL <cedric.bail@samsung.com>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14to take away your freedom to share and change the works. By contrast,
15the GNU General Public License is intended to guarantee your freedom to
16share and change all versions of a program--to make sure it remains free
17software for all its users. We, the Free Software Foundation, use the
18GNU General Public License for most of our software; it applies also to
19any other work released this way by its authors. You can apply it to
20your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/GPLv2.txt b/GPLv2.txt
new file mode 100644
index 0000000..44414e0
--- /dev/null
+++ b/GPLv2.txt
@@ -0,0 +1,344 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59---
60
61 GNU GENERAL PUBLIC LICENSE
62 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
63
64 0. This License applies to any program or other work which contains
65a notice placed by the copyright holder saying it may be distributed
66under the terms of this General Public License. The `Program', below,
67refers to any such program or work, and a `work based on the Program'
68means either the Program or any derivative work under copyright law:
69that is to say, a work containing the Program or a portion of it,
70either verbatim or with modifications and/or translated into another
71language. (Hereinafter, translation is included without limitation in
72the term `modification'.) Each licensee is addressed as `you'.
73
74Activities other than copying, distribution and modification are not
75covered by this License; they are outside its scope. The act of
76running the Program is not restricted, and the output from the Program
77is covered only if its contents constitute a work based on the
78Program (independent of having been made by running the Program).
79Whether that is true depends on what the Program does.
80
81 1. You may copy and distribute verbatim copies of the Program's
82source code as you receive it, in any medium, provided that you
83conspicuously and appropriately publish on each copy an appropriate
84copyright notice and disclaimer of warranty; keep intact all the
85notices that refer to this License and to the absence of any warranty;
86and give any other recipients of the Program a copy of this License
87along with the Program.
88
89You may charge a fee for the physical act of transferring a copy, and
90you may at your option offer warranty protection in exchange for a fee.
91
92 2. You may modify your copy or copies of the Program or any portion
93of it, thus forming a work based on the Program, and copy and
94distribute such modifications or work under the terms of Section 1
95above, provided that you also meet all of these conditions:
96
97 a) You must cause the modified files to carry prominent notices
98 stating that you changed the files and the date of any change.
99
100 b) You must cause any work that you distribute or publish, that in
101 whole or in part contains or is derived from the Program or any
102 part thereof, to be licensed as a whole at no charge to all third
103 parties under the terms of this License.
104
105 c) If the modified program normally reads commands interactively
106 when run, you must cause it, when started running for such
107 interactive use in the most ordinary way, to print or display an
108 announcement including an appropriate copyright notice and a
109 notice that there is no warranty (or else, saying that you provide
110 a warranty) and that users may redistribute the program under
111 these conditions, and telling the user how to view a copy of this
112 License. (Exception: if the Program itself is interactive but
113 does not normally print such an announcement, your work based on
114 the Program is not required to print an announcement.)
115
116These requirements apply to the modified work as a whole. If
117identifiable sections of that work are not derived from the Program,
118and can be reasonably considered independent and separate works in
119themselves, then this License, and its terms, do not apply to those
120sections when you distribute them as separate works. But when you
121distribute the same sections as part of a whole which is a work based
122on the Program, the distribution of the whole must be on the terms of
123this License, whose permissions for other licensees extend to the
124entire whole, and thus to each and every part regardless of who wrote it.
125
126Thus, it is not the intent of this section to claim rights or contest
127your rights to work written entirely by you; rather, the intent is to
128exercise the right to control the distribution of derivative or
129collective works based on the Program.
130
131In addition, mere aggregation of another work not based on the Program
132with the Program (or with a work based on the Program) on a volume of
133a storage or distribution medium does not bring the other work under
134the scope of this License.
135
136 3. You may copy and distribute the Program (or a work based on it,
137under Section 2) in object code or executable form under the terms of
138Sections 1 and 2 above provided that you also do one of the following:
139
140 a) Accompany it with the complete corresponding machine-readable
141 source code, which must be distributed under the terms of Sections
142 1 and 2 above on a medium customarily used for software interchange; or,
143
144 b) Accompany it with a written offer, valid for at least three
145 years, to give any third party, for a charge no more than your
146 cost of physically performing source distribution, a complete
147 machine-readable copy of the corresponding source code, to be
148 distributed under the terms of Sections 1 and 2 above on a medium
149 customarily used for software interchange; or,
150
151 c) Accompany it with the information you received as to the offer
152 to distribute corresponding source code. (This alternative is
153 allowed only for noncommercial distribution and only if you
154 received the program in object code or executable form with such
155 an offer, in accord with Subsection b above.)
156
157The source code for a work means the preferred form of the work for
158making modifications to it. For an executable work, complete source
159code means all the source code for all modules it contains, plus any
160associated interface definition files, plus the scripts used to
161control compilation and installation of the executable. However, as a
162special exception, the source code distributed need not include
163anything that is normally distributed (in either source or binary
164form) with the major components (compiler, kernel, and so on) of the
165operating system on which the executable runs, unless that component
166itself accompanies the executable.
167
168If distribution of executable or object code is made by offering
169access to copy from a designated place, then offering equivalent
170access to copy the source code from the same place counts as
171distribution of the source code, even though third parties are not
172compelled to copy the source along with the object code.
173
174 4. You may not copy, modify, sublicense, or distribute the Program
175except as expressly provided under this License. Any attempt
176otherwise to copy, modify, sublicense or distribute the Program is
177void, and will automatically terminate your rights under this License.
178However, parties who have received copies, or rights, from you under
179this License will not have their licenses terminated so long as such
180parties remain in full compliance.
181
182 5. You are not required to accept this License, since you have not
183signed it. However, nothing else grants you permission to modify or
184distribute the Program or its derivative works. These actions are
185prohibited by law if you do not accept this License. Therefore, by
186modifying or distributing the Program (or any work based on the
187Program), you indicate your acceptance of this License to do so, and
188all its terms and conditions for copying, distributing or modifying
189the Program or works based on it.
190
191 6. Each time you redistribute the Program (or any work based on the
192Program), the recipient automatically receives a license from the
193original licensor to copy, distribute or modify the Program subject to
194these terms and conditions. You may not impose any further
195restrictions on the recipients' exercise of the rights granted herein.
196You are not responsible for enforcing compliance by third parties to
197this License.
198
199 7. If, as a consequence of a court judgment or allegation of patent
200infringement or for any other reason (not limited to patent issues),
201conditions are imposed on you (whether by court order, agreement or
202otherwise) that contradict the conditions of this License, they do not
203excuse you from the conditions of this License. If you cannot
204distribute so as to satisfy simultaneously your obligations under this
205License and any other pertinent obligations, then as a consequence you
206may not distribute the Program at all. For example, if a patent
207license would not permit royalty-free redistribution of the Program by
208all those who receive copies directly or indirectly through you, then
209the only way you could satisfy both it and this License would be to
210refrain entirely from distribution of the Program.
211
212If any portion of this section is held invalid or unenforceable under
213any particular circumstance, the balance of the section is intended to
214apply and the section as a whole is intended to apply in other
215circumstances.
216
217It is not the purpose of this section to induce you to infringe any
218patents or other property right claims or to contest validity of any
219such claims; this section has the sole purpose of protecting the
220integrity of the free software distribution system, which is
221implemented by public license practices. Many people have made
222generous contributions to the wide range of software distributed
223through that system in reliance on consistent application of that
224system; it is up to the author/donor to decide if he or she is willing
225to distribute software through any other system and a licensee cannot
226impose that choice.
227
228This section is intended to make thoroughly clear what is believed to
229be a consequence of the rest of this License.
230
231 8. If the distribution and/or use of the Program is restricted in
232certain countries either by patents or by copyrighted interfaces, the
233original copyright holder who places the Program under this License
234may add an explicit geographical distribution limitation excluding
235those countries, so that distribution is permitted only in or among
236countries not thus excluded. In such case, this License incorporates
237the limitation as if written in the body of this License.
238
239 9. The Free Software Foundation may publish revised and/or new versions
240of the General Public License from time to time. Such new versions will
241be similar in spirit to the present version, but may differ in detail to
242address new problems or concerns.
243
244Each version is given a distinguishing version number. If the Program
245specifies a version number of this License which applies to it and `any
246later version', you have the option of following the terms and conditions
247either of that version or of any later version published by the Free
248Software Foundation. If the Program does not specify a version number of
249this License, you may choose any version ever published by the Free Software
250Foundation.
251
252 10. If you wish to incorporate parts of the Program into other free
253programs whose distribution conditions are different, write to the author
254to ask for permission. For software which is copyrighted by the Free
255Software Foundation, write to the Free Software Foundation; we sometimes
256make exceptions for this. Our decision will be guided by the two goals
257of preserving the free status of all derivatives of our free software and
258of promoting the sharing and reuse of software generally.
259
260 NO WARRANTY
261
262 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
263FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
264OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
265PROVIDE THE PROGRAM `AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
266OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
267MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
268TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
269PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
270REPAIR OR CORRECTION.
271
272 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
273WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
274REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
275INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
276OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
277TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
278YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
279PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
280POSSIBILITY OF SUCH DAMAGES.
281
282 END OF TERMS AND CONDITIONS
283
284---
285
286 How to Apply These Terms to Your New Programs
287
288 If you develop a new program, and you want it to be of the greatest
289possible use to the public, the best way to achieve this is to make it
290free software which everyone can redistribute and change under these terms.
291
292 To do so, attach the following notices to the program. It is safest
293to attach them to the start of each source file to most effectively
294convey the exclusion of warranty; and each file should have at least
295the `copyright' line and a pointer to where the full notice is found.
296
297 (one line to give the program's name and a brief idea of what it does.)
298 Copyright (C) (year) (name of author)
299
300 This program is free software; you can redistribute it and/or modify
301 it under the terms of the GNU General Public License as published by
302 the Free Software Foundation; either version 2 of the License, or
303 (at your option) any later version.
304
305 This program is distributed in the hope that it will be useful,
306 but WITHOUT ANY WARRANTY; without even the implied warranty of
307 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
308 GNU General Public License for more details.
309
310 You should have received a copy of the GNU General Public License
311 along with this program; if not, write to the Free Software
312 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
313
314
315Also add information on how to contact you by electronic and paper mail.
316
317If the program is interactive, make it output a short notice like this
318when it starts in an interactive mode:
319
320 Gnomovision version 69, Copyright (C) year name of author
321 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
322 This is free software, and you are welcome to redistribute it
323 under certain conditions; type `show c' for details.
324
325The hypothetical commands `show w' and `show c' should show the appropriate
326parts of the General Public License. Of course, the commands you use may
327be called something other than `show w' and `show c'; they could even be
328mouse-clicks or menu items--whatever suits your program.
329
330You should also get your employer (if you work as a programmer) or your
331school, if any, to sign a `copyright disclaimer' for the program, if
332necessary. Here is a sample; alter the names:
333
334 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
335 `Gnomovision' (which makes passes at compilers) written by James Hacker.
336
337 (signature of Ty Coon), 1 April 1989
338 Ty Coon, President of Vice
339
340This General Public License does not permit incorporating your program into
341proprietary programs. If your program is a subroutine library, you may
342consider it more useful to permit linking proprietary applications with the
343library. If this is what you want to do, use the GNU Library General
344Public License instead of this License.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..a1e89e1
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,370 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
5Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
236a workaround. If GNU CC is not installed, it is therefore recommended
237to try
238
239 ./configure CC="cc"
240
241and if that doesn't work, try
242
243 ./configure CC="cc -nodtk"
244
245 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
246directory contains several dysfunctional programs; working variants of
247these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
248in your `PATH', put it _after_ `/usr/bin'.
249
250 On Haiku, software installed for all users goes in `/boot/common',
251not `/usr/local'. It is recommended to use the following options:
252
253 ./configure --prefix=/boot/common
254
255Specifying the System Type
256==========================
257
258 There may be some features `configure' cannot figure out
259automatically, but needs to determine by the type of machine the package
260will run on. Usually, assuming the package is built to be run on the
261_same_ architectures, `configure' can figure that out, but if it prints
262a message saying it cannot guess the machine type, give it the
263`--build=TYPE' option. TYPE can either be a short name for the system
264type, such as `sun4', or a canonical name which has the form:
265
266 CPU-COMPANY-SYSTEM
267
268where SYSTEM can have one of these forms:
269
270 OS
271 KERNEL-OS
272
273 See the file `config.sub' for the possible values of each field. If
274`config.sub' isn't included in this package, then this package doesn't
275need to know the machine type.
276
277 If you are _building_ compiler tools for cross-compiling, you should
278use the option `--target=TYPE' to select the type of system they will
279produce code for.
280
281 If you want to _use_ a cross compiler, that generates code for a
282platform different from the build platform, you should specify the
283"host" platform (i.e., that on which the generated programs will
284eventually be run) with `--host=TYPE'.
285
286Sharing Defaults
287================
288
289 If you want to set default values for `configure' scripts to share,
290you can create a site shell script called `config.site' that gives
291default values for variables like `CC', `cache_file', and `prefix'.
292`configure' looks for `PREFIX/share/config.site' if it exists, then
293`PREFIX/etc/config.site' if it exists. Or, you can set the
294`CONFIG_SITE' environment variable to the location of the site script.
295A warning: not all `configure' scripts look for a site script.
296
297Defining Variables
298==================
299
300 Variables not defined in a site shell script can be set in the
301environment passed to `configure'. However, some packages may run
302configure again during the build, and the customized values of these
303variables may be lost. In order to avoid this problem, you should set
304them in the `configure' command line, using `VAR=value'. For example:
305
306 ./configure CC=/usr/local2/bin/gcc
307
308causes the specified `gcc' to be used as the C compiler (unless it is
309overridden in the site shell script).
310
311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
312an Autoconf bug. Until the bug is fixed you can use this workaround:
313
314 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
315
316`configure' Invocation
317======================
318
319 `configure' recognizes the following options to control how it
320operates.
321
322`--help'
323`-h'
324 Print a summary of all of the options to `configure', and exit.
325
326`--help=short'
327`--help=recursive'
328 Print a summary of the options unique to this package's
329 `configure', and exit. The `short' variant lists options used
330 only in the top level, while the `recursive' variant lists options
331 also present in any nested packages.
332
333`--version'
334`-V'
335 Print the version of Autoconf used to generate the `configure'
336 script, and exit.
337
338`--cache-file=FILE'
339 Enable the cache: use and save the results of the tests in FILE,
340 traditionally `config.cache'. FILE defaults to `/dev/null' to
341 disable caching.
342
343`--config-cache'
344`-C'
345 Alias for `--cache-file=config.cache'.
346
347`--quiet'
348`--silent'
349`-q'
350 Do not print messages saying which checks are being made. To
351 suppress all normal output, redirect it to `/dev/null' (any error
352 messages will still be shown).
353
354`--srcdir=DIR'
355 Look for the package's source code in directory DIR. Usually
356 `configure' can determine that directory automatically.
357
358`--prefix=DIR'
359 Use DIR as the installation prefix. *note Installation Names::
360 for more details, including other options available for fine-tuning
361 the installation locations.
362
363`--no-create'
364`-n'
365 Run the configure checks, but stop before creating any output
366 files.
367
368`configure' also accepts some other, not widely useful, options. Run
369`configure --help' for more details.
370
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..da0306c
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,55 @@
1MAINTAINERCLEANFILES = \
2 ABOUT-NLS \
3 Makefile.in \
4 aclocal.m4 \
5 compile \
6 config.guess \
7 config.h.in \
8 config.rpath \
9 config.sub \
10 configure \
11 depcomp \
12 install-sh \
13 ltmain.sh \
14 missing \
15 m4/libtool.m4 \
16 m4/ltoptions.m4 \
17 m4/ltsugar.m4 \
18 m4/ltversion.m4 \
19 m4/lt~obsolete.m4 \
20 po/boldquot.sed \
21 po/en@boldquot.header \
22 po/en@quot.header \
23 po/insert-header.sin \
24 po/Makefile.in.in \
25 po/Makevars.template \
26 po/quot.sed \
27 po/remove-potcdate.sin \
28 po/Rules-quot \
29 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
30 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2
31
32SUBDIRS = doc src po data
33
34ACLOCAL_AMFLAGS = -I m4
35
36filesdir = $(docdir)
37files_DATA = \
38 AUTHORS \
39 COPYING \
40 ChangeLog \
41 GPLv2.txt \
42 INSTALL \
43 NEWS \
44 README \
45 TODO
46
47EXTRA_DIST = \
48 GPLv2.txt \
49 autogen.sh \
50 config.rpath \
51 configure \
52 m4/efl_attribute.m4 \
53 m4/efl_binary.m4 \
54 m4/efl_compiler_flag.m4 \
55 m4/efl_path_max.m4
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..fe644eb
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,15 @@
1#!/bin/sh
2
3rm -rf autom4te.cache
4rm -f aclocal.m4 ltmain.sh
5
6echo "Running autopoint..." ; autopoint -f || :
7echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
8echo "Running autoconf..." ; autoconf || exit 1
9echo "Running autoheader..." ; autoheader || exit 1
10echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
11echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
12
13if [ -z "$NOCONFIGURE" ]; then
14 ./configure "$@"
15fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..1faf9dd
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,68 @@
1AC_INIT([expansion], [0.0.99], [cedric.bail@free.fr])
2AC_PREREQ([2.65])
3AC_CONFIG_SRCDIR([configure.ac])
4AC_CONFIG_HEADERS([config.h])
5AC_CANONICAL_BUILD
6AC_CANONICAL_HOST
7AC_CONFIG_MACRO_DIR([m4])
8
9AM_INIT_AUTOMAKE([1.10 dist-bzip2])
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
12# this will speed up libtool checks
13LT_PREREQ([2.2])
14LT_INIT([win32-dll])
15
16AC_PROG_CC
17AM_PROG_CC_C_O
18EFL_ATTRIBUTE_UNUSED
19ELM_QUICKLAUNCH
20EFL_COMPILER_FLAG([-Wall])
21EFL_COMPILER_FLAG([-W])
22
23# Checks for header files.
24EFL_CHECK_PATH_MAX
25
26# Check for EFL
27PKG_CHECK_MODULES([EXPANSION],
28[
29 eina >= 1.8.0
30 evas >= 1.8.0
31 ecore >= 1.8.0
32 edje >= 1.8.0
33 elementary >= 1.8.0
34])
35
36# Check edje_cc
37EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
38
39# Checks for library functions.
40AC_CHECK_FUNCS([setlocale])
41
42AM_GNU_GETTEXT_VERSION([0.18.1])
43AM_GNU_GETTEXT([external])
44
45AC_CONFIG_FILES([
46Makefile
47doc/Makefile
48po/Makefile.in
49data/Makefile
50data/images/Makefile
51src/Makefile
52src/bin/Makefile
53])
54AC_OUTPUT
55
56echo
57echo
58echo "------------------------------------------------------------------------"
59echo "$PACKAGE_NAME $PACKAGE_VERSION"
60echo "------------------------------------------------------------------------"
61echo
62echo "Compilation..............: make (or gmake)"
63echo " CFLAGS.................: $CFLAGS"
64echo " edje_cc................: ${edje_cc}"
65echo
66echo "Installation.............: make install (as root if needed, with 'su' or 'sudo')"
67echo " prefix.................: $prefix"
68echo
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..860f117
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,3 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = images
diff --git a/data/images/Makefile.am b/data/images/Makefile.am
new file mode 100644
index 0000000..f027bee
--- /dev/null
+++ b/data/images/Makefile.am
@@ -0,0 +1,7 @@
1AUTOMAKE_OPTIONS = 1.4 foreign
2MAINTAINERCLEANFILES = Makefile.in
3
4filesdir = $(datadir)/expansion/images/
5files_DATA = logo.png
6
7EXTRA_DIST = $(files_DATA)
diff --git a/data/images/logo.png b/data/images/logo.png
new file mode 100644
index 0000000..9037bea
--- /dev/null
+++ b/data/images/logo.png
Binary files differ
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..da74907
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,4 @@
1MAINTAINERCLEANFILES = Makefile.in
2EXTRA_DIST = expansion.1
3
4man_MANS = expansion.1
diff --git a/doc/expansion.1 b/doc/expansion.1
new file mode 100644
index 0000000..41636a4
--- /dev/null
+++ b/doc/expansion.1
@@ -0,0 +1,84 @@
1.TH ELEMINES 1 "21 Mar 2013" "elemines 0.2.3"
2
3.SH NAME
4elemines \- a minesweeper clone based on the EFL
5
6.SH SYNOPSIS
7.B elemines
8[-d] [-f] [-t=THEME] [-m=MINES] [-L] [-C] [-V] [-h]
9
10.SH DESCRIPTION
11
12Elemines is a single-player video game. The object of the game is to clear
13an abstract minefield without detonating a mine. The game is played by revealing
14squares of the grid, by clicking them with a mouse. If a square containing a mine
15is revealed, you lose the game. Otherwise, a digit is revealed in the square,
16indicating the number of adjacent squares that contain mines.
17
18With no option, the program starts with a 10x10 grid and 12 mines to find.
19
20
21.SH CONTROLS
22
23.TP
24.B Left Mouse Button
25Reveal a square.
26
27.TP
28.B Right Mouse Button
29Add (or remove) a flag.
30
31.TP
32.B Middle Mouse Button
33Clear around a revealed square once the correct number of mines have been flagged around it.
34
35.SH OPTIONS
36
37.TP
38.B -d, --debug
39Turn on debugging.
40
41.TP
42.B -f, --fullscreen
43Run fullscreen. This is useful on mobile devices.
44
45.TP
46.B -t=THEME, --theme=THEME
47Use THEME.edj as theme file. Theme files must be in the $(datarootdir)/elemines/themes/
48folder.
49
50.TP
51.B -m=MINES, --mines=MINES
52Specify the number of mines hidden in the field. MINES must be an integer smaller
53than the number of cells (100).
54
55.TP
56.B -L, --license
57Show license.
58
59.TP
60.B -C, --copyright
61Show copyright.
62
63.TP
64.B -V, --version
65Show program version.
66
67.TP
68.B -h, --help
69Print list of options with short description.
70
71
72.SH BUGS
73
74Reports are welcome.
75
76
77.SH HOMEPAGE
78
79http://elemines.sourceforge.net
80
81
82.SH AUTHORS
83
84Jerome Pinot <ngc891@gmail.com> and various contributors.
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 0000000..a53c042
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,21 @@
1# codeset.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([AM_LANGINFO_CODESET],
10[
11 AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
12 [AC_TRY_LINK([#include <langinfo.h>],
13 [char* cs = nl_langinfo(CODESET); return !cs;],
14 [am_cv_langinfo_codeset=yes],
15 [am_cv_langinfo_codeset=no])
16 ])
17 if test $am_cv_langinfo_codeset = yes; then
18 AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
19 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
20 fi
21])
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
new file mode 100644
index 0000000..78bff15
--- /dev/null
+++ b/m4/efl_attribute.m4
@@ -0,0 +1,56 @@
1dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macros for checking if the compiler supports some __attribute__ uses
5
6dnl Usage: EFL_ATTRIBUTE_UNUSED
7dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
8
9AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
10[
11AC_MSG_CHECKING([for __attribute__ ((unused))])
12AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[
15void foo(int x __attribute__ ((unused))) {}
16 ]],
17 [[
18 ]])],
19 [have_attribute_unused="yes"],
20 [have_attribute_unused="no"])
21AC_MSG_RESULT([${have_attribute_unused}])
22
23if test "x${have_attribute_unused}" = "xyes" ; then
24 AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
25else
26 AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
27fi
28])
29
30dnl Usage: EFL_ATTRIBUTE_VECTOR
31dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
32
33AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
34[
35AC_MSG_CHECKING([for __attribute__ ((vector))])
36AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM(
38 [[
39typedef int v4si __attribute__ ((vector_size (16)));
40 ]],
41 [[
42if (sizeof(v4si) == 16)
43 return 0;
44else
45 return -1;
46 ]])],
47 [have_attribute_vector="yes"],
48 [have_attribute_vector="no"])
49AC_MSG_RESULT([${have_attribute_vector}])
50
51if test "x${have_attribute_vector}" = "xyes" ; then
52 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
53fi
54])
55
56dnl End of efl_attribute.m4
diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4
new file mode 100644
index 0000000..c774688
--- /dev/null
+++ b/m4/efl_binary.m4
@@ -0,0 +1,71 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if a binary is built or not
5
6dnl Usage: EFL_ENABLE_BIN(binary)
7dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
8dnl Define have_binary (- is transformed into _)
9dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
10
11AC_DEFUN([EFL_ENABLE_BIN],
12[
13
14m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
16
17have_[]m4_defn([DOWN])="yes"
18
19dnl configure option
20
21AC_ARG_ENABLE([$1],
22 [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
23 [
24 if test "x${enableval}" = "xyes" ; then
25 have_[]m4_defn([DOWN])="yes"
26 else
27 have_[]m4_defn([DOWN])="no"
28 fi
29 ])
30
31AC_MSG_CHECKING([whether to build ]DOWN[ binary])
32AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
33
34if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
35 UP[]_PRG=DOWN[${EXEEXT}]
36fi
37
38AC_SUBST(UP[]_PRG)
39
40AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
41
42AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
43
44])
45
46
47dnl Macro that check if a binary is built or not
48
49dnl Usage: EFL_WITH_BIN(package, binary, default_value)
50dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
51
52AC_DEFUN([EFL_WITH_BIN],
53[
54
55m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
56
57dnl configure option
58
59AC_ARG_WITH([$2],
60 [AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
61 [_efl_with_binary=${withval}],
62 [_efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3])
63
64DOWN=${_efl_with_binary}
65AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
66
67with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
68
69AC_SUBST(DOWN)
70
71])
diff --git a/m4/efl_compiler_flag.m4 b/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000..25c285d
--- /dev/null
+++ b/m4/efl_compiler_flag.m4
@@ -0,0 +1,57 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
3dnl That code is public domain and can be freely used or copied.
4
5dnl Macro that checks if a compiler flag is supported by the compiler.
6
7dnl Usage: EFL_COMPILER_FLAG(flag)
8dnl flag is added to CFLAGS if supported.
9
10AC_DEFUN([EFL_COMPILER_FLAG],
11[
12
13CFLAGS_save="${CFLAGS}"
14CFLAGS="${CFLAGS} $1"
15
16AC_LANG_PUSH([C])
17AC_MSG_CHECKING([whether the compiler supports $1])
18
19AC_COMPILE_IFELSE(
20 [AC_LANG_PROGRAM([[]])],
21 [have_flag="yes"],
22 [have_flag="no"])
23AC_MSG_RESULT([${have_flag}])
24
25if test "x${have_flag}" = "xno" ; then
26 CFLAGS="${CFLAGS_save}"
27fi
28AC_LANG_POP([C])
29
30])
31
32dnl Macro that checks if a linker flag is supported by the compiler.
33
34dnl Usage: EFL_LINKER_FLAG(flag)
35dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
36
37AC_DEFUN([EFL_LINKER_FLAG],
38[
39
40LDFLAGS_save="${LDFLAGS}"
41LDFLAGS="${LDFLAGS} $1"
42
43AC_LANG_PUSH([C])
44AC_MSG_CHECKING([whether the compiler supports $1])
45
46AC_LINK_IFELSE(
47 [AC_LANG_PROGRAM([[]])],
48 [have_flag="yes"],
49 [have_flag="no"])
50AC_MSG_RESULT([${have_flag}])
51
52if test "x${have_flag}" = "xno" ; then
53 LDFLAGS="${LDFLAGS_save}"
54fi
55AC_LANG_POP([C])
56
57])
diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4
new file mode 100644
index 0000000..f57bfd2
--- /dev/null
+++ b/m4/efl_path_max.m4
@@ -0,0 +1,36 @@
1dnl Check for PATH_MAX in limits.h, and define a default value if not found
2dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
3
4dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
5dnl
6dnl If PATH_MAX is not defined in <limits.h>, defines it
7dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
8dnl to using 4096
9
10AC_DEFUN([EFL_CHECK_PATH_MAX],
11[
12
13default_max=m4_default([$1], "4096")
14AC_LANG_PUSH([C])
15
16AC_MSG_CHECKING([for PATH_MAX in limits.h])
17AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[
20#include <limits.h>
21 ]],
22 [[
23int i = PATH_MAX;
24 ]])],
25 [AC_MSG_RESULT([yes])],
26 [
27 AC_DEFINE_UNQUOTED([PATH_MAX],
28 [${default_max}],
29 [default value since PATH_MAX is not defined])
30 AC_MSG_RESULT([no: using ${default_max}])
31 ])
32
33AC_LANG_POP([C])
34
35])
36dnl end of efl_path_max.m4
diff --git a/m4/elm_quicklaunch.m4 b/m4/elm_quicklaunch.m4
new file mode 100644
index 0000000..3db9945
--- /dev/null
+++ b/m4/elm_quicklaunch.m4
@@ -0,0 +1,24 @@
1dnl Copyright (C) 2013 Cedric Bail <cedric dot bail at samsung dot com>
2dnl That code is public domain and can be freely used or copied
3
4dnl Macro that check if -pie -rdynamic can be given to ld
5
6dnl Usage: ELM_QUICKLAUNCH
7dnl add -pie -rdynamic to LDFLAGS and -fpie to CFLAGS
8
9AC_DEFUN([ELM_QUICKLAUNCH],
10[
11AC_MSG_CHECKING([If the compiler as what it takes to do quicklaunch (-pie -rdynamic)])
12old_LDFLAGS="$LDFLAGS"
13old_CFLAGS="$CFLAGS"
14
15LDFLAGS="$LDFLAGS -pie -rdynamic"
16CFLAGS="$CFLAGS -fpie"
17
18AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
19 [AC_MSG_RESULT([yes])],
20 [LDFLAGS="$old_LDFLAGS"
21 CFLAGS="$old_CFLAGS"
22 AC_MSG_RESULT([no])
23 ])
24])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
new file mode 100644
index 0000000..d416a61
--- /dev/null
+++ b/m4/fcntl-o.m4
@@ -0,0 +1,81 @@
1# fcntl-o.m4 serial 1
2dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Written by Paul Eggert.
8
9# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
10# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
11# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
12AC_DEFUN([gl_FCNTL_O_FLAGS],
13[
14 dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
17 [AC_RUN_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[#include <sys/types.h>
20 #include <sys/stat.h>
21 #include <unistd.h>
22 #include <fcntl.h>
23 #ifndef O_NOATIME
24 #define O_NOATIME 0
25 #endif
26 #ifndef O_NOFOLLOW
27 #define O_NOFOLLOW 0
28 #endif
29 static int const constants[] =
30 {
31 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
32 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
33 };
34 ]],
35 [[
36 int status = !constants;
37 {
38 static char const sym[] = "conftest.sym";
39 if (symlink (".", sym) != 0
40 || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
41 status |= 32;
42 unlink (sym);
43 }
44 {
45 static char const file[] = "confdefs.h";
46 int fd = open (file, O_RDONLY | O_NOATIME);
47 char c;
48 struct stat st0, st1;
49 if (fd < 0
50 || fstat (fd, &st0) != 0
51 || sleep (1) != 0
52 || read (fd, &c, 1) != 1
53 || close (fd) != 0
54 || stat (file, &st1) != 0
55 || st0.st_atime != st1.st_atime)
56 status |= 64;
57 }
58 return status;]])],
59 [gl_cv_header_working_fcntl_h=yes],
60 [case $? in #(
61 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
62 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
63 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
64 *) gl_cv_header_working_fcntl_h='no';;
65 esac],
66 [gl_cv_header_working_fcntl_h=cross-compiling])])
67
68 case $gl_cv_header_working_fcntl_h in #(
69 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
70 *) ac_val=1;;
71 esac
72 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
73 [Define to 1 if O_NOATIME works.])
74
75 case $gl_cv_header_working_fcntl_h in #(
76 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
77 *) ac_val=1;;
78 esac
79 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
80 [Define to 1 if O_NOFOLLOW works.])
81])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644
index 0000000..f84e6a5
--- /dev/null
+++ b/m4/gettext.m4
@@ -0,0 +1,383 @@
1# gettext.m4 serial 63 (gettext-0.18)
2dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
19
20dnl Macro to add for using GNU gettext.
21
22dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
23dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
24dnl default (if it is not specified or empty) is 'no-libtool'.
25dnl INTLSYMBOL should be 'external' for packages with no intl directory,
26dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
27dnl If INTLSYMBOL is 'use-libtool', then a libtool library
28dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
29dnl depending on --{enable,disable}-{shared,static} and on the presence of
30dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
31dnl $(top_builddir)/intl/libintl.a will be created.
32dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
33dnl implementations (in libc or libintl) without the ngettext() function
34dnl will be ignored. If NEEDSYMBOL is specified and is
35dnl 'need-formatstring-macros', then GNU gettext implementations that don't
36dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
37dnl INTLDIR is used to find the intl libraries. If empty,
38dnl the value `$(top_builddir)/intl/' is used.
39dnl
40dnl The result of the configuration is one of three cases:
41dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
42dnl and used.
43dnl Catalog format: GNU --> install in $(datadir)
44dnl Catalog extension: .mo after installation, .gmo in source tree
45dnl 2) GNU gettext has been found in the system's C library.
46dnl Catalog format: GNU --> install in $(datadir)
47dnl Catalog extension: .mo after installation, .gmo in source tree
48dnl 3) No internationalization, always use English msgid.
49dnl Catalog format: none
50dnl Catalog extension: none
51dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
52dnl The use of .gmo is historical (it was needed to avoid overwriting the
53dnl GNU format catalogs when building on a platform with an X/Open gettext),
54dnl but we keep it in order not to force irrelevant filename changes on the
55dnl maintainers.
56dnl
57AC_DEFUN([AM_GNU_GETTEXT],
58[
59 dnl Argument checking.
60 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
61 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
62])])])])])
63 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
64 [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
67])])])])
68 define([gt_included_intl],
69 ifelse([$1], [external],
70 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
71 [yes]))
72 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
73 gt_NEEDS_INIT
74 AM_GNU_GETTEXT_NEED([$2])
75
76 AC_REQUIRE([AM_PO_SUBDIRS])dnl
77 ifelse(gt_included_intl, yes, [
78 AC_REQUIRE([AM_INTL_SUBDIR])dnl
79 ])
80
81 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
82 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
83 AC_REQUIRE([AC_LIB_RPATH])
84
85 dnl Sometimes libintl requires libiconv, so first search for libiconv.
86 dnl Ideally we would do this search only after the
87 dnl if test "$USE_NLS" = "yes"; then
88 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
89 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
90 dnl the configure script would need to contain the same shell code
91 dnl again, outside any 'if'. There are two solutions:
92 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
93 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
94 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
95 dnl documented, we avoid it.
96 ifelse(gt_included_intl, yes, , [
97 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
98 ])
99
100 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
101 gt_INTL_MACOSX
102
103 dnl Set USE_NLS.
104 AC_REQUIRE([AM_NLS])
105
106 ifelse(gt_included_intl, yes, [
107 BUILD_INCLUDED_LIBINTL=no
108 USE_INCLUDED_LIBINTL=no
109 ])
110 LIBINTL=
111 LTLIBINTL=
112 POSUB=
113
114 dnl Add a version number to the cache macros.
115 case " $gt_needs " in
116 *" need-formatstring-macros "*) gt_api_version=3 ;;
117 *" need-ngettext "*) gt_api_version=2 ;;
118 *) gt_api_version=1 ;;
119 esac
120 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
121 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
122
123 dnl If we use NLS figure out what method
124 if test "$USE_NLS" = "yes"; then
125 gt_use_preinstalled_gnugettext=no
126 ifelse(gt_included_intl, yes, [
127 AC_MSG_CHECKING([whether included gettext is requested])
128 AC_ARG_WITH([included-gettext],
129 [ --with-included-gettext use the GNU gettext library included here],
130 nls_cv_force_use_gnu_gettext=$withval,
131 nls_cv_force_use_gnu_gettext=no)
132 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
133
134 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
135 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
136 ])
137 dnl User does not insist on using GNU NLS library. Figure out what
138 dnl to use. If GNU gettext is available we use this. Else we have
139 dnl to fall back to GNU NLS library.
140
141 if test $gt_api_version -ge 3; then
142 gt_revision_test_code='
143#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
144#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
145#endif
146changequote(,)dnl
147typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
148changequote([,])dnl
149'
150 else
151 gt_revision_test_code=
152 fi
153 if test $gt_api_version -ge 2; then
154 gt_expression_test_code=' + * ngettext ("", "", 0)'
155 else
156 gt_expression_test_code=
157 fi
158
159 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
160 [AC_TRY_LINK([#include <libintl.h>
161$gt_revision_test_code
162extern int _nl_msg_cat_cntr;
163extern int *_nl_domain_bindings;],
164 [bindtextdomain ("", "");
165return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
166 [eval "$gt_func_gnugettext_libc=yes"],
167 [eval "$gt_func_gnugettext_libc=no"])])
168
169 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
170 dnl Sometimes libintl requires libiconv, so first search for libiconv.
171 ifelse(gt_included_intl, yes, , [
172 AM_ICONV_LINK
173 ])
174 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
175 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
176 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
177 dnl even if libiconv doesn't exist.
178 AC_LIB_LINKFLAGS_BODY([intl])
179 AC_CACHE_CHECK([for GNU gettext in libintl],
180 [$gt_func_gnugettext_libintl],
181 [gt_save_CPPFLAGS="$CPPFLAGS"
182 CPPFLAGS="$CPPFLAGS $INCINTL"
183 gt_save_LIBS="$LIBS"
184 LIBS="$LIBS $LIBINTL"
185 dnl Now see whether libintl exists and does not depend on libiconv.
186 AC_TRY_LINK([#include <libintl.h>
187$gt_revision_test_code
188extern int _nl_msg_cat_cntr;
189extern
190#ifdef __cplusplus
191"C"
192#endif
193const char *_nl_expand_alias (const char *);],
194 [bindtextdomain ("", "");
195return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
196 [eval "$gt_func_gnugettext_libintl=yes"],
197 [eval "$gt_func_gnugettext_libintl=no"])
198 dnl Now see whether libintl exists and depends on libiconv.
199 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
200 LIBS="$LIBS $LIBICONV"
201 AC_TRY_LINK([#include <libintl.h>
202$gt_revision_test_code
203extern int _nl_msg_cat_cntr;
204extern
205#ifdef __cplusplus
206"C"
207#endif
208const char *_nl_expand_alias (const char *);],
209 [bindtextdomain ("", "");
210return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
211 [LIBINTL="$LIBINTL $LIBICONV"
212 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
213 eval "$gt_func_gnugettext_libintl=yes"
214 ])
215 fi
216 CPPFLAGS="$gt_save_CPPFLAGS"
217 LIBS="$gt_save_LIBS"])
218 fi
219
220 dnl If an already present or preinstalled GNU gettext() is found,
221 dnl use it. But if this macro is used in GNU gettext, and GNU
222 dnl gettext is already preinstalled in libintl, we update this
223 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
224 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
225 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
226 && test "$PACKAGE" != gettext-runtime \
227 && test "$PACKAGE" != gettext-tools; }; then
228 gt_use_preinstalled_gnugettext=yes
229 else
230 dnl Reset the values set by searching for libintl.
231 LIBINTL=
232 LTLIBINTL=
233 INCINTL=
234 fi
235
236 ifelse(gt_included_intl, yes, [
237 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
238 dnl GNU gettext is not found in the C library.
239 dnl Fall back on included GNU gettext library.
240 nls_cv_use_gnu_gettext=yes
241 fi
242 fi
243
244 if test "$nls_cv_use_gnu_gettext" = "yes"; then
245 dnl Mark actions used to generate GNU NLS library.
246 BUILD_INCLUDED_LIBINTL=yes
247 USE_INCLUDED_LIBINTL=yes
248 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
249 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
250 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
251 fi
252
253 CATOBJEXT=
254 if test "$gt_use_preinstalled_gnugettext" = "yes" \
255 || test "$nls_cv_use_gnu_gettext" = "yes"; then
256 dnl Mark actions to use GNU gettext tools.
257 CATOBJEXT=.gmo
258 fi
259 ])
260
261 if test -n "$INTL_MACOSX_LIBS"; then
262 if test "$gt_use_preinstalled_gnugettext" = "yes" \
263 || test "$nls_cv_use_gnu_gettext" = "yes"; then
264 dnl Some extra flags are needed during linking.
265 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
266 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
267 fi
268 fi
269
270 if test "$gt_use_preinstalled_gnugettext" = "yes" \
271 || test "$nls_cv_use_gnu_gettext" = "yes"; then
272 AC_DEFINE([ENABLE_NLS], [1],
273 [Define to 1 if translation of program messages to the user's native language
274 is requested.])
275 else
276 USE_NLS=no
277 fi
278 fi
279
280 AC_MSG_CHECKING([whether to use NLS])
281 AC_MSG_RESULT([$USE_NLS])
282 if test "$USE_NLS" = "yes"; then
283 AC_MSG_CHECKING([where the gettext function comes from])
284 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
285 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
286 gt_source="external libintl"
287 else
288 gt_source="libc"
289 fi
290 else
291 gt_source="included intl directory"
292 fi
293 AC_MSG_RESULT([$gt_source])
294 fi
295
296 if test "$USE_NLS" = "yes"; then
297
298 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
299 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
300 AC_MSG_CHECKING([how to link with libintl])
301 AC_MSG_RESULT([$LIBINTL])
302 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
303 fi
304
305 dnl For backward compatibility. Some packages may be using this.
306 AC_DEFINE([HAVE_GETTEXT], [1],
307 [Define if the GNU gettext() function is already present or preinstalled.])
308 AC_DEFINE([HAVE_DCGETTEXT], [1],
309 [Define if the GNU dcgettext() function is already present or preinstalled.])
310 fi
311
312 dnl We need to process the po/ directory.
313 POSUB=po
314 fi
315
316 ifelse(gt_included_intl, yes, [
317 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
318 dnl to 'yes' because some of the testsuite requires it.
319 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
320 BUILD_INCLUDED_LIBINTL=yes
321 fi
322
323 dnl Make all variables we use known to autoconf.
324 AC_SUBST([BUILD_INCLUDED_LIBINTL])
325 AC_SUBST([USE_INCLUDED_LIBINTL])
326 AC_SUBST([CATOBJEXT])
327
328 dnl For backward compatibility. Some configure.ins may be using this.
329 nls_cv_header_intl=
330 nls_cv_header_libgt=
331
332 dnl For backward compatibility. Some Makefiles may be using this.
333 DATADIRNAME=share
334 AC_SUBST([DATADIRNAME])
335
336 dnl For backward compatibility. Some Makefiles may be using this.
337 INSTOBJEXT=.mo
338 AC_SUBST([INSTOBJEXT])
339
340 dnl For backward compatibility. Some Makefiles may be using this.
341 GENCAT=gencat
342 AC_SUBST([GENCAT])
343
344 dnl For backward compatibility. Some Makefiles may be using this.
345 INTLOBJS=
346 if test "$USE_INCLUDED_LIBINTL" = yes; then
347 INTLOBJS="\$(GETTOBJS)"
348 fi
349 AC_SUBST([INTLOBJS])
350
351 dnl Enable libtool support if the surrounding package wishes it.
352 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
353 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
354 ])
355
356 dnl For backward compatibility. Some Makefiles may be using this.
357 INTLLIBS="$LIBINTL"
358 AC_SUBST([INTLLIBS])
359
360 dnl Make all documented variables known to autoconf.
361 AC_SUBST([LIBINTL])
362 AC_SUBST([LTLIBINTL])
363 AC_SUBST([POSUB])
364])
365
366
367dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
368m4_define([gt_NEEDS_INIT],
369[
370 m4_divert_text([DEFAULTS], [gt_needs=])
371 m4_define([gt_NEEDS_INIT], [])
372])
373
374
375dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
376AC_DEFUN([AM_GNU_GETTEXT_NEED],
377[
378 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
379])
380
381
382dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
383AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/m4/glibc2.m4 b/m4/glibc2.m4
new file mode 100644
index 0000000..f148c12
--- /dev/null
+++ b/m4/glibc2.m4
@@ -0,0 +1,30 @@
1# glibc2.m4 serial 2
2dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7# Test for the GNU C Library, version 2.0 or newer.
8# From Bruno Haible.
9
10AC_DEFUN([gt_GLIBC2],
11 [
12 AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
13 [ac_cv_gnu_library_2],
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16#include <features.h>
17#ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ >= 2)
19 Lucky GNU user
20 #endif
21#endif
22 ],
23 [ac_cv_gnu_library_2=yes],
24 [ac_cv_gnu_library_2=no])
25 ]
26 )
27 AC_SUBST([GLIBC2])
28 GLIBC2="$ac_cv_gnu_library_2"
29 ]
30)
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 0000000..68ada9d
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,0 +1,30 @@
1# glibc21.m4 serial 4
2dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7# Test for the GNU C Library, version 2.1 or newer.
8# From Bruno Haible.
9
10AC_DEFUN([gl_GLIBC21],
11 [
12 AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
13 [ac_cv_gnu_library_2_1],
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16#include <features.h>
17#ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
19 Lucky GNU user
20 #endif
21#endif
22 ],
23 [ac_cv_gnu_library_2_1=yes],
24 [ac_cv_gnu_library_2_1=no])
25 ]
26 )
27 AC_SUBST([GLIBC21])
28 GLIBC21="$ac_cv_gnu_library_2_1"
29 ]
30)
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644
index 0000000..e2041b9
--- /dev/null
+++ b/m4/iconv.m4
@@ -0,0 +1,214 @@
1# iconv.m4 serial 11 (gettext-0.18.1)
2dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
10[
11 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
12 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
13 AC_REQUIRE([AC_LIB_RPATH])
14
15 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
16 dnl accordingly.
17 AC_LIB_LINKFLAGS_BODY([iconv])
18])
19
20AC_DEFUN([AM_ICONV_LINK],
21[
22 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
23 dnl those with the standalone portable GNU libiconv installed).
24 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
25
26 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
27 dnl accordingly.
28 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
29
30 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
31 dnl because if the user has installed libiconv and not disabled its use
32 dnl via --without-libiconv-prefix, he wants to use it. The first
33 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
34 am_save_CPPFLAGS="$CPPFLAGS"
35 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
36
37 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
38 am_cv_func_iconv="no, consider installing GNU libiconv"
39 am_cv_lib_iconv=no
40 AC_TRY_LINK([#include <stdlib.h>
41#include <iconv.h>],
42 [iconv_t cd = iconv_open("","");
43 iconv(cd,NULL,NULL,NULL,NULL);
44 iconv_close(cd);],
45 [am_cv_func_iconv=yes])
46 if test "$am_cv_func_iconv" != yes; then
47 am_save_LIBS="$LIBS"
48 LIBS="$LIBS $LIBICONV"
49 AC_TRY_LINK([#include <stdlib.h>
50#include <iconv.h>],
51 [iconv_t cd = iconv_open("","");
52 iconv(cd,NULL,NULL,NULL,NULL);
53 iconv_close(cd);],
54 [am_cv_lib_iconv=yes]
55 [am_cv_func_iconv=yes])
56 LIBS="$am_save_LIBS"
57 fi
58 ])
59 if test "$am_cv_func_iconv" = yes; then
60 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
61 dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
62 am_save_LIBS="$LIBS"
63 if test $am_cv_lib_iconv = yes; then
64 LIBS="$LIBS $LIBICONV"
65 fi
66 AC_TRY_RUN([
67#include <iconv.h>
68#include <string.h>
69int main ()
70{
71 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
72 returns. */
73 {
74 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
75 if (cd_utf8_to_88591 != (iconv_t)(-1))
76 {
77 static const char input[] = "\342\202\254"; /* EURO SIGN */
78 char buf[10];
79 const char *inptr = input;
80 size_t inbytesleft = strlen (input);
81 char *outptr = buf;
82 size_t outbytesleft = sizeof (buf);
83 size_t res = iconv (cd_utf8_to_88591,
84 (char **) &inptr, &inbytesleft,
85 &outptr, &outbytesleft);
86 if (res == 0)
87 return 1;
88 }
89 }
90 /* Test against Solaris 10 bug: Failures are not distinguishable from
91 successful returns. */
92 {
93 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
94 if (cd_ascii_to_88591 != (iconv_t)(-1))
95 {
96 static const char input[] = "\263";
97 char buf[10];
98 const char *inptr = input;
99 size_t inbytesleft = strlen (input);
100 char *outptr = buf;
101 size_t outbytesleft = sizeof (buf);
102 size_t res = iconv (cd_ascii_to_88591,
103 (char **) &inptr, &inbytesleft,
104 &outptr, &outbytesleft);
105 if (res == 0)
106 return 1;
107 }
108 }
109#if 0 /* This bug could be worked around by the caller. */
110 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
111 {
112 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
113 if (cd_88591_to_utf8 != (iconv_t)(-1))
114 {
115 static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
116 char buf[50];
117 const char *inptr = input;
118 size_t inbytesleft = strlen (input);
119 char *outptr = buf;
120 size_t outbytesleft = sizeof (buf);
121 size_t res = iconv (cd_88591_to_utf8,
122 (char **) &inptr, &inbytesleft,
123 &outptr, &outbytesleft);
124 if ((int)res > 0)
125 return 1;
126 }
127 }
128#endif
129 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
130 provided. */
131 if (/* Try standardized names. */
132 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
133 /* Try IRIX, OSF/1 names. */
134 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
135 /* Try AIX names. */
136 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
137 /* Try HP-UX names. */
138 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
139 return 1;
140 return 0;
141}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
142 [case "$host_os" in
143 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
144 *) am_cv_func_iconv_works="guessing yes" ;;
145 esac])
146 LIBS="$am_save_LIBS"
147 ])
148 case "$am_cv_func_iconv_works" in
149 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
150 *) am_func_iconv=yes ;;
151 esac
152 else
153 am_func_iconv=no am_cv_lib_iconv=no
154 fi
155 if test "$am_func_iconv" = yes; then
156 AC_DEFINE([HAVE_ICONV], [1],
157 [Define if you have the iconv() function and it works.])
158 fi
159 if test "$am_cv_lib_iconv" = yes; then
160 AC_MSG_CHECKING([how to link with libiconv])
161 AC_MSG_RESULT([$LIBICONV])
162 else
163 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
164 dnl either.
165 CPPFLAGS="$am_save_CPPFLAGS"
166 LIBICONV=
167 LTLIBICONV=
168 fi
169 AC_SUBST([LIBICONV])
170 AC_SUBST([LTLIBICONV])
171])
172
173dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
174dnl avoid warnings like
175dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
176dnl This is tricky because of the way 'aclocal' is implemented:
177dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
178dnl Otherwise aclocal's initial scan pass would miss the macro definition.
179dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
180dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
181dnl warnings.
182m4_define([gl_iconv_AC_DEFUN],
183 m4_version_prereq([2.64],
184 [[AC_DEFUN_ONCE(
185 [$1], [$2])]],
186 [[AC_DEFUN(
187 [$1], [$2])]]))
188gl_iconv_AC_DEFUN([AM_ICONV],
189[
190 AM_ICONV_LINK
191 if test "$am_cv_func_iconv" = yes; then
192 AC_MSG_CHECKING([for iconv declaration])
193 AC_CACHE_VAL([am_cv_proto_iconv], [
194 AC_TRY_COMPILE([
195#include <stdlib.h>
196#include <iconv.h>
197extern
198#ifdef __cplusplus
199"C"
200#endif
201#if defined(__STDC__) || defined(__cplusplus)
202size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
203#else
204size_t iconv();
205#endif
206], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
207 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
208 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
209 AC_MSG_RESULT([
210 $am_cv_proto_iconv])
211 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
212 [Define as const if the declaration of iconv() needs const.])
213 fi
214])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644
index 0000000..289c4df
--- /dev/null
+++ b/m4/intdiv0.m4
@@ -0,0 +1,84 @@
1# intdiv0.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([gt_INTDIV0],
10[
11 AC_REQUIRE([AC_PROG_CC])dnl
12 AC_REQUIRE([AC_CANONICAL_HOST])dnl
13
14 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
15 gt_cv_int_divbyzero_sigfpe,
16 [
17 gt_cv_int_divbyzero_sigfpe=
18changequote(,)dnl
19 case "$host_os" in
20 macos* | darwin[6-9]* | darwin[1-9][0-9]*)
21 # On MacOS X 10.2 or newer, just assume the same as when cross-
22 # compiling. If we were to perform the real test, 1 Crash Report
23 # dialog window would pop up.
24 case "$host_cpu" in
25 i[34567]86 | x86_64)
26 gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
27 esac
28 ;;
29 esac
30changequote([,])dnl
31 if test -z "$gt_cv_int_divbyzero_sigfpe"; then
32 AC_TRY_RUN([
33#include <stdlib.h>
34#include <signal.h>
35
36static void
37sigfpe_handler (int sig)
38{
39 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
40 exit (sig != SIGFPE);
41}
42
43int x = 1;
44int y = 0;
45int z;
46int nan;
47
48int main ()
49{
50 signal (SIGFPE, sigfpe_handler);
51/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
52#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
53 signal (SIGTRAP, sigfpe_handler);
54#endif
55/* Linux/SPARC yields signal SIGILL. */
56#if defined (__sparc__) && defined (__linux__)
57 signal (SIGILL, sigfpe_handler);
58#endif
59
60 z = x / y;
61 nan = y / y;
62 exit (1);
63}
64], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
65 [
66 # Guess based on the CPU.
67changequote(,)dnl
68 case "$host_cpu" in
69 alpha* | i[34567]86 | x86_64 | m68k | s390*)
70 gt_cv_int_divbyzero_sigfpe="guessing yes";;
71 *)
72 gt_cv_int_divbyzero_sigfpe="guessing no";;
73 esac
74changequote([,])dnl
75 ])
76 fi
77 ])
78 case "$gt_cv_int_divbyzero_sigfpe" in
79 *yes) value=1;;
80 *) value=0;;
81 esac
82 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
83 [Define if integer division by zero raises signal SIGFPE.])
84])
diff --git a/m4/intl.m4 b/m4/intl.m4
new file mode 100644
index 0000000..335b23c
--- /dev/null
+++ b/m4/intl.m4
@@ -0,0 +1,294 @@
1# intl.m4 serial 17 (gettext-0.18)
2dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
19
20AC_PREREQ([2.52])
21
22dnl Checks for all prerequisites of the intl subdirectory,
23dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
24dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
25AC_DEFUN([AM_INTL_SUBDIR],
26[
27 AC_REQUIRE([AC_PROG_INSTALL])dnl
28 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
29 AC_REQUIRE([AC_PROG_CC])dnl
30 AC_REQUIRE([AC_CANONICAL_HOST])dnl
31 AC_REQUIRE([gt_GLIBC2])dnl
32 AC_REQUIRE([AC_PROG_RANLIB])dnl
33 AC_REQUIRE([gl_VISIBILITY])dnl
34 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
35 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
36 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
37 AC_REQUIRE([gt_TYPE_WINT_T])dnl
38 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
39 AC_REQUIRE([gt_TYPE_INTMAX_T])
40 AC_REQUIRE([gt_PRINTF_POSIX])
41 AC_REQUIRE([gl_GLIBC21])dnl
42 AC_REQUIRE([gl_XSIZE])dnl
43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
44 AC_REQUIRE([gt_INTL_MACOSX])dnl
45
46 dnl Support for automake's --enable-silent-rules.
47 case "$enable_silent_rules" in
48 yes) INTL_DEFAULT_VERBOSITY=0;;
49 no) INTL_DEFAULT_VERBOSITY=1;;
50 *) INTL_DEFAULT_VERBOSITY=1;;
51 esac
52 AC_SUBST([INTL_DEFAULT_VERBOSITY])
53
54 AC_CHECK_TYPE([ptrdiff_t], ,
55 [AC_DEFINE([ptrdiff_t], [long],
56 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
57 ])
58 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
59 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
60 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
61
62 dnl Use the _snprintf function only if it is declared (because on NetBSD it
63 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
64 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
65 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
66
67 dnl Use the *_unlocked functions only if they are declared.
68 dnl (because some of them were defined without being declared in Solaris
69 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
70 dnl on Solaris 2.5.1 to run on Solaris 2.6).
71 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
72 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
73
74 case $gt_cv_func_printf_posix in
75 *yes) HAVE_POSIX_PRINTF=1 ;;
76 *) HAVE_POSIX_PRINTF=0 ;;
77 esac
78 AC_SUBST([HAVE_POSIX_PRINTF])
79 if test "$ac_cv_func_asprintf" = yes; then
80 HAVE_ASPRINTF=1
81 else
82 HAVE_ASPRINTF=0
83 fi
84 AC_SUBST([HAVE_ASPRINTF])
85 if test "$ac_cv_func_snprintf" = yes; then
86 HAVE_SNPRINTF=1
87 else
88 HAVE_SNPRINTF=0
89 fi
90 AC_SUBST([HAVE_SNPRINTF])
91 if test "$ac_cv_func_newlocale" = yes; then
92 HAVE_NEWLOCALE=1
93 else
94 HAVE_NEWLOCALE=0
95 fi
96 AC_SUBST([HAVE_NEWLOCALE])
97 if test "$ac_cv_func_wprintf" = yes; then
98 HAVE_WPRINTF=1
99 else
100 HAVE_WPRINTF=0
101 fi
102 AC_SUBST([HAVE_WPRINTF])
103
104 AM_LANGINFO_CODESET
105 gt_LC_MESSAGES
106
107 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
108 dnl 1. when we install a shared library, we must arrange to export
109 dnl auxiliary pointer variables for every exported variable,
110 dnl 2. when we install a shared library and a static library simultaneously,
111 dnl the include file specifies __declspec(dllimport) and therefore we
112 dnl must arrange to define the auxiliary pointer variables for the
113 dnl exported variables _also_ in the static library.
114 if test "$enable_shared" = yes; then
115 case "$host_os" in
116 mingw* | cygwin*) is_woe32dll=yes ;;
117 *) is_woe32dll=no ;;
118 esac
119 else
120 is_woe32dll=no
121 fi
122 WOE32DLL=$is_woe32dll
123 AC_SUBST([WOE32DLL])
124
125 dnl On mingw and Cygwin, we can activate special Makefile rules which add
126 dnl version information to the shared libraries and executables.
127 case "$host_os" in
128 mingw* | cygwin*) is_woe32=yes ;;
129 *) is_woe32=no ;;
130 esac
131 WOE32=$is_woe32
132 AC_SUBST([WOE32])
133 if test $WOE32 = yes; then
134 dnl Check for a program that compiles Windows resource files.
135 AC_CHECK_TOOL([WINDRES], [windres])
136 fi
137
138 dnl Determine whether when creating a library, "-lc" should be passed to
139 dnl libtool or not. On many platforms, it is required for the libtool option
140 dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
141 dnl in the *.la files - makes it impossible to create multithreaded programs,
142 dnl because libtool also reorders the -lc to come before the -pthread, and
143 dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
144 case "$host_os" in
145 hpux*) LTLIBC="" ;;
146 *) LTLIBC="-lc" ;;
147 esac
148 AC_SUBST([LTLIBC])
149
150 dnl Rename some macros and functions used for locking.
151 AH_BOTTOM([
152#define __libc_lock_t gl_lock_t
153#define __libc_lock_define gl_lock_define
154#define __libc_lock_define_initialized gl_lock_define_initialized
155#define __libc_lock_init gl_lock_init
156#define __libc_lock_lock gl_lock_lock
157#define __libc_lock_unlock gl_lock_unlock
158#define __libc_lock_recursive_t gl_recursive_lock_t
159#define __libc_lock_define_recursive gl_recursive_lock_define
160#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
161#define __libc_lock_init_recursive gl_recursive_lock_init
162#define __libc_lock_lock_recursive gl_recursive_lock_lock
163#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
164#define glthread_in_use libintl_thread_in_use
165#define glthread_lock_init_func libintl_lock_init_func
166#define glthread_lock_lock_func libintl_lock_lock_func
167#define glthread_lock_unlock_func libintl_lock_unlock_func
168#define glthread_lock_destroy_func libintl_lock_destroy_func
169#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
170#define glthread_rwlock_init_func libintl_rwlock_init_func
171#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
172#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
173#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
174#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
175#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
176#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
177#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
178#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
179#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
180#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
181#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
182#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
183#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
184#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
185#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
186#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
187#define glthread_once_func libintl_once_func
188#define glthread_once_singlethreaded libintl_once_singlethreaded
189#define glthread_once_multithreaded libintl_once_multithreaded
190])
191])
192
193
194dnl Checks for the core files of the intl subdirectory:
195dnl dcigettext.c
196dnl eval-plural.h
197dnl explodename.c
198dnl finddomain.c
199dnl gettextP.h
200dnl gmo.h
201dnl hash-string.h hash-string.c
202dnl l10nflist.c
203dnl libgnuintl.h.in (except the *printf stuff)
204dnl loadinfo.h
205dnl loadmsgcat.c
206dnl localealias.c
207dnl log.c
208dnl plural-exp.h plural-exp.c
209dnl plural.y
210dnl Used by libglocale.
211AC_DEFUN([gt_INTL_SUBDIR_CORE],
212[
213 AC_REQUIRE([AC_C_INLINE])dnl
214 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
215 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
216 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
217 AC_REQUIRE([AC_FUNC_MMAP])dnl
218 AC_REQUIRE([gt_INTDIV0])dnl
219 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
220 AC_REQUIRE([gt_INTTYPES_PRI])dnl
221 AC_REQUIRE([gl_LOCK])dnl
222
223 AC_TRY_LINK(
224 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
225 [],
226 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
227 [Define to 1 if the compiler understands __builtin_expect.])])
228
229 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
230 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
231 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
232 argz_stringify argz_next __fsetlocking])
233
234 dnl Use the *_unlocked functions only if they are declared.
235 dnl (because some of them were defined without being declared in Solaris
236 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
237 dnl on Solaris 2.5.1 to run on Solaris 2.6).
238 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
239 gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
240 gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
241
242 AM_ICONV
243
244 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
245 dnl because plural.y uses bison specific features. It requires at least
246 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
247 dnl compile.
248 dnl bison is only needed for the maintainer (who touches plural.y). But in
249 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
250 dnl the rule in general Makefile. Now, some people carelessly touch the
251 dnl files or have a broken "make" program, hence the plural.c rule will
252 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
253 dnl present or too old.
254 AC_CHECK_PROGS([INTLBISON], [bison])
255 if test -z "$INTLBISON"; then
256 ac_verc_fail=yes
257 else
258 dnl Found it, now check the version.
259 AC_MSG_CHECKING([version of bison])
260changequote(<<,>>)dnl
261 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
262 case $ac_prog_version in
263 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
264 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
265changequote([,])dnl
266 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
267 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
268 esac
269 AC_MSG_RESULT([$ac_prog_version])
270 fi
271 if test $ac_verc_fail = yes; then
272 INTLBISON=:
273 fi
274])
275
276
277dnl gt_CHECK_DECL(FUNC, INCLUDES)
278dnl Check whether a function is declared.
279AC_DEFUN([gt_CHECK_DECL],
280[
281 AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
282 [AC_TRY_COMPILE([$2], [
283#ifndef $1
284 char *p = (char *) $1;
285#endif
286], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
287 if test $ac_cv_have_decl_$1 = yes; then
288 gt_value=1
289 else
290 gt_value=0
291 fi
292 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
293 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
294])
diff --git a/m4/intldir.m4 b/m4/intldir.m4
new file mode 100644
index 0000000..ebae76d
--- /dev/null
+++ b/m4/intldir.m4
@@ -0,0 +1,19 @@
1# intldir.m4 serial 2 (gettext-0.18)
2dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16AC_PREREQ([2.52])
17
18dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
19AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
new file mode 100644
index 0000000..dd91025
--- /dev/null
+++ b/m4/intlmacosx.m4
@@ -0,0 +1,51 @@
1# intlmacosx.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Checks for special options needed on MacOS X.
17dnl Defines INTL_MACOSX_LIBS.
18AC_DEFUN([gt_INTL_MACOSX],
19[
20 dnl Check for API introduced in MacOS X 10.2.
21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22 [gt_cv_func_CFPreferencesCopyAppValue],
23 [gt_save_LIBS="$LIBS"
24 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
25 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
26 [CFPreferencesCopyAppValue(NULL, NULL)],
27 [gt_cv_func_CFPreferencesCopyAppValue=yes],
28 [gt_cv_func_CFPreferencesCopyAppValue=no])
29 LIBS="$gt_save_LIBS"])
30 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
31 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
32 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
33 fi
34 dnl Check for API introduced in MacOS X 10.3.
35 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36 [gt_save_LIBS="$LIBS"
37 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
38 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
39 [gt_cv_func_CFLocaleCopyCurrent=yes],
40 [gt_cv_func_CFLocaleCopyCurrent=no])
41 LIBS="$gt_save_LIBS"])
42 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
43 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
44 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
45 fi
46 INTL_MACOSX_LIBS=
47 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
49 fi
50 AC_SUBST([INTL_MACOSX_LIBS])
51])
diff --git a/m4/intmax.m4 b/m4/intmax.m4
new file mode 100644
index 0000000..74aaaf5
--- /dev/null
+++ b/m4/intmax.m4
@@ -0,0 +1,33 @@
1# intmax.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8dnl Test whether the system has the 'intmax_t' type, but don't attempt to
9dnl find a replacement if it is lacking.
10
11AC_DEFUN([gt_TYPE_INTMAX_T],
12[
13 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15 AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
16 [AC_TRY_COMPILE([
17#include <stddef.h>
18#include <stdlib.h>
19#if HAVE_STDINT_H_WITH_UINTMAX
20#include <stdint.h>
21#endif
22#if HAVE_INTTYPES_H_WITH_UINTMAX
23#include <inttypes.h>
24#endif
25], [intmax_t x = -1;
26 return !x;],
27 [gt_cv_c_intmax_t=yes],
28 [gt_cv_c_intmax_t=no])])
29 if test $gt_cv_c_intmax_t = yes; then
30 AC_DEFINE([HAVE_INTMAX_T], [1],
31 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
32 fi
33])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 0000000..718a4f4
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,36 @@
1# inttypes-pri.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_PREREQ([2.52])
10
11# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
12# macros to non-string values. This is the case on AIX 4.3.3.
13
14AC_DEFUN([gt_INTTYPES_PRI],
15[
16 AC_CHECK_HEADERS([inttypes.h])
17 if test $ac_cv_header_inttypes_h = yes; then
18 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
19 [gt_cv_inttypes_pri_broken],
20 [
21 AC_TRY_COMPILE([#include <inttypes.h>
22#ifdef PRId32
23char *p = PRId32;
24#endif
25], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
26 ])
27 fi
28 if test "$gt_cv_inttypes_pri_broken" = yes; then
29 AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
30 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
31 PRI_MACROS_BROKEN=1
32 else
33 PRI_MACROS_BROKEN=0
34 fi
35 AC_SUBST([PRI_MACROS_BROKEN])
36])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 0000000..782d77e
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,26 @@
1# inttypes_h.m4 serial 9
2dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Paul Eggert.
8
9# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
10# doesn't clash with <sys/types.h>, and declares uintmax_t.
11
12AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
13[
14 AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
15 [AC_TRY_COMPILE(
16 [#include <sys/types.h>
17#include <inttypes.h>],
18 [uintmax_t i = (uintmax_t) -1; return !i;],
19 [gl_cv_header_inttypes_h=yes],
20 [gl_cv_header_inttypes_h=no])])
21 if test $gl_cv_header_inttypes_h = yes; then
22 AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
23 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ])
25 fi
26])
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
new file mode 100644
index 0000000..1a70543
--- /dev/null
+++ b/m4/lcmessage.m4
@@ -0,0 +1,31 @@
1# lcmessage.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation,
3dnl Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7dnl
8dnl This file can can be used in projects which are not available under
9dnl the GNU General Public License or the GNU Library General Public
10dnl License but which still want to provide support for the GNU gettext
11dnl functionality.
12dnl Please note that the actual code of the GNU gettext library is covered
13dnl by the GNU Library General Public License, and the rest of the GNU
14dnl gettext package package is covered by the GNU General Public License.
15dnl They are *not* in the public domain.
16
17dnl Authors:
18dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
19
20# Check whether LC_MESSAGES is available in <locale.h>.
21
22AC_DEFUN([gt_LC_MESSAGES],
23[
24 AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
25 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
26 [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
27 if test $gt_cv_val_LC_MESSAGES = yes; then
28 AC_DEFINE([HAVE_LC_MESSAGES], [1],
29 [Define if your <locale.h> file defines LC_MESSAGES.])
30 fi
31])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644
index 0000000..ebb3052
--- /dev/null
+++ b/m4/lib-ld.m4
@@ -0,0 +1,110 @@
1# lib-ld.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Subroutines of libtool.m4,
8dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
9dnl with libtool.m4.
10
11dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
12AC_DEFUN([AC_LIB_PROG_LD_GNU],
13[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
14[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15case `$LD -v 2>&1 </dev/null` in
16*GNU* | *'with BFD'*)
17 acl_cv_prog_gnu_ld=yes ;;
18*)
19 acl_cv_prog_gnu_ld=no ;;
20esac])
21with_gnu_ld=$acl_cv_prog_gnu_ld
22])
23
24dnl From libtool-1.4. Sets the variable LD.
25AC_DEFUN([AC_LIB_PROG_LD],
26[AC_ARG_WITH([gnu-ld],
27[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
28test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
29AC_REQUIRE([AC_PROG_CC])dnl
30AC_REQUIRE([AC_CANONICAL_HOST])dnl
31# Prepare PATH_SEPARATOR.
32# The user is always right.
33if test "${PATH_SEPARATOR+set}" != set; then
34 echo "#! /bin/sh" >conf$$.sh
35 echo "exit 0" >>conf$$.sh
36 chmod +x conf$$.sh
37 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
38 PATH_SEPARATOR=';'
39 else
40 PATH_SEPARATOR=:
41 fi
42 rm -f conf$$.sh
43fi
44ac_prog=ld
45if test "$GCC" = yes; then
46 # Check if gcc -print-prog-name=ld gives a path.
47 AC_MSG_CHECKING([for ld used by GCC])
48 case $host in
49 *-*-mingw*)
50 # gcc leaves a trailing carriage return which upsets mingw
51 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
52 *)
53 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
54 esac
55 case $ac_prog in
56 # Accept absolute paths.
57 [[\\/]* | [A-Za-z]:[\\/]*)]
58 [re_direlt='/[^/][^/]*/\.\./']
59 # Canonicalize the path of ld
60 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
61 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
62 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
63 done
64 test -z "$LD" && LD="$ac_prog"
65 ;;
66 "")
67 # If it fails, then pretend we aren't using GCC.
68 ac_prog=ld
69 ;;
70 *)
71 # If it is relative, then search for the first ld in PATH.
72 with_gnu_ld=unknown
73 ;;
74 esac
75elif test "$with_gnu_ld" = yes; then
76 AC_MSG_CHECKING([for GNU ld])
77else
78 AC_MSG_CHECKING([for non-GNU ld])
79fi
80AC_CACHE_VAL([acl_cv_path_LD],
81[if test -z "$LD"; then
82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
83 for ac_dir in $PATH; do
84 test -z "$ac_dir" && ac_dir=.
85 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
86 acl_cv_path_LD="$ac_dir/$ac_prog"
87 # Check to see if the program is GNU ld. I'd rather use --version,
88 # but apparently some GNU ld's only accept -v.
89 # Break only if it was the GNU/non-GNU ld that we prefer.
90 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
91 *GNU* | *'with BFD'*)
92 test "$with_gnu_ld" != no && break ;;
93 *)
94 test "$with_gnu_ld" != yes && break ;;
95 esac
96 fi
97 done
98 IFS="$ac_save_ifs"
99else
100 acl_cv_path_LD="$LD" # Let the user override the test with a path.
101fi])
102LD="$acl_cv_path_LD"
103if test -n "$LD"; then
104 AC_MSG_RESULT([$LD])
105else
106 AC_MSG_RESULT([no])
107fi
108test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
109AC_LIB_PROG_LD_GNU
110])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
new file mode 100644
index 0000000..c73bd8e
--- /dev/null
+++ b/m4/lib-link.m4
@@ -0,0 +1,774 @@
1# lib-link.m4 serial 21 (gettext-0.18)
2dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_PREREQ([2.54])
10
11dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
12dnl the libraries corresponding to explicit and implicit dependencies.
13dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
14dnl augments the CPPFLAGS variable.
15dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
16dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
17AC_DEFUN([AC_LIB_LINKFLAGS],
18[
19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20 AC_REQUIRE([AC_LIB_RPATH])
21 pushdef([Name],[translit([$1],[./-], [___])])
22 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25 AC_LIB_LINKFLAGS_BODY([$1], [$2])
26 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
27 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
28 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
29 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
30 ])
31 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
32 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
33 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
34 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
35 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
36 AC_SUBST([LIB]NAME)
37 AC_SUBST([LTLIB]NAME)
38 AC_SUBST([LIB]NAME[_PREFIX])
39 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
40 dnl results of this search when this library appears as a dependency.
41 HAVE_LIB[]NAME=yes
42 popdef([NAME])
43 popdef([Name])
44])
45
46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
47dnl searches for libname and the libraries corresponding to explicit and
48dnl implicit dependencies, together with the specified include files and
49dnl the ability to compile and link the specified testcode. The missing-message
50dnl defaults to 'no' and may contain additional hints for the user.
51dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
52dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
53dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
54dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
55dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
56dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
57AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
58[
59 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
60 AC_REQUIRE([AC_LIB_RPATH])
61 pushdef([Name],[translit([$1],[./-], [___])])
62 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
63 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
64
65 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
66 dnl accordingly.
67 AC_LIB_LINKFLAGS_BODY([$1], [$2])
68
69 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
70 dnl because if the user has installed lib[]Name and not disabled its use
71 dnl via --without-lib[]Name-prefix, he wants to use it.
72 ac_save_CPPFLAGS="$CPPFLAGS"
73 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
74
75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
76 ac_save_LIBS="$LIBS"
77 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
78 dnl because these -l options might require -L options that are present in
79 dnl LIBS. -l options benefit only from the -L options listed before it.
80 dnl Otherwise, add it to the front of LIBS, because it may be a static
81 dnl library that depends on another static library that is present in LIBS.
82 dnl Static libraries benefit only from the static libraries listed after
83 dnl it.
84 case " $LIB[]NAME" in
85 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
86 *) LIBS="$LIB[]NAME $LIBS" ;;
87 esac
88 AC_TRY_LINK([$3], [$4],
89 [ac_cv_lib[]Name=yes],
90 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
91 LIBS="$ac_save_LIBS"
92 ])
93 if test "$ac_cv_lib[]Name" = yes; then
94 HAVE_LIB[]NAME=yes
95 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
96 AC_MSG_CHECKING([how to link with lib[]$1])
97 AC_MSG_RESULT([$LIB[]NAME])
98 else
99 HAVE_LIB[]NAME=no
100 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
101 dnl $INC[]NAME either.
102 CPPFLAGS="$ac_save_CPPFLAGS"
103 LIB[]NAME=
104 LTLIB[]NAME=
105 LIB[]NAME[]_PREFIX=
106 fi
107 AC_SUBST([HAVE_LIB]NAME)
108 AC_SUBST([LIB]NAME)
109 AC_SUBST([LTLIB]NAME)
110 AC_SUBST([LIB]NAME[_PREFIX])
111 popdef([NAME])
112 popdef([Name])
113])
114
115dnl Determine the platform dependent parameters needed to use rpath:
116dnl acl_libext,
117dnl acl_shlibext,
118dnl acl_hardcode_libdir_flag_spec,
119dnl acl_hardcode_libdir_separator,
120dnl acl_hardcode_direct,
121dnl acl_hardcode_minus_L.
122AC_DEFUN([AC_LIB_RPATH],
123[
124 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
125 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
126 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
127 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
128 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
129 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
130 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
131 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
132 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
133 . ./conftest.sh
134 rm -f ./conftest.sh
135 acl_cv_rpath=done
136 ])
137 wl="$acl_cv_wl"
138 acl_libext="$acl_cv_libext"
139 acl_shlibext="$acl_cv_shlibext"
140 acl_libname_spec="$acl_cv_libname_spec"
141 acl_library_names_spec="$acl_cv_library_names_spec"
142 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
143 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
144 acl_hardcode_direct="$acl_cv_hardcode_direct"
145 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
146 dnl Determine whether the user wants rpath handling at all.
147 AC_ARG_ENABLE([rpath],
148 [ --disable-rpath do not hardcode runtime library paths],
149 :, enable_rpath=yes)
150])
151
152dnl AC_LIB_FROMPACKAGE(name, package)
153dnl declares that libname comes from the given package. The configure file
154dnl will then not have a --with-libname-prefix option but a
155dnl --with-package-prefix option. Several libraries can come from the same
156dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
157dnl macro call that searches for libname.
158AC_DEFUN([AC_LIB_FROMPACKAGE],
159[
160 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
161 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
162 define([acl_frompackage_]NAME, [$2])
163 popdef([NAME])
164 pushdef([PACK],[$2])
165 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
166 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
167 define([acl_libsinpackage_]PACKUP,
168 m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
169 popdef([PACKUP])
170 popdef([PACK])
171])
172
173dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
174dnl the libraries corresponding to explicit and implicit dependencies.
175dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
176dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
177dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
178AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
179[
180 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
181 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
182 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
183 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
184 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
185 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
186 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
187 dnl Autoconf >= 2.61 supports dots in --with options.
188 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
189 dnl By default, look in $includedir and $libdir.
190 use_additional=yes
191 AC_LIB_WITH_FINAL_PREFIX([
192 eval additional_includedir=\"$includedir\"
193 eval additional_libdir=\"$libdir\"
194 ])
195 AC_ARG_WITH(P_A_C_K[-prefix],
196[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
197 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
198[
199 if test "X$withval" = "Xno"; then
200 use_additional=no
201 else
202 if test "X$withval" = "X"; then
203 AC_LIB_WITH_FINAL_PREFIX([
204 eval additional_includedir=\"$includedir\"
205 eval additional_libdir=\"$libdir\"
206 ])
207 else
208 additional_includedir="$withval/include"
209 additional_libdir="$withval/$acl_libdirstem"
210 if test "$acl_libdirstem2" != "$acl_libdirstem" \
211 && ! test -d "$withval/$acl_libdirstem"; then
212 additional_libdir="$withval/$acl_libdirstem2"
213 fi
214 fi
215 fi
216])
217 dnl Search the library and its dependencies in $additional_libdir and
218 dnl $LDFLAGS. Using breadth-first-seach.
219 LIB[]NAME=
220 LTLIB[]NAME=
221 INC[]NAME=
222 LIB[]NAME[]_PREFIX=
223 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
224 dnl computed. So it has to be reset here.
225 HAVE_LIB[]NAME=
226 rpathdirs=
227 ltrpathdirs=
228 names_already_handled=
229 names_next_round='$1 $2'
230 while test -n "$names_next_round"; do
231 names_this_round="$names_next_round"
232 names_next_round=
233 for name in $names_this_round; do
234 already_handled=
235 for n in $names_already_handled; do
236 if test "$n" = "$name"; then
237 already_handled=yes
238 break
239 fi
240 done
241 if test -z "$already_handled"; then
242 names_already_handled="$names_already_handled $name"
243 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
244 dnl or AC_LIB_HAVE_LINKFLAGS call.
245 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
246 eval value=\"\$HAVE_LIB$uppername\"
247 if test -n "$value"; then
248 if test "$value" = yes; then
249 eval value=\"\$LIB$uppername\"
250 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
251 eval value=\"\$LTLIB$uppername\"
252 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
253 else
254 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
255 dnl that this library doesn't exist. So just drop it.
256 :
257 fi
258 else
259 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
260 dnl and the already constructed $LIBNAME/$LTLIBNAME.
261 found_dir=
262 found_la=
263 found_so=
264 found_a=
265 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
266 if test -n "$acl_shlibext"; then
267 shrext=".$acl_shlibext" # typically: shrext=.so
268 else
269 shrext=
270 fi
271 if test $use_additional = yes; then
272 dir="$additional_libdir"
273 dnl The same code as in the loop below:
274 dnl First look for a shared library.
275 if test -n "$acl_shlibext"; then
276 if test -f "$dir/$libname$shrext"; then
277 found_dir="$dir"
278 found_so="$dir/$libname$shrext"
279 else
280 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
281 ver=`(cd "$dir" && \
282 for f in "$libname$shrext".*; do echo "$f"; done \
283 | sed -e "s,^$libname$shrext\\\\.,," \
284 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
285 | sed 1q ) 2>/dev/null`
286 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
287 found_dir="$dir"
288 found_so="$dir/$libname$shrext.$ver"
289 fi
290 else
291 eval library_names=\"$acl_library_names_spec\"
292 for f in $library_names; do
293 if test -f "$dir/$f"; then
294 found_dir="$dir"
295 found_so="$dir/$f"
296 break
297 fi
298 done
299 fi
300 fi
301 fi
302 dnl Then look for a static library.
303 if test "X$found_dir" = "X"; then
304 if test -f "$dir/$libname.$acl_libext"; then
305 found_dir="$dir"
306 found_a="$dir/$libname.$acl_libext"
307 fi
308 fi
309 if test "X$found_dir" != "X"; then
310 if test -f "$dir/$libname.la"; then
311 found_la="$dir/$libname.la"
312 fi
313 fi
314 fi
315 if test "X$found_dir" = "X"; then
316 for x in $LDFLAGS $LTLIB[]NAME; do
317 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
318 case "$x" in
319 -L*)
320 dir=`echo "X$x" | sed -e 's/^X-L//'`
321 dnl First look for a shared library.
322 if test -n "$acl_shlibext"; then
323 if test -f "$dir/$libname$shrext"; then
324 found_dir="$dir"
325 found_so="$dir/$libname$shrext"
326 else
327 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
328 ver=`(cd "$dir" && \
329 for f in "$libname$shrext".*; do echo "$f"; done \
330 | sed -e "s,^$libname$shrext\\\\.,," \
331 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
332 | sed 1q ) 2>/dev/null`
333 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
334 found_dir="$dir"
335 found_so="$dir/$libname$shrext.$ver"
336 fi
337 else
338 eval library_names=\"$acl_library_names_spec\"
339 for f in $library_names; do
340 if test -f "$dir/$f"; then
341 found_dir="$dir"
342 found_so="$dir/$f"
343 break
344 fi
345 done
346 fi
347 fi
348 fi
349 dnl Then look for a static library.
350 if test "X$found_dir" = "X"; then
351 if test -f "$dir/$libname.$acl_libext"; then
352 found_dir="$dir"
353 found_a="$dir/$libname.$acl_libext"
354 fi
355 fi
356 if test "X$found_dir" != "X"; then
357 if test -f "$dir/$libname.la"; then
358 found_la="$dir/$libname.la"
359 fi
360 fi
361 ;;
362 esac
363 if test "X$found_dir" != "X"; then
364 break
365 fi
366 done
367 fi
368 if test "X$found_dir" != "X"; then
369 dnl Found the library.
370 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
371 if test "X$found_so" != "X"; then
372 dnl Linking with a shared library. We attempt to hardcode its
373 dnl directory into the executable's runpath, unless it's the
374 dnl standard /usr/lib.
375 if test "$enable_rpath" = no \
376 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
377 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
378 dnl No hardcoding is needed.
379 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
380 else
381 dnl Use an explicit option to hardcode DIR into the resulting
382 dnl binary.
383 dnl Potentially add DIR to ltrpathdirs.
384 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
385 haveit=
386 for x in $ltrpathdirs; do
387 if test "X$x" = "X$found_dir"; then
388 haveit=yes
389 break
390 fi
391 done
392 if test -z "$haveit"; then
393 ltrpathdirs="$ltrpathdirs $found_dir"
394 fi
395 dnl The hardcoding into $LIBNAME is system dependent.
396 if test "$acl_hardcode_direct" = yes; then
397 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
398 dnl resulting binary.
399 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
400 else
401 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
402 dnl Use an explicit option to hardcode DIR into the resulting
403 dnl binary.
404 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
405 dnl Potentially add DIR to rpathdirs.
406 dnl The rpathdirs will be appended to $LIBNAME at the end.
407 haveit=
408 for x in $rpathdirs; do
409 if test "X$x" = "X$found_dir"; then
410 haveit=yes
411 break
412 fi
413 done
414 if test -z "$haveit"; then
415 rpathdirs="$rpathdirs $found_dir"
416 fi
417 else
418 dnl Rely on "-L$found_dir".
419 dnl But don't add it if it's already contained in the LDFLAGS
420 dnl or the already constructed $LIBNAME
421 haveit=
422 for x in $LDFLAGS $LIB[]NAME; do
423 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
424 if test "X$x" = "X-L$found_dir"; then
425 haveit=yes
426 break
427 fi
428 done
429 if test -z "$haveit"; then
430 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
431 fi
432 if test "$acl_hardcode_minus_L" != no; then
433 dnl FIXME: Not sure whether we should use
434 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
435 dnl here.
436 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
437 else
438 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
439 dnl here, because this doesn't fit in flags passed to the
440 dnl compiler. So give up. No hardcoding. This affects only
441 dnl very old systems.
442 dnl FIXME: Not sure whether we should use
443 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
444 dnl here.
445 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
446 fi
447 fi
448 fi
449 fi
450 else
451 if test "X$found_a" != "X"; then
452 dnl Linking with a static library.
453 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
454 else
455 dnl We shouldn't come here, but anyway it's good to have a
456 dnl fallback.
457 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
458 fi
459 fi
460 dnl Assume the include files are nearby.
461 additional_includedir=
462 case "$found_dir" in
463 */$acl_libdirstem | */$acl_libdirstem/)
464 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
465 if test "$name" = '$1'; then
466 LIB[]NAME[]_PREFIX="$basedir"
467 fi
468 additional_includedir="$basedir/include"
469 ;;
470 */$acl_libdirstem2 | */$acl_libdirstem2/)
471 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
472 if test "$name" = '$1'; then
473 LIB[]NAME[]_PREFIX="$basedir"
474 fi
475 additional_includedir="$basedir/include"
476 ;;
477 esac
478 if test "X$additional_includedir" != "X"; then
479 dnl Potentially add $additional_includedir to $INCNAME.
480 dnl But don't add it
481 dnl 1. if it's the standard /usr/include,
482 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
483 dnl 3. if it's already present in $CPPFLAGS or the already
484 dnl constructed $INCNAME,
485 dnl 4. if it doesn't exist as a directory.
486 if test "X$additional_includedir" != "X/usr/include"; then
487 haveit=
488 if test "X$additional_includedir" = "X/usr/local/include"; then
489 if test -n "$GCC"; then
490 case $host_os in
491 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
492 esac
493 fi
494 fi
495 if test -z "$haveit"; then
496 for x in $CPPFLAGS $INC[]NAME; do
497 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
498 if test "X$x" = "X-I$additional_includedir"; then
499 haveit=yes
500 break
501 fi
502 done
503 if test -z "$haveit"; then
504 if test -d "$additional_includedir"; then
505 dnl Really add $additional_includedir to $INCNAME.
506 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
507 fi
508 fi
509 fi
510 fi
511 fi
512 dnl Look for dependencies.
513 if test -n "$found_la"; then
514 dnl Read the .la file. It defines the variables
515 dnl dlname, library_names, old_library, dependency_libs, current,
516 dnl age, revision, installed, dlopen, dlpreopen, libdir.
517 save_libdir="$libdir"
518 case "$found_la" in
519 */* | *\\*) . "$found_la" ;;
520 *) . "./$found_la" ;;
521 esac
522 libdir="$save_libdir"
523 dnl We use only dependency_libs.
524 for dep in $dependency_libs; do
525 case "$dep" in
526 -L*)
527 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
528 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
529 dnl But don't add it
530 dnl 1. if it's the standard /usr/lib,
531 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
532 dnl 3. if it's already present in $LDFLAGS or the already
533 dnl constructed $LIBNAME,
534 dnl 4. if it doesn't exist as a directory.
535 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
536 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
537 haveit=
538 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
539 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
540 if test -n "$GCC"; then
541 case $host_os in
542 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
543 esac
544 fi
545 fi
546 if test -z "$haveit"; then
547 haveit=
548 for x in $LDFLAGS $LIB[]NAME; do
549 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
550 if test "X$x" = "X-L$additional_libdir"; then
551 haveit=yes
552 break
553 fi
554 done
555 if test -z "$haveit"; then
556 if test -d "$additional_libdir"; then
557 dnl Really add $additional_libdir to $LIBNAME.
558 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
559 fi
560 fi
561 haveit=
562 for x in $LDFLAGS $LTLIB[]NAME; do
563 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
564 if test "X$x" = "X-L$additional_libdir"; then
565 haveit=yes
566 break
567 fi
568 done
569 if test -z "$haveit"; then
570 if test -d "$additional_libdir"; then
571 dnl Really add $additional_libdir to $LTLIBNAME.
572 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
573 fi
574 fi
575 fi
576 fi
577 ;;
578 -R*)
579 dir=`echo "X$dep" | sed -e 's/^X-R//'`
580 if test "$enable_rpath" != no; then
581 dnl Potentially add DIR to rpathdirs.
582 dnl The rpathdirs will be appended to $LIBNAME at the end.
583 haveit=
584 for x in $rpathdirs; do
585 if test "X$x" = "X$dir"; then
586 haveit=yes
587 break
588 fi
589 done
590 if test -z "$haveit"; then
591 rpathdirs="$rpathdirs $dir"
592 fi
593 dnl Potentially add DIR to ltrpathdirs.
594 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
595 haveit=
596 for x in $ltrpathdirs; do
597 if test "X$x" = "X$dir"; then
598 haveit=yes
599 break
600 fi
601 done
602 if test -z "$haveit"; then
603 ltrpathdirs="$ltrpathdirs $dir"
604 fi
605 fi
606 ;;
607 -l*)
608 dnl Handle this in the next round.
609 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
610 ;;
611 *.la)
612 dnl Handle this in the next round. Throw away the .la's
613 dnl directory; it is already contained in a preceding -L
614 dnl option.
615 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
616 ;;
617