Browse Source

Initial commit

Monty Taylor 2 months ago
commit
754c66a53c
24 changed files with 2415 additions and 0 deletions
  1. 62
    0
      .gitignore
  2. 4
    0
      .gitreview
  3. 3
    0
      .mailmap
  4. 13
    0
      .zuul.yaml
  5. 675
    0
      COPYING
  6. 59
    0
      Makefile.am
  7. 23
    0
      README.rst
  8. 6
    0
      bindep.txt
  9. 17
    0
      bootstrap.sh
  10. 23
    0
      build.sh
  11. 112
    0
      configure.ac
  12. 66
    0
      m4/ax_assert.m4
  13. 61
    0
      m4/ax_debug.m4
  14. 313
    0
      m4/ax_pthread.m4
  15. 75
    0
      m4/ax_vcs_checkout.m4
  16. 60
    0
      m4/pandora_64bit.m4
  17. 23
    0
      m4/pandora_header_assert.m4
  18. 75
    0
      m4/pandora_optimize.m4
  19. 78
    0
      m4/pandora_vc_build.m4
  20. 447
    0
      m4/pandora_warnings.m4
  21. 77
    0
      m4/visibility.m4
  22. 91
    0
      m4/zuul_canonical.m4
  23. 13
    0
      playbooks/distcheck.yaml
  24. 39
    0
      zuul-preview/main.cc

+ 62
- 0
.gitignore View File

@@ -0,0 +1,62 @@
1
+*.py[cod]
2
+zuul-preview*.tar.gz
3
+
4
+# C extensions
5
+*.so
6
+
7
+# autotools
8
+Makefile
9
+config.h
10
+config.log
11
+config.status
12
+libtool
13
+stamp-h1
14
+Makefile.in
15
+aclocal.m4
16
+autom4te.cache/
17
+config.h.in
18
+config/
19
+configure
20
+m4/libtool.m4
21
+m4/ltoptions.m4
22
+m4/ltsugar.m4
23
+m4/ltversion.m4
24
+m4/lt~obsolete.m4
25
+.deps
26
+*.la
27
+*.lo
28
+*.o
29
+.dirstamp
30
+.libs
31
+
32
+# Packages
33
+*.egg
34
+*.egg-info
35
+dist
36
+build
37
+.eggs
38
+eggs
39
+parts
40
+bin
41
+var
42
+sdist
43
+develop-eggs
44
+.installed.cfg
45
+lib
46
+lib64
47
+
48
+# Translations
49
+*.mo
50
+
51
+# Mr Developer
52
+.mr.developer.cfg
53
+.project
54
+.pydevproject
55
+
56
+# Sphinx
57
+doc/build
58
+
59
+# Editors
60
+*~
61
+.*.swp
62
+.*sw?

+ 4
- 0
.gitreview View File

@@ -0,0 +1,4 @@
1
+[gerrit]
2
+host=review.openstack.org
3
+port=29418
4
+project=zuul/zuul-preview.git

+ 3
- 0
.mailmap View File

@@ -0,0 +1,3 @@
1
+# Format is:
2
+# <preferred e-mail> <other e-mail 1>
3
+# <preferred e-mail> <other e-mail 2>

+ 13
- 0
.zuul.yaml View File

@@ -0,0 +1,13 @@
1
+- job:
2
+    name: zuul-preview-distcheck
3
+    parent: unittests
4
+    description: |
5
+      Run make distcheck on zuul-preview
6
+
7
+- project:
8
+    check:
9
+      jobs:
10
+        - zuul-preview-distcheck
11
+    gate:
12
+      jobs:
13
+        - zuul-preview-distcheck

+ 675
- 0
COPYING View File

@@ -0,0 +1,675 @@
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
11
+software and other kinds of works.
12
+
13
+  The licenses for most software and other practical works are designed
14
+to take away your freedom to share and change the works.  By contrast,
15
+the GNU General Public License is intended to guarantee your freedom to
16
+share and change all versions of a program--to make sure it remains free
17
+software for all its users.  We, the Free Software Foundation, use the
18
+GNU General Public License for most of our software; it applies also to
19
+any other work released this way by its authors.  You can apply it to
20
+your programs, too.
21
+
22
+  When we speak of free software, we are referring to freedom, not
23
+price.  Our General Public Licenses are designed to make sure that you
24
+have the freedom to distribute copies of free software (and charge for
25
+them if you wish), that you receive source code or can get it if you
26
+want it, that you can change the software or use pieces of it in new
27
+free programs, and that you know you can do these things.
28
+
29
+  To protect your rights, we need to prevent others from denying you
30
+these rights or asking you to surrender the rights.  Therefore, you have
31
+certain responsibilities if you distribute copies of the software, or if
32
+you modify it: responsibilities to respect the freedom of others.
33
+
34
+  For example, if you distribute copies of such a program, whether
35
+gratis or for a fee, you must pass on to the recipients the same
36
+freedoms that you received.  You must make sure that they, too, receive
37
+or can get the source code.  And you must show them these terms so they
38
+know 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
42
+giving you legal permission to copy, distribute and/or modify it.
43
+
44
+  For the developers' and authors' protection, the GPL clearly explains
45
+that there is no warranty for this free software.  For both users' and
46
+authors' sake, the GPL requires that modified versions be marked as
47
+changed, so that their problems will not be attributed erroneously to
48
+authors of previous versions.
49
+
50
+  Some devices are designed to deny users access to install or run
51
+modified versions of the software inside them, although the manufacturer
52
+can do so.  This is fundamentally incompatible with the aim of
53
+protecting users' freedom to change the software.  The systematic
54
+pattern of such abuse occurs in the area of products for individuals to
55
+use, which is precisely where it is most unacceptable.  Therefore, we
56
+have designed this version of the GPL to prohibit the practice for those
57
+products.  If such problems arise substantially in other domains, we
58
+stand ready to extend this provision to those domains in future versions
59
+of the GPL, as needed to protect the freedom of users.
60
+
61
+  Finally, every program is threatened constantly by software patents.
62
+States should not allow patents to restrict development and use of
63
+software on general-purpose computers, but in those that do, we wish to
64
+avoid the special danger that patents applied to a free program could
65
+make it effectively proprietary.  To prevent this, the GPL assures that
66
+patents cannot be used to render the program non-free.
67
+
68
+  The precise terms and conditions for copying, distribution and
69
+modification 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
78
+works, such as semiconductor masks.
79
+
80
+  "The Program" refers to any copyrightable work licensed under this
81
+License.  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
85
+in a fashion requiring copyright permission, other than the making of an
86
+exact copy.  The resulting work is called a "modified version" of the
87
+earlier work or a work "based on" the earlier work.
88
+
89
+  A "covered work" means either the unmodified Program or a work based
90
+on the Program.
91
+
92
+  To "propagate" a work means to do anything with it that, without
93
+permission, would make you directly or secondarily liable for
94
+infringement under applicable copyright law, except executing it on a
95
+computer or modifying a private copy.  Propagation includes copying,
96
+distribution (with or without modification), making available to the
97
+public, and in some countries other activities as well.
98
+
99
+  To "convey" a work means any kind of propagation that enables other
100
+parties to make or receive copies.  Mere interaction with a user through
101
+a computer network, with no transfer of a copy, is not conveying.
102
+
103
+  An interactive user interface displays "Appropriate Legal Notices"
104
+to the extent that it includes a convenient and prominently visible
105
+feature that (1) displays an appropriate copyright notice, and (2)
106
+tells the user that there is no warranty for the work (except to the
107
+extent that warranties are provided), that licensees may convey the
108
+work under this License, and how to view a copy of this License.  If
109
+the interface presents a list of user commands or options, such as a
110
+menu, 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
115
+for making modifications to it.  "Object code" means any non-source
116
+form of a work.
117
+
118
+  A "Standard Interface" means an interface that either is an official
119
+standard defined by a recognized standards body, or, in the case of
120
+interfaces specified for a particular programming language, one that
121
+is widely used among developers working in that language.
122
+
123
+  The "System Libraries" of an executable work include anything, other
124
+than the work as a whole, that (a) is included in the normal form of
125
+packaging a Major Component, but which is not part of that Major
126
+Component, and (b) serves only to enable use of the work with that
127
+Major Component, or to implement a Standard Interface for which an
128
+implementation 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
132
+produce 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
135
+the source code needed to generate, install, and (for an executable
136
+work) run the object code and to modify the work, including scripts to
137
+control those activities.  However, it does not include the work's
138
+System Libraries, or general-purpose tools or generally available free
139
+programs which are used unmodified in performing those activities but
140
+which are not part of the work.  For example, Corresponding Source
141
+includes interface definition files associated with source files for
142
+the work, and the source code for shared libraries and dynamically
143
+linked subprograms that the work is specifically designed to require,
144
+such as by intimate data communication or control flow between those
145
+subprograms and other parts of the work.
146
+
147
+  The Corresponding Source need not include anything that users
148
+can regenerate automatically from other parts of the Corresponding
149
+Source.
150
+
151
+  The Corresponding Source for a work in source code form is that
152
+same work.
153
+
154
+  2. Basic Permissions.
155
+
156
+  All rights granted under this License are granted for the term of
157
+copyright on the Program, and are irrevocable provided the stated
158
+conditions are met.  This License explicitly affirms your unlimited
159
+permission to run the unmodified Program.  The output from running a
160
+covered work is covered by this License only if the output, given its
161
+content, constitutes a covered work.  This License acknowledges your
162
+rights 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
165
+convey, without conditions so long as your license otherwise remains
166
+in force.  You may convey covered works to others for the sole purpose
167
+of having them make modifications exclusively for you, or provide you
168
+with facilities for running those works, provided that you comply with
169
+the terms of this License in conveying all material for which you do
170
+not control copyright.  Those thus making or running the covered works
171
+for you must do so exclusively on your behalf, under your direction
172
+and control, on terms that prohibit them from making any copies of
173
+your copyrighted material outside their relationship with you.
174
+
175
+  Conveying under any other circumstances is permitted solely under
176
+the conditions stated below.  Sublicensing is not allowed; section 10
177
+makes 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
182
+measure under any applicable law fulfilling obligations under article
183
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+similar laws prohibiting or restricting circumvention of such
185
+measures.
186
+
187
+  When you convey a covered work, you waive any legal power to forbid
188
+circumvention of technological measures to the extent such circumvention
189
+is effected by exercising rights under this License with respect to
190
+the covered work, and you disclaim any intention to limit operation or
191
+modification of the work as a means of enforcing, against the work's
192
+users, your or third parties' legal rights to forbid circumvention of
193
+technological measures.
194
+
195
+  4. Conveying Verbatim Copies.
196
+
197
+  You may convey verbatim copies of the Program's source code as you
198
+receive it, in any medium, provided that you conspicuously and
199
+appropriately publish on each copy an appropriate copyright notice;
200
+keep intact all notices stating that this License and any
201
+non-permissive terms added in accord with section 7 apply to the code;
202
+keep intact all notices of the absence of any warranty; and give all
203
+recipients 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,
206
+and 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
211
+produce it from the Program, in the form of source code under the
212
+terms 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
236
+works, which are not by their nature extensions of the covered work,
237
+and which are not combined with it such as to form a larger program,
238
+in or on a volume of a storage or distribution medium, is called an
239
+"aggregate" if the compilation and its resulting copyright are not
240
+used to limit the access or legal rights of the compilation's users
241
+beyond what the individual works permit.  Inclusion of a covered work
242
+in an aggregate does not cause this License to apply to the other
243
+parts 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
248
+of sections 4 and 5, provided that you also convey the
249
+machine-readable Corresponding Source under the terms of this License,
250
+in 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
294
+from the Corresponding Source as a System Library, need not be
295
+included in conveying the object code work.
296
+
297
+  A "User Product" is either (1) a "consumer product", which means any
298
+tangible personal property which is normally used for personal, family,
299
+or household purposes, or (2) anything designed or sold for incorporation
300
+into a dwelling.  In determining whether a product is a consumer product,
301
+doubtful cases shall be resolved in favor of coverage.  For a particular
302
+product received by a particular user, "normally used" refers to a
303
+typical or common use of that class of product, regardless of the status
304
+of the particular user or of the way in which the particular user
305
+actually uses, or expects or is expected to use, the product.  A product
306
+is a consumer product regardless of whether the product has substantial
307
+commercial, industrial or non-consumer uses, unless such uses represent
308
+the only significant mode of use of the product.
309
+
310
+  "Installation Information" for a User Product means any methods,
311
+procedures, authorization keys, or other information required to install
312
+and execute modified versions of a covered work in that User Product from
313
+a modified version of its Corresponding Source.  The information must
314
+suffice to ensure that the continued functioning of the modified object
315
+code is in no case prevented or interfered with solely because
316
+modification has been made.
317
+
318
+  If you convey an object code work under this section in, or with, or
319
+specifically for use in, a User Product, and the conveying occurs as
320
+part of a transaction in which the right of possession and use of the
321
+User Product is transferred to the recipient in perpetuity or for a
322
+fixed term (regardless of how the transaction is characterized), the
323
+Corresponding Source conveyed under this section must be accompanied
324
+by the Installation Information.  But this requirement does not apply
325
+if neither you nor any third party retains the ability to install
326
+modified object code on the User Product (for example, the work has
327
+been installed in ROM).
328
+
329
+  The requirement to provide Installation Information does not include a
330
+requirement to continue to provide support service, warranty, or updates
331
+for a work that has been modified or installed by the recipient, or for
332
+the User Product in which it has been modified or installed.  Access to a
333
+network may be denied when the modification itself materially and
334
+adversely affects the operation of the network or violates the rules and
335
+protocols for communication across the network.
336
+
337
+  Corresponding Source conveyed, and Installation Information provided,
338
+in accord with this section must be in a format that is publicly
339
+documented (and with an implementation available to the public in
340
+source code form), and must require no special password or key for
341
+unpacking, reading or copying.
342
+
343
+  7. Additional Terms.
344
+
345
+  "Additional permissions" are terms that supplement the terms of this
346
+License by making exceptions from one or more of its conditions.
347
+Additional permissions that are applicable to the entire Program shall
348
+be treated as though they were included in this License, to the extent
349
+that they are valid under applicable law.  If additional permissions
350
+apply only to part of the Program, that part may be used separately
351
+under those permissions, but the entire Program remains governed by
352
+this License without regard to the additional permissions.
353
+
354
+  When you convey a copy of a covered work, you may at your option
355
+remove any additional permissions from that copy, or from any part of
356
+it.  (Additional permissions may be written to require their own
357
+removal in certain cases when you modify the work.)  You may place
358
+additional permissions on material, added by you to a covered work,
359
+for which you have or can give appropriate copyright permission.
360
+
361
+  Notwithstanding any other provision of this License, for material you
362
+add to a covered work, you may (if authorized by the copyright holders of
363
+that 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
389
+restrictions" within the meaning of section 10.  If the Program as you
390
+received it, or any part of it, contains a notice stating that it is
391
+governed by this License along with a term that is a further
392
+restriction, you may remove that term.  If a license document contains
393
+a further restriction but permits relicensing or conveying under this
394
+License, you may add to a covered work material governed by the terms
395
+of that license document, provided that the further restriction does
396
+not survive such relicensing or conveying.
397
+
398
+  If you add terms to a covered work in accord with this section, you
399
+must place, in the relevant source files, a statement of the
400
+additional terms that apply to those files, or a notice indicating
401
+where to find the applicable terms.
402
+
403
+  Additional terms, permissive or non-permissive, may be stated in the
404
+form of a separately written license, or stated as exceptions;
405
+the above requirements apply either way.
406
+
407
+  8. Termination.
408
+
409
+  You may not propagate or modify a covered work except as expressly
410
+provided under this License.  Any attempt otherwise to propagate or
411
+modify it is void, and will automatically terminate your rights under
412
+this License (including any patent licenses granted under the third
413
+paragraph of section 11).
414
+
415
+  However, if you cease all violation of this License, then your
416
+license from a particular copyright holder is reinstated (a)
417
+provisionally, unless and until the copyright holder explicitly and
418
+finally terminates your license, and (b) permanently, if the copyright
419
+holder fails to notify you of the violation by some reasonable means
420
+prior to 60 days after the cessation.
421
+
422
+  Moreover, your license from a particular copyright holder is
423
+reinstated permanently if the copyright holder notifies you of the
424
+violation by some reasonable means, this is the first time you have
425
+received notice of violation of this License (for any work) from that
426
+copyright holder, and you cure the violation prior to 30 days after
427
+your receipt of the notice.
428
+
429
+  Termination of your rights under this section does not terminate the
430
+licenses of parties who have received copies or rights from you under
431
+this License.  If your rights have been terminated and not permanently
432
+reinstated, you do not qualify to receive new licenses for the same
433
+material 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
438
+run a copy of the Program.  Ancillary propagation of a covered work
439
+occurring solely as a consequence of using peer-to-peer transmission
440
+to receive a copy likewise does not require acceptance.  However,
441
+nothing other than this License grants you permission to propagate or
442
+modify any covered work.  These actions infringe copyright if you do
443
+not accept this License.  Therefore, by modifying or propagating a
444
+covered 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
449
+receives a license from the original licensors, to run, modify and
450
+propagate that work, subject to this License.  You are not responsible
451
+for enforcing compliance by third parties with this License.
452
+
453
+  An "entity transaction" is a transaction transferring control of an
454
+organization, or substantially all assets of one, or subdividing an
455
+organization, or merging organizations.  If propagation of a covered
456
+work results from an entity transaction, each party to that
457
+transaction who receives a copy of the work also receives whatever
458
+licenses to the work the party's predecessor in interest had or could
459
+give under the previous paragraph, plus a right to possession of the
460
+Corresponding Source of the work from the predecessor in interest, if
461
+the predecessor has it or can get it with reasonable efforts.
462
+
463
+  You may not impose any further restrictions on the exercise of the
464
+rights granted or affirmed under this License.  For example, you may
465
+not impose a license fee, royalty, or other charge for exercise of
466
+rights granted under this License, and you may not initiate litigation
467
+(including a cross-claim or counterclaim in a lawsuit) alleging that
468
+any patent claim is infringed by making, using, selling, offering for
469
+sale, 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
474
+License of the Program or a work on which the Program is based.  The
475
+work thus licensed is called the contributor's "contributor version".
476
+
477
+  A contributor's "essential patent claims" are all patent claims
478
+owned or controlled by the contributor, whether already acquired or
479
+hereafter acquired, that would be infringed by some manner, permitted
480
+by this License, of making, using, or selling its contributor version,
481
+but do not include claims that would be infringed only as a
482
+consequence of further modification of the contributor version.  For
483
+purposes of this definition, "control" includes the right to grant
484
+patent sublicenses in a manner consistent with the requirements of
485
+this License.
486
+
487
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+patent license under the contributor's essential patent claims, to
489
+make, use, sell, offer for sale, import and otherwise run, modify and
490
+propagate the contents of its contributor version.
491
+
492
+  In the following three paragraphs, a "patent license" is any express
493
+agreement or commitment, however denominated, not to enforce a patent
494
+(such as an express permission to practice a patent or covenant not to
495
+sue for patent infringement).  To "grant" such a patent license to a
496
+party means to make such an agreement or commitment not to enforce a
497
+patent against the party.
498
+
499
+  If you convey a covered work, knowingly relying on a patent license,
500
+and the Corresponding Source of the work is not available for anyone
501
+to copy, free of charge and under the terms of this License, through a
502
+publicly available network server or other readily accessible means,
503
+then you must either (1) cause the Corresponding Source to be so
504
+available, or (2) arrange to deprive yourself of the benefit of the
505
+patent license for this particular work, or (3) arrange, in a manner
506
+consistent with the requirements of this License, to extend the patent
507
+license to downstream recipients.  "Knowingly relying" means you have
508
+actual knowledge that, but for the patent license, your conveying the
509
+covered work in a country, or your recipient's use of the covered work
510
+in a country, would infringe one or more identifiable patents in that
511
+country that you have reason to believe are valid.
512
+
513
+  If, pursuant to or in connection with a single transaction or
514
+arrangement, you convey, or propagate by procuring conveyance of, a
515
+covered work, and grant a patent license to some of the parties
516
+receiving the covered work authorizing them to use, propagate, modify
517
+or convey a specific copy of the covered work, then the patent license
518
+you grant is automatically extended to all recipients of the covered
519
+work and works based on it.
520
+
521
+  A patent license is "discriminatory" if it does not include within
522
+the scope of its coverage, prohibits the exercise of, or is
523
+conditioned on the non-exercise of one or more of the rights that are
524
+specifically granted under this License.  You may not convey a covered
525
+work if you are a party to an arrangement with a third party that is
526
+in the business of distributing software, under which you make payment
527
+to the third party based on the extent of your activity of conveying
528
+the work, and under which the third party grants, to any of the
529
+parties who would receive the covered work from you, a discriminatory
530
+patent license (a) in connection with copies of the covered work
531
+conveyed by you (or copies made from those copies), or (b) primarily
532
+for and in connection with specific products or compilations that
533
+contain the covered work, unless you entered into that arrangement,
534
+or that patent license was granted, prior to 28 March 2007.
535
+
536
+  Nothing in this License shall be construed as excluding or limiting
537
+any implied license or other defenses to infringement that may
538
+otherwise 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
543
+otherwise) that contradict the conditions of this License, they do not
544
+excuse you from the conditions of this License.  If you cannot convey a
545
+covered work so as to satisfy simultaneously your obligations under this
546
+License and any other pertinent obligations, then as a consequence you may
547
+not convey it at all.  For example, if you agree to terms that obligate you
548
+to collect a royalty for further conveying from those to whom you convey
549
+the Program, the only way you could satisfy both those terms and this
550
+License 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
555
+permission to link or combine any covered work with a work licensed
556
+under version 3 of the GNU Affero General Public License into a single
557
+combined work, and to convey the resulting work.  The terms of this
558
+License will continue to apply to the part which is the covered work,
559
+but the special requirements of the GNU Affero General Public License,
560
+section 13, concerning interaction through a network will apply to the
561
+combination as such.
562
+
563
+  14. Revised Versions of this License.
564
+
565
+  The Free Software Foundation may publish revised and/or new versions of
566
+the GNU General Public License from time to time.  Such new versions will
567
+be similar in spirit to the present version, but may differ in detail to
568
+address new problems or concerns.
569
+
570
+  Each version is given a distinguishing version number.  If the
571
+Program specifies that a certain numbered version of the GNU General
572
+Public License "or any later version" applies to it, you have the
573
+option of following the terms and conditions either of that numbered
574
+version or of any later version published by the Free Software
575
+Foundation.  If the Program does not specify a version number of the
576
+GNU General Public License, you may choose any version ever published
577
+by the Free Software Foundation.
578
+
579
+  If the Program specifies that a proxy can decide which future
580
+versions of the GNU General Public License can be used, that proxy's
581
+public statement of acceptance of a version permanently authorizes you
582
+to choose that version for the Program.
583
+
584
+  Later license versions may give you additional or different
585
+permissions.  However, no additional obligations are imposed on any
586
+author or copyright holder as a result of your choosing to follow a
587
+later version.
588
+
589
+  15. Disclaimer of Warranty.
590
+
591
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ALL 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
603
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+SUCH DAMAGES.
611
+
612
+  17. Interpretation of Sections 15 and 16.
613
+
614
+  If the disclaimer of warranty and limitation of liability provided
615
+above cannot be given local legal effect according to their terms,
616
+reviewing courts shall apply local law that most closely approximates
617
+an absolute waiver of all civil liability in connection with the
618
+Program, unless a warranty or assumption of liability accompanies a
619
+copy 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
626
+possible use to the public, the best way to achieve this is to make it
627
+free 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
630
+to attach them to the start of each source file to most effectively
631
+state the exclusion of warranty; and each file should have at least
632
+the "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
+
650
+Also 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
653
+notice 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
+
660
+The hypothetical commands `show w' and `show c' should show the appropriate
661
+parts of the General Public License.  Of course, your program's commands
662
+might 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,
665
+if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+For 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
670
+into proprietary programs.  If your program is a subroutine library, you
671
+may consider it more useful to permit linking proprietary applications with
672
+the library.  If this is what you want to do, use the GNU Lesser General
673
+Public License instead of this License.  But first, please read
674
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
675
+

+ 59
- 0
Makefile.am View File

@@ -0,0 +1,59 @@
1
+# Copyright (c) 2016 Red Hat, Inc.
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License");
4
+# you may not use this file except in compliance with the License.
5
+# You may obtain a copy of the License at
6
+#
7
+#    http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS,
11
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
+# implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+ACLOCAL_AMFLAGS = -I m4
17
+
18
+SUFFIXES =
19
+
20
+SUBDIRS= .
21
+
22
+DIST_SUBDIRS = ${SUBDIRS}
23
+
24
+EXTRA_DIST= \
25
+	    config/pandora_vc_revinfo \
26
+	    ${top_srcdir}/m4/*m4
27
+
28
+DISTCLEANFILES=		config/top.h
29
+
30
+MAINTAINERCLEANFILES=
31
+MAINTAINERCLEANFILES+= autom4te.cache
32
+
33
+maintainer-clean-local:
34
+	find . -type f -name '*~' -exec rm -f '{}' \;
35
+	-rm -rf @PACKAGE@-*.rpm
36
+	-rm -rf @PACKAGE@-*.tar.gz
37
+	-rm -r -f autom4te.cache
38
+	-rm -f Makefile.in
39
+	-rm -f aclocal.m4
40
+	-rm -f config/config.guess
41
+	-rm -f config/config.sub
42
+	-rm -f config/depcomp
43
+	-rm -f config/install-sh
44
+	-rm -f config/ltmain.sh
45
+	-rm -f config/missing
46
+	-rm -f config.in
47
+	-rm -f config.log
48
+	-rm -f config.status
49
+	-rm -f configure
50
+	-rm -f m4/libtool.m4
51
+	-rm -f m4/ltoptions.m4
52
+	-rm -f m4/ltsugar.m4
53
+	-rm -f m4/ltversion.m4
54
+	-rm -f m4/lt~obsolete.m4
55
+
56
+
57
+bin_PROGRAMS = zuul-preview/zuul-preview
58
+zuul_preview_zuul_preview_SOURCES = \
59
+	zuul-preview/main.cc

+ 23
- 0
README.rst View File

@@ -0,0 +1,23 @@
1
+============
2
+zuul-preview
3
+============
4
+
5
+A preview proxy server for zuul.
6
+
7
+Building
8
+--------
9
+
10
+First you need some dependencies:
11
+
12
+.. code-block:: bash
13
+
14
+  python3 -m pip install bindep
15
+  apt-get install $(bindep -b compile)
16
+
17
+Then you can build the code:
18
+
19
+.. code-block:: bash
20
+
21
+  autoreconf -fi
22
+  ./configure
23
+  make

+ 6
- 0
bindep.txt View File

@@ -0,0 +1,6 @@
1
+pkg-config [compile test]
2
+build-essential [compile test]
3
+autoconf [compile test]
4
+automake [compile test]
5
+libtool [compile test]
6
+nlohmann-json-dev [compile test]

+ 17
- 0
bootstrap.sh View File

@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+# Copyright (c) 2017 Red Hat, Inc.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#    http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+# implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
17
+autoreconf -fi

+ 23
- 0
build.sh View File

@@ -0,0 +1,23 @@
1
+#!/bin/sh
2
+# Copyright (c) 2016 Red Hat, Inc.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#    http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+# implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
17
+if [ ! -f configure ]; then
18
+  autoreconf -fi
19
+fi
20
+if [ ! -f Makefile ]; then
21
+  ./configure
22
+fi
23
+make

+ 112
- 0
configure.ac View File

@@ -0,0 +1,112 @@
1
+dnl -*- bash -*-
2
+dnl Process this file with autoconf to produce a configure script.
3
+
4
+dnl Copyright (C) 2009 Sun Microsystems, Inc.
5
+dnl
6
+dnl This program is free software; you can redistribute it and/or modify
7
+dnl it under the terms of the GNU General Public License as published by
8
+dnl the Free Software Foundation; version 2 of the License.
9
+dnl
10
+dnl This program is distributed in the hope that it will be useful,
11
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
+dnl GNU General Public License for more details.
14
+dnl
15
+dnl You should have received a copy of the GNU General Public License
16
+dnl along with this program; if not, write to the Free Software
17
+dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
+
19
+
20
+AC_INIT(
21
+  [zuul_preview],
22
+  [1.0],
23
+  [http://storyboard.openstack.org],
24
+  [zuul-preview],
25
+  [http://zuul-ci.org/])
26
+
27
+AC_CONFIG_AUX_DIR([config])
28
+
29
+AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar])
30
+AC_PREREQ(2.59)dnl		Minimum Autoconf version required.
31
+
32
+AC_CANONICAL_HOST
33
+AC_CANONICAL_BUILD
34
+AC_ARG_PROGRAM
35
+AC_USE_SYSTEM_EXTENSIONS
36
+
37
+AC_CONFIG_MACRO_DIR([m4])
38
+
39
+AC_CONFIG_HEADERS([config.h])
40
+
41
+AC_CONFIG_SRCDIR([zuul-preview/main.cc])
42
+
43
+ZUUL_CANONICAL_TARGET([require-cxx, version-from-vc]) 
44
+
45
+LT_PREREQ([2.4])
46
+LT_INIT
47
+LT_LANG([C++])
48
+
49
+
50
+gl_VISIBILITY
51
+AX_ASSERT
52
+
53
+
54
+AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[
55
+
56
+  AC_ARG_WITH([comment],
57
+    [AS_HELP_STRING([--with-comment],
58
+      [Comment about compilation environment. @<:@default=off@:>@])],
59
+    [with_comment=$withval],
60
+    [with_comment=no])
61
+  AS_IF([test "$with_comment" != "no"],[
62
+    COMPILATION_COMMENT=$with_comment
63
+    ],[
64
+    COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
65
+    ])
66
+  AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
67
+    [Comment about compilation environment])
68
+])
69
+
70
+AX_PTHREAD([
71
+  AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
72
+  AM_LDFLAGS="${PTHREAD_LIBS} ${AM_LDFLAGS}"
73
+  LIBS="${PTHREAD_LIBS} ${LIBS}"
74
+  ], [AC_MSG_ERROR([zuul-preview requires pthreads])])
75
+
76
+#########################################################################
77
+
78
+AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
79
+  LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
80
+  ])
81
+
82
+AM_CXXFLAGS="-std=c++14 $AM_CXXFLAGS"
83
+
84
+AC_CONFIG_FILES([Makefile])
85
+
86
+AC_OUTPUT
87
+
88
+echo "---"
89
+echo "Configuration summary for $PACKAGE_NAME version $VERSION"
90
+echo ""
91
+echo "   * Installation prefix:       $prefix"
92
+echo "   * System type:               $host_vendor-$host_os"
93
+echo "   * Host CPU:                  $host_cpu"
94
+echo "   * C++ Compiler:              $CXX_VERSION"
95
+echo "   * C++ Flags:                 $CXXFLAGS"
96
+echo "   * C++ AM Flags:              $AM_CXXFLAGS"
97
+echo "   * CPP Flags:                 $CPPFLAGS"
98
+echo "   * CPP AM Flags:              $AM_CPPFLAGS"
99
+echo "   * Assertions enabled:        $ac_cv_assert"
100
+echo "   * Debug enabled:             $with_debug"
101
+echo "   * Profiling enabled:         $ac_profiling"
102
+echo "   * Coverage enabled:          $ac_coverage"
103
+echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
104
+echo ""
105
+echo "---"
106
+
107
+dnl libtoolize scans configure.ac  and needs to see some text
108
+m4_define([LIBTOOLIZE_AC_INIT], [])
109
+m4_define([UNUSED_MACRO], [
110
+  LT_INIT
111
+  AC_CONFIG_MACRO_DIR([m4])
112
+])

+ 66
- 0
m4/ax_assert.m4 View File

@@ -0,0 +1,66 @@
1
+# ===========================================================================
2
+#      https://github.com/BrianAker/ddm4/
3
+# ===========================================================================
4
+#
5
+# SYNOPSIS
6
+#
7
+#   AX_ASSERT()
8
+#
9
+# DESCRIPTION
10
+#
11
+#   --enable-assert
12
+#
13
+# LICENSE
14
+#
15
+#  Copyright (C) 2012 Brian Aker
16
+#  All rights reserved.
17
+#  
18
+#  Redistribution and use in source and binary forms, with or without
19
+#  modification, are permitted provided that the following conditions are
20
+#  met:
21
+#  
22
+#      * Redistributions of source code must retain the above copyright
23
+#  notice, this list of conditions and the following disclaimer.
24
+#  
25
+#      * Redistributions in binary form must reproduce the above
26
+#  copyright notice, this list of conditions and the following disclaimer
27
+#  in the documentation and/or other materials provided with the
28
+#  distribution.
29
+#  
30
+#      * The names of its contributors may not be used to endorse or
31
+#  promote products derived from this software without specific prior
32
+#  written permission.
33
+#  
34
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45
+
46
+#serial 6
47
+
48
+AC_DEFUN([AX_ASSERT],
49
+    [AC_PREREQ([2.63])dnl
50
+    AC_REQUIRE([AX_DEBUG])
51
+    AC_REQUIRE([AX_VCS_CHECKOUT])
52
+    AC_ARG_ENABLE([assert],
53
+      [AS_HELP_STRING([--enable-assert],
54
+        [Enable assert, this will be overridden by --enable-debug (yes|no) @<:@default=no@:>@])],
55
+      [ax_enable_assert=yes],
56
+      [ax_enable_assert=no])
57
+
58
+    AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" -o "$ac_cv_vcs_checkout" = "yes" ],
59
+      [ax_enable_assert="yes"],
60
+      [ax_enable_assert="no"
61
+      AC_DEFINE(NDEBUG,[1],[Define to 1 to disable assert'ing code.])])
62
+
63
+    AC_MSG_CHECKING([for assert])
64
+    AC_MSG_RESULT([$ax_enable_assert])
65
+    ])
66
+

+ 61
- 0
m4/ax_debug.m4 View File

@@ -0,0 +1,61 @@
1
+# ===========================================================================
2
+#      https://github.com/BrianAker/ddm4/
3
+# ===========================================================================
4
+#
5
+# SYNOPSIS
6
+#
7
+#   AX_DEBUG()
8
+#
9
+# DESCRIPTION
10
+#
11
+#   --enable-debug
12
+#
13
+# LICENSE
14
+#
15
+#  Copyright (C) 2012 Brian Aker
16
+#  All rights reserved.
17
+#  
18
+#  Redistribution and use in source and binary forms, with or without
19
+#  modification, are permitted provided that the following conditions are
20
+#  met:
21
+#  
22
+#      * Redistributions of source code must retain the above copyright
23
+#  notice, this list of conditions and the following disclaimer.
24
+#  
25
+#      * Redistributions in binary form must reproduce the above
26
+#  copyright notice, this list of conditions and the following disclaimer
27
+#  in the documentation and/or other materials provided with the
28
+#  distribution.
29
+#  
30
+#      * The names of its contributors may not be used to endorse or
31
+#  promote products derived from this software without specific prior
32
+#  written permission.
33
+#  
34
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45
+
46
+#serial 5
47
+
48
+AC_DEFUN([AX_DEBUG],
49
+    [AC_PREREQ([2.63])dnl
50
+    AC_ARG_ENABLE([debug],
51
+      [AS_HELP_STRING([--enable-debug],
52
+        [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
53
+      [ax_enable_debug=yes
54
+      AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])],
55
+      [ax_enable_debug=no
56
+      AC_SUBST([MCHECK])
57
+      AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
58
+
59
+    AC_MSG_CHECKING([for debug])
60
+    AC_MSG_RESULT([$ax_enable_debug])
61
+    AM_CONDITIONAL([DEBUG],[test "x${ax_enable_debug}" = "xyes"])])

+ 313
- 0
m4/ax_pthread.m4 View File

@@ -0,0 +1,313 @@
1
+# ===========================================================================
2
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
3
+# ===========================================================================
4
+#
5
+# SYNOPSIS
6
+#
7
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
8
+#
9
+# DESCRIPTION
10
+#
11
+#   This macro figures out how to build C programs using POSIX threads. It
12
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
13
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
14
+#   flags that are needed. (The user can also force certain compiler
15
+#   flags/libs to be tested by setting these environment variables.)
16
+#
17
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
18
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
19
+#   is necessary on AIX to use the special cc_r compiler alias.)
20
+#
21
+#   NOTE: You are assumed to not only compile your program with these flags,
22
+#   but also link it with them as well. e.g. you should link with
23
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
24
+#
25
+#   If you are only building threads programs, you may wish to use these
26
+#   variables in your default LIBS, CFLAGS, and CC:
27
+#
28
+#     LIBS="$PTHREAD_LIBS $LIBS"
29
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
30
+#     CC="$PTHREAD_CC"
31
+#
32
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
33
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
34
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
35
+#
36
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
37
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
38
+#   PTHREAD_CFLAGS.
39
+#
40
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
41
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
42
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
43
+#   will define HAVE_PTHREAD.
44
+#
45
+#   Please let the authors know if this macro fails on any platform, or if
46
+#   you have any other suggestions or comments. This macro was based on work
47
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
48
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
49
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
50
+#   grateful for the helpful feedback of numerous users.
51
+#
52
+#   Updated for Autoconf 2.68 by Daniel Richard G.
53
+#
54
+# LICENSE
55
+#
56
+#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
57
+#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
58
+#
59
+#   This program is free software: you can redistribute it and/or modify it
60
+#   under the terms of the GNU General Public License as published by the
61
+#   Free Software Foundation, either version 3 of the License, or (at your
62
+#   option) any later version.
63
+#
64
+#   This program is distributed in the hope that it will be useful, but
65
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
66
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
67
+#   Public License for more details.
68
+#
69
+#   You should have received a copy of the GNU General Public License along
70
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
71
+#
72
+#   As a special exception, the respective Autoconf Macro's copyright owner
73
+#   gives unlimited permission to copy, distribute and modify the configure
74
+#   scripts that are the output of Autoconf when processing the Macro. You
75
+#   need not follow the terms of the GNU General Public License when using
76
+#   or distributing such scripts, even though portions of the text of the
77
+#   Macro appear in them. The GNU General Public License (GPL) does govern
78
+#   all other use of the material that constitutes the Autoconf Macro.
79
+#
80
+#   This special exception to the GPL applies to versions of the Autoconf
81
+#   Macro released by the Autoconf Archive. When you make and distribute a
82
+#   modified version of the Autoconf Macro, you may extend this special
83
+#   exception to the GPL to apply to your modified version as well.
84
+
85
+#serial 19
86
+
87
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
88
+AC_DEFUN([AX_PTHREAD], [
89
+AC_REQUIRE([AC_CANONICAL_HOST])
90
+AC_LANG_PUSH([C])
91
+ax_pthread_ok=no
92
+
93
+# We used to check for pthread.h first, but this fails if pthread.h
94
+# requires special compiler flags (e.g. on True64 or Sequent).
95
+# It gets checked for in the link test anyway.
96
+
97
+# First of all, check if the user has set any of the PTHREAD_LIBS,
98
+# etcetera environment variables, and if threads linking works using
99
+# them:
100
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
101
+        save_CFLAGS="$CFLAGS"
102
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
103
+        save_LIBS="$LIBS"
104
+        LIBS="$PTHREAD_LIBS $LIBS"
105
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
106
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
107
+        AC_MSG_RESULT($ax_pthread_ok)
108
+        if test x"$ax_pthread_ok" = xno; then
109
+                PTHREAD_LIBS=""
110
+                PTHREAD_CFLAGS=""
111
+        fi
112
+        LIBS="$save_LIBS"
113
+        CFLAGS="$save_CFLAGS"
114
+fi
115
+
116
+# We must check for the threads library under a number of different
117
+# names; the ordering is very important because some systems
118
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
119
+# libraries is broken (non-POSIX).
120
+
121
+# Create a list of thread flags to try.  Items starting with a "-" are
122
+# C compiler flags, and other items are library names, except for "none"
123
+# which indicates that we try without any flags at all, and "pthread-config"
124
+# which is a program returning the flags for the Pth emulation library.
125
+
126
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
127
+
128
+# The ordering *is* (sometimes) important.  Some notes on the
129
+# individual items follow:
130
+
131
+# pthreads: AIX (must check this before -lpthread)
132
+# none: in case threads are in libc; should be tried before -Kthread and
133
+#       other compiler flags to prevent continual compiler warnings
134
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
135
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
136
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
137
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
138
+# -pthreads: Solaris/gcc
139
+# -mthreads: Mingw32/gcc, Lynx/gcc
140
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
141
+#      doesn't hurt to check since this sometimes defines pthreads too;
142
+#      also defines -D_REENTRANT)
143
+#      ... -mt is also the pthreads flag for HP/aCC
144
+# pthread: Linux, etcetera
145
+# --thread-safe: KAI C++
146
+# pthread-config: use pthread-config program (for GNU Pth library)
147
+
148
+case ${host_os} in
149
+        solaris*)
150
+
151
+        # On Solaris (at least, for some versions), libc contains stubbed
152
+        # (non-functional) versions of the pthreads routines, so link-based
153
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
154
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
155
+        # a function called by this macro, so we could check for that, but
156
+        # who knows whether they'll stub that too in a future libc.)  So,
157
+        # we'll just look for -pthreads and -lpthread first:
158
+
159
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
160
+        ;;
161
+
162
+        darwin12*)
163
+        ax_pthread_flags="$ax_pthread_flags"
164
+        ;;
165
+
166
+        darwin*)
167
+        ax_pthread_flags="-pthread $ax_pthread_flags"
168
+        ;;
169
+esac
170
+
171
+if test x"$ax_pthread_ok" = xno; then
172
+for flag in $ax_pthread_flags; do
173
+
174
+        case $flag in
175
+                none)
176
+                AC_MSG_CHECKING([whether pthreads work without any flags])
177
+                ;;
178
+
179
+                -*)
180
+                AC_MSG_CHECKING([whether pthreads work with $flag])
181
+                PTHREAD_CFLAGS="$flag"
182
+                ;;
183
+
184
+                pthread-config)
185
+                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
186
+                if test x"$ax_pthread_config" = xno; then continue; fi
187
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
188
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
189
+                ;;
190
+
191
+                *)
192
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
193
+                PTHREAD_LIBS="-l$flag"
194
+                ;;
195
+        esac
196
+
197
+        save_LIBS="$LIBS"
198
+        save_CFLAGS="$CFLAGS"
199
+        LIBS="$PTHREAD_LIBS $LIBS"
200
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
201
+
202
+        # Check for various functions.  We must include pthread.h,
203
+        # since some functions may be macros.  (On the Sequent, we
204
+        # need a special flag -Kthread to make this header compile.)
205
+        # We check for pthread_join because it is in -lpthread on IRIX
206
+        # while pthread_create is in libc.  We check for pthread_attr_init
207
+        # due to DEC craziness with -lpthreads.  We check for
208
+        # pthread_cleanup_push because it is one of the few pthread
209
+        # functions on Solaris that doesn't have a non-functional libc stub.
210
+        # We try pthread_create on general principles.
211
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
212
+                        static void routine(void *a) { a = 0; }
213
+                        static void *start_routine(void *a) { return a; }],
214
+                       [pthread_t th; pthread_attr_t attr;
215
+                        pthread_create(&th, 0, start_routine, 0);
216
+                        pthread_join(th, 0);
217
+                        pthread_attr_init(&attr);
218
+                        pthread_cleanup_push(routine, 0);
219
+                        pthread_cleanup_pop(0) /* ; */])],
220
+                [ax_pthread_ok=yes],
221
+                [])
222
+
223
+        LIBS="$save_LIBS"
224
+        CFLAGS="$save_CFLAGS"
225
+
226
+        AC_MSG_RESULT($ax_pthread_ok)
227
+        if test "x$ax_pthread_ok" = xyes; then
228
+                break;
229
+        fi
230
+
231
+        PTHREAD_LIBS=""
232
+        PTHREAD_CFLAGS=""
233
+done
234
+fi
235
+
236
+# Various other checks:
237
+if test "x$ax_pthread_ok" = xyes; then
238
+        save_LIBS="$LIBS"
239
+        LIBS="$PTHREAD_LIBS $LIBS"
240
+        save_CFLAGS="$CFLAGS"
241
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
242
+
243
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
244
+        AC_MSG_CHECKING([for joinable pthread attribute])
245
+        attr_name=unknown
246
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
247
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
248
+                           [int attr = $attr; return attr /* ; */])],
249
+                [attr_name=$attr; break],
250
+                [])
251
+        done
252
+        AC_MSG_RESULT($attr_name)
253
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
254
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
255
+                               [Define to necessary symbol if this constant
256
+                                uses a non-standard name on your system.])
257
+        fi
258
+
259
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
260
+        flag=no
261
+        case ${host_os} in
262
+            aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
263
+            osf* | hpux*) flag="-D_REENTRANT";;
264
+            solaris*)
265
+            if test "$GCC" = "yes"; then
266
+                flag="-D_REENTRANT"
267
+            else
268
+                flag="-mt -D_REENTRANT"
269
+            fi
270
+            ;;
271
+        esac
272
+        AC_MSG_RESULT(${flag})
273
+        if test "x$flag" != xno; then
274
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
275
+        fi
276
+
277
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
278
+            ax_cv_PTHREAD_PRIO_INHERIT, [
279
+                AC_LINK_IFELSE([
280
+                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
281
+                    [ax_cv_PTHREAD_PRIO_INHERIT=yes],
282
+                    [ax_cv_PTHREAD_PRIO_INHERIT=no])
283
+            ])
284
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
285
+            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
286
+
287
+        LIBS="$save_LIBS"
288
+        CFLAGS="$save_CFLAGS"
289
+
290
+        # More AIX lossage: must compile with xlc_r or cc_r
291
+        if test x"$GCC" != xyes; then
292
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
293
+        else
294
+          PTHREAD_CC=$CC
295
+        fi
296
+else
297
+        PTHREAD_CC="$CC"
298
+fi
299
+
300
+AC_SUBST(PTHREAD_LIBS)
301
+AC_SUBST(PTHREAD_CFLAGS)
302
+AC_SUBST(PTHREAD_CC)
303
+
304
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
305
+if test x"$ax_pthread_ok" = xyes; then
306
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
307
+        :
308
+else
309
+        ax_pthread_ok=no
310
+        $2
311
+fi
312
+AC_LANG_POP
313
+])dnl AX_PTHREAD

+ 75
- 0
m4/ax_vcs_checkout.m4 View File

@@ -0,0 +1,75 @@
1
+# ===========================================================================
2
+#      http://
3
+# ===========================================================================
4
+#
5
+# SYNOPSIS
6
+#
7
+#   AX_VCS_CHECKOUT
8
+#
9
+# DESCRIPTION
10
+#
11
+#   Discover whether or not we are operating with a tree which
12
+#   has been checked out of a version control system.
13
+#
14
+#
15
+# LICENSE
16
+#
17
+#  Copyright (C) 2012 Brian Aker
18
+#  All rights reserved.
19
+#  
20
+#  Redistribution and use in source and binary forms, with or without
21
+#  modification, are permitted provided that the following conditions are
22
+#  met:
23
+#  
24
+#      * Redistributions of source code must retain the above copyright
25
+#  notice, this list of conditions and the following disclaimer.
26
+#  
27
+#      * Redistributions in binary form must reproduce the above
28
+#  copyright notice, this list of conditions and the following disclaimer
29
+#  in the documentation and/or other materials provided with the
30
+#  distribution.
31
+#  
32
+#      * The names of its contributors may not be used to endorse or
33
+#  promote products derived from this software without specific prior
34
+#  written permission.
35
+#  
36
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37
+#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40
+#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
+#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44
+#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45
+#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46
+#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
+
48
+#serial 6
49
+
50
+AC_DEFUN([AX_VCS_SYSTEM],
51
+    [AC_PREREQ([2.63])dnl
52
+    AC_CACHE_CHECK([for vcs system], [ac_cv_vcs_system],
53
+      [ac_cv_vcs_system="none"
54
+      AS_IF([test -d ".bzr"],[ac_cv_vcs_system="bazaar"])
55
+      AS_IF([test -d ".svn"],[ac_cv_vcs_system="svn"])
56
+      AS_IF([test -d ".hg"],[ac_cv_vcs_system="mercurial"])
57
+      AS_IF([test -d ".git"],[ac_cv_vcs_system="git"])
58
+      ])
59
+    AC_DEFINE_UNQUOTED([VCS_SYSTEM],["$ac_cv_vcs_system"],[VCS system])
60
+    ])
61
+
62
+AC_DEFUN([AX_VCS_CHECKOUT],
63
+    [AC_PREREQ([2.63])dnl
64
+    AC_REQUIRE([AX_VCS_SYSTEM])
65
+    AC_CACHE_CHECK([for vcs checkout],[ac_cv_vcs_checkout],
66
+      [AS_IF([test "x$ac_cv_vcs_system" != "xnone"],
67
+        [ac_cv_vcs_checkout=yes],
68
+        [ac_cv_vcs_checkout=no])
69
+      ])
70
+
71
+    AM_CONDITIONAL([IS_VCS_CHECKOUT],[test "x$ac_cv_vcs_checkout" = "xyes"])
72
+    AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"],
73
+      [AC_DEFINE([VCS_CHECKOUT],[1],[Define if the code was built from VCS.])],
74
+      [AC_DEFINE([VCS_CHECKOUT],[0],[Define if the code was built from VCS.])])
75
+    ])

+ 60
- 0
m4/pandora_64bit.m4 View File

@@ -0,0 +1,60 @@
1
+dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
+dnl This file is free software; Sun Microsystems, Inc.
3
+dnl gives unlimited permission to copy and/or distribute it,
4
+dnl with or without modifications, as long as this notice is preserved.
5
+
6
+dnl ---------------------------------------------------------------------------
7
+dnl Macro: PANDORA_64BIT
8
+dnl ---------------------------------------------------------------------------
9
+AC_DEFUN([PANDORA_64BIT],[
10
+  AC_BEFORE([$0], [AC_LIB_PREFIX])
11
+
12
+  AC_ARG_ENABLE([64bit],
13
+    [AS_HELP_STRING([--disable-64bit],
14
+      [Build 64 bit binary @<:@default=on@:>@])],
15
+    [ac_enable_64bit="$enableval"],
16
+    [ac_enable_64bit="yes"])
17
+
18
+  AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
19
+  AS_IF([test "x$ISAINFO" != "xno"],
20
+        [isainfo_b=`${ISAINFO} -b`],
21
+        [isainfo_b="x"])
22
+
23
+  AS_IF([test "$isainfo_b" != "x" -a "$isainfo_b" != "32"],[
24
+
25
+    isainfo_k=`${ISAINFO} -k`
26
+    DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
27
+
28
+    AS_IF([test "x$ac_enable_64bit" = "xyes"],[
29
+
30
+      AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
31
+        LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
32
+      ])
33
+
34
+      AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
35
+       dnl The user hasn't overridden the default libdir, so we'll
36
+       dnl the dir suffix to match solaris 32/64-bit policy
37
+       libdir="${libdir}/${isainfo_k}"
38
+      ])
39
+
40
+      AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
41
+        CFLAGS="${CFLAGS} -m64"
42
+        ac_cv_env_CFLAGS_set=set
43
+        ac_cv_env_CFLAGS_value='-m64'
44
+      ])
45
+      AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
46
+        CXXFLAGS="${CXXFLAGS} -m64"
47
+        ac_cv_env_CXXFLAGS_set=set
48
+        ac_cv_env_CXXFLAGS_value='-m64'
49
+      ])
50
+
51
+      AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
52
+        AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
53
+        AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
54
+      ])
55
+    ])
56
+  ])
57
+])
58
+dnl ---------------------------------------------------------------------------
59
+dnl End Macro: PANDORA_64BIT
60
+dnl ---------------------------------------------------------------------------

+ 23
- 0
m4/pandora_header_assert.m4 View File

@@ -0,0 +1,23 @@
1
+dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
+dnl This file is free software; Sun Microsystems, Inc.
3
+dnl gives unlimited permission to copy and/or distribute it,
4
+dnl with or without modifications, as long as this notice is preserved.
5
+
6
+dnl PANDORA_HEADER_ASSERT
7
+dnl ----------------
8
+dnl Check whether to enable assertions.
9
+AC_DEFUN([PANDORA_HEADER_ASSERT],
10
+[
11
+  AC_CHECK_HEADERS(assert.h)
12
+  AC_MSG_CHECKING([whether to enable assertions])
13
+  AC_ARG_ENABLE([assert],
14
+    [AS_HELP_STRING([--disable-assert],
15
+       [Turn off assertions])],
16
+    [ac_cv_assert="no"],
17
+    [ac_cv_assert="yes"])
18
+  AC_MSG_RESULT([$ac_cv_assert])
19
+
20
+  AS_IF([test "$ac_cv_assert" = "no"], 
21
+    [AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])])
22
+])
23
+

+ 75
- 0
m4/pandora_optimize.m4 View File

@@ -0,0 +1,75 @@
1
+dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
+dnl This file is free software; Sun Microsystems, Inc.
3
+dnl gives unlimited permission to copy and/or distribute it,
4
+dnl with or without modifications, as long as this notice is preserved.
5
+
6
+AC_DEFUN([PANDORA_OPTIMIZE],[
7
+  dnl Build optimized or debug version ?
8
+  dnl First check for gcc and g++
9
+  AS_IF([test "$GCC" = "yes" -a "$INTELCC" = "no"],[
10
+
11
+    dnl The following is required for portable results of floating point 
12
+    dnl calculations on PowerPC. The same must also be done for IA-64, but 
13
+    dnl this options is missing in the IA-64 gcc backend.
14
+    case "$target_cpu" in
15
+      *ppc* | *powerpc*)
16
+        AM_CFLAGS="-mno-fused-madd ${AM_CFLAGS}"
17
+        AM_CXXFLAGS="-mno-fused-madd ${AM_CXXFLAGS}"
18
+      ;;
19
+    esac
20
+
21
+    dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
22
+    dnl with using AC_CC_STD_C99 above
23
+    CC="${CC} -std=gnu99"
24
+
25
+    AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
26
+
27
+    DEBUG_CFLAGS="-O0"
28
+    DEBUG_CXXFLAGS="-O0"
29
+
30
+    OPTIMIZE_CFLAGS="-O2"
31
+    OPTIMIZE_CXXFLAGS="-O2"
32
+  ])
33
+  AS_IF([test "$INTELCC" = "yes"],[
34
+    AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
35
+
36
+    DEBUG_CFLAGS="-O0"
37
+    DEBUG_CXXFLAGS="-O0"
38
+
39
+    OPTIMIZE_CFLAGS="-xHOST -O2 -no-prec-div -static"
40
+    OPTIMIZE_CXXFLAGS="${OPTIMIZE_CFLAGS}"
41
+
42
+  ])
43
+  AS_IF([test "$SUNCC" = "yes"],[
44
+    dnl Once we can use a modern autoconf, we can replace the -xc99=all here
45
+    dnl with using AC_CC_STD_C99 above
46
+    CC="${CC} -xc99=all"
47
+    CXX="${CXX} -xlang=c99"
48
+
49
+    AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}"
50
+    AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef ${AM_CXXFLAGS}"
51
+
52
+    DEBUG_CXXFLAGS="-g"
53
+
54
+    dnl TODO: Make a test for -xO4 usability here
55
+    OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin"
56
+    OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}"
57
+    OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}"
58
+
59
+  ])
60
+
61
+  AC_ARG_WITH([debug],
62
+    [AS_HELP_STRING([--with-debug],
63
+       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
64
+    [with_debug=$withval],
65
+    [with_debug=no])
66
+  AS_IF([test "$with_debug" = "yes"],[
67
+    # Debugging. No optimization.
68
+    AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG"
69
+    AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG"
70
+  ],[
71
+    # Optimized version. No debug
72
+    AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
73
+    AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
74
+  ])
75
+])

+ 78
- 0
m4/pandora_vc_build.m4 View File

@@ -0,0 +1,78 @@
1
+dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
+dnl This file is free software; Sun Microsystems, Inc.
3
+dnl gives unlimited permission to copy and/or distribute it,
4
+dnl with or without modifications, as long as this notice is preserved.
5
+
6
+AC_DEFUN([PANDORA_TEST_VC_DIR],[
7
+  pandora_building_from_vc=no
8
+
9
+  if test -d ".git" ; then
10
+    pandora_building_from_git=yes
11
+    pandora_building_from_vc=yes
12
+  else
13
+    pandora_building_from_git=no
14
+  fi
15
+])
16
+
17
+AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
18
+  m4_syscmd(PANDORA_TEST_VC_DIR
19
+    m4_if(PCT_NO_VC_CHANGELOG,yes,[
20
+      vc_changelog=no
21
+      ],[
22
+      vc_changelog=yes
23
+      ])
24
+
25
+    [
26
+
27
+    if test "${pandora_building_from_git}" = "yes"; then
28
+      echo "# Grabbing changelog and version information from git"
29
+      # Fix this for git
30
+      PANDORA_RELEASE_VERSION=0.0.1
31
+    fi
32
+
33
+    if ! test -d config ; then
34
+      mkdir -p config
35
+    fi
36
+
37
+    if test "${pandora_building_from_git}" = "yes" -o ! -f config/pandora_vc_revinfo ; then 
38
+      cat > config/pandora_vc_revinfo.tmp <<EOF
39
+PANDORA_RELEASE_VERSION=${PANDORA_RELEASE_VERSION}
40
+EOF
41
+      if ! diff config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo >/dev/null 2>&1 ; then
42
+        mv config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo
43
+      fi
44
+      rm -f config/pandora_vc_revinfo.tmp
45
+    fi
46
+  ])
47
+])
48
+
49
+AC_DEFUN([_PANDORA_READ_FROM_FILE],[
50
+  $1=`grep $1 $2 | cut -f2 -d=`
51
+])
52
+
53
+AC_DEFUN([PANDORA_VC_VERSION],[
54
+  AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
55
+
56
+  PANDORA_TEST_VC_DIR
57
+
58
+  AS_IF([test -f ${srcdir}/config/pandora_vc_revinfo],[
59
+    _PANDORA_READ_FROM_FILE(
60
+      [PANDORA_RELEASE_VERSION],${srcdir}/config/pandora_vc_revinfo)
61
+  ])
62
+
63
+  VERSION="${PANDORA_RELEASE_VERSION}"
64
+  AC_DEFINE_UNQUOTED(
65
+    [PANDORA_RELEASE_VERSION],
66
+    ["${PANDORA_RELEASE_VERSION}"],
67
+    [The real version of the software])
68
+])
69
+
70
+AC_DEFUN([PANDORA_VC_INFO_HEADER],[
71
+  AC_REQUIRE([PANDORA_VC_VERSION])
72
+  m4_define([PANDORA_VC_PREFIX],m4_toupper(m4_normalize(AC_PACKAGE_NAME))[_])
73
+
74
+  AC_DEFINE_UNQUOTED(
75
+    PANDORA_VC_PREFIX[RELEASE_VERSION],
76
+    ["$PANDORA_RELEASE_VERSION"],
77
+    [Release date and revision number of checkout])
78
+])

+ 447
- 0
m4/pandora_warnings.m4 View File

@@ -0,0 +1,447 @@
1
+dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
+dnl This file is free software; Sun Microsystems, Inc.
3
+dnl gives unlimited permission to copy and/or distribute it,
4
+dnl with or without modifications, as long as this notice is preserved.
5
+
6
+dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
7
+dnl   less-warnings turn on a limited set of warnings
8
+dnl   warnings-always-on always set warnings=error regardless of tarball/vc
9
+
10
+dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
11
+dnl        allow it
12
+ 
13
+AC_DEFUN([PANDORA_WARNINGS],[
14
+  m4_define([PW_LESS_WARNINGS],[no])
15
+  m4_define([PW_WARN_ALWAYS_ON],[no])
16
+  ifdef([m4_define],,[define([m4_define],   defn([define]))])
17
+  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
18
+  m4_foreach([pw_arg],[$*],[
19
+    m4_case(pw_arg,
20
+      [less-warnings],[
21
+        m4_undefine([PW_LESS_WARNINGS])
22
+        m4_define([PW_LESS_WARNINGS],[yes])
23
+      ],
24
+      [warnings-always-on],[
25
+        m4_undefine([PW_WARN_ALWAYS_ON])
26
+        m4_define([PW_WARN_ALWAYS_ON],[yes])
27
+    ]) 
28
+  ])
29
+
30
+  AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
31
+  m4_if(PW_WARN_ALWAYS_ON, [yes],
32
+    [ac_cv_warnings_as_errors=yes],
33
+    AS_IF([test "$pandora_building_from_vc" = "yes"],
34
+          [ac_cv_warnings_as_errors=yes],
35
+          [ac_cv_warnings_as_errors=no]))
36
+
37
+  AC_ARG_ENABLE([gcc-profile-mode],
38
+      [AS_HELP_STRING([--enable-gcc-profile-mode],
39
+         [Toggle gcc profile mode @<:@default=off@:>@])],
40
+      [ac_gcc_profile_mode="$enableval"],
41
+      [ac_gcc_profile_mode="no"])
42
+
43
+  AC_ARG_ENABLE([profiling],
44
+      [AS_HELP_STRING([--enable-profiling],
45
+         [Toggle profiling @<:@default=off@:>@])],
46
+      [ac_profiling="$enableval"],
47
+      [ac_profiling="no"])
48
+
49
+  AC_ARG_ENABLE([coverage],
50
+      [AS_HELP_STRING([--enable-coverage],
51
+         [Toggle coverage @<:@default=off@:>@])],
52
+      [ac_coverage="$enableval"],
53
+      [ac_coverage="no"])
54
+
55
+  AS_IF([test "$GCC" = "yes"],[
56
+
57
+    AS_IF([test "$ac_profiling" = "yes"],[
58
+      CC_PROFILING="-pg"
59
+      GCOV_LIBS="-pg -lgcov"
60
+      save_LIBS="${LIBS}"
61
+      LIBS=""
62
+      AC_CHECK_LIB(c_p, read)
63
+      LIBC_P="${LIBS}"
64
+      LIBS="${save_LIBS}"
65
+      AC_SUBST(LIBC_P)
66
+    ],[
67
+      CC_PROFILING=" "
68
+    ])
69
+
70
+    AS_IF([test "$ac_coverage" = "yes"],
71
+          [
72
+            CC_COVERAGE="--coverage"
73
+            GCOV_LIBS="-lgcov"
74
+          ])
75
+
76
+
77
+	 
78
+    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],[
79
+      W_FAIL="-Werror"
80
+      SPHINX_WARNINGS="-W"
81
+      dnl INTLTOOL_WARNINGS="yes"
82
+    ])
83
+
84
+    AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
85
+      [ac_cv_safe_to_use_fdiagnostics_show_option_],
86
+      [save_CFLAGS="$CFLAGS"
87
+       CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
88
+       AC_COMPILE_IFELSE(
89
+         [AC_LANG_PROGRAM([],[])],
90
+         [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
91
+         [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
92
+       CFLAGS="$save_CFLAGS"])
93
+
94
+    AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
95
+          [
96
+            F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
97
+          ])
98
+
99
+    AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
100
+      [ac_cv_safe_to_use_floop_parallelize_all_],
101
+      [save_CFLAGS="$CFLAGS"
102
+       CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
103
+       AC_COMPILE_IFELSE(
104
+         [AC_LANG_PROGRAM([],[])],
105
+         [ac_cv_safe_to_use_floop_parallelize_all_=yes],
106
+         [ac_cv_safe_to_use_floop_parallelize_all_=no])
107
+       CFLAGS="$save_CFLAGS"])
108
+
109
+    AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
110
+          [
111
+            F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
112
+          ])
113
+
114
+    NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
115
+    NO_SHADOW="-Wno-shadow"
116
+
117
+    AS_IF([test "$INTELCC" = "yes"],[
118
+      m4_if(PW_LESS_WARNINGS,[no],[
119
+        BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
120
+      ],[
121
+        dnl 2203 is like old-style-cast
122
+        dnl 1684 is like strict-aliasing
123
+        dnl 188 is about using enums as bitfields
124
+        dnl 1683 is a warning about _EXPLICIT_ casting, which we want
125
+        BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
126
+      ])
127
+      CC_WARNINGS="${BASE_WARNINGS}"
128
+      CXX_WARNINGS="${BASE_WARNINGS}"
129
+      PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
130
+      
131
+    ],[
132
+      m4_if(PW_LESS_WARNINGS,[no],[
133
+        BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing -Wswitch-enum "
134
+        CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
135
+        CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
136
+        NO_OLD_STYLE_CAST="-Wno-old-style-cast"
137
+        NO_EFF_CXX="-Wno-effc++"
138
+      ],[
139
+        BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
140
+      ])
141
+
142
+      AS_IF([test "${ac_cv_assert}" = "no"],
143
+            [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
144
+  
145
+      AC_CACHE_CHECK([whether it is safe to use -Wextra],
146
+        [ac_cv_safe_to_use_Wextra_],
147
+        [save_CFLAGS="$CFLAGS"
148
+         CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
149
+         AC_COMPILE_IFELSE([
150
+           AC_LANG_PROGRAM(
151
+           [[
152
+#include <stdio.h>
153
+           ]], [[]])
154
+        ],
155
+        [ac_cv_safe_to_use_Wextra_=yes],
156
+        [ac_cv_safe_to_use_Wextra_=no])
157
+      CFLAGS="$save_CFLAGS"])
158
+
159
+      BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
160
+      AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
161
+            [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
162
+            [BASE_WARNINGS="${BASE_WARNINGS} -W"])
163
+  
164
+      AC_CACHE_CHECK([whether it is safe to use -Wformat],
165
+        [ac_cv_safe_to_use_wformat_],
166
+        [save_CFLAGS="$CFLAGS"
167
+         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
168
+         dnl conversion warnings to all the tarball folks
169
+         CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
170
+         AC_COMPILE_IFELSE(
171
+           [AC_LANG_PROGRAM([[
172
+#include <stdio.h>
173
+#include <stdint.h>
174
+#include <inttypes.h>
175
+void foo();
176
+void foo()
177
+{
178
+  uint64_t test_u= 0;
179
+  printf("This is a %" PRIu64 "test\n", test_u);
180
+}
181
+           ]],[[
182
+foo();
183
+           ]])],
184
+           [ac_cv_safe_to_use_wformat_=yes],
185
+           [ac_cv_safe_to_use_wformat_=no])
186
+         CFLAGS="$save_CFLAGS"])
187
+      AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
188
+        BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wno-format-security"
189
+        BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wno-format-security"
190
+        ],[
191
+        BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
192
+        BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
193
+      ])
194
+
195
+
196
+ 
197
+      AC_CACHE_CHECK([whether it is safe to use -Wconversion],
198
+        [ac_cv_safe_to_use_wconversion_],
199
+        [save_CFLAGS="$CFLAGS"
200
+         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
201
+         dnl conversion warnings to all the tarball folks
202
+         CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
203
+         AC_COMPILE_IFELSE(
204
+           [AC_LANG_PROGRAM([[
205
+#include <stdbool.h>
206
+void foo(bool a)
207
+{
208
+  (void)a;
209
+}
210
+           ]],[[
211
+foo(0);
212
+           ]])],
213
+           [ac_cv_safe_to_use_wconversion_=yes],
214
+           [ac_cv_safe_to_use_wconversion_=no])
215
+         CFLAGS="$save_CFLAGS"])
216
+  
217
+      AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
218
+        [W_CONVERSION="-Wconversion"
219
+        AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
220
+          [ac_cv_safe_to_use_Wconversion_],
221
+          [save_CFLAGS="$CFLAGS"
222
+           dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
223
+           dnl conversion warnings to all the tarball folks
224
+           CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
225
+           AC_COMPILE_IFELSE(
226
+             [AC_LANG_PROGRAM(
227
+               [[
228
+#include <netinet/in.h>
229
+               ]],[[
230
+uint16_t x= htons(80);
231
+               ]])],
232
+             [ac_cv_safe_to_use_Wconversion_=yes],
233
+             [ac_cv_safe_to_use_Wconversion_=no])
234
+           CFLAGS="$save_CFLAGS"])
235
+  
236
+        AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
237
+              [NO_CONVERSION="-Wno-conversion"])
238
+      ])
239
+
240
+      CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
241
+      CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
242
+
243
+      AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
244
+        [ac_cv_safe_to_use_Wmissing_declarations_],
245
+        [AC_LANG_PUSH(C++)
246
+         save_CXXFLAGS="$CXXFLAGS"
247
+         CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
248
+         AC_COMPILE_IFELSE([
249
+           AC_LANG_PROGRAM(
250
+           [[
251
+#include <stdio.h>
252
+           ]], [[]])
253
+        ],
254
+        [ac_cv_safe_to_use_Wmissing_declarations_=yes],
255
+        [ac_cv_safe_to_use_Wmissing_declarations_=no])
256
+        CXXFLAGS="$save_CXXFLAGS"
257
+        AC_LANG_POP()
258
+      ])
259
+      AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
260
+            [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
261
+  
262
+      AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
263
+        [ac_cv_safe_to_use_Wframe_larger_than_],
264
+        [AC_LANG_PUSH(C++)
265
+         save_CXXFLAGS="$CXXFLAGS"
266
+         CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
267
+         AC_COMPILE_IFELSE([
268
+           AC_LANG_PROGRAM(
269
+           [[
270
+#include <stdio.h>
271
+           ]], [[]])
272
+        ],
273
+        [ac_cv_safe_to_use_Wframe_larger_than_=yes],
274
+        [ac_cv_safe_to_use_Wframe_larger_than_=no])
275
+        CXXFLAGS="$save_CXXFLAGS"
276
+        AC_LANG_POP()
277
+      ])
278
+      AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
279
+            [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
280
+  
281
+      AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
282
+        [ac_cv_safe_to_use_Wlogical_op_],
283
+        [save_CFLAGS="$CFLAGS"
284
+         CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
285
+         AC_COMPILE_IFELSE([
286
+           AC_LANG_PROGRAM(
287
+           [[
288
+#include <stdio.h>
289
+           ]], [[]])
290
+        ],
291
+        [ac_cv_safe_to_use_Wlogical_op_=yes],
292
+        [ac_cv_safe_to_use_Wlogical_op_=no])
293
+      CFLAGS="$save_CFLAGS"])
294
+      AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
295
+            [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
296
+  
297
+      AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
298
+        [ac_cv_safe_to_use_Wredundant_decls_],
299
+        [AC_LANG_PUSH(C++)
300
+         save_CXXFLAGS="${CXXFLAGS}"
301
+         CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
302
+         AC_COMPILE_IFELSE(
303
+           [AC_LANG_PROGRAM([
304
+template <typename E> struct C { void foo(); };
305
+template <typename E> void C<E>::foo() { }
306
+template <> void C<int>::foo();
307
+            AC_INCLUDES_DEFAULT])],
308
+            [ac_cv_safe_to_use_Wredundant_decls_=yes],
309
+            [ac_cv_safe_to_use_Wredundant_decls_=no])
310
+         CXXFLAGS="${save_CXXFLAGS}"
311
+         AC_LANG_POP()])
312
+      AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
313
+            [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
314
+            [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
315
+
316
+      AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
317
+        [ac_cv_safe_to_use_Wattributes_],
318
+        [AC_LANG_PUSH(C++)
319
+         save_CXXFLAGS="${CXXFLAGS}"
320
+         CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
321
+         AC_COMPILE_IFELSE(
322
+           [AC_LANG_PROGRAM([
323
+#include <google/protobuf/message.h>
324
+#include <google/protobuf/descriptor.h>
325
+
326
+
327
+const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
328
+enum Table_TableOptions_RowType {
329
+  Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
330
+  Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
331
+  Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
332
+  Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
333
+  Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
334
+  Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
335
+  Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
336
+};
337
+
338
+namespace google {
339
+namespace protobuf {
340
+template <>
341
+inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
342
+  return Table_TableOptions_RowType_descriptor();
343
+}
344
+}
345
+}
346
+            ])],
347
+            [ac_cv_safe_to_use_Wattributes_=yes],
348
+            [ac_cv_safe_to_use_Wattributes_=no])
349
+          CXXFLAGS="${save_CXXFLAGS}"
350
+          AC_LANG_POP()])
351
+      AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
352
+        [ac_cv_safe_to_use_Wno_attributes_],
353
+        [save_CFLAGS="$CFLAGS"
354
+         CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
355
+         AC_COMPILE_IFELSE([
356
+           AC_LANG_PROGRAM(
357
+           [[
358
+#include <stdio.h>
359
+           ]], [[]])
360
+        ],
361
+        [ac_cv_safe_to_use_Wno_attributes_=yes],
362
+        [ac_cv_safe_to_use_Wno_attributes_=no])
363
+      CFLAGS="$save_CFLAGS"])
364
+
365
+      dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
366
+      dnl by using that. 
367
+      AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
368
+        AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
369
+          CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
370
+          NO_ATTRIBUTES="-Wno-attributes"])])
371
+  
372
+  
373
+      NO_REDUNDANT_DECLS="-Wno-redundant-decls"
374
+      dnl TODO: Figure out a better way to deal with this:
375
+      PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
376
+      NO_WERROR="-Wno-error"
377
+      PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
378
+      PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
379
+      AS_IF([test "$host_vendor" = "apple"],[
380
+        BOOSTSKIP_WARNINGS="-Wno-uninitialized"
381
+      ])
382
+    ])
383
+  ])
384
+
385
+  AS_IF([test "$SUNCC" = "yes"],[
386
+
387
+    AS_IF([test "$ac_profiling" = "yes"],
388
+          [CC_PROFILING="-xinstrument=datarace"])
389
+
390
+    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
391
+          [W_FAIL="-errwarn=%all"])
392
+
393
+    AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
394
+      [ac_cv_paste_result],
395
+      [
396
+        save_CFLAGS="${CFLAGS}"
397
+        CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
398
+        AC_COMPILE_IFELSE(
399
+          [AC_LANG_PROGRAM([
400
+            AC_INCLUDES_DEFAULT
401
+          ],[
402
+            int x= 0;])],
403
+          [ac_cv_paste_result=yes],
404
+          [ac_cv_paste_result=no])
405
+        CFLAGS="${save_CFLAGS}"
406
+      ])
407
+    AS_IF([test $ac_cv_paste_result = yes],
408
+      [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
409
+
410
+
411
+    m4_if(PW_LESS_WARNINGS, [no],[
412
+      CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
413
+      CXX_WARNINGS_FULL="-erroff=inllargeuse"
414
+    ],[
415
+      CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
416
+      CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
417
+    ])
418
+
419
+    CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
420
+    CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
421
+    PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
422
+    BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
423
+    PERMISSIVE_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem,notused,badargtype2w,wunreachable"
424
+    INNOBASE_SKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit,wunreachable"
425
+    NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
426
+    NO_WERROR="-errwarn=%none"
427
+
428
+  ])
429
+
430
+  AC_SUBST(NO_CONVERSION)
431
+  AC_SUBST(NO_REDUNDANT_DECLS)
432
+  AC_SUBST(NO_UNREACHED)
433
+  AC_SUBST(NO_SHADOW)
434
+  AC_SUBST(NO_STRICT_ALIASING)
435
+  AC_SUBST(NO_EFF_CXX)
436
+  AC_SUBST(NO_OLD_STYLE_CAST)
437
+  AC_SUBST(PROTOSKIP_WARNINGS)
438
+  AC_SUBST(INNOBASE_SKIP_WARNINGS)
439
+  AC_SUBST(BOOSTSKIP_WARNINGS)
440
+  AC_SUBST(PERMISSIVE_WARNINGS)
441
+  AC_SUBST(PERMISSIVE_C_WARNINGS)
442
+  AC_SUBST(NO_WERROR)
443
+  AC_SUBST([GCOV_LIBS])
444
+  AC_SUBST([SPHINX_WARNINGS])
445
+  AC_SUBST([INTLTOOL_WARNINGS])
446
+
447
+])

+ 77
- 0
m4/visibility.m4 View File

@@ -0,0 +1,77 @@
1
+# visibility.m4 serial 4 (gettext-0.18.2)
2
+dnl Copyright (C) 2005, 2008, 2010-2011 Free Software Foundation, Inc.
3
+dnl This file is free software; the Free Software Foundation
4
+dnl gives unlimited permission to copy and/or distribute it,
5
+dnl with or without modifications, as long as this notice is preserved.
6
+
7
+dnl From Bruno Haible.
8
+
9
+dnl Tests whether the compiler supports the command-line option
10
+dnl -fvisibility=hidden and the function and variable attributes
11
+dnl __attribute__((__visibility__("hidden"))) and
12
+dnl __attribute__((__visibility__("default"))).
13
+dnl Does *not* test for __visibility__("protected") - which has tricky
14
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
15
+dnl MacOS X.
16
+dnl Does *not* test for __visibility__("internal") - which has processor
17
+dnl dependent semantics.
18
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
19
+dnl "really only recommended for legacy code".
20
+dnl Set the variable CFLAG_VISIBILITY.
21
+dnl Defines and sets the variable HAVE_VISIBILITY.
22
+
23
+AC_DEFUN([gl_VISIBILITY],
24
+[
25
+  AC_REQUIRE([AC_PROG_CC])
26
+  CFLAG_VISIBILITY=
27
+  HAVE_VISIBILITY=0
28
+  if test -n "$GCC"; then
29
+    dnl First, check whether -Werror can be added to the command line, or
30
+    dnl whether it leads to an error because of some other option that the
31
+    dnl user has put into $CC $CFLAGS $CPPFLAGS.
32
+    AC_MSG_CHECKING([whether the -Werror option is usable])
33
+    AC_CACHE_VAL([gl_cv_cc_vis_werror], [
34
+      gl_save_CFLAGS="$CFLAGS"
35
+      CFLAGS="$CFLAGS -Werror"
36
+      AC_COMPILE_IFELSE(
37
+        [AC_LANG_PROGRAM([[]], [[]])],
38
+        [gl_cv_cc_vis_werror=yes],
39
+        [gl_cv_cc_vis_werror=no])
40
+      CFLAGS="$gl_save_CFLAGS"])
41
+    AC_MSG_RESULT([$gl_cv_cc_vis_werror])
42
+    dnl Now check whether visibility declarations are supported.
43
+    AC_MSG_CHECKING([for simple visibility declarations])
44
+    AC_CACHE_VAL([gl_cv_cc_visibility], [
45
+      gl_save_CFLAGS="$CFLAGS"
46
+      CFLAGS="$CFLAGS -fvisibility=hidden"
47
+      dnl We use the option -Werror and a function dummyfunc, because on some
48
+      dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
49
+      dnl "visibility attribute not supported in this configuration; ignored"
50
+      dnl at the first function definition in every compilation unit, and we
51
+      dnl don't want to use the option in this case.
52
+      if test $gl_cv_cc_vis_werror = yes; then
53
+        CFLAGS="$CFLAGS -Werror"
54
+      fi
55
+      AC_COMPILE_IFELSE(
56
+        [AC_LANG_PROGRAM(
57
+           [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
58
+             extern __attribute__((__visibility__("default"))) int exportedvar;
59
+             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
60
+             extern __attribute__((__visibility__("default"))) int exportedfunc (void);
61
+             void dummyfunc (void) {}
62
+           ]],
63
+           [[]])],
64
+        [gl_cv_cc_visibility=yes],
65
+        [gl_cv_cc_visibility=no])
66
+      CFLAGS="$gl_save_CFLAGS"])
67
+    AC_MSG_RESULT([$gl_cv_cc_visibility])
68
+    if test $gl_cv_cc_visibility = yes; then
69
+      CFLAG_VISIBILITY="-fvisibility=hidden"
70
+      HAVE_VISIBILITY=1
71
+    fi
72
+  fi
73
+  AC_SUBST([CFLAG_VISIBILITY])
74
+  AC_SUBST([HAVE_VISIBILITY])
75
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
76
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
77
+])

+ 91
- 0
m4/zuul_canonical.m4 View File

@@ -0,0 +1,91 @@
1
+#  Copyright (C) 2009 Sun Microsystems, Inc.
2
+#  This file is free software; Sun Microsystems, Inc.
3
+#  gives unlimited permission to copy and/or distribute it,
4
+#  with or without modifications, as long as this notice is preserved.
5
+
6
+# Which version of the canonical setup we're using
7
+AC_DEFUN([ZUUL_CANONICAL_VERSION],[0.175])
8
+
9
+AC_DEFUN([ZUUL_CANONICAL_TARGET],[
10
+  ifdef([m4_define],,[define([m4_define],   defn([define]))])
11
+  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
12
+  m4_define([PCT_ALL_ARGS],[$*])
13
+  m4_define([PCT_REQUIRE_CXX],[no])
14
+  m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
15
+  m4_define([PCT_NO_VC_CHANGELOG],[no])
16
+  m4_define([PCT_VERSION_FROM_VC],[no])
17
+  m4_define([PCT_USE_VISIBILITY],[yes])
18
+  m4_foreach([pct_arg],[$*],[
19
+    m4_case(pct_arg,
20
+      [require-cxx], [
21
+        m4_undefine([PCT_REQUIRE_CXX])
22
+        m4_define([PCT_REQUIRE_CXX],[yes])
23
+      ],
24
+      [skip-visibility], [
25
+        m4_undefine([PCT_USE_VISIBILITY])
26
+        m4_define([PCT_USE_VISIBILITY],[no])
27
+      ],
28
+      [dont-suppress-include], [
29
+        m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
30
+        m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
31
+      ],
32
+      [no-vc-changelog], [
33
+        m4_undefine([PCT_NO_VC_CHANGELOG])
34
+        m4_define([PCT_NO_VC_CHANGELOG],[yes])
35
+      ],
36
+      [version-from-vc], [
37
+        m4_undefine([PCT_VERSION_FROM_VC])
38
+        m4_define([PCT_VERSION_FROM_VC],[yes])
39
+    ])
40
+  ])
41
+
42
+  # We need to prevent canonical target
43
+  # from injecting -O2 into CFLAGS - but we won't modify anything if we have
44
+  # set CFLAGS on the command line, since that should take ultimate precedence
45
+  AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
46
+        [CFLAGS=""])
47
+  AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
48
+        [CXXFLAGS=""])
49
+
50
+  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
51
+
52
+  AC_REQUIRE([AC_PROG_CC])
53
+
54
+  m4_if(PCT_NO_VC_CHANGELOG,yes,[
55
+    vc_changelog=no
56
+  ],[
57
+    vc_changelog=yes
58
+  ])
59
+  m4_if(PCT_VERSION_FROM_VC,yes,[
60
+    PANDORA_VC_INFO_HEADER
61
+  ],[
62
+    PANDORA_TEST_VC_DIR
63
+
64
+    AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"],
65
+                       [Version of the software])
66
+
67
+    AC_SUBST(PANDORA_RELEASE_VERSION)
68
+  ])
69
+
70
+  AC_REQUIRE([AC_PROG_CXX])
71
+  AM_PROG_CC_C_O
72
+
73
+  PANDORA_OPTIMIZE
74
+
75
+  PANDORA_HEADER_ASSERT
76
+
77
+  # Enable PANDORA_WARNINGS once there is C++ code that's not generated, if
78
+  # that's ever a time
79
+  dnl PANDORA_WARNINGS(PCT_ALL_ARGS)
80
+
81
+  PANDORA_ENABLE_DTRACE
82
+
83
+  AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
84
+  AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
85
+
86
+  AC_SUBST([AM_CFLAGS])
87
+  AC_SUBST([AM_CXXFLAGS])
88
+  AC_SUBST([AM_CPPFLAGS])
89
+  AC_SUBST([AM_LDFLAGS])
90
+
91
+])

+ 13
- 0
playbooks/distcheck.yaml View File

@@ -0,0 +1,13 @@
1
+- hosts: all
2
+  tasks:
3
+
4
+    - name: Run make distcheck
5
+      shell:
6
+        executable: /bin/bash
7
+        chdir: '{{ zuul_work_dir|default(zuul.project.src_dir) }}'
8
+        cmd: |
9
+          set -ex
10
+          ./bootstrap.sh
11
+          ./configure
12
+          make
13
+          make distcheck

+ 39
- 0
zuul-preview/main.cc View File

@@ -0,0 +1,39 @@
1
+/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
+ *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
+ *
4
+ *  Copyright (C) 2019 Red Hat, Inc.
5
+ *
6
+ *  This program is free software: you can redistribute it and/or modify
7
+ *  it under the terms of the GNU General Public License as published by
8
+ *  the Free Software Foundation, either version 3 of the License, or
9
+ *  (at your option) any later version.
10
+ *
11
+ *  This program is distributed in the hope that it will be useful,
12
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ *  GNU General Public License for more details.
15
+ *
16
+ *  You should have received a copy of the GNU General Public License
17
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
+ */
19
+
20
+#include <config.h>
21
+
22
+#include <pthread.h>
23
+
24
+#include <json.hpp>
25
+
26
+// for convenience
27
+using json = nlohmann::json;
28
+
29
+using namespace std;
30
+
31
+
32
+int main(int argc, char **argv)
33
+{
34
+  json j;
35
+  j["pi"] = 3.14;
36
+  j["happy"] = true;
37
+
38
+  cout << j.dump(4) << endl; 
39
+}

Loading…
Cancel
Save